31#if defined(MeshHelpers_RECURSES)
32#error Recursive header files inclusion detected in MeshHelpers.h
35#define MeshHelpers_RECURSES
37#if !defined MeshHelpers_h
44#include "DGtal/base/Common.h"
45#include "DGtal/topology/CCellEmbedder.h"
46#include "DGtal/topology/CDigitalSurfaceContainer.h"
47#include "DGtal/topology/DigitalSurface.h"
48#include "DGtal/shapes/TriangulatedSurface.h"
49#include "DGtal/shapes/PolygonalSurface.h"
50#include "DGtal/shapes/Mesh.h"
51#include "DGtal/shapes/SurfaceMesh.h"
80 template <
typename Po
int>
96 template <
typename Po
int>
129 template <
typename Po
int>
134 bool centroid =
true );
152 template <
typename DigitalSurfaceContainer,
153 typename CellEmbedder,
158 const CellEmbedder& cembedder,
160 VertexMap& vertexmap );
173 template <
typename DigitalSurfaceContainer,
174 typename CellEmbedder,
179 const CellEmbedder& cembedder,
181 VertexMap& vertexmap );
196 template <
typename DigitalSurfaceContainer,
197 typename CellEmbedder,
202 const CellEmbedder& cembedder,
220 template <
typename DigitalSurfaceContainer,
221 typename CellEmbedder,
226 const CellEmbedder& cembedder,
239 template <
typename Po
int>
253 template <
typename Po
int>
269 template <
typename RealPo
int,
typename RealVector >
281 template <
typename Po
int>
284 ( std::ostream& output,
293 template <
typename Po
int>
296 ( std::ostream& output,
313 template <
typename TTriangulatedOrPolygonalSurface>
316 ( std::ostream& output_obj,
317 const std::string& mtl_filename,
318 const TTriangulatedOrPolygonalSurface& polysurf,
319 const std::vector< typename TTriangulatedOrPolygonalSurface::Point >& normals,
320 const std::vector< Color >& diffuse_colors,
321 const Color& ambient_color =
Color( 32, 32, 32 ),
322 const Color& diffuse_color =
Color( 200, 200, 255 ),
335 ( std::ostream& output_mtl,
336 unsigned long idxMaterial,
337 const Color& ambient_color,
338 const Color& diffuse_color,
339 const Color& specular_color );
348#include "DGtal/shapes/MeshHelpers.ih"
355#undef MeshHelpers_RECURSES
Structure representing an RGB triple with alpha component.
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
Aim: Static class that provides builder and converters between meshes.
static bool exportOBJ(std::ostream &output, const TriangulatedSurface< Point > &trisurf)
static bool digitalSurface2PrimalSurfaceMesh(const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, SurfaceMesh< typename CellEmbedder::Value, typename CellEmbedder::Value > &polysurf, CellMap &cellmap)
static bool digitalSurface2PrimalPolygonalSurface(const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, PolygonalSurface< typename CellEmbedder::Value > &polysurf, CellMap &cellmap)
static bool mesh2TriangulatedSurface(const Mesh< Point > &mesh, TriangulatedSurface< Point > &trisurf)
static void polygonalSurface2TriangulatedSurface(const PolygonalSurface< Point > &polysurf, TriangulatedSurface< Point > &trisurf, bool centroid=true)
static bool exportMTLNewMaterial(std::ostream &output_mtl, unsigned long idxMaterial, const Color &ambient_color, const Color &diffuse_color, const Color &specular_color)
static void polygonalSurface2Mesh(const PolygonalSurface< Point > &polysurf, Mesh< Point > &mesh)
static void digitalSurface2DualTriangulatedSurface(const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, TriangulatedSurface< typename CellEmbedder::Value > &trisurf, VertexMap &vertexmap)
static void surfaceMesh2Mesh(const SurfaceMesh< RealPoint, RealVector > &smesh, Mesh< RealPoint > &mesh, const std::vector< Color > &cols={})
static bool exportOBJ(std::ostream &output, const PolygonalSurface< Point > &polysurf)
static bool exportOBJwithFaceNormalAndColor(std::ostream &output_obj, const std::string &mtl_filename, const TTriangulatedOrPolygonalSurface &polysurf, const std::vector< typename TTriangulatedOrPolygonalSurface::Point > &normals, const std::vector< Color > &diffuse_colors, const Color &ambient_color=Color(32, 32, 32), const Color &diffuse_color=Color(200, 200, 255), const Color &specular_color=Color::White)
static void digitalSurface2DualPolygonalSurface(const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, PolygonalSurface< typename CellEmbedder::Value > &polysurf, VertexMap &vertexmap)
static void triangulatedSurface2Mesh(const TriangulatedSurface< Point > &trisurf, Mesh< Point > &mesh)
static bool mesh2PolygonalSurface(const Mesh< Point > &mesh, PolygonalSurface< Point > &polysurf)
Aim: This class is defined to represent a surface mesh through a set of vertices and faces....
Aim: Represents a polygon mesh, i.e. a 2-dimensional combinatorial surface whose faces are (topologic...
Aim: Represents a triangulated surface. The topology is stored with a half-edge data structure....
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Represents an embedded mesh as faces and a list of vertices. Vertices may be shared among faces ...