32 #include "DGtal/base/Common.h"
33 #include "DGtal/helpers/StdDefs.h"
34 #include "DGtal/shapes/fromPoints/MeshFromPoints.h"
35 #include "DGtal/io/viewers/Viewer3D.h"
36 #include <QtGui/qapplication.h>
41 using namespace DGtal;
42 using namespace DGtal::Z3i;
52 int main(
int argc,
char** argv )
56 for (
int i = 0; i < argc; ++i )
60 QApplication application(argc,argv);
67 aMesh.addVertex(
Point(0,0,0));
68 aMesh.addVertex(
Point(1,0,0));
69 aMesh.addVertex(
Point(1,1,0));
71 aMesh.addVertex(
Point(0,0,1));
72 aMesh.addVertex(
Point(1,0,1));
73 aMesh.addVertex(
Point(1,1,1));
74 aMesh.addVertex(
Point(0,1,1));
76 aMesh.addVertex(
Point(0,1,0));
77 aMesh.addVertex(
Point(0,2,0));
78 aMesh.addVertex(
Point(0,3,1));
79 aMesh.addVertex(
Point(0,2,2));
80 aMesh.addVertex(
Point(0,1,2));
81 aMesh.addVertex(
Point(0,0,1));
83 aMesh.addTriangularFace(0, 1, 2,
Color(150,0,150,104));
84 aMesh.addQuadFace(6,5,4,3, Color::Blue);
86 vector<unsigned int> listIndex;
87 listIndex.push_back(7);
88 listIndex.push_back(8);
89 listIndex.push_back(9);
90 listIndex.push_back(10);
91 listIndex.push_back(11);
92 listIndex.push_back(12);
94 aMesh.addFace(listIndex,
Color(150,150,0,54));
99 viewer << Viewer3D::updateDisplay;
100 bool res = application.exec();
102 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;