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

Go to the source code of this file.

Functions

int main ()
 

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-3-objects.cpp.

Function Documentation

◆ main()

int main ( void  )

Definition at line 57 of file viewer3D-3-objects.cpp.

58{
60
61 // Instructs the viewer to draw adjacencies relation whenever possible
62 v.drawAdjacencies(true /* false */);
63
64 Point p1( 0, 0, 0 );
65 Point p2( 10, 10 , 10 );
66 Domain domain( p1, p2 );
67
68 DigitalSet shape_set( domain );
69 Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
70 Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
71
72 v << shape_set;
73
74 Object6_18 shape1( dt6_18, shape_set );
75 Object18_6 shape2( dt18_6, shape_set );
76
77 // Draws both the object the adjacencies
78 v << shape1;
79 v << shape2;
80
81 v.show();
82 return 0;
83}
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
void drawAdjacencies(bool toggle=true)
Aim: An object (or digital object) represents a set in some digital space associated with a digital t...
Definition Object.h:120
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)
static const DT6_18 dt6_18
Definition StdDefs.h:194
static const DT18_6 dt18_6
Definition StdDefs.h:195
Space::Point Point
Definition StdDefs.h:168
Object< DT6_18, DigitalSet > Object6_18
Definition StdDefs.h:174
Domain domain

References DGtal::Shapes< TDomain >::addNorm1Ball(), DGtal::Shapes< TDomain >::addNorm2Ball(), domain, DGtal::Display3D< Space, KSpace >::drawAdjacencies(), DGtal::Z3i::dt18_6, DGtal::Z3i::dt6_18, and DGtal::PolyscopeViewer< Space, KSpace >::show().