Objects have a border, which are the points which touch the complement in the sense of background adjacency. A border of an object is itself an object, with the same topology as the object.
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/readers/VolReader.h"
#include "DGtal/io/DrawWithDisplay3DModifier.h"
#include "DGtal/io/viewers/Viewer3D.h"
#include "DGtal/io/Color.h"
#include "DGtal/images/ImageSelector.h"
#include "DGtal/helpers/StdDefs.h"
#include "ConfigExamples.h"
using namespace std;
int main(
int argc,
char** argv )
{
typedef SpaceND< 3,int >
Z3;
typedef MetricAdjacency< Z3, 1 >
Adj6;
typedef MetricAdjacency< Z3, 2 >
Adj18;
typedef DigitalTopology< Adj6, Adj18 >
DT6_18;
typedef HyperRectDomain< Z3 >
Domain;
typedef DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type
DigitalSet;
typedef Object<DT6_18, DigitalSet> ObjectType;
Point p1( -50, -50, -50 );
for ( DomainConstIterator it =
domain.begin(); it !=
domain.end(); ++it )
{
if ( (*it - c ).norm1() <= 30 ) diamond_set.insertNew( *it );
}
ObjectType diamond( dt6_18, diamond_set );
ObjectType diamond_clone( diamond );
diamond_clone.pointSet().erase( c );
ObjectType bdiamond = diamond.border();
ObjectType bdiamond_clone = diamond_clone.border();
QApplication application(argc,argv);
typedef Viewer3D<> MyViewer;
MyViewer viewer;
viewer.show();
viewer<< CustomColors3D(Color(250, 250,250),Color(250, 250,250));
viewer << bdiamond_clone;
viewer << bdiamond ;
viewer << ClippingPlane(1,1,0,5, false) << MyViewer::updateDisplay;
return application.exec();
}
MyDigitalSurface::ConstIterator ConstIterator
MetricAdjacency< Space, 2 > Adj18
MetricAdjacency< Space, 1 > Adj6
DigitalTopology< Adj6, Adj18 > DT6_18
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
HyperRectDomain< Space > Domain
Z2i::DigitalSet DigitalSet