DGtal  1.5.beta
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)
35 #define MeshWriter_RECURSES
36 
37 #if !defined MeshWriter_h
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);
95 
96 
97 
98 
107  static bool export2OBJ(std::ostream &out, const Mesh<TPoint> &aMesh);
108 
119  static bool export2OBJ_colors(std::ostream &out, std::ostream &outMTL,
120  const std::string nameMTLFile,
121  const Mesh<TPoint> &aMesh);
122 
131  static bool export2OBJ_colors(std::ostream &out,
132  const Mesh<TPoint> &aMesh);
133 
134 
135  };
136 
137 
138 
139 
140 
150  template <typename TPoint>
151  bool
152  operator >> ( Mesh<TPoint> & aMesh, const std::string & aFilename );
153 
154 
155 
156 
157 
165  template <typename TPoint>
166  bool
167  operator >> ( Mesh<TPoint> & aMesh, std::ostream &out );
168 
169 
170 
171 
172 
173 
174 
175 }//namespace
176 
178 // Includes inline functions.
179 #include "DGtal/io/writers/MeshWriter.ih"
180 
181 // //
183 
184 #endif // !defined MeshWriter_h
185 
186 #undef MeshWriter_RECURSES
187 #endif // else defined(MeshWriter_RECURSES)
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Definition: Mesh.h:92
DGtal is the top-level namespace which contains all DGtal functions and types.
void operator>>(const Display3D< Space, KSpace > &aDisplay3D, DGtal::Mesh< typename Display3D< Space, KSpace >::RealPoint > &aMesh)
Aim: Export a Mesh (Mesh object) in different format as OFF and OBJ).
Definition: MeshWriter.h:77
static bool export2OBJ_colors(std::ostream &out, std::ostream &outMTL, const std::string nameMTLFile, const Mesh< TPoint > &aMesh)
static bool export2OBJ_colors(std::ostream &out, const Mesh< TPoint > &aMesh)
static bool export2OBJ(std::ostream &out, const Mesh< TPoint > &aMesh)
static bool export2OFF(std::ostream &out, const Mesh< TPoint > &aMesh, bool exportColor=true)