DGtal  1.5.beta
exampleArithmeticalDSSComputer.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/base/BasicTypes.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
Include dependency graph for exampleArithmeticalDSSComputer.cpp:

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

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
2013/11/14

An example file named ArithmeticalDSSComputer.

This file is part of the DGtal library.

Definition in file exampleArithmeticalDSSComputer.cpp.

Function Documentation

◆ main()

int main ( void  )

[ArithmeticalDSSComputerStandardCtor]

[ArithmeticalDSSComputerStandardCtor]

[ArithmeticalDSSComputerStandardExtension]

[ArithmeticalDSSComputerStandardExtension]

[ArithmeticalDSSComputerStandardPrimitive]

[ArithmeticalDSSComputerStandardPrimitive]

Definition at line 56 of file exampleArithmeticalDSSComputer.cpp.

57 {
58 
59 
60  using namespace Z2i;
61 
63  // Container of digital points
64  typedef std::vector<Z2::Point> Container;
65  // Iterator on the container
66  typedef Container::const_iterator ConstIterator;
67  // StandardDSS4 computer
68  typedef StandardDSS4Computer<ConstIterator> DSSComputer;
69  // Construction of the computer
70  DSSComputer theDSSComputer;
72 
73  // Input points
74  Container contour;
75  contour.push_back(Z2::Point(0,0));
76  contour.push_back(Z2::Point(1,0));
77  contour.push_back(Z2::Point(1,1));
78  contour.push_back(Z2::Point(2,1));
79  contour.push_back(Z2::Point(3,1));
80  contour.push_back(Z2::Point(3,2));
81  contour.push_back(Z2::Point(4,2));
82  contour.push_back(Z2::Point(5,2));
83  contour.push_back(Z2::Point(6,2));
84  contour.push_back(Z2::Point(6,3));
85  contour.push_back(Z2::Point(6,4));
86 
88  // Add points while it is possible
89  theDSSComputer.init( contour.begin() );
90  while ( ( theDSSComputer.end() != contour.end() ) &&
91  ( theDSSComputer.extendFront() ) ) {}
93 
94  // Trace to the standard output
95  cout << theDSSComputer << endl;
96 
98  DSSComputer::Primitive theDSS = theDSSComputer.primitive();
100 
101  // Trace to the standard output
102  cout << theDSS << endl;
103 
104  return 1;
105 }
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
void init(const ConstIterator &it)
MyDigitalSurface::ConstIterator ConstIterator
MyPointD Point
Definition: testClone2.cpp:383

References DGtal::ArithmeticalDSSComputer< TIterator, TInteger, adjacency >::init().