DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
exampleEuclideanShapesDecorator.cpp
Go to the documentation of this file.
1
16
30
32
34
#include <iostream>
35
#include "DGtal/base/Common.h"
36
37
// Shape construction
38
#include "DGtal/shapes/GaussDigitizer.h"
39
#include "DGtal/topology/LightImplicitDigitalSurface.h"
40
#include "DGtal/topology/DigitalSurface.h"
41
#include "DGtal/io/boards/Board2D.h"
42
#include "DGtal/images/ImageHelper.h"
43
#include "DGtal/shapes/Shapes.h"
44
#include "DGtal/shapes/implicit/ImplicitBall.h"
45
#include "DGtal/shapes/EuclideanShapesDecorator.h"
46
47
// Drawing
48
#include "DGtal/io/boards/Board2D.h"
49
51
52
using namespace
std
;
53
using namespace
DGtal
;
54
56
57
int
main
(
int
argc,
char
** argv )
58
{
59
trace
.
beginBlock
(
"Example EuclideanShapesDecorator"
);
60
trace
.
info
() <<
"Args:"
;
61
for
(
int
i = 0; i < argc; ++i )
62
trace
.
info
() <<
" "
<< argv[ i ];
63
trace
.
info
() << endl;
64
66
double
h = 1.0;
67
69
typedef
ImplicitBall< Z2i::Space >
MyEuclideanShapeA;
70
typedef
ImplicitBall< Z2i::Space >
MyEuclideanShapeB;
71
MyEuclideanShapeA shapeA(
Z2i::RealPoint
( 0.0, 0.0 ), 15 );
72
MyEuclideanShapeB shapeB(
Z2i::RealPoint
( 0.0, 0.0 ), 10 );
73
MyEuclideanShapeB shapeC(
Z2i::RealPoint
( -5.0, 0.0 ), 5 );
74
75
typedef
EuclideanShapesCSG< MyEuclideanShapeA, MyEuclideanShapeB >
Minus;
76
Minus s_minus ( shapeA );
77
s_minus.minus( shapeB );
78
s_minus.plus( shapeC );
80
81
typedef
GaussDigitizer< Z2i::Space, Minus >
MyGaussDigitizer;
82
MyGaussDigitizer digShape;
83
digShape.
attach
( s_minus );
84
digShape.init( s_minus.getLowerBound(), s_minus.getUpperBound(), h );
85
Z2i::Domain
domainShape = digShape.getDomain();
86
Z2i::DigitalSet
aSet( domainShape );
87
Shapes<Z2i::Domain>::digitalShaper
( aSet, digShape );
88
89
Board2D
board;
90
board <<
SetMode
( domainShape.
className
(),
"Paving"
)
91
<< domainShape;
92
93
Color
dorange ( 255, 136, 0, 220 );
94
95
board <<
CustomStyle
( aSet.
className
(),
new
CustomFillColor
( dorange ));
96
board << aSet;
97
98
board.
saveSVG
(
"example-EuclideanShapesDecorator.svg"
);
99
100
trace
.
endBlock
();
101
return
0;
102
}
103
105
// //
DGtal::Board2D
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition
Board2D.h:71
DGtal::Color
Structure representing an RGB triple with alpha component.
Definition
Color.h:77
DGtal::DigitalSetByAssociativeContainer::className
std::string className() const
DGtal::EuclideanShapesCSG
Aim: Constructive Solid Geometry (CSG) between models of CEuclideanBoundedShape and CEuclideanOriente...
Definition
EuclideanShapesDecorator.h:68
DGtal::GaussDigitizer
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
Definition
GaussDigitizer.h:80
DGtal::GaussDigitizer::attach
void attach(ConstAlias< EuclideanShape > shape)
DGtal::HyperRectDomain::className
std::string className() const
DGtal::ImplicitBall
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD....
Definition
ImplicitBall.h:65
DGtal::Shapes::digitalShaper
static void digitalShaper(TDigitalSet &aSet, const TShapeFunctor &aFunctor)
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::endBlock
double endBlock()
LibBoard::Board::saveSVG
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition
Board.cpp:1011
DGtal::Z2i::RealPoint
Space::RealPoint RealPoint
Definition
StdDefs.h:97
DGtal::Z2i::DigitalSet
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition
StdDefs.h:100
DGtal::Z2i::Domain
HyperRectDomain< Space > Domain
Definition
StdDefs.h:99
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
std
STL namespace.
DGtal::CustomFillColor
Custom style class redefining the fill color. You may use Board2D::Color::None for transparent color.
Definition
Board2D.h:343
DGtal::CustomStyle::CustomStyle
CustomStyle(std::string classname, DrawableWithBoard2D *style)
Definition
Board2D.h:224
DGtal::SetMode::SetMode
SetMode(std::string classname, std::string mode)
Definition
Board2D.h:254
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
examples
shapes
exampleEuclideanShapesDecorator.cpp
Generated on
for DGtal by
1.18.0