File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
exampleArithDSS3d.cpp File Reference
#include <iostream>
#include "DGtal/io/viewers/PolyscopeViewer.h"
#include "DGtal/io/readers/PointListReader.h"
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "ConfigExamples.h"
#include "DGtal/geometry/curves/StandardDSS6Computer.h"
#include "DGtal/geometry/curves/GreedySegmentation.h"
Include dependency graph for exampleArithDSS3d.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)

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
2011/06/01

This file is part of the DGtal library

Definition in file exampleArithDSS3d.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 69 of file exampleArithDSS3d.cpp.

70{
71
73 typedef std::vector<Point>::iterator Iterator;
75 typedef GreedySegmentation<SegmentComputer> Decomposition;
76
77 string inputFilename = examplesPath + "samples/sinus.dat";
78 vector<Point> sequence = PointListReader<Point>::getPointsFromFile(inputFilename);
79
80
81 SegmentComputer algo;
82 Decomposition theDecomposition(sequence.begin(), sequence.end(), algo);
83
85 //display
86 Point p;
87
88#ifdef DGTAL_WITH_POLYSCOPE
89
90 PolyscopeViewer viewer;
91 viewer.allowReuseList = true; // groups segments
92 viewer.drawAsGrid();
93#endif
94
95 unsigned int c = 0;
96 Decomposition::SegmentComputerIterator i = theDecomposition.begin();
97 for ( ; i != theDecomposition.end(); ++i) {
98 SegmentComputer currentSegmentComputer(*i);
99 #ifdef DGTAL_WITH_POLYSCOPE
100 viewer.drawAsBalls();
101 viewer << currentSegmentComputer;
102 viewer.defaultStyle();
103 viewer << currentSegmentComputer;
104 #endif
105 c++;
106 }
107
108
109 #ifdef DGTAL_WITH_POLYSCOPE
110 viewer.show();
111 #endif
112
113}
void drawAsGrid(bool toggle=true)
Aim: Computes the greedy segmentation of a range given by a pair of ConstIterators....
Aim: Implements basic operations that will be used in Point and Vector classes.
void show() override
Starts the event loop and display of elements.
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
static std::vector< TPoint > getPointsFromFile(const std::string &filename, std::vector< unsigned int > aVectPosition=std::vector< unsigned int >())
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer

References DGtal::Display3D< Space, KSpace >::allowReuseList, DGtal::Display3D< Space, KSpace >::defaultStyle(), DGtal::Display3D< Space, KSpace >::drawAsBalls(), DGtal::Display3D< Space, KSpace >::drawAsGrid(), DGtal::PointListReader< TPoint >::getPointsFromFile(), and DGtal::PolyscopeViewer< Space, KSpace >::show().