DGtal 2.1.0
Loading...
Searching...
No Matches
viewer3D-5-colors.cpp
Go to the documentation of this file.
1
41#include <iostream>
42
43#include "DGtal/base/Common.h"
44#include "DGtal/helpers/StdDefs.h"
45#include "DGtal/io/Color.h"
46#include "DGtal/shapes/Shapes.h"
47#include "DGtal/io/viewers/PolyscopeViewer.h"
48
50
51using namespace std;
52using namespace DGtal;
53using namespace Z3i;
54
55
57// Standard services - public :
58
59int main()
60{
61 PolyscopeViewer viewer;
62
63 Point p1( -1, -1, -2 );
64 Point p2( 2, 2, 3 );
65 Domain domain( p1, p2 );
66 Point p3( 1, 1, 1 );
67 Point p4( 2, -1, 3 );
68 Point p5( -1, 2, 3 );
69 Point p6( 0, 0, 0 );
70 Point p0( 0, 2, 1 );
71
72 // By default, objects are rendered with different colors
73 viewer << p1 << p2 << p3;
74
75 // Drawing color can be changed by inserting it in the stream
76 viewer << Color(255, 0, 0) << p4 << p5 ;
77 viewer << Color(250, 200,0);
78 viewer << p6;
79 viewer << Color(250, 200,0, 20);
80 viewer << p0;
81
82 viewer.setDefaultColors();
83 viewer << domain;
84
85 viewer.show();
86 return 0;
87}
88// //
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.
Domain domain
int main()