DGtal  1.5.beta
geometry/curves/exampleNaive3DDSSComputer.cpp

This example shows the basic usage of a naive 3D DSS recognition.

See also
Digital straight lines and segments
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/base/BasicTypes.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/geometry/curves/Naive3DDSSComputer.h"
using namespace std;
using namespace DGtal;
int main()
{
using namespace Z3i;
// Container of digital points
typedef std::vector<Z3::Point> Container;
// Iterator on the container
typedef Container::const_iterator ConstIterator;
// Naive3DDSS computer
typedef Naive3DDSSComputer< ConstIterator, int, 8 > DSSComputer;
// Construction of the computer
DSSComputer theDSSComputer;
// Input points
Container contour;
contour.push_back(Z3::Point(18,25,18));
contour.push_back(Z3::Point(17,25,19));
contour.push_back(Z3::Point(16,25,20));
contour.push_back(Z3::Point(15,25,21));
contour.push_back(Z3::Point(14,25,22));
contour.push_back(Z3::Point(13,25,23));
contour.push_back(Z3::Point(12,25,24));
contour.push_back(Z3::Point(11,25,25));
contour.push_back(Z3::Point(10,25,26));
contour.push_back(Z3::Point(9,25,27));
contour.push_back(Z3::Point(8,25,28));
// Add points while it is possible
theDSSComputer.init( contour.begin() );
while ( ( theDSSComputer.end() != contour.end() ) &&
( theDSSComputer.extendFront() ) ) {}
// Trace to the standard output
theDSSComputer.selfDisplay( cout );
theDSSComputer.validArithmeticalDSS2d( 0 );
DSSComputer::ArithmeticalDSSComputer2d theDSS = theDSSComputer.arithmeticalDSS2d( 0 );
DSSComputer::Point3d directionZ3;
DSSComputer::PointR3d intercept;
DSSComputer::PointR3d thikness;
theDSSComputer.getParameters ( directionZ3, intercept, thikness );
return 1;
}
// //
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
MyPointD Point
Definition: testClone2.cpp:383