30#ifndef DOXYGEN_SHOULD_SKIP_THIS
35#include "DGtalCatch.h"
36#include "DGtal/helpers/StdDefs.h"
37#include "DGtal/shapes/parametric/AccFlower2D.h"
38#include "DGtal/shapes/parametric/Astroid2D.h"
39#include "DGtal/shapes/parametric/Ball2D.h"
40#include "DGtal/shapes/parametric/Ellipse2D.h"
41#include "DGtal/shapes/parametric/Flower2D.h"
42#include "DGtal/shapes/parametric/Lemniscate2D.h"
43#include "DGtal/shapes/parametric/NGon2D.h"
44#include "DGtal/shapes/implicit/ImplicitBall.h"
45#include "DGtal/shapes/implicit/ImplicitHyperCube.h"
46#include "DGtal/shapes/implicit/ImplicitNorm1Ball.h"
47#include "DGtal/shapes/implicit/ImplicitRoundedHyperCube.h"
68template<
typename Shape>
74 return MyAccFlower( center, radii[0], radii[1], 12, 2. );
80 return MyAstroid( center, radii[0], radii[1] );
86 return MyBall( center, radii[0] );
92 return MyEllipse( center, radii[0], radii[1], 2. );
98 return MyFlower( center, radii[0], radii[1], 5, 2. );
104 return MyLemniscate( center, radii[0] );
110 return MyNGon( center, radii[0], 20, 2. );
116 return BallImplicit( center, radii[0] );
122 return HyperCubeImplicit( center, radii[0] );
128 return Norm1BallImplicit( center, radii[0] );
132RoundedHyperCubeImplicit createShape(
const RealPoint& center,
const RealPoint& radii )
134 return RoundedHyperCubeImplicit( center, radii[0], 3. );
137std::uniform_real_distribution<double> unif(-1000000.,1000000.);
138std::default_random_engine re;
140TEMPLATE_TEST_CASE(
"Star shapes",
"move() method",
141 MyAccFlower, MyAstroid, MyBall, MyEllipse, MyFlower, MyLemniscate, MyNGon,
142 BallImplicit, HyperCubeImplicit, Norm1BallImplicit, RoundedHyperCubeImplicit)
144 const double centerX = unif(re);
145 const double centerY = unif(re);
146 const double radiusX = unif(re);
147 const double radiusY = unif(re);
149 TestType shape = createShape<TestType>(
RealPoint(centerX, centerY),
RealPoint(radiusX, radiusY) );
156 SECTION(
"Change center position")
158 const double newCenterX = unif(re);
159 const double newCenterY = unif(re);
161 shape.moveTo(
RealPoint( newCenterX, newCenterY ) );
Aim: Model of the concept StarShaped represents any accelerated flower in the plane.
Aim: Model of the concept StarShaped represents an astroid.
Aim: Model of the concept StarShaped represents any circle in the plane.
Aim: Model of the concept StarShaped represents any ellipse in the plane.
Aim: Model of the concept StarShaped represents any flower with k-petals in the plane.
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD....
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create an hypercube in n...
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball for the L_...
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a rounded hypercu...
Aim: Model of the concept StarShaped represents a lemniscate.
Aim: Model of the concept StarShaped represents any regular k-gon in the plane.
DGtal is the top-level namespace which contains all DGtal functions and types.
SECTION("Testing constant forward iterators")
REQUIRE(domain.isInside(aPoint))
PointVector< 3, double > RealPoint