32 #include "DGtal/base/Common.h"
33 #include "DGtal/shapes/Mesh.h"
34 #include "DGtal/io/readers/MeshReader.h"
35 #include "DGtal/helpers/StdDefs.h"
37 #include "ConfigTest.h"
42 using namespace DGtal;
47 using Component = double;
49 static const unsigned int dimension = 3;
50 const Component & operator[](
unsigned int i )
const{
60 Component & operator[](
unsigned int i ) {
92 unsigned int nbok = 0;
96 std::string filenameOFF = testPath +
"samples/box.off";
98 bool importOK = a3DMesh << filenameOFF;
99 nbok += importOK ? 1 : 0;
104 bool isWellImported = (a3DMesh.
nbVertex()==8) && (a3DMesh.
nbFaces()==6) && (aFace.size()==4) && (aFace.at(0)==0);
105 nbok+=isWellImported? 1: 0;
108 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
109 <<
"true == true" << std::endl;
113 std::string filenameOFS = testPath +
"samples/testMesh.ofs";
115 bool importOK2= a3DMesh2 << filenameOFS;
116 nbok += importOK2 ? 1 : 0;
119 std::string filenameOBJ = testPath +
"samples/testObj.obj";
121 bool importOK3= a3DMesh3 << filenameOBJ;
122 nbok += importOK3 ? 1 : 0;
127 nbok += importOK4 ? 1 : 0;
131 bool isWellImported2 = (a3DMesh2.
nbVertex()==32) && (a3DMesh2.
nbFaces()==60) && (aFace2.size()==3) && (aFace2.at(0)==0);
132 nbok+=isWellImported2? 1: 0;
135 std::string filenameOBJrel = testPath +
"samples/testObjRel.obj";
137 bool importOK5 = a3DMesh4 << filenameOBJrel;
138 nbok += importOK5 ? 1 : 0;
143 nbok += importOK6 ? 1 : 0;
146 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
147 <<
"true == true" << std::endl;
157 int main(
int argc,
char** argv )
161 for (
int i = 0; i < argc; ++i )
166 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
static const Color Purple
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
const Color & getFaceColor(Index i) const
const MeshFace & getFace(Index i) const
std::vector< Index > MeshFace
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)