45 #include <boost/program_options/options_description.hpp>
46 #include <boost/program_options/parsers.hpp>
47 #include <boost/program_options/variables_map.hpp>
49 #include "DGtal/base/Common.h"
50 #include "DGtal/base/Exceptions.h"
51 #include "DGtal/kernel/SpaceND.h"
52 #include "DGtal/kernel/domains/HyperRectDomain.h"
53 #include "DGtal/kernel/BasicPointPredicates.h"
54 #include "DGtal/math/linalg/EigenDecomposition.h"
55 #include "DGtal/topology/KhalimskySpaceND.h"
56 #include "DGtal/geometry/curves/GridCurve.h"
57 #include "DGtal/geometry/curves/Naive3DDSSComputer.h"
58 #include "DGtal/geometry/curves/StandardDSS6Computer.h"
59 #include "DGtal/geometry/curves/SaturatedSegmentation.h"
60 #include "DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.h"
61 #include "DGtal/geometry/volumes/estimation/VoronoiCovarianceMeasure.h"
62 #include "DGtal/geometry/curves/estimation/LambdaMST3D.h"
63 #include "DGtal/geometry/curves/estimation/FunctorsLambdaMST.h"
64 #include "DGtal/io/viewers/Viewer3D.h"
65 #include "DGtal/io/readers/PointListReader.h"
66 #include "DGtal/io/DrawWithDisplay3DModifier.h"
69 using namespace DGtal;
150 const Color AXIS_COLOR( 0, 0, 0, 255 );
151 const double AXIS_LINESIZE = 0.1;
152 const Color XY_COLOR( 0, 0, 255, 50 );
153 const Color XZ_COLOR( 0, 255, 0, 50 );
154 const Color YZ_COLOR( 255, 0, 0, 50 );
155 const Color CURVE3D_COLOR( 100, 100, 140, 128 );
156 const Color CURVE2D_COLOR( 200, 200, 200, 100 );
157 const double MS3D_LINESIZE = 0.05;
162 template <
typename Po
int,
typename RealPo
int,
typename space,
typename kspace >
164 const Point & lowerBound,
const Point & upperBound,
165 const std::string & mode )
167 RealPoint p0( (
double)lowerBound[ 0 ]-0.5,
168 (
double)lowerBound[ 1 ]-0.5,
169 (
double)lowerBound[ 2 ]-0.5 );
170 RealPoint p1( (
double)upperBound[ 0 ]-0.5,
171 (
double)upperBound[ 1 ]-0.5,
172 (
double)upperBound[ 2 ]-0.5 );
173 if ( ( mode ==
"WIRED" ) || ( mode ==
"COLORED" ) )
201 if ( mode ==
"COLORED" )
221 template <
typename KSpace,
typename Naive3DDSSComputer,
typename space,
typename kspace >
229 template <
typename Po
int1,
typename Po
int2>
230 void assign( Point1 & p1,
const Point2 & p2 )
237 template <
typename KSpace,
typename Naive3DDSSComputer,
typename space,
typename kspace >
247 PointR3d interceptR, thicknessR;
258 assign( direction, directionZ3 );
259 direction /= direction.
norm();
260 assign( P1, *dss3d.
begin() );
261 assign( P2, *(dss3d.
end()-1) );
262 double t1 = (P1 - intercept).dot( direction );
263 double t2 = (P2 - intercept).dot( direction );
273 template <
typename KSpace,
typename StandardDSS6Computer,
typename space,
typename kspace >
279 typedef typename ArithmeticalDSSComputer2d::ConstIterator ConstIterator2d;
280 typedef typename ArithmeticalDSSComputer2d::Point Point2d;
287 for ( ConstIterator2d itP = dss2d.begin(), itPEnd = dss2d.end(); itP != itPEnd; ++itP )
293 case 0: q = Point3d( 2*b[ i ] , 2*p[ 0 ]+1, 2*p[ 1 ]+1 );
break;
294 case 1: q = Point3d( 2*p[ 0 ]+1, 2*b[ i ] , 2*p[ 1 ]+1 );
break;
295 case 2: q = Point3d( 2*p[ 0 ]+1, 2*p[ 1 ]+1, 2*b[ i ] );
break;
297 Cell c = ks.
uCell( q );
303 template <
typename KSpace,
typename StandardDSS6Computer,
typename space,
typename kspace >
310 typedef typename ArithmeticalDSSComputer2d::ConstIterator ConstIterator2d;
311 typedef typename ArithmeticalDSSComputer2d::Point Point2d;
319 const typename ArithmeticalDSSComputer2d::Primitive & dss2d
322 std::vector<PointD2d> pts2d;
323 pts2d.push_back( dss2d.project(dss2d.back(), dss2d.Uf()) );
324 pts2d.push_back( dss2d.project(dss2d.back(), dss2d.Lf()) );
325 pts2d.push_back( dss2d.project(dss2d.front(), dss2d.Lf()) );
326 pts2d.push_back( dss2d.project(dss2d.front(), dss2d.Uf()) );
327 std::vector<PointD3D> bb;
329 for (
unsigned int j = 0; j < pts2d.size(); ++j )
333 case 0: p3.center[0] = (double) b[ i ]-0.5; p3.center[1] = pts2d[ j ][ 0 ]; p3.center[2] = pts2d[ j ][ 1 ];
break;
334 case 1: p3.center[0] = pts2d[ j ][ 0 ]; p3.center[1] = (double) b[ i ]-0.5; p3.center[2] = pts2d[ j ][ 1 ];
break;
335 case 2: p3.center[0] = pts2d[ j ][ 0 ]; p3.center[1] = pts2d[ j ][ 1 ]; p3.center[2] = (double) b[ i ]-0.5;
break;
339 for (
unsigned int j = 0; j < pts2d.size(); ++j ){
350 template <
typename KSpace,
typename Naive3DDSSComputer,
typename space,
typename kspace >
356 typedef typename ArithmeticalDSSComputer2d::ConstIterator ConstIterator2d;
357 typedef typename ArithmeticalDSSComputer2d::Point Point2d;
370 if ( validXY && validXZ )
372 for ( ConstIterator2d itXY = dssXY.begin(), itXZ = dssXZ.begin(), itPEnd = dssXY.end(); itXY != itPEnd; ++itXY, ++itXZ )
374 Point2d p1 = *itXY, p2 = *itXZ;
376 q1 = Point3d ( 2*b[ 0 ], 2*p1[ 1 ]+1, 2*p2[ 1 ]+1 );
377 q2 = Point3d ( 2*p2[ 0 ]+1, 2*b[ 1 ], 2*p2[ 1 ]+1 );
378 q3 = Point3d ( 2*p1[ 0 ]+1, 2*p1[ 1 ]+1, 2*b[ 2 ] );
379 Cell c1 = ks.
uCell( q1 ); Cell c2 = ks.
uCell( q2 ); Cell c3 = ks.
uCell( q3 );
387 if ( validYZ && validXY )
389 for ( ConstIterator2d itYZ = dssYZ.begin(), itXY = dssXY.begin(), itPEnd = dssXY.end(); itXY != itPEnd; ++itXY, ++itYZ )
391 Point2d p1 = *itYZ, p2 = *itXY;
393 q1 = Point3d ( 2*b[ 0 ], 2*p1[ 0 ]+1, 2*p1[ 1 ]+1 );
394 q2 = Point3d ( 2*p2[ 0 ]+1, 2*b[ 1 ], 2*p1[ 1 ]+1 );
395 q3 = Point3d ( 2*p2[ 0 ]+1, 2*p2[ 1 ]+1, 2*b[ 2 ] );
396 Cell c1 = ks.
uCell( q1 ); Cell c2 = ks.
uCell( q2 ); Cell c3 = ks.
uCell( q3 );
404 for ( ConstIterator2d itYZ = dssYZ.begin(), itXZ = dssXZ.begin(), itPEnd = dssXZ.end(); itXZ != itPEnd; ++itXZ, ++itYZ )
406 Point2d p1 = *itYZ, p2 = *itXZ;
408 q1 = Point3d ( 2*b[ 0 ], 2*p1[ 0 ]+1, 2*p1[ 1 ]+1 );
409 q2 = Point3d ( 2*p2[ 0 ]+1, 2*b[ 1 ], 2*p2[ 1 ]+1 );
410 q3 = Point3d ( 2*p2[ 0 ]+1, 2*p1[ 0 ]+1, 2*b[ 2 ] );
411 Cell c1 = ks.
uCell( q1 ); Cell c2 = ks.
uCell( q2 );Cell c3 = ks.
uCell( q3 );
421 template <
typename KSpace,
typename Naive3DDSSComputer,
typename space,
typename kspace >
428 typedef typename ArithmeticalDSSComputer2d::ConstIterator ConstIterator2d;
429 typedef typename ArithmeticalDSSComputer2d::Point Point2d;
440 const typename ArithmeticalDSSComputer2d::Primitive & dss2d
443 std::vector<PointD2d> pts2d;
444 pts2d.push_back( dss2d.project(dss2d.back(), dss2d.Uf()) );
445 pts2d.push_back( dss2d.project(dss2d.back(), dss2d.Lf()) );
446 pts2d.push_back( dss2d.project(dss2d.front(), dss2d.Lf()) );
447 pts2d.push_back( dss2d.project(dss2d.front(), dss2d.Uf()) );
448 std::vector<PointD3D> bb;
450 for (
unsigned int j = 0; j < pts2d.size(); ++j )
454 case 0: p3.center[0] = (double) b[ i ]-0.5; p3.center[1] = pts2d[ j ][ 0 ]; p3.center[2] = pts2d[ j ][ 1 ];
break;
455 case 1: p3.center[0] = pts2d[ j ][ 0 ]; p3.center[1] = (double) b[ i ]-0.5; p3.center[2] = pts2d[ j ][ 1 ];
break;
456 case 2: p3.center[0] = pts2d[ j ][ 0 ]; p3.center[1] = pts2d[ j ][ 1 ]; p3.center[2] = (double) b[ i ]-0.5;
break;
460 for (
unsigned int j = 0; j < pts2d.size(); ++j ){
472 template <
typename KSpace,
typename Po
intIterator,
typename space,
typename kspace >
474 const KSpace & ks, PointIterator b, PointIterator e,
475 bool dss3d,
bool proj2d,
bool dss2d,
bool tangent,
478 typedef typename PointIterator::value_type Point;
481 typedef typename Decomposition::SegmentComputerIterator SegmentComputerIterator;
482 typedef typename SegmentComputer::ArithmeticalDSSComputer2d ArithmeticalDSSComputer2d;
483 SegmentComputer algo;
484 Decomposition theDecomposition(b, e, algo);
486 viewer <<
SetMode3D( algo.className(),
"BoundingBox" );
490 for ( SegmentComputerIterator i = theDecomposition.begin();
491 i != theDecomposition.end(); ++i)
493 SegmentComputer ms3d(*i);
494 const ArithmeticalDSSComputer2d & dssXY = ms3d.arithmeticalDSS2dXY();
495 const ArithmeticalDSSComputer2d & dssXZ = ms3d.arithmeticalDSS2dXZ();
496 const ArithmeticalDSSComputer2d & dssYZ = ms3d.arithmeticalDSS2dYZ();
497 Point f = *ms3d.begin();
498 Point l = *(ms3d.end() - 1);
501 <<
" [" << f[ 0 ] <<
"," << f[ 1 ] <<
","<< f[ 2 ] <<
"]"
502 <<
"->[" << l[ 0 ] <<
"," << l[ 1 ] <<
","<< l[ 2 ] <<
"]"
504 << dssXY.a() <<
"," << dssXY.b() <<
"," << dssXY.mu()
506 << dssXZ.a() <<
"," << dssXZ.b() <<
"," << dssXZ.mu()
508 << dssYZ.a() <<
"," << dssYZ.b() <<
"," << dssYZ.mu()
510 Color color = cmap_hue( c );
511 if ( tangent ) displayDSS3dTangent( viewer, ks, ms3d, color );
512 if ( dss3d ) displayDSS3d( viewer, ks, ms3d, color );
513 if ( dss2d ) displayDSS2d6( viewer, ks, ms3d, color );
514 if ( proj2d ) displayProj2d6( viewer, ks, ms3d, CURVE2D_COLOR );
524 template <
typename KSpace,
typename Po
intIterator,
typename space,
typename kspace >
526 const KSpace & ks, PointIterator b, PointIterator e,
527 bool dss3d,
bool proj2d,
bool dss2d,
bool tangent,
530 typedef typename PointIterator::value_type Point;
533 typedef typename Decomposition::SegmentComputerIterator SegmentComputerIterator;
534 typedef typename SegmentComputer::ArithmeticalDSSComputer2d ArithmeticalDSSComputer2d;
535 SegmentComputer algo;
536 Decomposition theDecomposition(b, e, algo);
538 viewer <<
SetMode3D( algo.className(),
"BoundingBox" );
542 for ( SegmentComputerIterator i = theDecomposition.begin();
543 i != theDecomposition.end(); ++i)
545 SegmentComputer ms3d(*i);
546 const ArithmeticalDSSComputer2d & dssXY = ms3d.arithmeticalDSS2dXY();
547 const ArithmeticalDSSComputer2d & dssXZ = ms3d.arithmeticalDSS2dXZ();
548 const ArithmeticalDSSComputer2d & dssYZ = ms3d.arithmeticalDSS2dYZ();
549 Point f = *ms3d.begin();
550 Point l = *(ms3d.end() - 1);
553 <<
" [" << f[ 0 ] <<
"," << f[ 1 ] <<
","<< f[ 2 ] <<
"]"
554 <<
"->[" << l[ 0 ] <<
"," << l[ 1 ] <<
","<< l[ 2 ] <<
"]"
556 << dssXY.a() <<
"," << dssXY.b() <<
"," << dssXY.mu()
558 << dssXZ.a() <<
"," << dssXZ.b() <<
"," << dssXZ.mu()
560 << dssYZ.a() <<
"," << dssYZ.b() <<
"," << dssYZ.mu()
564 Color color = cmap_hue( c );
565 if ( tangent ) displayDSS3dTangent( viewer, ks, ms3d, color );
566 if ( dss3d ) displayDSS3d( viewer, ks, ms3d, color );
567 if ( dss2d ) displayDSS2d26( viewer, ks, ms3d, color );
568 if ( proj2d ) displayProj2d26( viewer, ks, ms3d, CURVE2D_COLOR );
574 template <
typename Po
intIterator,
typename Space,
typename TangentSequence >
575 void ComputeVCM (
const double & R,
const double & r,
576 const PointIterator & begin,
const PointIterator & end, TangentSequence & tangents,
const std::string & output )
578 using namespace DGtal;
584 typedef LinearAlgebraTool::Matrix Matrix;
586 fstream outputStream;
587 outputStream.open ( ( output +
".vcm" ).c_str(), std::ios::out );
588 outputStream <<
"# VCM estimation R=" << R <<
" r=" << r <<
" chi=hat" << endl;
591 VCM vcm ( R, ceil( r ), l2,
true );
592 vcm.init( begin, end );
593 KernelFunction chi( 1.0, r );
595 typename Space::RealVector eval;
596 for ( PointIterator it = begin; it != end; ++it )
599 vcm_r = vcm.measure( chi, *it );
600 LinearAlgebraTool::getEigenDecomposition ( vcm_r, evec, eval );
601 typename Space::RealVector tangent = evec.column( 0 );
602 tangents.push_back ( tangent );
603 outputStream << (*it)[0] <<
" " << (*it)[1] <<
" " << (*it)[2] <<
" "
604 << tangent[0] <<
" " << tangent[1] <<
" " << tangent[2] << endl;
606 outputStream.close();
609 template <
typename Po
intIterator,
typename Space,
typename TangentSequence >
610 void ComputeLMST6 (
const PointIterator & begin,
const PointIterator & end, TangentSequence & tangents,
const std::string & output )
612 typedef typename PointIterator::value_type Point;
615 typedef typename Decomposition::SegmentComputerIterator SegmentComputerIterator;
616 typedef typename SegmentComputer::ArithmeticalDSSComputer2d ArithmeticalDSSComputer2d;
617 SegmentComputer algo;
618 Decomposition theDecomposition ( begin, end, algo );
620 fstream outputStream;
621 outputStream.open ( ( output +
".lmst" ).c_str(), std::ios::out );
622 outputStream <<
"X Y Z X Y Z" << endl;
625 lmst64.
attach ( theDecomposition );
626 lmst64.
init ( begin, end );
627 lmst64.
eval ( begin, end, std::back_inserter ( tangents ) );
628 typename TangentSequence::iterator itt = tangents.
begin();
629 for ( PointIterator it = begin; it != end; ++it, ++itt )
631 typename Space::RealVector & tangent = (*itt);
632 if ( tangent.norm() != 0. )
633 tangent = tangent.getNormalized();
634 outputStream << (*it)[0] <<
" " << (*it)[1] <<
" " << (*it)[2] <<
" "
635 << tangent[0] <<
" " << tangent[1] <<
" " << tangent[2] << endl;
639 template <
typename Po
intIterator,
typename Space,
typename TangentSequence >
640 void ComputeLMST26 (
const PointIterator & begin,
const PointIterator & end, TangentSequence & tangents,
const std::string & output )
642 typedef typename PointIterator::value_type Point;
645 typedef typename Decomposition::SegmentComputerIterator SegmentComputerIterator;
646 typedef typename SegmentComputer::ArithmeticalDSSComputer2d ArithmeticalDSSComputer2d;
647 SegmentComputer algo;
648 Decomposition theDecomposition ( begin, end, algo );
650 fstream outputStream;
651 outputStream.open ( ( output +
".lmst" ).c_str(), std::ios::out );
652 outputStream <<
"X Y Z X Y Z" << endl;
655 lmst64.
attach ( theDecomposition );
656 lmst64.
init ( begin, end );
657 lmst64.
eval ( begin, end, std::back_inserter ( tangents ) );
658 typename TangentSequence::iterator itt = tangents.
begin();
659 for ( PointIterator it = begin; it != end; ++it, ++itt )
661 typename Space::RealVector & tangent = (*itt);
662 if ( tangent.norm() != 0. )
663 tangent = tangent.getNormalized();
664 outputStream << (*it)[0] <<
" " << (*it)[1] <<
" " << (*it)[2] <<
" "
665 << tangent[0] <<
" " << tangent[1] <<
" " << tangent[2] << endl;
670 namespace po = boost::program_options;
680 int main(
int argc,
char **argv)
683 using namespace DGtal;
686 typedef Z3::Point Point;
690 typedef typename vector<Point>::const_iterator PointIterator;
693 QApplication application(argc,argv);
694 po::options_description general_opt(
"Specific allowed options are ");
695 general_opt.add_options()
696 (
"help,h",
"display this message")
697 (
"input,i", po::value<string>(),
"the name of the text file containing the list of 3D points: (x y z) per line." )
698 (
"view,V", po::value<string>()->default_value(
"OFF" ),
"toggles display ON/OFF" )
699 (
"box,b", po::value<int>()->default_value( 0 ),
"specifies the the tightness of the bounding box around the curve with a given integer displacement <arg> to enlarge it (0 is tight)" )
700 (
"viewBox,v", po::value<string>()->default_value(
"WIRED" ),
"displays the bounding box, <arg>=WIRED means that only edges are displayed, <arg>=COLORED adds colors for planes (XY is red, XZ green, YZ, blue)." )
701 (
"connectivity,T", po::value<string>()->default_value(
"6" ),
"specifies whether it is a 6-connected curve or a 26-connected curve: arg=6 | 26.")
702 (
"curve3d,C",
"displays the 3D curve")
703 (
"curve2d,c",
"displays the 2D projections of the 3D curve on the bounding box")
704 (
"cover3d,3",
"displays the 3D tangential cover of the curve" )
705 (
"cover2d,2",
"displays the 2D projections of the 3D tangential cover of the curve" )
706 (
"nbColors,n", po::value<int>()->default_value( 3 ),
"sets the number of successive colors used for displaying 2d and 3d maximal segments (default is 3: red, green, blue)" )
707 (
"tangent,t",
"displays the tangents to the curve" )
708 (
"big-radius,R", po::value<double>()->default_value( 10.0 ),
"the radius parameter R in the VCM estimator." )
709 (
"small-radius,r", po::value<double>()->default_value( 3.0 ),
"the radius parameter r in the VCM estimator." )
710 (
"method,m", po::value<string>()->default_value(
"VCM" ),
"the method of tangent computation: VCM (default), L-MST." )
711 (
"output,o", po::value<string>()->default_value(
"3d-curve-tangent-estimations"),
"the basename of the output text file which will contain points and tangent vectors: (x y z tx ty tz) per line" )
713 po::positional_options_description pos_opt;
714 pos_opt.add(
"input", 1);
718 po::variables_map vm;
721 po::command_line_parser clp( argc, argv );
722 clp.options( general_opt ).positional( pos_opt );
723 po::store( clp.run(), vm );
725 catch(
const exception& ex )
728 trace.
info() <<
"Error checking program options: "<< ex.what() << endl;
731 if( !parseOK || vm.count(
"help")||argc<=1)
733 cout <<
"Usage: " << argv[0] <<
" [options] --input <filename>\n"
734 <<
"This program estimates the tangent vector to a set of 3D integer points, which are supposed to approximate a 3D curve. "
735 <<
"This set of points is given as a list of points in file <input>."
737 <<
"The tangent estimator uses either the digital Voronoi Covariance Measure (VCM) or the 3D lambda-Maximal Segment Tangent (L-MST)."
739 <<
"This program can also displays the curve and tangent estimations, "
740 <<
"and it can also extract maximal digital straight segments (2D and 3D)."
742 <<
"Note: It is not compulsory for the points to be ordered in sequence, except if you wish to compute maximal digital straight segments."
744 <<
"In this case, you can select the connectivity of your curve between 6 (standard) or 26 (naive).\n"
745 << general_opt <<
"\n\n";
747 <<
"3dCurveTangentEstimator -i ${DGtal}/examples/samples/sinus.dat -V ON -c -R 20 -r 3 -T 6\n";
752 string input = vm[
"input"].as<
string>();
753 int b = vm[
"box"].as<
int>();
755 vector<Point> sequence;
757 inputStream.open ( input.c_str(), ios::in);
770 bool view = vm[
"view" ].as<
string>() ==
"ON";
774 Point lowerBound = sequence[ 0 ];
775 Point upperBound = sequence[ 0 ];
776 for (
unsigned int j = 1; j < sequence.size(); ++j )
778 lowerBound = lowerBound.inf( sequence[ j ] );
779 upperBound = upperBound.sup( sequence[ j ] );
781 lowerBound -= Point::diagonal( b );
782 upperBound += Point::diagonal( b + 1 );
783 K3 ks; ks.
init( lowerBound, upperBound,
true );
787 std::vector< RealVector > tangents;
788 string output = vm[
"output"].as<
string>();
789 string method = vm[
"method"].as<
string>();
791 if ( method ==
"VCM" )
794 const double R = vm[
"big-radius"].as<
double>();
795 trace.
info() <<
"Big radius R = " << R << endl;
796 const double r = vm[
"small-radius"].as<
double>();
797 trace.
info() <<
"Small radius r = " << r << endl;
799 ComputeVCM < PointIterator, Z3, std::vector< RealVector > > ( R, r, sequence.begin(), sequence.end(), tangents, output );
801 else if ( method ==
"L-MST" )
803 if (vm[
"connectivity" ].as<string>() ==
"6")
804 ComputeLMST6 < PointIterator, Z3, std::vector< RealVector > > ( sequence.begin(), sequence.end(), tangents, output );
806 ComputeLMST26 < PointIterator, Z3, std::vector< RealVector > > ( sequence.begin(), sequence.end(), tangents, output );
810 trace.
info() <<
"Wrong method! Try: VCM or L-MST" << endl;
816 for (
unsigned int i = 0; i < tangents.size(); i++ )
819 RealPoint p = sequence[i];
820 RealVector tangent = tangents[i];
823 viewer.
addLine( p + 2.0 * tangent, p - 2.0 * tangent, 5.0 );
833 gc.initFromPointsVector( sequence );
837 trace.
warning() <<
"[ConnectivityException] GridCurve only accepts a sequence of face adjacent points. Try connectivity=6 instead." << endl;
847 if ( vm.count(
"viewBox" ) )
848 displayAxes<Point,RealPoint, Z3i::Space, Z3i::KSpace>( viewer, lowerBound, upperBound, vm[
"viewBox" ].as<std::string>() );
850 res = vm[
"connectivity" ].as<
string>() ==
"6"
851 ? displayCover6( viewer, ks, sequence.begin(), sequence.end(),
852 vm.count(
"cover3d" ),
853 vm.count(
"curve2d" ),
854 vm.count(
"cover2d" ),
855 vm.count(
"tangent" ),
856 vm[
"nbColors"].as<
int>() )
857 : displayCover26( viewer, ks, sequence.begin(), sequence.end(),
858 vm.count(
"cover3d" ),
859 vm.count(
"curve2d" ),
860 vm.count(
"cover2d" ),
861 vm.count(
"tangent" ),
862 vm[
"nbColors"].as<int>() );
864 if ( vm.count(
"curve3d" ) )
867 for ( vector<Point>::const_iterator it = sequence.begin(), itE = sequence.end();
873 viewer << Viewer3D<Z3,K3>::updateDisplay;
876 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
virtual void setFillColor(DGtal::Color aColor)
void beginBlock(const std::string &keyword="")
void addBall(const RealPoint ¢er, const double radius=0.5, const unsigned int resolution=30)
DGtal::uint32_t Dimension
void init(const ConstIterator &itb, const ConstIterator &ite)
virtual void setLineColor(DGtal::Color aColor)
const ArithmeticalDSSComputer2d & arithmeticalDSS2dXZ() const
IteratorCirculatorTraits< ConstIterator >::Value Point3d
RealVector eval(const ConstIterator &it)
const Point & lowerBound() const
Cell uCell(const PreCell &c) const
bool init(const Point &lower, const Point &upper, bool isClosed)
const ArithmeticalDSSComputer2d & arithmeticalDSS2dXY() const
const ArithmeticalDSSComputer2d & arithmeticalDSS2d(Dimension i) const
void addLine(const RealPoint &p1, const RealPoint &p2, const double width=0.03)
void getParameters(Vector3d &direction, PointR3d &intercept, PointR3d &thickness) const
Trace trace(traceWriterTerm)
double norm(const NormType type=L_2) const
typename Self::Point Point
const ArithmeticalDSSComputer2d & arithmeticalDSS2dYZ() const
ConstIterator begin() const
bool validArithmeticalDSS2d(Dimension i) const
const Primitive & primitive() const
static std::vector< TPoint > getPointsFromInputStream(std::istream &in, std::vector< unsigned int > aVectPosition=std::vector< unsigned int >())
ConstIterator end() const
Space::RealVector RealVector
std::array< Quotient, 3 > PointR3d
void addQuad(const RealPoint &p1, const RealPoint &p2, const RealPoint &p3, const RealPoint &p4)
void attach(Alias< DSSSegmentationComputer > segmentComputer)
typename Self::Domain Domain
const ArithmeticalDSSComputer2d & arithmeticalDSS2d(Dimension i) const