ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
TriangleMeshIO.cpp File Reference
#include "io/TriangleMeshIO.h"
#include <Eigen/Geometry>
#include <fstream>
#include <numeric>
#include <unordered_map>
#include <FileSystem.h>
#include <Helper.h>
#include <Logging.h>
#include <ProgressReporters.h>
#include <ecvHObjectCaster.h>
#include <ecvMesh.h>
#include <ecvPointCloud.h>
#include <ImageIO.h>
#include <rply.h>
#include <tiny_gltf.h>
#include <tiny_obj_loader.h>
#include "io/FileFormatIO.h"
Include dependency graph for TriangleMeshIO.cpp:

Go to the source code of this file.

Classes

struct  cloudViewer::io::ArrayAdapter< T >
 
struct  cloudViewer::io::IntArrayBase
 
struct  cloudViewer::io::IntArray< T >
 

Namespaces

 cloudViewer
 Generic file read and write utility for python interface.
 
 cloudViewer::ply_trianglemesh_reader
 
 cloudViewer::io
 

Functions

std::shared_ptr< ccMeshcloudViewer::io::CreateMeshFromFile (const std::string &filename, bool print_progress)
 
bool cloudViewer::io::ReadTriangleMesh (const std::string &filename, ccMesh &mesh, ReadTriangleMeshOptions params)
 
