DGtal  0.9.2
MeshWriter.h
1 
17 #pragma once
18 
31 #if defined(MeshWriter_RECURSES)
32 #error Recursive header files inclusion detected in MeshWriter.h
33 #else // defined(MeshWriter_RECURSES)
34 
35 #define MeshWriter_RECURSES
36 
37 #if !defined MeshWriter_h
38 
39 #define MeshWriter_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <string>
45 #include <boost/static_assert.hpp>
46 #include "DGtal/base/Common.h"
47 #include "DGtal/shapes/Mesh.h"
49 
50 namespace DGtal
51 {
52 
54  // template class MeshWriter
75  template <typename TPoint>
76  struct MeshWriter
77  {
78  // ----------------------- Standard services ------------------------------
79 
80 
81 
82 
93  static bool export2OFF(std::ostream &out, const Mesh<TPoint> &aMesh,
94  bool exportColor=true) throw(DGtal::IOException);
95 
96 
97 
98 
107  static bool export2OBJ(std::ostream &out, const Mesh<TPoint> &aMesh) throw(DGtal::IOException);
108 
119  static bool export2OBJ_colors(std::ostream &out, std::ostream &outMTL,
120  const std::string nameMTLFile,
121  const Mesh<TPoint> &aMesh) throw(DGtal::IOException);
122 
123 
124  };
125 
126 
127 
128 
129 
139  template <typename TPoint>
140  bool
141  operator >> ( Mesh<TPoint> & aMesh, const std::string & aFilename );
142 
143 
144 
145 
146 
154  template <typename TPoint>
155  bool
156  operator >> ( Mesh<TPoint> & aMesh, std::ostream &out );
157 
158 
159 
160 
161 
162 
163 
164 }//namespace
165 
167 // Includes inline functions.
168 #include "DGtal/io/writers/MeshWriter.ih"
169 
170 // //
172 
173 #endif // !defined MeshWriter_h
174 
175 #undef MeshWriter_RECURSES
176 #endif // else defined(MeshWriter_RECURSES)
static bool export2OBJ(std::ostream &out, const Mesh< TPoint > &aMesh)
Aim: This class is defined to represent a surface mesh through a set of vertices and faces...
Definition: Mesh.h:91
static bool export2OFF(std::ostream &out, const Mesh< TPoint > &aMesh, bool exportColor=true)
Aim: Export a Mesh (Mesh object) in different format as OFF and OBJ).
Definition: MeshWriter.h:76
void operator>>(const Display3D< Space, KSpace > &aDisplay3D, DGtal::Mesh< typename Display3D< Space, KSpace >::RealPoint > &aMesh)
DGtal is the top-level namespace which contains all DGtal functions and types.
static bool export2OBJ_colors(std::ostream &out, std::ostream &outMTL, const std::string nameMTLFile, const Mesh< TPoint > &aMesh)