DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
testViewer3D.cpp
Go to the documentation of this file.
1
16
29
31
#include <iostream>
32
#include "DGtal/base/Common.h"
33
#include "DGtal/io/viewers/PolyscopeViewer.h"
34
#include "DGtal/io/Color.h"
35
#include "DGtal/helpers/StdDefs.h"
36
#include "DGtal/shapes/Shapes.h"
38
39
using namespace
std
;
40
using namespace
DGtal
;
41
using namespace
Z3i
;
42
44
// Functions for testing class PolyscopeViewer.
46
47
49
// Standard services - public :
50
51
int
main
()
52
{
53
PolyscopeViewer
viewer;
54
55
trace
.
beginBlock
(
"Testing class for PolyscopeViewer"
);
56
57
Point
p1( 14, 14, 14 );
58
Point
p2( 27, 27, 27 );
59
Domain
domain
( p1, p2 );
60
61
viewer.
drawAsGrid
();
62
viewer <<
Color
(20, 20, 20, 50);
63
viewer <<
domain
;
64
65
DigitalSet
shape_set(
domain
);
66
Shapes<Domain>::addNorm1Ball
( shape_set,
Point
( 13, 23, 13 ), 7 );
67
viewer <<
Color
(250, 200,0, 50);
68
69
viewer << shape_set ;
70
DigitalSet
shape_set2(
domain
);
71
Shapes<Domain>::addNorm1Ball
( shape_set2,
Point
( 24, 15, 12 ), 12 );
72
viewer << shape_set2 ;
73
74
DigitalSet
shape_set3(
domain
);
75
Shapes<Domain>::addNorm2Ball
( shape_set3,
Point
( 11, 15, 12 ), 12 );
76
viewer <<
Color
(220, 20,20, 250);
77
viewer << shape_set3 ;
78
79
Point
pp1( -1, -1, -2 );
80
Point
pp2( 2, 2, 3 );
81
82
Domain
domain2( pp1, pp2 );
83
Point
pp3( 1, 1, 1 );
84
Point
pp4( 2, -1, 5 );
85
Point
pp5( -1, 2, 3 );
86
Point
pp6( 0, 0, 0 );
87
Point
pp0( 0, 2, 1 );
88
89
viewer.
drawAsPaving
();
90
viewer << pp1 << pp2 << pp3;
91
92
viewer.
drawAsGrid
();
93
viewer <<
Color
(250, 0,0);
94
viewer << pp4 << pp5 ;
95
viewer <<
Color
(250, 0,0, 100);
96
viewer << pp6;
97
viewer <<
Color
(250, 200,0, 20);
98
viewer << pp0;
99
100
viewer.
drawAsPaving
();
101
viewer << domain2;
102
103
trace
.
emphase
() <<
"Passed."
<< endl;
104
trace
.
endBlock
();
105
viewer.
show
();
106
return
0;
107
}
108
// //
DGtal::Color::Color
Color()
Definition
Color.h:139
DGtal::Display3D::drawAsGrid
void drawAsGrid(bool toggle=true)
DGtal::Display3D::drawAsPaving
void drawAsPaving()
DGtal::PolyscopeViewer
Definition
PolyscopeViewer.h:57
DGtal::PolyscopeViewer::show
void show() override
Starts the event loop and display of elements.
Definition
PolyscopeViewer.h:73
DGtal::Shapes::addNorm1Ball
static void addNorm1Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
DGtal::Shapes::addNorm2Ball
static void addNorm2Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
DGtal::Point
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::endBlock
double endBlock()
DGtal::Domain
DGtal::Z3i
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal::Z3i::DigitalSet
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition
StdDefs.h:173
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.
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
domain
Domain domain
Definition
testProjection.cpp:88
tests
io
viewers
testViewer3D.cpp
Generated on
for DGtal by
1.18.0