34#include "DGtal/base/Common.h"
35#include "DGtal/kernel/SpaceND.h"
36#include "DGtal/kernel/domains/HyperRectDomain.h"
37#include "DGtal/kernel/sets/DigitalSetBySTLSet.h"
38#include "DGtal/topology/KhalimskySpaceND.h"
39#include "DGtal/geometry/volumes/CellGeometry.h"
40#include "DGtal/geometry/volumes/DigitalConvexity.h"
41#include "DGtal/shapes/Shapes.h"
42#include "DGtalCatch.h"
53SCENARIO(
"DigitalConvexity< Z2 > full convexity tests",
"[digital_convexity][2d][full_convexity]" )
59 DConvexity dconv(
Point( -5, -5 ),
Point( 10, 10 ) );
74SCENARIO(
"FullConvexity< Z3 > full convexity tests",
"[full_convexity][3d]" )
80 DConvexity dconv(
Point( -5, -5, -5 ),
Point( 10, 10, 10 ) );
85 std::vector< Point > X;
96 REQUIRE( ( cvx0 && cvx1 && cvx2 && cvx3 ) == cvxf );
99SCENARIO(
"DigitalConvexity< Z2 > ball tests",
"[digital_convexity][2d]" )
101 GIVEN(
"Given a 2D digital ball of radius 5 " ) {
109 Point lo = Point::diagonal( -7 );
110 Point hi = Point::diagonal( 7 );
111 Point c = Point::zero;
113 DConvexity dconv ( lo, hi );
116 std::vector<Point> V( ball.
begin(), ball.
end() );
119 THEN(
"It is a 0-convex and fully convex set by morphological characterization" ) {
126SCENARIO(
"DigitalConvexity< Z3 > ball tests",
"[digital_convexity][3d]" )
128 GIVEN(
"Given a 3D digital ball of radius 5 " ) {
136 Point lo = Point::diagonal( -7 );
137 Point hi = Point::diagonal( 7 );
138 Point c = Point::zero;
140 DConvexity dconv ( lo, hi );
143 std::vector<Point> V( ball.
begin(), ball.
end() );
146 THEN(
"It is a 0-convex and fully convex set by morphological characterization" ) {
153SCENARIO(
"DigitalConvexity< Z4 > ball tests",
"[digital_convexity][4d]" )
155 GIVEN(
"Given a 4D digital ball of radius 5 " ) {
164 Point lo = Point::diagonal( -7 );
165 Point hi = Point::diagonal( 7 );
166 Point c = Point::zero;
168 DConvexity dconv ( lo, hi );
171 std::vector<Point> V( ball.
begin(), ball.
end() );
175 THEN(
"It is a 0-convex and fully convex set by morphological characterization" ) {
void getPoints(std::vector< Point > &pts) const
bool isKConvex(const LatticePolytope &P, const Dimension k) const
static bool isSimplexFullDimensional(PointIterator itB, PointIterator itE)
static LatticePolytope makeSimplex(PointIterator itB, PointIterator itE)
bool isFullyConvex(const PointRange &X, bool convex0=false) const
bool is0Convex(const PointRange &X) const
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
ConstIterator end() const
ConstIterator begin() const
Aim: A container class for storing sets of digital points within some given domain.
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
static void addNorm2Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
DGtal is the top-level namespace which contains all DGtal functions and types.
GIVEN("A cubical complex with random 3-cells")
HyperRectDomain< Space > Domain
REQUIRE(domain.isInside(aPoint))
SCENARIO("UnorderedSetByBlock< PointVector< 2, int > unit tests with 32 bits blocks", "[unorderedsetbyblock][2d]")
Z2i::DigitalSet DigitalSet