7#include <opencv2/core.hpp>
36 auto read() -> ITKMesh::Pointer;
69 using Face = std::vector<VertexRefs>;
78 VertexWithTextureAndNormal
std::shared_ptr< UVMap > Pointer
Read an OBJ file into a volcart::ITKMesh.
std::vector< cv::Vec3d > vertices_
RefType
Validation enumeration to ensure proper parsing of OBJReader::VertexRefs.
std::vector< cv::Vec2d > uvs_
std::vector< cv::Vec3d > normals_
void parse_normal_(const std::vector< std::string > &strs)
auto classify_vertref_(const std::string &ref) -> RefType
void parse_vertex_(const std::vector< std::string > &strs)
auto getTextureMat() -> cv::Mat
Return texture image as cv::Mat.
std::vector< OBJReader::Face > faces_
filesystem::path texturePath_
void parse_face_(const std::vector< std::string > &strs)
auto read() -> ITKMesh::Pointer
Read the mesh from file.
auto getUVMap() -> UVMap::Pointer
Return parsed UV information.
cv::Vec3i VertexRefs
3-Tuple linking a vertex to its position, UV, and normal elements
void parse_mtllib_(const std::vector< std::string > &strs)
void setPath(const filesystem::path &p)
Set the OBJ file path.
auto getMesh() -> ITKMesh::Pointer
Return the parsed mesh.
void parse_tcoord_(const std::vector< std::string > &strs)
std::vector< VertexRefs > Face
A list of at least three OBJReader::VertexRefs comprise a face.