Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
MeshReader.h
1
16
17#pragma once
18
30
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
52namespace DGtal
53{
54
55
56
58// class MeshReader
91
92
93
94
95 template <typename TPoint>
97{
98 // ----------------------- Standard services ------------------------------
99public:
100
101
111
112 static bool importOFFFile(const std::string & filename,
113 DGtal::Mesh<TPoint> & aMesh, bool invertVertexOrder=false,
114 bool onlyFaceVertex=false);
115
116
117
118
128
129 static bool importOFSFile(const std::string & filename,
130 DGtal::Mesh<TPoint> & aMesh, bool invertVertexOrder=false, double scale=1.0);
131
141 static
142 bool importOBJFile(const std::string & filename, DGtal::Mesh<TPoint> & aMesh, bool onlyFaceVertex=false );
143
144
148 static
149 bool verifyIndicesUniqueness( const std::vector<
150 typename DGtal::Mesh<TPoint>::Index > &indices );
151
152
160 static
161 std::map<std::string, DGtal::Color> readMaterial( std::istream & input);
162
163
164
165}; // end of class MeshReader
166
167
168
169
170
171
178 template <typename TPoint>
179 bool
180 operator<< ( Mesh<TPoint> & mesh, const std::string &filename );
181
182
183
184
185}// namespace DGtal
186
187
188
190// Includes inline functions.
191#include "DGtal/io/readers/MeshReader.ih"
192
193
194// //
196
197#endif // !defined MeshReader_h
198
199#undef MeshReader_RECURSES
200#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
float scale
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: Defined to import OFF and OFS surface mesh. It allows to import a Mesh object and takes into acc...
Definition MeshReader.h:97
static bool importOFSFile(const std::string &filename, DGtal::Mesh< TPoint > &aMesh, bool invertVertexOrder=false, double scale=1.0)
static std::map< std::string, DGtal::Color > readMaterial(std::istream &input)
static bool importOFFFile(const std::string &filename, DGtal::Mesh< TPoint > &aMesh, bool invertVertexOrder=false, bool onlyFaceVertex=false)
static bool importOBJFile(const std::string &filename, DGtal::Mesh< TPoint > &aMesh, bool onlyFaceVertex=false)
static bool verifyIndicesUniqueness(const std::vector< typename DGtal::Mesh< TPoint >::Index > &indices)