Volume Cartographer 2.27.0
PLYReader.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <fstream>
6#include <map>
7
11
12namespace volcart::io
13{
14
27{
28public:
31 PLYReader() = default;
32
34 explicit PLYReader(filesystem::path path);
39 void setPath(filesystem::path path);
40
42 auto getMesh() -> ITKMesh::Pointer;
47 auto read() -> ITKMesh::Pointer;
50private:
52 filesystem::path inputPath_;
54 std::ifstream plyFile_;
56 ITKMesh::Pointer outMesh_;
58 std::string line_;
60 std::vector<SimpleMesh::Cell> faceList_;
62 std::vector<SimpleMesh::Vertex> pointList_;
64 std::vector<std::string> elementsList_;
70 std::vector<int> skippedLine_;
72 std::map<std::string, int> properties_;
73
78 bool hasLeadingChar_ = true;
79
81 bool hasPointNorm_ = false;
82
85
95
98
101};
102} // namespace volcart::io
Simple mesh structure.
Read a PLY file to an ITKMesh.
Definition: PLYReader.hpp:27
void parse_header_()
Parse the PLY header.
filesystem::path inputPath_
Definition: PLYReader.hpp:52
void read_points_()
Fill the temporary vertex list with parsed vertex information.
PLYReader(filesystem::path path)
Constructor with input file path.
void create_mesh_()
Construct outMesh_ from the temporary vertices and faces.
PLYReader()=default
Default constructor.
std::map< std::string, int > properties_
Definition: PLYReader.hpp:72
std::vector< int > skippedLine_
Definition: PLYReader.hpp:70
std::vector< std::string > elementsList_
Definition: PLYReader.hpp:64
auto read() -> ITKMesh::Pointer
Parse the input file.
std::vector< SimpleMesh::Vertex > pointList_
Definition: PLYReader.hpp:62
void read_faces_()
Fill the temporary face list with parsed face information.
std::vector< SimpleMesh::Cell > faceList_
Definition: PLYReader.hpp:60
ITKMesh::Pointer outMesh_
Definition: PLYReader.hpp:56
auto getMesh() -> ITKMesh::Pointer
Get the parsed input as an ITKMesh.
std::ifstream plyFile_
Definition: PLYReader.hpp:54
void setPath(filesystem::path path)
Set the input file path.
IO classes.