10 #ifndef POINTS_OFF_IO_H_
11 #define POINTS_OFF_IO_H_
13 #include <gudhi/Off_reader.h>
25 template<
typename Po
int_d>
28 std::vector<Point_d> point_cloud;
41 void init(
int dim,
int num_vertices,
int num_faces,
int num_edges) {
43 std::clog <<
"Points_off_visitor_reader::init - dim=" << dim <<
" - num_vertices=" <<
44 num_vertices <<
" - num_faces=" << num_faces <<
" - num_edges=" << num_edges << std::endl;
47 std::cerr <<
"Points_off_visitor_reader::init faces are not taken into account from OFF file for Points.\n";
50 std::cerr <<
"Points_off_visitor_reader::init edges are not taken into account from OFF file for Points.\n";
69 std::clog <<
"Points_off_visitor_reader::point ";
70 for (
auto coordinate :
point) {
71 std::clog << coordinate <<
" | ";
73 std::clog << std::endl;
76 point_cloud.push_back(Point_d(
point.begin(),
point.end()));
80 void maximal_face(
const std::vector<int>& face) { }
121 template<
typename Po
int_d>
133 std::ifstream stream(name_file);
134 if (stream.is_open()) {
137 valid_ = off_reader.
read(off_visitor);
142 std::cerr <<
"Points_off_reader::Points_off_reader could not open file " << name_file <<
"\n";
164 std::vector<Point_d> point_cloud;
OFF file reader top class visitor.
Definition: Off_reader.h:29
bool read(OffVisitor &off_visitor)
Read an OFF file and calls the following methods :
Definition: Off_reader.h:51
OFF file reader implementation in order to read points from an OFF file.
Definition: Points_off_io.h:122
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:131
const std::vector< Point_d > & get_point_cloud() const
Point cloud getter.
Definition: Points_off_io.h:158
bool is_valid() const
Returns if the OFF file read operation was successful or not.
Definition: Points_off_io.h:150
OFF file visitor implementation according to Off_reader in order to read points from an OFF file.
Definition: Points_off_io.h:26
const std::vector< Point_d > & get_point_cloud() const
Point cloud getter.
Definition: Points_off_io.h:89
void point(const std::vector< double > &point)
Off_reader visitor point implementation.
Definition: Points_off_io.h:67
void init(int dim, int num_vertices, int num_faces, int num_edges)
Off_reader visitor init implementation.
Definition: Points_off_io.h:41
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14