bool cloudViewer::io::WriteTriangleMesh (const std::string &filename, const ccMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
 
bool cloudViewer::io::IsPointInsidePolygon (const Eigen::MatrixX2d &polygon, double x, double y)
 
bool cloudViewer::io::AddTrianglesByEarClipping (ccMesh &mesh, std::vector< unsigned int > &indices)
 
bool cloudViewer::io::ReadTriangleMeshFromPLY (const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &params)
 
bool cloudViewer::io::WriteTriangleMeshToPLY (const std::string &filename, const ccMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
 
FileGeometry cloudViewer::io::ReadFileGeometryTypeFBX (const std::string &path)
 
FileGeometry cloudViewer::io::ReadFileGeometryTypeSTL (const std::string &path)
 
bool cloudViewer::io::ReadTriangleMeshFromSTL (const std::string &filename, ccMesh &mesh, bool print_progress)
 
bool cloudViewer::io::WriteTriangleMeshToSTL (const std::string &filename, const ccMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
 
FileGeometry cloudViewer::io::ReadFileGeometryTypeOBJ (const std::string &path)
 
bool cloudViewer::io::ReadTriangleMeshFromOBJ (const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &)
 
bool cloudViewer::io::WriteTriangleMeshToOBJ (const std::string &filename, const ccMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
 
FileGeometry cloudViewer::io::ReadFileGeometryTypeOFF (const std::string &path)
 
bool cloudViewer::io::ReadTriangleMeshFromOFF (const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &params)
 
bool cloudViewer::io::WriteTriangleMeshToOFF (const std::string &filename, const ccMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
 
FileGeometry cloudViewer::io::ReadFileGeometryTypeGLTF (const std::string &path)
 
bool cloudViewer::io::ReadTriangleMeshFromGLTF (const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &params)
 
bool cloudViewer::io::WriteTriangleMeshToGLTF (const std::string &filename, const ccMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
 

Variable Documentation

◆ color_index

long color_index

Definition at line 48 of file TriangleMeshIO.cpp.

◆ color_num

long color_num

Definition at line 49 of file TriangleMeshIO.cpp.

◆ colors

double colors[3]

Definition at line 53 of file TriangleMeshIO.cpp.

Referenced by ccPointCloud::addEigenColors(), ccPointCloud::addRGBColors(), PclUtils::PCLVis::addTextureMesh(), ccMesh::addVertexColors(), vtkScalarBarActorCustom::BuildScalarBarTexture(), Widgets::ColorPushButton::ColorPushButton(), cloudViewer::pipelines::registration::TransformationEstimationForColoredICP::ComputeRMSE(), cloudViewer::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::visualization::rendering::TMeshBuffersBuilder::ConstructBuffers(), vtk2cc::ConvertToPointCloud(), cloudViewer::t::geometry::PointCloud::CreateFromRGBDImage(), PclTools::CreateLine(), PclTools::CreatePolyDataFromLineSet(), define_ccPointCloud(), vtkBoundingRectContextDevice2D::DrawMarkers(), vtkBoundingRectContextDevice2D::DrawPoly(), cloudViewer::t::geometry::kernel::pointcloud::EstimateColorGradientsUsingHybridSearchCPU(), cloudViewer::t::geometry::kernel::pointcloud::EstimateColorGradientsUsingKNNSearchCPU(), cloudViewer::t::geometry::kernel::pointcloud::EstimateColorGradientsUsingRadiusSearchCPU(), cloudViewer::t::geometry::kernel::voxel_grid::ExtractPointCloud(), cloudViewer::t::geometry::VoxelBlockGrid::ExtractPointCloud(), cloudViewer::t::geometry::kernel::voxel_grid::ExtractPointCloudCPU(), cloudViewer::t::geometry::TriangleMesh::FromLegacy(), PclPointCloudColorHandlerLUT< PointT >::getColor(), ccPointCloud::getEigenColors(), PclTools::GetVtkPointsAndLinesFromLineSet(), cc2smReader::getVtkPolyDataAsSM(), cc2smReader::getVtkPolyDataFromMeshCloud(), cc2smReader::getvtkScalars(), ccPointCloud::Grid::init(), IoUtils::newCCMeshFromAIMesh(), PclUtils::context_items::Point::Paint(), PclUtils::context_items::Line::Paint(), PclUtils::context_items::Circle::Paint(), PclUtils::context_items::Disk::Paint(), PclUtils::context_items::Rectangle::Paint(), PclUtils::context_items::FilledRectangle::Paint(), PclUtils::context_items::Points::Paint(), PclUtils::context_items::Polygon::Paint(), PclUtils::context_items::Text::Paint(), PclUtils::context_items::Markers::Paint(), pcl::visualization::context_items::Point::Paint(), pcl::visualization::context_items::Line::Paint(), pcl::visualization::context_items::Circle::Paint(), pcl::visualization::context_items::Disk::Paint(), pcl::visualization::context_items::Rectangle::Paint(), pcl::visualization::context_items::FilledRectangle::Paint(), pcl::visualization::context_items::Points::Paint(), pcl::visualization::context_items::Polygon::Paint(), pcl::visualization::context_items::Text::Paint(), pcl::visualization::context_items::Markers::Paint(), cloudViewer::t::geometry::kernel::pointcloud::Project(), cloudViewer::t::geometry::kernel::pointcloud::ProjectCPU(), cloudViewer::t::io::ReadPCDData(), cloudViewer::io::ReadTriangleMeshFromGLTF(), ccHistogramWindow::refresh(), ccHistogramWindow::refreshBars(), ccHObject::ResizeAndPaintUniformColor(), cloudViewer::t::geometry::kernel::trianglemesh::SamplePointsUniformlyCPU(), ccPointCloud::Grid::setColor(), pcl::visualization::PCLContextItem::setColors(), QCPColoredBars::setData(), ccPointCloud::setEigenColors(), PclTools::SetPolyDataColor(), ccPointCloud::setRGBColor(), ccMesh::setVertexColors(), cloudViewer::visualization::rendering::TLineSetBuffersBuilder::TLineSetBuffersBuilder(), cloudViewer::visualization::rendering::TMeshBuffersBuilder::TMeshBuffersBuilder(), ccPointCloud::Grid::toImage(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::TPointCloudBuffersBuilder(), cloudViewer::t::geometry::kernel::pointcloud::Unproject(), cloudViewer::t::geometry::kernel::pointcloud::UnprojectCPU(), PclUtils::PCLVis::updateShadingMode(), and cloudViewer::t::io::WritePointCloudToPTS().

◆ face

◆ face_index

long face_index

Definition at line 51 of file TriangleMeshIO.cpp.

◆ face_num

long face_num

Definition at line 52 of file TriangleMeshIO.cpp.

◆ mesh_ptr

◆ normal_index

long normal_index

Definition at line 46 of file TriangleMeshIO.cpp.

◆ normal_num

long normal_num

Definition at line 47 of file TriangleMeshIO.cpp.

◆ normals

double normals[3]

Definition at line 54 of file TriangleMeshIO.cpp.

Referenced by PclUtils::PCLVis::addTextureMesh(), ccMesh::addVertexNormals(), NormalEstimation::compute(), MLSSmoothingUpsampling::compute(), ProjectionFilter::compute(), GreedyTriangulation::compute(), MarchingCubeReconstruction::compute(), PoissonReconstruction::compute(), cloudViewer::geometry::Qhull::ComputeConvexHull(), cloudViewer::t::pipelines::kernel::ComputeFPFHFeature(), cloudViewer::t::pipelines::kernel::ComputeFPFHFeatureCPU(), cloudViewer::t::geometry::vtkutils::ComputeNormals(), cloudViewer::t::geometry::kernel::trianglemesh::ComputeTriangleNormalsCPU(), cloudViewer::visualization::rendering::TriangleMeshBuffersBuilder::ConstructBuffers(), cloudViewer::visualization::rendering::PointCloudBuffersBuilder::ConstructBuffers(), cloudViewer::visualization::rendering::TMeshBuffersBuilder::ConstructBuffers(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::ConstructBuffers(), pcl2cc::Convert(), vtk2cc::ConvertToMesh(), vtk2cc::ConvertToPointCloud(), ccMesh::CreateBox(), ccMesh::CreateCone(), ccMesh::CreateCylinder(), ccMesh::CreateFromPointCloudAlphaShape(), ccMesh::CreateIcosahedron(), ccMesh::CreateMobius(), ccMesh::CreateOctahedron(), ccMesh::CreatePlane(), ccMesh::CreateSphere(), ccMesh::CreateTetrahedron(), PclTools::CreateTexturingMesh(), ccMesh::CreateTorus(), ccMesh::DeformAsRigidAsPossible(), qHoughNormals::doAction(), cloudViewer::t::geometry::kernel::pointcloud::EstimateColorGradientsUsingHybridSearchCPU(), cloudViewer::t::geometry::kernel::pointcloud::EstimateColorGradientsUsingKNNSearchCPU(), cloudViewer::t::geometry::kernel::pointcloud::EstimateColorGradientsUsingRadiusSearchCPU(), PCLModules::EstimateLocalReferenceFrame(), cloudViewer::t::geometry::kernel::pointcloud::EstimateNormalsFromCovariancesCPU(), PCLModules::EstimateShot(), cloudViewer::t::geometry::kernel::voxel_grid::ExtractPointCloud(), cloudViewer::t::geometry::VoxelBlockGrid::ExtractPointCloud(), cloudViewer::t::geometry::kernel::voxel_grid::ExtractPointCloudCPU(), cloudViewer::pipelines::integration::ScalableTSDFVolume::ExtractTriangleMesh(), cloudViewer::pipelines::integration::UniformTSDFVolume::ExtractTriangleMesh(), cvSelectionFilter::filterByNormalAngle(), ccMesh::FilterSharpen(), ccMesh::FilterSmoothLaplacian(), ccMesh::FilterSmoothSimple(), ccMesh::FilterSmoothTaubin(), FromFbxMesh(), cloudViewer::t::geometry::TriangleMesh::FromLegacy(), cc2smReader::getAsSM(), PCLModules::GetBoundaryCloud(), cc2smReader::getPointNormals(), PCLModules::GetRegionGrowing(), cc2smReader::getVtkPolyDataAsSM(), cc2smReader::getVtkPolyDataFromMeshCloud(), STLFilter::loadASCIIFile(), STLFilter::loadBinaryFile(), ObjFilter::loadFile(), STLFilter::loadFile(), VTKFilter::loadFile(), main(), cloudViewer::t::geometry::PointCloud::NormalizeNormals(), cloudViewer::t::geometry::kernel::pointcloud::NormalizeNormalsCPU(), cloudViewer::t::geometry::kernel::trianglemesh::NormalizeNormalsCPU(), cloudViewer::t::geometry::PointCloud::OrientNormalsToAlignWithDirection(), cloudViewer::t::geometry::kernel::pointcloud::OrientNormalsToAlignWithDirectionCPU(), cloudViewer::t::geometry::PointCloud::OrientNormalsTowardsCameraLocation(), cloudViewer::t::geometry::kernel::pointcloud::OrientNormalsTowardsCameraLocationCPU(), pc_save(), cloudViewer::io::ReadModelUsingAssimp(), cloudViewer::io::ReadTriangleMeshFromGLTF(), cloudViewer::t::geometry::kernel::transform::RotateNormals(), ccHObject::RotateNormals(), cloudViewer::t::geometry::kernel::transform::RotateNormalsCPU(), BallPivoting::Run(), cloudViewer::t::geometry::kernel::trianglemesh::SamplePointsUniformlyCPU(), ccMesh::SelectByIndex(), PclUtils::PCLVis::setMeshShadingMode(), cloudViewer::io::rpc::SetPointCloud(), cloudViewer::io::rpc::SetTriangleMesh(), ccMesh::setVertexNormals(), cloudViewer::visualization::rendering::TMeshBuffersBuilder::TMeshBuffersBuilder(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::TPointCloudBuffersBuilder(), cloudViewer::t::geometry::kernel::transform::TransformNormals(), ccHObject::TransformNormals(), cloudViewer::t::geometry::kernel::transform::TransformNormalsCPU(), cloudViewer::visualization::rendering::FilamentScene::UpdateGeometry(), and PclUtils::PCLVis::updateShadingMode().

◆ progress_bar

Definition at line 42 of file TriangleMeshIO.cpp.

◆ vertex_index

long vertex_index

Definition at line 44 of file TriangleMeshIO.cpp.

◆ vertex_num

long vertex_num

Definition at line 45 of file TriangleMeshIO.cpp.