DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
meshFromOFF.cpp
1 
30 
31 
32 #include "DGtal/base/Common.h"
33 #include "DGtal/io/Color.h"
34 #include "ConfigExamples.h"
36 #include "DGtal/io/readers/MeshReader.h"
37 
38 #include <QtGui/qapplication.h>
39 #include "DGtal/io/Display3D.h"
40 #include "DGtal/io/viewers/Viewer3D.h"
42 
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.
57  anImportedMesh << inputFilename;
59  trace.info()<< "importating done..."<< endl;
61  anImportedMesh.invertVertexFaceOrder();
62  viewer.setLineColor(DGtal::Color(150,0,0,254));
63  viewer << anImportedMesh;
64  viewer << Viewer3D::updateDisplay;
66  return application.exec();
67 }