22 #ifndef POINTS_3D_OFF_IO_H_ 23 #define POINTS_3D_OFF_IO_H_ 25 #include <gudhi/Off_reader.h> 37 template<
typename Po
int_3>
40 std::vector<Point_3> point_cloud_;
54 void init(
int dim,
int num_vertices,
int num_faces,
int num_edges) {
56 std::cout <<
"Points_3D_off_visitor_reader::init - dim=" << dim <<
" - num_vertices=" <<
57 num_vertices <<
" - num_faces=" << num_faces <<
" - num_edges=" << num_edges << std::endl;
58 #endif // DEBUG_TRACES 63 std::cerr <<
"Points_3D_off_reader::Points_3D_off_reader cannot read OFF files in dimension " << dim <<
"\n";
67 std::cerr <<
"Points_3D_off_visitor_reader::init faces are not taken into account from OFF file for Points.\n";
70 std::cerr <<
"Points_3D_off_visitor_reader::init edges are not taken into account from OFF file for Points.\n";
89 std::cout <<
"Points_3D_off_visitor_reader::point ";
90 for (
auto coordinate : point) {
91 std::cout << coordinate <<
" | ";
93 std::cout << std::endl;
94 #endif // DEBUG_TRACES 96 point_cloud_.push_back(Point_3(point[0], point[1], point[2]));
102 void maximal_face(
const std::vector<int>& face) { }
151 template<
typename Po
int_3>
163 std::ifstream stream(name_file);
164 if (stream.is_open()) {
167 valid_ = off_reader.
read(off_visitor);
168 valid_ = valid_ && off_visitor.
is_valid();
173 std::cerr <<
"Points_3D_off_reader::Points_3D_off_reader could not open file " << name_file <<
"\n";
195 std::vector<Point_3> point_cloud;
202 #endif // POINTS_3D_OFF_IO_H_ const std::vector< Point_3 > & get_point_cloud() const
Point cloud getter.
Definition: Points_3D_off_io.h:189
bool read(OffVisitor &off_visitor)
Read an OFF file and calls the following methods :
Definition: Off_reader.h:65
OFF file visitor implementation according to Off_reader in order to read points from an OFF file...
Definition: Points_3D_off_io.h:38
Definition: SimplicialComplexForAlpha.h:26
bool is_valid() const
Returns if the OFF file read operation was successful or not.
Definition: Points_3D_off_io.h:120
OFF file reader top class visitor.
Definition: Off_reader.h:43
void point(const std::vector< double > &point)
Off_reader visitor point implementation.
Definition: Points_3D_off_io.h:86
bool is_valid() const
Returns if the OFF file read operation was successful or not.
Definition: Points_3D_off_io.h:181
Definition: Points_3D_off_io.h:152
Points_3D_off_reader(const std::string &name_file)
Reads the OFF file and constructs a vector of points from the points that are in the OFF file...
Definition: Points_3D_off_io.h:161
void init(int dim, int num_vertices, int num_faces, int num_edges)
Off_reader visitor init implementation.
Definition: Points_3D_off_io.h:54
const std::vector< Point_3 > & get_point_cloud() const
Point cloud getter.
Definition: Points_3D_off_io.h:112