DGtal 2.0.0
Loading...
Searching...
No Matches
viewer3D-5-colors.cpp
Go to the documentation of this file.
1
40#include <iostream>
41
42#include "DGtal/base/Common.h"
43#include "DGtal/helpers/StdDefs.h"
44#include "DGtal/io/Color.h"
45#include "DGtal/shapes/Shapes.h"
46#include "DGtal/io/viewers/PolyscopeViewer.h"
47
49
50using namespace std;
51using namespace DGtal;
52using namespace Z3i;
53
54
56// Standard services - public :
57
58int main( int argc, char** argv )
59{
60 PolyscopeViewer viewer;
61
62 Point p1( -1, -1, -2 );
63 Point p2( 2, 2, 3 );
64 Domain domain( p1, p2 );
65 Point p3( 1, 1, 1 );
66 Point p4( 2, -1, 3 );
67 Point p5( -1, 2, 3 );
68 Point p6( 0, 0, 0 );
69 Point p0( 0, 2, 1 );
70
71 // By default, objects are rendered with different colors
72 viewer << p1 << p2 << p3;
73
74 // Drawing color can be changed by inserting it in the stream
75 viewer << Color(255, 0, 0) << p4 << p5 ;
76 viewer << Color(250, 200,0);
77 viewer << p6;
78 viewer << Color(250, 200,0, 20);
79 viewer << p0;
80
81 viewer.setDefaultColors();
82 viewer << domain;
83
84 viewer.show();
85 return 0;
86}
87// //
Structure representing an RGB triple with alpha component.
Definition Color.h:77
void setDefaultColors()
void show() override
Starts the event loop and display of elements.
DGtal is the top-level namespace which contains all DGtal functions and types.
STL namespace.
int main()
Definition testBits.cpp:56
Domain domain