56unsigned char findMainAxis (
const T & curve,
const long double & t )
59 value[0] = std::abs ( curve.xp ( t )[0] );
60 value[1] = std::abs ( curve.xp ( t )[1] );
61 value[2] = std::abs ( curve.xp ( t )[2] );
63 if ( value[0] >= value[1] && value[0] >= value[2] )
65 else if ( value[1] >= value[0] && value[1] >= value[2] )
72int main(
int argc,
char** argv )
74 QApplication application(argc,argv);
76 typedef EllipticHelix < Space > MyHelix;
77 typedef NaiveParametricCurveDigitizer3D < MyHelix > DigitizerHelix;
81 trace.
info() <<
"exampleParamCurve3dDigitization" << endl;
86 MyDigitalCurve digitalCurve;
88 MyHelix helix( 15, 10, 1 );
90 digitize.init ( M_PI / 2., ( MyHelix::getPeriod() * 10. ) + M_PI / 2., 0.0001 );
95 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
98 trace.
info() <<
"Number of points: " << digitalCurve.size () <<
" number of metadata: " << metaData.size () << endl;
103 for (
unsigned int i = 0; i < digitalCurve.size ( ); i++ )
105 if (
findMainAxis ( helix, metaData.at ( i ).first ) == 0 )
107 if (
findMainAxis ( helix, metaData.at ( i ).first ) == 1 )
109 if (
findMainAxis ( helix, metaData.at ( i ).first ) == 2 )
111 viewer <<
SetMode3D ( digitalCurve.at ( i ).className ( ),
"PavingWired" ) << digitalCurve.at ( i );
114 viewer << Viewer3D<>::updateDisplay;
116 return application.exec();
void digitize(Shape &shape, std::vector< SCell > &sCells0, std::vector< SCell > &sCells1, KSpace &kspace, const double h)