10 #ifndef POINTS_3D_OFF_IO_H_ 11 #define POINTS_3D_OFF_IO_H_ 13 #include <gudhi/Off_reader.h> 25 template<
typename Po
int_3>
28 std::vector<Point_3> point_cloud_;
42 void init(
int dim,
int num_vertices,
int num_faces,
int num_edges) {
44 std::cout <<
"Points_3D_off_visitor_reader::init - dim=" << dim <<
" - num_vertices=" <<
45 num_vertices <<
" - num_faces=" << num_faces <<
" - num_edges=" << num_edges << std::endl;
46 #endif // DEBUG_TRACES 51 std::cerr <<
"Points_3D_off_reader::Points_3D_off_reader cannot read OFF files in dimension " << dim <<
"\n";
55 std::cerr <<
"Points_3D_off_visitor_reader::init faces are not taken into account from OFF file for Points.\n";
58 std::cerr <<
"Points_3D_off_visitor_reader::init edges are not taken into account from OFF file for Points.\n";
77 std::cout <<
"Points_3D_off_visitor_reader::point ";
78 for (
auto coordinate : point) {
79 std::cout << coordinate <<
" | ";
81 std::cout << std::endl;
82 #endif // DEBUG_TRACES 84 point_cloud_.push_back(Point_3(point[0], point[1], point[2]));
90 void maximal_face(
const std::vector<int>& face) { }
139 template<
typename Po
int_3>
151 std::ifstream stream(name_file);
152 if (stream.is_open()) {
155 valid_ = off_reader.
read(off_visitor);
156 valid_ = valid_ && off_visitor.
is_valid();
161 std::cerr <<
"Points_3D_off_reader::Points_3D_off_reader could not open file " << name_file <<
"\n";
183 std::vector<Point_3> point_cloud;
190 #endif // POINTS_3D_OFF_IO_H_ bool read(OffVisitor &off_visitor)
Read an OFF file and calls the following methods :
Definition: Off_reader.h:51
bool is_valid() const
Returns if the OFF file read operation was successful or not.
Definition: Points_3D_off_io.h:169
bool is_valid() const
Returns if the OFF file read operation was successful or not.
Definition: Points_3D_off_io.h:108
OFF file visitor implementation according to Off_reader in order to read points from an OFF file...
Definition: Points_3D_off_io.h:26
Definition: SimplicialComplexForAlpha.h:14
const std::vector< Point_3 > & get_point_cloud() const
Point cloud getter.
Definition: Points_3D_off_io.h:177
OFF file reader top class visitor.
Definition: Off_reader.h:29
void point(const std::vector< double > &point)
Off_reader visitor point implementation.
Definition: Points_3D_off_io.h:74
Definition: Points_3D_off_io.h:140
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:149
void init(int dim, int num_vertices, int num_faces, int num_edges)
Off_reader visitor init implementation.
Definition: Points_3D_off_io.h:42
const std::vector< Point_3 > & get_point_cloud() const
Point cloud getter.
Definition: Points_3D_off_io.h:100