DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
exampleGeometricalDSS.cpp
1 
31 
32 #include <iostream>
33 
34 #include "DGtal/base/Common.h"
35 #include "DGtal/helpers/StdDefs.h"
36 #include "ConfigExamples.h"
37 
38 #include "DGtal/geometry/curves/GeometricalDSS.h"
39 
41 
42 using namespace std;
43 using namespace DGtal;
44 using namespace Z2i;
45 
46 
48 int main( int argc, char** argv )
49 {
50  trace.beginBlock ( "Example for GeometricalDSS" );
51  trace.info() << "Args:";
52  for ( int i = 0; i < argc; ++i )
53  trace.info() << " " << argv[ i ];
54  trace.info() << endl;
55 
56  std::string filename = examplesPath + "samples/DSS.dat";
57  ifstream instream; // input stream
58  instream.open (filename.c_str(), ifstream::in);
59 
60  Curve c; //grid curve
61  c.initFromVectorStream(instream);
62 
63 
64  trace.beginBlock("Simple example");
65 
67  Curve::IncidentPointsRange r = c.getIncidentPointsRange();
68  Curve::IncidentPointsRange::ConstIterator itEnd (r.end());
69 
71  //extension
72  s.init( r.begin() );
73  while ( ( s.end() != itEnd )
74  &&( s.extendForward() ) ) {}
76 
77  trace.info() << s << endl;
78 
79  trace.endBlock();
80 
81 
82  return 0;
83 }
84 // //