Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
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
39using namespace std;
40using namespace DGtal;
41using namespace Z3i;
42
44// Functions for testing class PolyscopeViewer.
46
47
49// Standard services - public :
50
51int main( int argc, char** argv )
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// //
110
Structure representing an RGB triple with alpha component.
Definition Color.h:77
void drawAsGrid(bool toggle=true)
void show() override
Starts the event loop and display of elements.
static void addNorm1Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
static void addNorm2Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
Z3i this namespace gathers the standard of types for 3D imagery.
Space::Point Point
Definition StdDefs.h:168
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition StdDefs.h:173
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
STL namespace.
int main()
Definition testBits.cpp:56
Domain domain