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";
81 std::cout <<
"Points_off_visitor_reader::point ";
82 for (
auto coordinate : point) {
83 std::cout << coordinate <<
" | ";
85 std::cout << std::endl;
86 #endif // DEBUG_TRACES 88 point_cloud.push_back(Point_d(point.begin(), point.end()));
92 void maximal_face(
const std::vector<int>& face) { }
133 template<
typename Po
int_d>
145 std::ifstream stream(name_file);
146 if (stream.is_open()) {
149 valid_ = off_reader.
read(off_visitor);
154 std::cerr <<
"Points_off_reader::Points_off_reader could not open file " << name_file <<
"\n";
176 std::vector<Point_d> point_cloud;
183 #endif // POINTS_OFF_IO_H_ const std::vector< Point_d > & get_point_cloud() const
Point cloud getter.
Definition: Points_off_io.h:101
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:134
OFF file visitor implementation according to Off_reader in order to read points from an OFF file...
Definition: Points_off_io.h:38
Definition: SimplicialComplexForAlpha.h:26
const std::vector< Point_d > & get_point_cloud() const
Point cloud getter.
Definition: Points_off_io.h:170
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:143
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:162
void point(const std::vector< double > &point)
Off_reader visitor point implementation.
Definition: Points_off_io.h:79