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::cout <<
"Points_off_visitor_reader::init - dim=" << dim <<
" - num_vertices=" <<
44 num_vertices <<
" - num_faces=" << num_faces <<
" - num_edges=" << num_edges << std::endl;
45 #endif // DEBUG_TRACES
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::cout <<
"Points_off_visitor_reader::point ";
70 for (
auto coordinate :
point) {
71 std::cout << coordinate <<
" | ";
73 std::cout << std::endl;
74 #endif // DEBUG_TRACES
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;
171 #endif // POINTS_OFF_IO_H_
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_off_io.h:67
bool is_valid() const
Returns if the OFF file read operation was successful or not.
Definition: Points_off_io.h:150
void init(int dim, int num_vertices, int num_faces, int num_edges)
Off_reader visitor init implementation.
Definition: Points_off_io.h:41
const std::vector< Point_d > & get_point_cloud() const
Point cloud getter.
Definition: Points_off_io.h:89
OFF file visitor implementation according to Off_reader in order to read points from an OFF file.
Definition: Points_off_io.h:26
OFF file reader implementation in order to read points from an OFF file.
Definition: Points_off_io.h:122
bool read(OffVisitor &off_visitor)
Read an OFF file and calls the following methods :
Definition: Off_reader.h:51
const std::vector< Point_d > & get_point_cloud() const
Point cloud getter.
Definition: Points_off_io.h:158
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
GUDHI
Version 3.1.1
- C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.
- Copyright : MIT
|
Generated on Mon Apr 25 2022 14:03:04 for GUDHI by
Doxygen 1.8.17
|