DGtal  1.1.0
meshFromOFF.cpp
Go to the documentation of this file.
1 
42 
44 
46 #include "DGtal/io/readers/MeshReader.h"
48 
49 #include "DGtal/io/Display3D.h"
50 #include "DGtal/io/viewers/Viewer3D.h"
51 
52 #include "DGtal/base/Common.h"
53 #include "DGtal/io/Color.h"
54 #include "ConfigExamples.h"
56 using namespace std;
57 using namespace DGtal;
59 
60 int main( int argc, char** argv )
61 {
62  QApplication application(argc,argv);
63  Viewer3D<> viewer;
64  viewer.show();
66  std::string inputFilename = examplesPath + "samples/tref.off";
67  // Since the input points are not necessary integers we use the PointD3D from Display3D.
68  Mesh<Viewer3D<>::RealPoint> anImportedMesh;
69  anImportedMesh << inputFilename;
71  trace.info()<< "importating done..."<< endl;
73  viewer.setLineColor(DGtal::Color(150,0,0,254));
74  viewer << anImportedMesh;
75  viewer << Viewer3D<>::updateDisplay;
77  return application.exec();
78 }
DGtal::Color
Structure representing an RGB triple with alpha component.
Definition: Color.h:67
DGtal::trace
Trace trace
Definition: Common.h:150
main
int main(int argc, char **argv)
Definition: meshFromOFF.cpp:60
DGtal::Trace::info
std::ostream & info()
DGtal::Viewer3D
Definition: Viewer3D.h:133
DGtal::Mesh
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Definition: Mesh.h:92
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::Display3D< SpaceND< 3 >, KhalimskySpaceND< 3 > >::setLineColor
virtual void setLineColor(DGtal::Color aColor)
DGtal::Viewer3D::show
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...