DGtal  1.3.beta
MeshReader.h
1 
17 #pragma once
18 
31 #if defined(MeshReader_RECURSES)
32 #error Recursive header files inclusion detected in MeshReader.h
33 #else // defined(MeshReader_RECURSES)
34 
35 #define MeshReader_RECURSES
36 
37 #if !defined MeshReader_h
38 
39 #define MeshReader_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <map>
45 #include <string>
46 #include <DGtal/kernel/SpaceND.h>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/shapes/Mesh.h"
49 
51 
52 namespace DGtal
53 {
54 
55 
56 
58 // class MeshReader
97  template <typename TPoint>
98 struct MeshReader
99 {
100  // ----------------------- Standard services ------------------------------
101 public:
102 
103 
113  static bool importOFFFile(const std::string & filename,
114  DGtal::Mesh<TPoint> & aMesh, bool invertVertexOrder=false);
115 
116 
117 
118 
129  static bool importOFSFile(const std::string & filename,
130  DGtal::Mesh<TPoint> & aMesh, bool invertVertexOrder=false, double scale=1.0);
131 
140  static
141  bool importOBJFile(const std::string & filename, DGtal::Mesh<TPoint> & aMesh );
142 
143 
147  static
148  bool verifyIndicesUniqueness( const std::vector< unsigned int > &indices );
149 
150 
158  static
159  std::map<std::string, DGtal::Color> readMaterial( std::istream & input);
160 
161 
162 
163 }; // end of class MeshReader
164 
165 
166 
167 
168 
169 
176  template <typename TPoint>
177  bool
178  operator<< ( Mesh<TPoint> & mesh, const std::string &filename );
179 
180 
181 
182 
183 }// namespace DGtal
184 
185 
186 
188 // Includes inline functions.
189 #include "DGtal/io/readers/MeshReader.ih"
190 
191 
192 // //
194 
195 #endif // !defined MeshReader_h
196 
197 #undef MeshReader_RECURSES
198 #endif // else defined(MeshReader_RECURSES)
DGtal::MeshReader::verifyIndicesUniqueness
static bool verifyIndicesUniqueness(const std::vector< unsigned int > &indices)
DGtal::MeshReader
Aim: Defined to import OFF and OFS surface mesh. It allows to import a Mesh object and takes into acc...
Definition: MeshReader.h:98
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::Mesh
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Definition: Mesh.h:91
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::MeshReader::importOFSFile
static bool importOFSFile(const std::string &filename, DGtal::Mesh< TPoint > &aMesh, bool invertVertexOrder=false, double scale=1.0)
DGtal::MeshReader::importOFFFile
static bool importOFFFile(const std::string &filename, DGtal::Mesh< TPoint > &aMesh, bool invertVertexOrder=false)
DGtal::MeshReader::importOBJFile
static bool importOBJFile(const std::string &filename, DGtal::Mesh< TPoint > &aMesh)
DGtal::MeshReader::readMaterial
static std::map< std::string, DGtal::Color > readMaterial(std::istream &input)