DGtal  0.9.3
exampleStabbingCircleComputer.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "ConfigExamples.h"
#include "DGtal/geometry/curves/StabbingCircleComputer.h"
Include dependency graph for exampleStabbingCircleComputer.cpp:

Go to the source code of this file.

## Functions

int main (int argc, char **argv)

## Detailed Description

An example file for StabbingCircleComputer.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Date
2011/10/06
testStabbingCircleComputer examplePreimage

This file is part of the DGtal library.

Definition in file exampleStabbingCircleComputer.cpp.

## ◆ main()

 int main ( int argc, char ** argv )

[StabbingCircleComputerUsage]

[StabbingCircleComputerUsage]

Definition at line 48 of file exampleStabbingCircleComputer.cpp.

49 {
50  trace.beginBlock ( "Example for StabbingCircleComputer" );
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/DCA.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();
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 }
void beginBlock(const std::string &keyword="")
MyDigitalSurface::ConstIterator ConstIterator
Trace trace
Definition: Common.h:137
GridCurve< K2 > Curve
Definition: StdDefs.h:116
double endBlock()
Aim: On-line recognition of a digital circular arcs (DCA) defined as a sequence of connected grid edg...
void init(const ConstIterator &anIt)
std::ostream & info()