DGtal
1.5.beta
|
Aim: Static class that provides builder and converters between meshes. More...
#include <DGtal/shapes/MeshHelpers.h>
Static Public Member Functions | |
template<typename Point > | |
static bool | mesh2TriangulatedSurface (const Mesh< Point > &mesh, TriangulatedSurface< Point > &trisurf) |
template<typename Point > | |
static bool | mesh2PolygonalSurface (const Mesh< Point > &mesh, PolygonalSurface< Point > &polysurf) |
template<typename Point > | |
static void | polygonalSurface2TriangulatedSurface (const PolygonalSurface< Point > &polysurf, TriangulatedSurface< Point > &trisurf, bool centroid=true) |
template<typename DigitalSurfaceContainer , typename CellEmbedder , typename VertexMap > | |
static void | digitalSurface2DualTriangulatedSurface (const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, TriangulatedSurface< typename CellEmbedder::Value > &trisurf, VertexMap &vertexmap) |
template<typename DigitalSurfaceContainer , typename CellEmbedder , typename VertexMap > | |
static void | digitalSurface2DualPolygonalSurface (const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, PolygonalSurface< typename CellEmbedder::Value > &polysurf, VertexMap &vertexmap) |
template<typename DigitalSurfaceContainer , typename CellEmbedder , typename CellMap > | |
static bool | digitalSurface2PrimalPolygonalSurface (const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, PolygonalSurface< typename CellEmbedder::Value > &polysurf, CellMap &cellmap) |
template<typename DigitalSurfaceContainer , typename CellEmbedder , typename CellMap > | |
static bool | digitalSurface2PrimalSurfaceMesh (const DigitalSurface< DigitalSurfaceContainer > &dsurf, const CellEmbedder &cembedder, SurfaceMesh< typename CellEmbedder::Value, typename CellEmbedder::Value > &polysurf, CellMap &cellmap) |
template<typename Point > | |
static void | triangulatedSurface2Mesh (const TriangulatedSurface< Point > &trisurf, Mesh< Point > &mesh) |
template<typename Point > | |
static void | polygonalSurface2Mesh (const PolygonalSurface< Point > &polysurf, Mesh< Point > &mesh) |
template<typename RealPoint , typename RealVector > | |
static void | surfaceMesh2Mesh (const SurfaceMesh< RealPoint, RealVector > &smesh, Mesh< RealPoint > &mesh, const std::vector< Color > &cols={}) |
template<typename Point > | |
static bool | exportOBJ (std::ostream &output, const TriangulatedSurface< Point > &trisurf) |
template<typename Point > | |
static bool | exportOBJ (std::ostream &output, const PolygonalSurface< Point > &polysurf) |
template<typename TTriangulatedOrPolygonalSurface > | |
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 bool | exportMTLNewMaterial (std::ostream &output_mtl, unsigned long idxMaterial, const Color &ambient_color, const Color &diffuse_color, const Color &specular_color) |
Aim: Static class that provides builder and converters between meshes.
Description of template class 'MeshHelpers'
Definition at line 63 of file MeshHelpers.h.
|
static |
Builds a polygonal surface (class PolygonalSurface) from the dual graph of a 2-dimensional digital surface in K^3 (class DigitalSurface).
DigitalSurfaceContainer | the container chosen for the digital surface. |
CellEmbedder | the embedder chosen for the digital surface. |
[in] | dsurf | the input digital surface. |
[in] | cembedder | the embedder for 2-cells of the digital surface, which are vertices in the output polygonal surface. |
[out] | polysurf | the output polygonal surface mesh. |
[out] | vertexmap | the output mapping between a Vertex of dsurf and an Index in polysurf. |
Referenced by DGtal::Shortcuts< TKSpace >::makeDualPolygonalSurface(), and DGtal::Shortcuts< TKSpace >::makePolygonalSurface().
|
static |
Builds a triangulated surface (class TriangulatedSurface) from the dual graph of a 2-dimensional digital surface in K^3 (class DigitalSurface).
DigitalSurfaceContainer | the container chosen for the digital surface. |
CellEmbedder | the embedder chosen for the digital surface. |
[in] | dsurf | the input digital surface. |
[in] | cembedder | the embedder for 2-cells of the digital surface, which are vertices in the output triangulated surface. |
[out] | trisurf | the output triangulated surface mesh. |
[out] | vertexmap | the output mapping between a Vertex of dsurf and an Index in trisurf. |
Referenced by DGtal::Shortcuts< TKSpace >::makeTriangulatedSurface().
|
static |
Builds a polygonal surface (class PolygonalSurface) from the primal graph of a 2-dimensional digital surface in K^3 (class DigitalSurface).
DigitalSurfaceContainer | the container chosen for the digital surface. |
CellEmbedder | the embedder chosen for the digital surface. |
CellMap | the type for encoding the map 0-cell -> Index. |
[in] | dsurf | the input digital surface. |
[in] | cembedder | the embedder for 0-cells of the digital surface, which are vertices in the output polygonal surface. |
[out] | polysurf | the output polygonal surface mesh. |
[out] | cellmap | the output mapping between a 0-cell of dsurf and an Index in polysurf. |
Referenced by DGtal::Shortcuts< TKSpace >::makePrimalPolygonalSurface().
|
static |
Builds a polygonal surface (class SurfaceMesh) from the primal graph of a digital surface in K^3 (class DigitalSurface). The digital surface does not need to be a combinatorial 2-manifold.
DigitalSurfaceContainer | the container chosen for the digital surface. |
CellEmbedder | the embedder chosen for the digital surface. |
CellMap | the type for encoding the map 0-cell -> Index. |
[in] | dsurf | the input digital surface. |
[in] | cembedder | the embedder for 0-cells of the digital surface, which are vertices in the output polygonal surface. |
[out] | polysurf | the output polygonal surface mesh. |
[out] | cellmap | the output mapping between a 0-cell of dsurf and an Index in polysurf. |
Referenced by DGtal::Shortcuts< TKSpace >::makePrimalSurfaceMesh().
|
static |
Exports a new material in a MTL stream.
[in,out] | output_mtl | an output stream into a MTL file |
[in] | idxMaterial | the index of the new material. |
[in] | ambient_color | the ambient color for the material. |
[in] | diffuse_color | the diffuse color for the material. |
[in] | specular_color | the specular color for the material. |
Referenced by DGtal::Shortcuts< TKSpace >::saveOBJ(), and DGtal::Shortcuts< TKSpace >::saveVectorFieldOBJ().
|
static |
Exports a polygonal surface as an OBJ file (with topology) into the given output stream.
Point | the type for points. |
[in,out] | output | an output stream |
[in] | polysurf | the input polygonal surface mesh. |
|
static |
Exports a triangulated surface as an OBJ file (with topology) into the given output stream.
Point | the type for points. |
[in,out] | output | an output stream |
[in] | trisurf | the input triangulated surface mesh. |
Referenced by DGtal::Shortcuts< TKSpace >::saveOBJ().
|
static |
Exports a triangulated or polygonal surface as an OBJ file (with topology) into the given output stream. It can also specifies normals per face and colors per face.
TTriangulatedOrPolygonalSurface | either some TriangulatedSurface or some PolygonalSurface. |
[in,out] | output_obj | an output stream where the OBJ file is written. |
[in] | mtl_filename | the name of the material filename (stores colors). |
[in] | polysurf | the input triangulated or polygonal surface mesh. |
[in] | normals | either empty or a vector of size polysurf.nbFaces specifying the normal vector for each face. |
[in] | diffuse_colors | either empty or a vector of size polysurf.nbFaces specifying the diffuse color for each face. |
[in] | ambient_color | the ambient color of all faces. |
[in] | diffuse_color | the diffuse color of all faces if diffuse_colors was empty. |
[in] | specular_color | the specular color of all faces. |
Referenced by DGtal::Shortcuts< TKSpace >::saveOBJ().
|
static |
Builds a polygon mesh (class PolygonalSurface) from a mesh (class Mesh). The output polygonal surface rebuilds a topology between faces.
Point | the type for points. |
[in] | mesh | the input mesh. |
[out] | polysurf | the output polygonal surface mesh. |
Referenced by DGtal::Shortcuts< TKSpace >::makePolygonalSurface().
|
static |
Builds a triangulated surface (class TriangulatedSurface) from a mesh (class Mesh). Note that a triangulated surface contains only triangles, so polygonal faces (0,1,2,3,4,...) of the input mesh are (naively) triangulated (triangles (0,1,2), (0,2,3), (0,3,4), etc). Furthermore, the output triangulated surface rebuilds a topology between faces.
Point | the type for points. |
[in] | mesh | the input mesh. |
[out] | trisurf | the output triangulated surface mesh. |
Referenced by DGtal::Shortcuts< TKSpace >::makeTriangulatedSurface().
|
static |
Builds a mesh (class Mesh) from a polygon mesh (class PolygonalSurface). Note that the mesh looses the topology of the polygonal surface, since it is essentially a soup of triangles.
Point | the type for points. |
[in] | polysurf | the input polygonal surface (ie a polygon mesh). |
[in,out] | mesh | the output mesh (which should be empty). |
Referenced by DGtal::Shortcuts< TKSpace >::makeMesh(), and DGtal::Shortcuts< TKSpace >::saveOFF().
|
static |
Builds a polygonal surface from a triangulated surface. Polygonal faces are triangulated according to centroid: when 'true', creates a vertex in each non triangular face, otherwise creates triangles (0,i,i+1) in face (0, 1, ..., n) for i < n-1.
Point | the type for points. |
[in] | polysurf | the input polygonal surface mesh. |
[out] | trisurf | the output triangulated surface. |
[in] | centroid | when 'true' creates a vertex in the middle of non triangular faces and a fan around it, otherwise naively subdivides the face as a fan around the first vertex. |
Referenced by DGtal::Shortcuts< TKSpace >::makeTriangulatedSurface().
|
static |
Builds a mesh (class Mesh) from a surface mesh (class SurfaceMesh). Note that the mesh looses the topology of the surface mesh, since it is essentially a soup of triangles.
RealPoint | the type for 3d points. |
RealVector | the type for 3d vectors. |
[in] | smesh | the input surface mesh. |
[in] | cols | a vector defining the face colors. |
[in,out] | mesh | the output mesh (which should be empty). |
|
static |
Builds a mesh (class Mesh) from a triangulated surface (class TriangulatedSurface). Note that the mesh looses the topology of the triangulated surface, since it is essentially a soup of triangles.
Point | the type for points. |
[in] | trisurf | the input triangulated surface mesh. |
[in,out] | mesh | the output mesh (which should be empty). |
Referenced by DGtal::Shortcuts< TKSpace >::makeMesh(), and DGtal::Shortcuts< TKSpace >::saveOFF().