47 #include "DGtal/base/Common.h" 48 #include "DGtal/io/viewers/Viewer3D.h" 49 #include "DGtal/io/DrawWithDisplay3DModifier.h" 50 #include "DGtal/io/Color.h" 51 #include "DGtal/shapes/Shapes.h" 52 #include "DGtal/helpers/StdDefs.h" 57 using namespace DGtal;
64 int main(
int argc,
char** argv )
69 QApplication application(argc,argv);
71 viewer.setWindowTitle(
"simpleExample3DViewer");
76 Point p1( -50, -50, -50 );
77 Point p2( 50, 50, 50 );
80 trace.
warning() <<
"Constructing a ring DigitalSet ... ";
81 DigitalSet shape_set( domain );
84 if ( ((*it - c ).norm() <= 25) && ((*it - c ).norm() >= 18)
85 && ( (((*it)[0] <= 3)&& ((*it)[0] >= -3))|| (((*it)[1] <= 3)&& ((*it)[1] >= -3)))){
86 shape_set.insertNew( *it );
92 Object18_6 shape( dt18_6, shape_set );
94 DigitalSet::Iterator it, itE;
97 DigitalSet & S = shape.pointSet();
98 std::queue<DigitalSet::Iterator> Q;
102 std::vector<DigitalSet::Iterator> v( S.size() );
103 std::vector<uint8_t> b( v.size() );
104 for (
size_t i = 0; it != itE; ++it, ++i )
106 #pragma omp parallel for schedule(dynamic) 107 for (
size_t i = 0; i < v.size(); ++i )
108 b[ i ] = shape.isSimple( *(v[ i ]) );
110 for (
size_t i = 0; i < v.size(); ++i )
111 if ( b[ i ] ) Q.push( v[ i ] );
113 for ( ; it != itE; ++it )
114 if ( shape.isSimple( *it ) )
118 while ( ! Q.empty() )
120 DigitalSet::Iterator itt = Q.front();
122 if ( shape.isSimple( *itt ) )
129 while ( nb_simple != 0 );
130 DigitalSet & S = shape.pointSet();
135 viewer <<
SetMode3D( shape_set.className(),
"Paving" );
139 viewer <<
SetMode3D( shape_set.className(),
"PavingTransp" );
140 viewer << CustomColors3D(
Color(250, 0,0, 25),
Color(250, 0,0, 5));
143 viewer<< Viewer3D<>::updateDisplay;
147 return application.exec();
void beginBlock(const std::string &keyword="")
const ConstIterator & end() const
const Domain domain(Point(1, 2), Point(6, 5))
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
int main(int argc, char **argv)
const ConstIterator & begin() const
DGtal is the top-level namespace which contains all DGtal functions and types.
Structure representing an RGB triple with alpha component.
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.