Volume Cartographer 2.27.0
PLYWriter.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstdint>
6#include <fstream>
7
8#include <opencv2/core.hpp>
9
13
14namespace volcart::io
15{
32{
33public:
36 PLYWriter() = default;
37
39 PLYWriter(filesystem::path outputPath, ITKMesh::Pointer mesh);
40
43 filesystem::path outputPath, ITKMesh::Pointer mesh, cv::Mat texture);
52 void setPath(const filesystem::path& path);
53
55 void setMesh(ITKMesh::Pointer mesh);
56
59
61 void setTexture(cv::Mat texture);
62
64 void setVertexColors(const std::vector<std::uint16_t>& c);
76 void write();
79private:
81 filesystem::path outputPath_;
83 std::ofstream outputMesh_;
85 ITKMesh::Pointer mesh_;
89 cv::Mat texture_;
91 std::vector<std::uint16_t> vcolors_;
92
95
111};
112} // namespace volcart::io
std::shared_ptr< UVMap > Pointer
Definition: UVMap.hpp:55
Write an ITKMesh to a PLY file.
Definition: PLYWriter.hpp:32
PLYWriter(filesystem::path outputPath, ITKMesh::Pointer mesh, cv::Mat texture)
Constructor with output path and textured mesh information.
void write()
Write the PLY to disk.
ITKMesh::Pointer mesh_
Definition: PLYWriter.hpp:85
void setUVMap(UVMap::Pointer uvMap)
Set the input UV Map.
std::ofstream outputMesh_
Definition: PLYWriter.hpp:83
void write_vertices_()
Write the PLY vertices.
void setMesh(ITKMesh::Pointer mesh)
Set the input mesh.
void setPath(const filesystem::path &path)
Set the output path.
void write_header_()
Write the PLY header.
PLYWriter()=default
Default constructor.
UVMap::Pointer uvMap_
Definition: PLYWriter.hpp:87
filesystem::path outputPath_
Definition: PLYWriter.hpp:81
std::vector< std::uint16_t > vcolors_
Definition: PLYWriter.hpp:91
PLYWriter(filesystem::path outputPath, ITKMesh::Pointer mesh)
Constructor with output path and input mesh.
void write_faces_()
Write the PLY faces.
void setTexture(cv::Mat texture)
Set texture image.
void setVertexColors(const std::vector< std::uint16_t > &c)
Set per-vertex color information.
IO classes.