DGtal  1.3.beta
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)
34 
35 #define SurfaceMeshReader_RECURSES
36 
37 #if !defined SurfaceMeshReader_h
38 
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;
69  BOOST_STATIC_ASSERT( ( dimension == 3 ) );
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::SurfaceMeshReader::Size
SurfaceMesh::Size Size
Definition: SurfaceMeshReader.h:72
DGtal::SurfaceMeshReader::Vertices
SurfaceMesh::Vertices Vertices
Definition: SurfaceMeshReader.h:74
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:137
DGtal::SurfaceMesh
Aim: Represents an embedded mesh as faces and a list of vertices. Vertices may be shared among faces ...
Definition: SurfaceMesh.h:91
DGtal::SurfaceMeshReader::split
static std::vector< std::string > split(const std::string &str, char delim=' ')
DGtal::SurfaceMeshReader::readOBJ
static bool readOBJ(std::istream &input, SurfaceMesh &smesh)
DGtal::SurfaceMeshReader::dimension
static const Dimension dimension
Definition: SurfaceMeshReader.h:68
DGtal::SurfaceMesh::Faces
std::vector< Face > Faces
Definition: SurfaceMesh.h:116
DGtal::SurfaceMesh::Vertices
std::vector< Vertex > Vertices
The type that defines a list/range of vertices (e.g. to define faces)
Definition: SurfaceMesh.h:112
DGtal::SurfaceMeshReader::Self
SurfaceMeshReader< RealPoint, RealVector > Self
Definition: SurfaceMeshReader.h:67
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::SurfaceMeshReader::SurfaceMesh
DGtal::SurfaceMesh< RealPoint, RealVector > SurfaceMesh
Definition: SurfaceMeshReader.h:71
DGtal::SurfaceMeshReader::Faces
SurfaceMesh::Faces Faces
Definition: SurfaceMeshReader.h:75
DGtal::SurfaceMeshReader
Aim: An helper class for reading mesh files (Wavefront OBJ at this point) and creating a SurfaceMesh.
Definition: SurfaceMeshReader.h:63
DGtal::SurfaceMeshReader::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((dimension==3))
DGtal::SurfaceMeshReader::RealPoint
TRealPoint RealPoint
Definition: SurfaceMeshReader.h:65
DGtal::PointVector::dimension
static const Dimension dimension
Copy of the static dimension of the Point/Vector.
Definition: PointVector.h:626
DGtal::SurfaceMeshReader::Index
SurfaceMesh::Index Index
Definition: SurfaceMeshReader.h:73
DGtal::SurfaceMesh::Size
std::size_t Size
The type for counting elements.
Definition: SurfaceMesh.h:103
DGtal::SurfaceMeshReader::RealVector
TRealVector RealVector
Definition: SurfaceMeshReader.h:66
DGtal::SurfaceMeshReader::verifyIndicesUniqueness
static bool verifyIndicesUniqueness(const std::vector< Index > &indices)
DGtal::SurfaceMesh::Index
std::size_t Index
The type used for numbering vertices and faces.
Definition: SurfaceMesh.h:105