Write an ITKMesh to an OBJ file.
More...
#include <vc/core/io/OBJWriter.hpp>
|
|
|
| OBJWriter ()=default |
| | Default constructor.
|
| |
|
| OBJWriter (filesystem::path outputPath, ITKMesh::Pointer mesh) |
| | Constructor with output path and input mesh.
|
| |
|
| OBJWriter (filesystem::path outputPath, ITKMesh::Pointer mesh, UVMap::Pointer uvMap, cv::Mat uvImg) |
| | Constructor with output path and textured mesh information.
|
| |
|
| void | setPath (const filesystem::path &path) |
| | Set the output path. More...
|
| |
|
void | setMesh (ITKMesh::Pointer mesh) |
| | Set the input mesh.
|
| |
|
void | setUVMap (UVMap::Pointer uvMap) |
| | Set the input UV Map.
|
| |
|
void | setTexture (cv::Mat uvImg) |
| | Set the input texture image.
|
| |
| void | setTextureFormat (std::string fmt) |
| | Set the texture image format. More...
|
| |
|
| void | write () |
| | Write the OBJ to disk. More...
|
| |
Write an ITKMesh to an OBJ file.
- Author
- Seth Parker
- Date
- 6/24/15
Writes both textured and untextured meshes in ASCII OBJ format. Texture information is automatically written if a UV map is set and is not empty.
Definition at line 29 of file OBJWriter.hpp.
◆ setPath()
| void volcart::io::OBJWriter::setPath |
( |
const filesystem::path & |
path | ) |
|
Set the output path.
write() and validate() will fail if path does not have an expected file extension (.obj/.OBJ).
◆ setTextureFormat()
| void volcart::io::OBJWriter::setTextureFormat |
( |
std::string |
fmt | ) |
|
Set the texture image format.
Passed value will be used as the file extension when writing the texture image. Example values: tif, jpg, png.
◆ write()
| void volcart::io::OBJWriter::write |
( |
| ) |
|
Write the OBJ to disk.
If UV Map is not empty, automatically writes MTL and texture image.
- Exceptions
-
◆ write_faces_()
| void volcart::io::OBJWriter::write_faces_ |
( |
| ) |
|
|
private |
◆ write_header_()
| void volcart::io::OBJWriter::write_header_ |
( |
| ) |
|
|
private |
◆ write_mtl_()
| void volcart::io::OBJWriter::write_mtl_ |
( |
| ) |
|
|
private |
◆ write_obj_()
| void volcart::io::OBJWriter::write_obj_ |
( |
| ) |
|
|
private |
◆ write_texture_()
| void volcart::io::OBJWriter::write_texture_ |
( |
| ) |
|
|
private |
◆ write_texture_coordinates_()
| void volcart::io::OBJWriter::write_texture_coordinates_ |
( |
| ) |
|
|
private |
Write the OBJ texture coordinates
◆ write_vertices_()
| void volcart::io::OBJWriter::write_vertices_ |
( |
| ) |
|
|
private |
◆ mesh_
| ITKMesh::Pointer volcart::io::OBJWriter::mesh_ |
|
private |
◆ outputMesh_
| std::ofstream volcart::io::OBJWriter::outputMesh_ |
|
private |
◆ outputMTL_
| std::ofstream volcart::io::OBJWriter::outputMTL_ |
|
private |
◆ outputPath_
| filesystem::path volcart::io::OBJWriter::outputPath_ |
|
private |
◆ pointLinks_
| std::map<std::uint32_t, cv::Vec3i> volcart::io::OBJWriter::pointLinks_ |
|
private |
Keeps track of what info we have about each point in the mesh. Used for building OBJ faces.
[ Point Index, {v, vt, vn} ]
v = vertex index number
vt = UV coordinate index number
vn = vertex normal index number
Definition at line 104 of file OBJWriter.hpp.
◆ texture_
| cv::Mat volcart::io::OBJWriter::texture_ |
|
private |
◆ textureFmt_
| std::string volcart::io::OBJWriter::textureFmt_ {"tif"} |
|
private |
Output texture image file extension
Definition at line 88 of file OBJWriter.hpp.
◆ uvMap_
The documentation for this class was generated from the following file: