DGtal 2.1.0
Loading...
Searching...
No Matches
io/viewers/viewer3D-3-objects.cpp

Example of 6-18 digital Adjacencies visualization with PolyscopeViewer.

See also
Drawmode selection: the example of digital objects in 3D
6-18 digital Adjacencies visualization with PolyscopeViewer.
#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"
using namespace std;
using namespace DGtal;
using namespace Z3i;
// Standard services - public :
int main()
{
// Instructs the viewer to draw adjacencies relation whenever possible
v.drawAdjacencies(true /* false */);
Point p1( 0, 0, 0 );
Point p2( 10, 10 , 10 );
Domain domain( p1, p2 );
DigitalSet shape_set( domain );
Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
v << shape_set;
Object6_18 shape1( dt6_18, shape_set );
Object18_6 shape2( dt18_6, shape_set );
// Draws both the object the adjacencies
v << shape1;
v << shape2;
v.show();
return 0;
}
// //
void drawAdjacencies(bool toggle=true)
void show() override
Starts the event loop and display of elements.
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
DGtal is the top-level namespace which contains all DGtal functions and types.
STL namespace.
int main()
Definition testBits.cpp:56
MyPointD Point
Domain domain
HyperRectDomain< Space > Domain
Z2i::DigitalSet DigitalSet