DGtal  0.9.2
meshFromOFF.cpp
1 
30 
32 
34 #include "DGtal/io/readers/MeshReader.h"
36 
37 #include "DGtal/io/Display3D.h"
38 #include "DGtal/io/viewers/Viewer3D.h"
39 
40 #include "DGtal/base/Common.h"
41 #include "DGtal/io/Color.h"
42 #include "ConfigExamples.h"
44 using namespace std;
45 using namespace DGtal;
47 
48 int main( int argc, char** argv )
49 {
50  QApplication application(argc,argv);
51  Viewer3D<> viewer;
52  viewer.show();
54  std::string inputFilename = examplesPath + "samples/tref.off";
55  // Since the input points are not necessary integers we use the PointD3D from Display3D.
56  Mesh<Viewer3D<>::RealPoint> anImportedMesh;
57  anImportedMesh << inputFilename;
59  trace.info()<< "importating done..."<< endl;
61  viewer.setLineColor(DGtal::Color(150,0,0,254));
62  viewer << anImportedMesh;
63  viewer << Viewer3D<>::updateDisplay;
65  return application.exec();
66 }
Trace trace
Definition: Common.h:130
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
Aim: This class is defined to represent a surface mesh through a set of vertices and faces...
Definition: Mesh.h:91
STL namespace.
virtual void setLineColor(DGtal::Color aColor)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & info()
Structure representing an RGB triple with alpha component.
Definition: Color.h:66