33#include "DGtalCatch.h"
34#include "DGtal/helpers/StdDefs.h"
35#include "DGtal/shapes/parametric/AccFlower2D.h"
36#include "DGtal/shapes/parametric/Astroid2D.h"
37#include "DGtal/shapes/parametric/Ball2D.h"
38#include "DGtal/shapes/parametric/Ellipse2D.h"
39#include "DGtal/shapes/parametric/Flower2D.h"
40#include "DGtal/shapes/parametric/Lemniscate2D.h"
41#include "DGtal/shapes/parametric/NGon2D.h"
42#include "DGtal/shapes/implicit/ImplicitBall.h"
43#include "DGtal/shapes/implicit/ImplicitHyperCube.h"
44#include "DGtal/shapes/implicit/ImplicitNorm1Ball.h"
45#include "DGtal/shapes/implicit/ImplicitRoundedHyperCube.h"
69template<
typename Shape>
75 return AccFlower( center, radii[0], radii[1], 12, 2. );
81 return Astroid( center, radii[0], radii[1] );
87 return Ball( center, radii[0] );
93 return Ellipse( center, radii[0], radii[1], 2. );
99 return Flower( center, radii[0], radii[1], 5, 2. );
111 return NGon( center, radii[0], 20, 2. );
138std::uniform_real_distribution<double>
unif(-1000000.,1000000.);
139std::default_random_engine
re;
145 const double centerX =
unif(
re);
146 const double centerY =
unif(
re);
147 const double radiusX =
unif(
re);
148 const double radiusY =
unif(
re);
150 TestType shape = createShape<TestType>(
RealPoint(centerX, centerY),
RealPoint(radiusX, radiusY) );
157 SECTION(
"Change center position")
159 const double newCenterX =
unif(
re);
160 const double newCenterY =
unif(
re);
162 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.
std::default_random_engine re
std::uniform_real_distribution< double > unif(-1000000., 1000000.)
Ellipse2D< Space > Ellipse
Astroid2D< Space > Astroid
ImplicitHyperCube< Space > HyperCubeImplicit
Shape createShape(const RealPoint ¢er, const RealPoint &radii)
AccFlower2D< Space > AccFlower
ImplicitNorm1Ball< Space > Norm1BallImplicit
TEMPLATE_TEST_CASE("Star shapes", "move() method", AccFlower, Astroid, Ball, Ellipse, Flower, Lemniscate, NGon, BallImplicit, HyperCubeImplicit, Norm1BallImplicit, RoundedHyperCubeImplicit)
Lemniscate2D< Space > Lemniscate
ImplicitBall< Space > BallImplicit
ImplicitRoundedHyperCube< Space > RoundedHyperCubeImplicit
SECTION("Testing constant forward iterators")
REQUIRE(domain.isInside(aPoint))