DGtal  1.2.0
SurfaceMeshReader.h
1 
17 #pragma once
18 
31 #if defined(SurfaceMeshReader_RECURSES)
32 #error Recursive header files inclusion detected in SurfaceMeshReader.h
33 #else // defined(SurfaceMeshReader_RECURSES)
35 #define SurfaceMeshReader_RECURSES
36 
37 #if !defined SurfaceMeshReader_h
39 #define SurfaceMeshReader_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <sstream>
45 #include <string>
46 #include "DGtal/base/Common.h"
47 #include "DGtal/helpers/StdDefs.h"
48 #include "DGtal/shapes/SurfaceMesh.h"
49 
50 namespace DGtal
51 {
52 
54  // template class SurfaceMeshReader
62  template < typename TRealPoint, typename TRealVector >
64  {
65  typedef TRealPoint RealPoint;
66  typedef TRealVector RealVector;
68  static const Dimension dimension = RealPoint::dimension;
70 
72  typedef typename SurfaceMesh::Size Size;
73  typedef typename SurfaceMesh::Index Index;
74  typedef typename SurfaceMesh::Vertices Vertices;
75  typedef typename SurfaceMesh::Faces Faces;
76 
80  static bool verifyIndicesUniqueness( const std::vector< Index > &indices );
81 
87  static
88  std::vector< std::string > split( const std::string& str, char delim = ' ');
89 
98  static
99  bool readOBJ( std::istream & input, SurfaceMesh & smesh );
100  };
101 
102 } // namespace DGtal
103 
105 // Includes inline functions.
106 #include "SurfaceMeshReader.ih"
107 // //
109 
110 #endif // !defined SurfaceMeshReader_h
111 
112 #undef SurfaceMeshReader_RECURSES
113 #endif // else defined(SurfaceMeshReader_RECURSES)
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Definition: Common.h:137
Aim: An helper class for reading mesh files (Wavefront OBJ at this point) and creating a SurfaceMesh.
static const Dimension dimension
static bool verifyIndicesUniqueness(const std::vector< Index > &indices)
SurfaceMesh::Index Index
static bool readOBJ(std::istream &input, SurfaceMesh &smesh)
SurfaceMeshReader< RealPoint, RealVector > Self
SurfaceMesh::Faces Faces
BOOST_STATIC_ASSERT((dimension==3))
SurfaceMesh::Vertices Vertices
DGtal::SurfaceMesh< RealPoint, RealVector > SurfaceMesh
static std::vector< std::string > split(const std::string &str, char delim=' ')
Aim: Represents an embedded mesh as faces and a list of vertices. Vertices may be shared among faces ...
Definition: SurfaceMesh.h:92
std::vector< Vertex > Vertices
The type that defines a list/range of vertices (e.g. to define faces)
Definition: SurfaceMesh.h:112
std::size_t Index
The type used for numbering vertices and faces.
Definition: SurfaceMesh.h:105
std::size_t Size
The type for counting elements.
Definition: SurfaceMesh.h:103
std::vector< Face > Faces
Definition: SurfaceMesh.h:116