DGtal  1.5.beta
exampleStabbingCircleComputer.cpp File Reference

An example file for StabbingCircleComputer. More...

#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/.

Author
Tristan Roussillon (trist.nosp@m.an.r.nosp@m.oussi.nosp@m.llon.nosp@m.@liri.nosp@m.s.cn.nosp@m.rs.fr ) Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
Date
2011/10/06
See also
testStabbingCircleComputer examplePreimage

This file is part of the DGtal library.

Definition in file exampleStabbingCircleComputer.cpp.

Function Documentation

◆ 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 }
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
Definition: GridCurve.h:173
bool initFromVectorStream(std::istream &in)
Storage::const_iterator ConstIterator
Definition: GridCurve.h:314
Aim: On-line recognition of a digital circular arcs (DCA) defined as a sequence of connected grid edg...
void init(const ConstIterator &anIt)
void beginBlock(const std::string &keyword="")
std::ostream & info()
double endBlock()
Trace trace
Definition: Common.h:153

References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), DGtal::Trace::info(), DGtal::StabbingCircleComputer< TConstIterator >::init(), DGtal::GridCurve< TKSpace >::initFromVectorStream(), and DGtal::trace.