DGtal 2.0.0
Loading...
Searching...
No Matches
viewer3D-5-colors.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/Color.h"
#include "DGtal/shapes/Shapes.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
Include dependency graph for viewer3D-5-colors.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
Bertrand Kerautret (kerau.nosp@m.tre@.nosp@m.loria.nosp@m..fr ) LORIA (CNRS, UMR 7503), University of Nancy, France
Date
2011/19/03

Simple example of class PolyscopeViewer.

This file is part of the DGtal library.

Definition in file viewer3D-5-colors.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 58 of file viewer3D-5-colors.cpp.

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}
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.
Domain domain

References domain, DGtal::Display3D< Space, KSpace >::setDefaultColors(), and DGtal::PolyscopeViewer< Space, KSpace >::show().