Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
exampleStabbingLineComputer.cpp
Go to the documentation of this file.
1
16
30
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/StabbingLineComputer.h"
39
41
42using namespace std;
43using namespace DGtal;
44using namespace Z2i;
45
46
48int main( int argc, char** argv )
49{
50 trace.beginBlock ( "Example for StabbingLineComputer" );
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
69
71 //extension
72 s.init( r.begin() );
73 while ( ( s.end() != itEnd )
74 &&( s.extendFront() ) ) {}
76
77 trace.info() << s << endl;
78
79 trace.endBlock();
80
81
82 return 0;
83}
84// //
ConstIterator begin() const
ConstIterator end() const
bool initFromVectorStream(std::istream &in)
IncidentPointsRange getIncidentPointsRange() const
Definition GridCurve.h:478
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToIncidentPoints< KSpace >, std::pair< Point, Point > > IncidentPointsRange
Definition GridCurve.h:473
Storage::const_iterator ConstIterator
Definition GridCurve.h:306
Aim: On-line recognition of a digital straight segment (DSS) defined as a sequence of connected grid ...
ConstIterator end() const
void init(const ConstIterator &anIt)
Z2i this namespace gathers the standard of types for 2D imagery.
GridCurve< K2 > Curve
Definition StdDefs.h:116
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
STL namespace.
int main()
Definition testBits.cpp:56