Code_TYMPAN  4.4.0
Industrial site acoustic simulation
altimetry_file_reader_impl.h
Go to the documentation of this file.
1 
10 #ifndef TYMPAN__ALTIMETRYREADERIMPL_H__INCLUDED
11 #define TYMPAN__ALTIMETRYREADERIMPL_H__INCLUDED
12 
13 typedef struct t_ply_* p_ply; // Avoid including rply.h here
14 
15 #include "altimetry_file_reader.h"
16 
17 namespace tympan
18 {
19 
24 {
25 public:
26  typedef enum
27  {
28  X,
29  Y,
30  Z,
33  typedef enum
34  {
39  typedef enum
40  {
44 
45  AltimetryPLYReader(const std::string filename);
46  virtual ~AltimetryPLYReader();
47 
50  virtual const points_array_t& points() const
51  {
52  return _points;
53  };
54  virtual const faces_array_t& faces() const
55  {
56  return _faces;
57  };
58  virtual const materials_array_t& materials() const
59  {
60  return _material_by_face;
61  };
62  virtual void read();
64 
67  void setup_callbacks();
68  void init_data();
69  void read_data();
72 
75  long nvertices() const
76  {
77  return _nvertices;
78  }
79  long nfaces() const
80  {
81  return _nfaces;
82  }
84 
87  bool vertex_cb(vertex_properties property, unsigned vertex_index, double value);
88  bool face_cb(face_properties property, unsigned face_index, unsigned nproperties, int property_index,
89  double value);
90  bool material_cb(material_properties property, unsigned material_index, unsigned nproperties,
91  int property_index, double value);
92  void error_cb(p_ply ply, const char* message);
94 
97 public:
98  const std::string _filename;
99 
100 protected:
103  std::vector<unsigned> _material_indices;
106 
109  long _nfaces;
112 
113 }; // AltimetryPLYReader
114 }; // namespace tympan
115 
116 #endif // TYMPAN__ALTIMETRYREADERIMPL_H__INCLUDED
Provides for reading back an altimetry written in a file.
struct t_ply_ * p_ply
read an Altimetry from a PLY file.
virtual const points_array_t & points() const
std::vector< unsigned > _material_indices
bool vertex_cb(vertex_properties property, unsigned vertex_index, double value)
virtual void read()
read the file whose name was given at reader's construction time
bool face_cb(face_properties property, unsigned face_index, unsigned nproperties, int property_index, double value)
virtual const materials_array_t & materials() const
Getter for the faces read.
AltimetryPLYReader(const std::string filename)
void error_cb(p_ply ply, const char *message)
virtual const faces_array_t & faces() const
Getter for the faces read.
bool material_cb(material_properties property, unsigned material_index, unsigned nproperties, int property_index, double value)
std::deque< std::string > materials_array_t
Type of the material array returned.
std::deque< OPoint3D > points_array_t
Type of the points array returned.
std::deque< OTriangle > faces_array_t
Type of the faces array returned.