Volume Cartographer 2.27.0
Private Member Functions | Private Attributes | List of all members
volcart::io::PLYReader Class Reference
Core » IO

Read a PLY file to an ITKMesh. More...

#include <vc/core/io/PLYReader.hpp>

Public Member Functions

 PLYReader ()=default
 Default constructor.
 
 PLYReader (filesystem::path path)
 Constructor with input file path.
 
void setPath (filesystem::path path)
 Set the input file path.
 
auto getMesh () -> ITKMesh::Pointer
 Get the parsed input as an ITKMesh.
 
auto read () -> ITKMesh::Pointer
 Parse the input file.
 

Private Member Functions

void create_mesh_ ()
 Construct outMesh_ from the temporary vertices and faces.
 
void parse_header_ ()
 Parse the PLY header. More...
 
void read_faces_ ()
 Fill the temporary face list with parsed face information.
 
void read_points_ ()
 Fill the temporary vertex list with parsed vertex information.
 

Private Attributes

filesystem::path inputPath_
 
std::ifstream plyFile_
 
ITKMesh::Pointer outMesh_
 
std::string line_
 
std::vector< SimpleMesh::CellfaceList_
 
std::vector< SimpleMesh::VertexpointList_
 
std::vector< std::string > elementsList_
 
int numVertices_
 
int numFaces_
 
std::vector< int > skippedLine_
 
std::map< std::string, int > properties_
 
bool hasLeadingChar_ = true
 
bool hasPointNorm_ = false
 

Detailed Description

Read a PLY file to an ITKMesh.

Author
Hannah Hatch
Date
10/18/16

Only supports vertices, vertex normals, and faces.

Definition at line 26 of file PLYReader.hpp.

Member Function Documentation

◆ parse_header_()

void volcart::io::PLYReader::parse_header_ ( )
private

Parse the PLY header.

The header defines the expected layout for the body of the PLY file, including the count for each element (e.g. vertices, faces, etc). This information is stored in elementsList_ and used when reading in faces and vertices.

Member Data Documentation

◆ elementsList_

std::vector<std::string> volcart::io::PLYReader::elementsList_
private

List of elements parsed from the header

Definition at line 64 of file PLYReader.hpp.

◆ faceList_

std::vector<SimpleMesh::Cell> volcart::io::PLYReader::faceList_
private

Temporary face list

Definition at line 60 of file PLYReader.hpp.

◆ hasLeadingChar_

bool volcart::io::PLYReader::hasLeadingChar_ = true
private

Tracks if there is a leading character in front of each face line. This character tells how many vertices are in that face.

Definition at line 78 of file PLYReader.hpp.

◆ hasPointNorm_

bool volcart::io::PLYReader::hasPointNorm_ = false
private

Track if there are vertex normals

Definition at line 81 of file PLYReader.hpp.

◆ inputPath_

filesystem::path volcart::io::PLYReader::inputPath_
private

Input file path

Definition at line 52 of file PLYReader.hpp.

◆ line_

std::string volcart::io::PLYReader::line_
private

Line currently being parsed

Definition at line 58 of file PLYReader.hpp.

◆ numFaces_

int volcart::io::PLYReader::numFaces_
private

Number of faces expected in the parsed mesh

Definition at line 68 of file PLYReader.hpp.

◆ numVertices_

int volcart::io::PLYReader::numVertices_
private

Number of vertices expected in the parsed mesh

Definition at line 66 of file PLYReader.hpp.

◆ outMesh_

ITKMesh::Pointer volcart::io::PLYReader::outMesh_
private

Output mesh

Definition at line 56 of file PLYReader.hpp.

◆ plyFile_

std::ifstream volcart::io::PLYReader::plyFile_
private

Input file stream

Definition at line 54 of file PLYReader.hpp.

◆ pointList_

std::vector<SimpleMesh::Vertex> volcart::io::PLYReader::pointList_
private

Temporary vertex list

Definition at line 62 of file PLYReader.hpp.

◆ properties_

std::map<std::string, int> volcart::io::PLYReader::properties_
private

Maps positions in a string to a particular attribute

Definition at line 72 of file PLYReader.hpp.

◆ skippedLine_

std::vector<int> volcart::io::PLYReader::skippedLine_
private

Number of lines used by the elements we can't handle

Definition at line 70 of file PLYReader.hpp.


The documentation for this class was generated from the following file: