File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
testViewer3D.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
#include "DGtal/io/Color.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/shapes/Shapes.h"
Include dependency graph for testViewer3D.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/01/03

Functions for testing class PolyscopeViewer.

This file is part of the DGtal library.

Definition in file testViewer3D.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 51 of file testViewer3D.cpp.

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}
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)
Space::Point Point
Definition StdDefs.h:168
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition StdDefs.h:173
Trace trace
Domain domain

References DGtal::Shapes< TDomain >::addNorm1Ball(), DGtal::Shapes< TDomain >::addNorm2Ball(), domain, DGtal::Display3D< Space, KSpace >::drawAsGrid(), DGtal::Display3D< Space, KSpace >::drawAsPaving(), DGtal::PolyscopeViewer< Space, KSpace >::show(), and DGtal::trace.