36 #include "DGtalCatch.h"
37 #include "DGtal/base/Common.h"
38 #include "DGtal/helpers/StdDefs.h"
40 #include "DGtal/geometry/curves/parametric/EllipticHelix.h"
41 #include "DGtal/geometry/curves/parametric/DecoratorParametricCurveTransformation.h"
42 #include "DGtal/geometry/curves/parametric/Knot_3_1.h"
43 #include "DGtal/geometry/curves/parametric/Knot_3_2.h"
44 #include "DGtal/geometry/curves/parametric/Knot_4_1.h"
45 #include "DGtal/geometry/curves/parametric/Knot_4_3.h"
46 #include "DGtal/geometry/curves/parametric/Knot_5_1.h"
47 #include "DGtal/geometry/curves/parametric/Knot_5_2.h"
48 #include "DGtal/geometry/curves/parametric/Knot_6_2.h"
49 #include "DGtal/geometry/curves/parametric/Knot_7_4.h"
50 #include "DGtal/geometry/curves/parametric/NaiveParametricCurveDigitizer3D.h"
51 #include "DGtal/images/RigidTransformation3D.h"
56 using namespace DGtal;
58 using namespace functors;
67 MyDigitalCurve digitalCurve;
69 MyHelix helix( 15, 10, 1 );
71 digitize.init ( M_PI / 2., MyHelix::getPeriod() + M_PI / 2., 0.001 );
73 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ) );
77 REQUIRE( digitalCurve.size ( ) > 0 );
80 digitalCurve.clear ( );
82 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
86 REQUIRE( digitalCurve.size ( ) > 0 );
87 REQUIRE( metaData.size ( ) > 0 );
88 REQUIRE( metaData.size ( ) == digitalCurve.size ( ) );
93 helix.f ( digitalCurve[0] );
94 helix.g ( digitalCurve[0] );
95 helix.h ( digitalCurve[0] );
110 MyDigitalCurve digitalCurve;
112 MyHelix helix( 30, 20, 1 );
114 double angle = M_PI/3.;
117 MyRotatedCurve rotCurve ( helix, trans );
121 digitize.init ( 0, MyHelix::getPeriod(), 0.001 );
122 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ) );
126 REQUIRE( digitalCurve.size ( ) > 0 );
129 digitalCurve.clear ( );
131 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
135 REQUIRE( digitalCurve.size ( ) > 0 );
136 REQUIRE( metaData.size ( ) > 0 );
137 REQUIRE( metaData.size ( ) == digitalCurve.size ( ) );
149 MyDigitalCurve digitalCurve;
151 MyKnot knot( 10, 10, 10 );
155 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ) );
159 REQUIRE( digitalCurve.size ( ) > 0 );
162 digitalCurve.clear ( );
164 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
168 REQUIRE( digitalCurve.size ( ) > 0 );
169 REQUIRE( metaData.size ( ) > 0 );
170 REQUIRE( metaData.size ( ) == digitalCurve.size ( ) );
182 MyDigitalCurve digitalCurve;
184 MyKnot knot( 10, 10, 10 );
188 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ) );
192 REQUIRE( digitalCurve.size ( ) > 0 );
195 digitalCurve.clear ( );
197 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
201 REQUIRE( digitalCurve.size ( ) > 0 );
202 REQUIRE( metaData.size ( ) > 0 );
203 REQUIRE( metaData.size ( ) == digitalCurve.size ( ) );
215 MyDigitalCurve digitalCurve;
217 MyKnot knot( 10, 10, 10 );
221 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ) );
225 REQUIRE( digitalCurve.size ( ) > 0 );
228 digitalCurve.clear ( );
230 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
234 REQUIRE( digitalCurve.size ( ) > 0 );
235 REQUIRE( metaData.size ( ) > 0 );
236 REQUIRE( metaData.size ( ) == digitalCurve.size ( ) );
248 MyDigitalCurve digitalCurve;
250 MyKnot knot( 10, 10, 10 );
254 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ) );
258 REQUIRE( digitalCurve.size ( ) > 0 );
261 digitalCurve.clear ( );
263 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
267 REQUIRE( digitalCurve.size ( ) > 0 );
268 REQUIRE( metaData.size ( ) > 0 );
269 REQUIRE( metaData.size ( ) == digitalCurve.size ( ) );
281 MyDigitalCurve digitalCurve;
283 MyKnot knot( 10, 10, 10 );
287 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ) );
291 REQUIRE( digitalCurve.size ( ) > 0 );
294 digitalCurve.clear ( );
296 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
300 REQUIRE( digitalCurve.size ( ) > 0 );
301 REQUIRE( metaData.size ( ) > 0 );
302 REQUIRE( metaData.size ( ) == digitalCurve.size ( ) );
314 MyDigitalCurve digitalCurve;
316 MyKnot knot( 10, 10, 10 );
320 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ) );
324 REQUIRE( digitalCurve.size ( ) > 0 );
327 digitalCurve.clear ( );
329 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
333 REQUIRE( digitalCurve.size ( ) > 0 );
334 REQUIRE( metaData.size ( ) > 0 );
335 REQUIRE( metaData.size ( ) == digitalCurve.size ( ) );
347 MyDigitalCurve digitalCurve;
349 MyKnot knot( 10, 10, 10 );
353 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ) );
357 REQUIRE( digitalCurve.size ( ) > 0 );
360 digitalCurve.clear ( );
362 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
366 REQUIRE( digitalCurve.size ( ) > 0 );
367 REQUIRE( metaData.size ( ) > 0 );
368 REQUIRE( metaData.size ( ) == digitalCurve.size ( ) );
380 MyDigitalCurve digitalCurve;
382 MyKnot knot( 10, 10, 10 );
386 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ) );
390 REQUIRE( digitalCurve.size ( ) > 0 );
393 digitalCurve.clear ( );
395 digitize.digitize( back_insert_iterator < MyDigitalCurve> ( digitalCurve ), back_insert_iterator < MyMetaData > ( metaData ) );
399 REQUIRE( digitalCurve.size ( ) > 0 );
400 REQUIRE( metaData.size ( ) > 0 );
401 REQUIRE( metaData.size ( ) == digitalCurve.size ( ) );
Aim: Implement a parametric curve – elliptic helix.
Aim: Implement a parametrized knot 3, 1.
Aim: Implement a parametrized knot 3, 2.
Aim: Implement a parametrized knot 4, 1.
Aim: Implement a parametrized knot 4, 3.
Aim: Implement a parametrized knot 5, 1.
Aim: Implement a parametrized knot 5, 2.
Aim: Implement a parametrized knot 6, 2.
Aim: Implement a parametrized knot 7, 4.
Aim: Digitization of 3D parametric curves. This method produces, for good parameters step and k_next,...
std::vector< std::pair< long double, unsigned int > > MetaData
std::vector< Point > DigitalCurve
Digital curve type.
Aim: Implements basic operations that will be used in Point and Vector classes.
DGtal is the top-level namespace which contains all DGtal functions and types.
TEST_CASE("Elliptic Helix test")
void digitize(Shape &shape, std::vector< SCell > &sCells0, std::vector< SCell > &sCells1, KSpace &kspace, const double h)
SECTION("Testing constant forward iterators")
REQUIRE(domain.isInside(aPoint))