DGtal  1.4.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)
35 #define MeshReader_RECURSES
36 
37 #if !defined MeshReader_h
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<
149  typename DGtal::Mesh<TPoint>::Index > &indices );
150 
151 
159  static
160  std::map<std::string, DGtal::Color> readMaterial( std::istream & input);
161 
162 
163 
164 }; // end of class MeshReader
165 
166 
167 
168 
169 
170 
177  template <typename TPoint>
178  bool
179  operator<< ( Mesh<TPoint> & mesh, const std::string &filename );
180 
181 
182 
183 
184 }// namespace DGtal
185 
186 
187 
189 // Includes inline functions.
190 #include "DGtal/io/readers/MeshReader.ih"
191 
192 
193 // //
195 
196 #endif // !defined MeshReader_h
197 
198 #undef MeshReader_RECURSES
199 #endif // else defined(MeshReader_RECURSES)
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Definition: Mesh.h:92
VertexStorage::size_type Index
Definition: Mesh.h:120
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
Aim: Defined to import OFF and OFS surface mesh. It allows to import a Mesh object and takes into acc...
Definition: MeshReader.h:99
static bool importOFFFile(const std::string &filename, DGtal::Mesh< TPoint > &aMesh, bool invertVertexOrder=false)
static bool importOFSFile(const std::string &filename, DGtal::Mesh< TPoint > &aMesh, bool invertVertexOrder=false, double scale=1.0)
static bool importOBJFile(const std::string &filename, DGtal::Mesh< TPoint > &aMesh)
static std::map< std::string, DGtal::Color > readMaterial(std::istream &input)
static bool verifyIndicesUniqueness(const std::vector< typename DGtal::Mesh< TPoint >::Index > &indices)