54unsigned char findMainAxis (
const T & curve,
const long double & t )
57 value[0] = std::abs ( curve.xp ( t )[0] );
58 value[1] = std::abs ( curve.xp ( t )[1] );
59 value[2] = std::abs ( curve.xp ( t )[2] );
61 if ( value[0] >= value[1] && value[0] >= value[2] )
63 else if ( value[1] >= value[0] && value[1] >= value[2] )
70int main(
int argc,
char** argv )
72 QApplication application(argc,argv);
74 typedef NaiveParametricCurveDigitizer3D < MyKnot > Digitizer;
78 trace.
info() <<
"exampleParamCurve3dDigitization" << endl;
82 MyDigitalCurve digitalCurve;
84 MyKnot knot ( 10, 10, 10 );
88 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
90 trace.
info() <<
"Number of points: " << digitalCurve.size () <<
" number of metadata: " << metaData.size () << endl;
93 for (
unsigned int i = 0; i < digitalCurve.size ( ); i++ )
95 if (
findMainAxis ( knot, metaData.at ( i ).first ) == 0 )
97 if (
findMainAxis ( knot, metaData.at ( i ).first ) == 1 )
99 if (
findMainAxis ( knot, metaData.at ( i ).first ) == 2 )
101 viewer <<
SetMode3D ( digitalCurve.at ( i ).className ( ),
"PavingWired" ) << digitalCurve.at ( i );
103 viewer << Viewer3D<>::updateDisplay;
105 return application.exec();
void digitize(Shape &shape, std::vector< SCell > &sCells0, std::vector< SCell > &sCells1, KSpace &kspace, const double h)