22 #ifndef POINTS_OFF_IO_H_
23 #define POINTS_OFF_IO_H_
25 #include <gudhi/Off_reader.h>
37 template<
typename Po
int_d>
40 std::vector<Point_d> point_cloud;
53 void init(
int dim,
int num_vertices,
int num_faces,
int num_edges) {
55 std::cout <<
"Points_off_visitor_reader::init - dim=" << dim <<
" - num_vertices=" <<
56 num_vertices <<
" - num_faces=" << num_faces <<
" - num_edges=" << num_edges << std::endl;
57 #endif // DEBUG_TRACES
59 std::cerr <<
"Points_off_visitor_reader::init faces are not taken into account from OFF file for Points.\n";
62 std::cerr <<
"Points_off_visitor_reader::init edges are not taken into account from OFF file for Points.\n";
82 std::cout <<
"Points_off_visitor_reader::point ";
83 for (
auto coordinate : point) {
84 std::cout << coordinate <<
" | ";
86 std::cout << std::endl;
87 #endif // DEBUG_TRACES
89 point_cloud.push_back(Point_d(point.size(), point.begin(), point.end()));
93 void maximal_face(
const std::vector<int>& face) { }
134 template<
typename Po
int_d>
146 std::ifstream stream(name_file);
147 if (stream.is_open()) {
150 valid_ = off_reader.
read(off_visitor);
155 std::cerr <<
"Points_off_reader::Points_off_reader could not open file " << name_file <<
"\n";
177 std::vector<Point_d> point_cloud;
184 #endif // POINTS_OFF_IO_H_
const std::vector< Point_d > & get_point_cloud() const
Point cloud getter.
Definition: Points_off_io.h:102
bool read(OffVisitor &off_visitor)
Read an OFF file and calls the following methods :
Definition: Off_reader.h:65
OFF file reader implementation in order to read points from an OFF file.
Definition: Points_off_io.h:135
OFF file visitor implementation according to Off_reader in order to read points from an OFF file...
Definition: Points_off_io.h:38
const std::vector< Point_d > & get_point_cloud() const
Point cloud getter.
Definition: Points_off_io.h:171
Points_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_off_io.h:144
void init(int dim, int num_vertices, int num_faces, int num_edges)
Off_reader visitor init implementation.
Definition: Points_off_io.h:53
OFF file reader top class visitor.
Definition: Off_reader.h:43
bool is_valid() const
Returns if the OFF file read operation was successful or not.
Definition: Points_off_io.h:163
void point(const std::vector< double > &point)
Off_reader visitor point implementation.
Definition: Points_off_io.h:80