Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
io/viewers/viewer3D-6-clipping.cpp

Example of visualization after adding two clipping planes

See also
Adding clipping planes
Visualization after adding a second clipping plane (1,0,0,-4.9) .
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/shapes/Shapes.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
#include "DGtal/io/Color.h"
using namespace std;
using namespace DGtal;
using namespace Z3i;
// Standard services - public :
int main( int argc, char** argv )
{
PolyscopeViewer viewer;
Point p1( 0, 0, 0 );
Point p2( 20, 20, 20 );
Domain domain(p1, p2);
DigitalSet shape_set( domain );
Shapes<Domain>::addNorm2Ball( shape_set, Point( 10, 10, 10 ), 7 );
viewer << shape_set;
viewer << Color(250, 200,0, 100);
viewer << ClippingPlane(1,0,0,-4.9);
viewer << ClippingPlane(0,1,0.3,-10);
viewer.show();
return 0;
}
// //
Structure representing an RGB triple with alpha component.
Definition Color.h:77
void show() override
Starts the event loop and display of elements.
static void addNorm2Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
STL namespace.
Clipping plane.
Definition Display3D.h:299
int main()
Definition testBits.cpp:56
MyPointD Point
Domain domain
HyperRectDomain< Space > Domain
Z2i::DigitalSet DigitalSet