ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
TriangleMeshIO.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <AutoIO.h>
11 
12 #include <memory>
13 #include <string>
14 #include <vector>
15 
16 class ccMesh;
17 namespace cloudViewer {
18 namespace io {
19 
22 std::shared_ptr<ccMesh> CreateMeshFromFile(const std::string &filename,
23  bool print_progress = false);
24 
28 bool ReadTriangleMesh(const std::string &filename,
29  ccMesh &mesh,
30  ReadTriangleMeshOptions params = {});
31 
39 bool WriteTriangleMesh(const std::string &filename,
40  const ccMesh &mesh,
41  bool write_ascii = false,
42  bool compressed = false,
43  bool write_vertex_normals = true,
44  bool write_vertex_colors = true,
45  bool write_triangle_uvs = true,
46  bool print_progress = false);
47 
48 // Currently enable_post_processing not used in ReadTriangleMeshFromPLY.
49 bool ReadTriangleMeshFromPLY(const std::string &filename,
50  ccMesh &mesh,
51  const ReadTriangleMeshOptions &params);
52 
53 bool WriteTriangleMeshToPLY(const std::string &filename,
54  const ccMesh &mesh,
55  bool write_ascii,
56  bool compressed,
57  bool write_vertex_normals,
58  bool write_vertex_colors,
59  bool write_triangle_uvs,
60  bool print_progress);
61 
62 bool ReadTriangleMeshFromSTL(const std::string &filename,
63  ccMesh &mesh,
64  bool print_progress);
65 
66 bool WriteTriangleMeshToSTL(const std::string &filename,
67  const ccMesh &mesh,
68  bool write_ascii,
69  bool compressed,
70  bool write_vertex_normals,
71  bool write_vertex_colors,
72  bool write_triangle_uvs,
73  bool print_progress);
74 
75 bool ReadTriangleMeshFromOBJ(const std::string &filename,
76  ccMesh &mesh,
77  const ReadTriangleMeshOptions &params);
78 
79 bool WriteTriangleMeshToOBJ(const std::string &filename,
80  const ccMesh &mesh,
81  bool write_ascii,
82  bool compressed,
83  bool write_vertex_normals,
84  bool write_vertex_colors,
85  bool write_triangle_uvs,
86  bool print_progress);
87 
88 bool ReadTriangleMeshUsingASSIMP(const std::string &filename,
89  ccMesh &mesh,
90  const ReadTriangleMeshOptions &params);
91 
92 // Currently enable_post_processing not used in ReadTriangleMeshFromOFF.
93 bool ReadTriangleMeshFromOFF(const std::string &filename,
94  ccMesh &mesh,
95  const ReadTriangleMeshOptions &params);
96 
97 bool WriteTriangleMeshToOFF(const std::string &filename,
98  const ccMesh &mesh,
99  bool write_ascii,
100  bool compressed,
101  bool write_vertex_normals,
102  bool write_vertex_colors,
103  bool write_triangle_uvs,
104  bool print_progress);
105 
106 // Currently enable_post_processing not used in ReadTriangleMeshFromGLTF.
107 bool ReadTriangleMeshFromGLTF(const std::string &filename,
108  ccMesh &mesh,
109  const ReadTriangleMeshOptions &params);
110 
111 bool WriteTriangleMeshToGLTF(const std::string &filename,
112  const ccMesh &mesh,
113  bool write_ascii,
114  bool compressed,
115  bool write_vertex_normals,
116  bool write_vertex_colors,
117  bool write_triangle_uvs,
118  bool print_progress);
119 
128  std::vector<unsigned int> &indices);
129 
130 } // namespace io
131 } // namespace cloudViewer
cloudViewer::io::ReadFileGeometryTypeOBJ
FileGeometry ReadFileGeometryTypeOBJ(const std::string &path)
Definition: TriangleMeshIO.cpp:724
vertex_index
long vertex_index
Definition: TriangleMeshIO.cpp:44
cloudViewer::io::ReadTriangleMeshFromPLY
bool ReadTriangleMeshFromPLY(const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &params)
Definition: TriangleMeshIO.cpp:382
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
colors
double colors[3]
Definition: TriangleMeshIO.cpp:53
cloudViewer::io::ReadFileGeometryTypeFBX
FileGeometry ReadFileGeometryTypeFBX(const std::string &path)
Definition: TriangleMeshIO.cpp:561
cloudViewer::t::io::WriteTriangleMeshUsingASSIMP
bool WriteTriangleMeshUsingASSIMP(const std::string &filename, const geometry::TriangleMesh &mesh, const bool write_ascii, const bool compressed, const bool write_vertex_normals, const bool write_vertex_colors, const bool write_triangle_uvs, const bool print_progress)
Definition: FileASSIMP.cpp:371
cloudViewer::t::geometry::TriangleMesh::GetVertexNormals
core::Tensor & GetVertexNormals()
Definition: TriangleMesh.h:156
QtCompat::endl
QTextStream & endl(QTextStream &stream)
Definition: QtCompat.h:718
ccMesh::Material::MaterialParameter
Definition: ecvMesh.h:628
cloudViewer::io::IntArrayBase::size
virtual size_t size() const =0
cloudViewer::io::ReadTriangleMeshFromOBJ
bool ReadTriangleMeshFromOBJ(const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &)
Definition: TriangleMeshIO.cpp:728
ccMesh::hasTriNormals
bool hasTriNormals() const override
Returns whether the mesh has per-triangle normals.
Definition: ecvMesh.cpp:3589
filename
std::string filename
Definition: PointCloudIO.cpp:47
cloudViewer::t::io::ReadTriangleMeshUsingASSIMP
bool ReadTriangleMeshUsingASSIMP(const std::string &filename, geometry::TriangleMesh &mesh, const cloudViewer::io::ReadTriangleMeshOptions &params)
Definition: FileASSIMP.cpp:46
cloudViewer::io::ArrayAdapter::elem_count
const size_t elem_count
Definition: TriangleMeshIO.cpp:1309
cloudViewer::t::io::file_extension_to_trianglemesh_write_function
static const std::unordered_map< std::string, std::function< bool(const std::string &, const geometry::TriangleMesh &, const bool, const bool, const bool, const bool, const bool, const bool)> > file_extension_to_trianglemesh_write_function
Definition: TriangleMeshIO.cpp:47
cloudViewer::io::ArrayAdapter
Definition: TriangleMeshIO.cpp:1305
rgb
normal_z rgb
Definition: my_point_types.h:168
cloudViewer::io::WriteTriangleMeshToOBJ
bool 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)
Definition: TriangleMeshIO.cpp:923
ProgressReporters.h
FileSystem.h
cloudViewer::core::Tensor::GetLength
int64_t GetLength() const
Definition: Tensor.h:1125
cloudViewer::core::make_pair
CLOUDVIEWER_HOST_DEVICE Pair< First, Second > make_pair(const First &_first, const Second &_second)
Definition: SlabTraits.h:49
cloudViewer::t::geometry::TriangleMesh::HasTriangleColors
bool HasTriangleColors() const
Definition: TriangleMesh.h:367
x
normal_z x
Definition: my_point_types.h:165
cloudViewer::t::geometry::knot_data
data::KnotMesh knot_data
Definition: TriangleMeshIO.cpp:20
ccPointCloud::getPointColor
const ecvColor::Rgb & getPointColor(unsigned pointIndex) const override
Returns color corresponding to a given point.
Definition: ecvPointCloud.cpp:1535
cloudViewer::t::geometry::TriangleMesh::GetTriangleIndices
core::Tensor & GetTriangleIndices()
Definition: TriangleMesh.h:174
ImageIO.h
ecvColor::RgbTpl::ToEigen
static Eigen::Vector3d ToEigen(const Type col[3])
Definition: ecvColorTypes.h:72
ccMesh::Translate
virtual ccMesh & Translate(const Eigen::Vector3d &translation, bool relative=true) override
Apply translation to the geometry coordinates.
Definition: ecvMesh.cpp:863
cloudViewer::t::geometry::TriangleMesh::SetTriangleColors
void SetTriangleColors(const core::Tensor &value)
Definition: TriangleMesh.h:305
TriangleMeshIO.h
cloudViewer::data::KnotMesh::GetPath
std::string GetPath() const
Path to the KnotMesh.ply file.
Definition: Dataset.h:547
cloudViewer::io::ArrayAdapter::ArrayAdapter
ArrayAdapter(const unsigned char *ptr, size_t count, size_t byte_stride)
Definition: TriangleMeshIO.cpp:1317
cloudViewer::io::IntArray::size
size_t size() const override
Definition: TriangleMeshIO.cpp:1349
ccPointCloud::getEigenNormal
Eigen::Vector3d getEigenNormal(size_t index) const
Definition: ecvPointCloud.cpp:1600
core::Tensor
ccMesh::size
virtual unsigned size() const override
Returns the number of triangles.
Definition: ecvMesh.cpp:2143
cloudViewer::t::geometry::TriangleMesh::SetVertexColors
void SetVertexColors(const core::Tensor &value)
Definition: TriangleMesh.h:268
normal
double normal[3]
Definition: FileIOFactory.cpp:53
cloudViewer::utility::filesystem::GetFileExtensionInLowerCase
std::string GetFileExtensionInLowerCase(const std::string &filename)
Definition: FileSystem.cpp:281
ccMesh::hasTriangleMaterialIds
bool hasTriangleMaterialIds() const
Definition: ecvMesh.h:721
cloudViewer::t::geometry::TriangleMesh::HasVertexNormals
bool HasVertexNormals() const
Definition: TriangleMesh.h:337
ccHObjectCaster::ToPointCloud
static ccPointCloud * ToPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccPointCloud.
Definition: ecvHObjectCaster.cpp:54
ccMesh::Transform
virtual ccMesh & Transform(const Eigen::Matrix4d &transformation) override
Apply transformation (4x4 matrix) to the geometry coordinates.
Definition: ecvMesh.cpp:852
vertex_num
long vertex_num
Definition: TriangleMeshIO.cpp:45
position
math::float3 position
Definition: LineSetBuffers.cpp:44
ccMesh::getTriangleVertIndexes
cloudViewer::VerticesIndexes * getTriangleVertIndexes(unsigned triangleIndex) override
Returns the indexes of the vertices of a given triangle.
Definition: ecvMesh.cpp:2599
cloudViewer::utility::ColorToUint8
Eigen::Vector3uint8 ColorToUint8(const Eigen::Vector3d &color)
Definition: Eigen.cpp:269
cloudViewer::io::AutoWriteMesh
bool AutoWriteMesh(const std::string &filename, const ccMesh &mesh, bool write_ascii=false, bool compressed=false, bool write_vertex_normals=true, bool write_vertex_colors=true, bool write_triangle_uvs=true, bool print_progress=false)
Definition: AutoIO.cpp:314
ccObject::setLocked
virtual void setLocked(bool state)
Sets the "enabled" property.
Definition: ecvObject.h:117
cloudViewer::t::geometry::TriangleMesh::SetVertexAttr
void SetVertexAttr(const std::string &key, const core::Tensor &value)
Definition: TriangleMesh.h:254
cloudViewer::io::AutoReadMesh
bool AutoReadMesh(const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &params={})
Definition: AutoIO.cpp:306
ccPointCloud::reserveThePointsTable
bool reserveThePointsTable(unsigned _numberOfPoints)
Reserves memory to store the points coordinates.
Definition: ecvPointCloud.cpp:1191
cloudViewer::PointCloudTpl::size
unsigned size() const override
Definition: PointCloudTpl.h:38
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
cloudViewer::t::geometry::TriangleMesh::HasTriangleNormals
bool HasTriangleNormals() const
Definition: TriangleMesh.h:360
ccMesh::triangle_material_ids_
std::vector< int > triangle_material_ids_
List of material ids.
Definition: ecvMesh.h:707
ccPointCloud::resizeTheNormsTable
bool resizeTheNormsTable()
Resizes the compressed normals array.
Definition: ecvPointCloud.cpp:1281
cloudViewer::t::io::WriteTriangleMesh
bool WriteTriangleMesh(const std::string &filename, const geometry::TriangleMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
Definition: TriangleMeshIO.cpp:114
ccPointCloud::resizeTheRGBTable
bool resizeTheRGBTable(bool fillWithWhite=false)
Resizes the RGB colors array.
Definition: ecvPointCloud.cpp:1226
Dataset.h
cloudViewer::utility::filesystem::GetFileNameWithoutExtension
std::string GetFileNameWithoutExtension(const std::string &filename)
Definition: FileSystem.cpp:295
cloudViewer::io::ReadTriangleMeshOptions::print_progress
bool print_progress
Definition: AutoIO.h:30
cloudViewer::geometry::TriangleMesh
::ccMesh TriangleMesh
Definition: TriangleMesh.h:19
cloudViewer::t::geometry::Image
The Image class stores image with customizable rows, cols, channels, dtype and device.
Definition: Image.h:29
color
math::float4 color
Definition: LineSetBuffers.cpp:46
ccMesh::hasTriangleUvs
bool hasTriangleUvs() const
Definition: ecvMesh.h:717
cloudViewer::t::geometry::TriangleMesh::GetTriangleNormals
core::Tensor & GetTriangleNormals()
Definition: TriangleMesh.h:178
NumpyIO.h
ccMesh::triangle_uvs_
std::vector< Eigen::Vector2d > triangle_uvs_
List of uv coordinates per triangle.
Definition: ecvMesh.h:625
ccMesh::getVerticeSize
unsigned int getVerticeSize() const
Definition: ecvMesh.cpp:2336
TriangleMeshIO.h
progress_bar
utility::CountingProgressReporter * progress_bar
Definition: TriangleMeshIO.cpp:42
cloudViewer::visualization::rendering::Material::SetTextureMap
void SetTextureMap(const std::string &key, const t::geometry::Image &image)
Definition: Material.cpp:34
ccMesh::getTriangleNorm
Eigen::Vector3d getTriangleNorm(size_t index) const
Definition: ecvMesh.cpp:3474
ccMesh::reserve
bool reserve(std::size_t n)
Reserves the memory to store the vertex indexes (3 per triangle)
Definition: ecvMesh.cpp:2475
cloudViewer::io::IntArray::operator[]
unsigned int operator[](size_t position) const override
Definition: TriangleMeshIO.cpp:1345
ccMesh::getAssociatedCloud
ccGenericPointCloud * getAssociatedCloud() const override
Returns the vertices cloud.
Definition: ecvMesh.h:143
CCVector3
Vector3Tpl< PointCoordinateType > CCVector3
Default 3D Vector.
Definition: CVGeom.h:798
ccMesh::shrinkToFit
void shrinkToFit()
Removes unused capacity.
Definition: ecvMesh.h:302
color_num
long color_num
Definition: TriangleMeshIO.cpp:49
cloudViewer::io::ReadTriangleMesh
bool ReadTriangleMesh(const std::string &filename, ccMesh &mesh, ReadTriangleMeshOptions params)
Definition: TriangleMeshIO.cpp:206
face
std::vector< unsigned int > face
Definition: TriangleMeshIO.cpp:50
cloudViewer::io::IntArrayBase::operator[]
virtual unsigned int operator[](size_t) const =0
cloudViewer::PointCloudTpl::getPointPtr
CCVector3 * getPointPtr(size_t index)
Definition: PointCloudTpl.h:146
cloudViewer::t::geometry::DrawableGeometry::GetMaterial
visualization::rendering::Material & GetMaterial()
Get material associated with this Geometry.
Definition: DrawableGeometry.h:28
cloudViewer::t::geometry::TriangleMesh::GetTriangleColors
core::Tensor & GetTriangleColors()
Definition: TriangleMesh.h:182
cloudViewer::t::geometry::TriangleMesh
A triangle mesh contains vertices and triangles.
Definition: TriangleMesh.h:98
normals
double normals[3]
Definition: TriangleMeshIO.cpp:54
cloudViewer::io::CreateMeshFromFile
std::shared_ptr< ccMesh > CreateMeshFromFile(const std::string &filename, bool print_progress)
Definition: TriangleMeshIO.cpp:192
cloudViewer::t::io::CreateMeshFromFile
std::shared_ptr< geometry::TriangleMesh > CreateMeshFromFile(const std::string &filename, bool print_progress)
Definition: TriangleMeshIO.cpp:52
cloudViewer::io::ReadTriangleMeshUsingASSIMP
bool ReadTriangleMeshUsingASSIMP(const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &params)
Definition: FileASSIMP.cpp:163
cloudViewer::t::geometry::IOReadTensorTriangleMesh
void IOReadTensorTriangleMesh(benchmark::State &state, const std::string &input_file_path)
Definition: TriangleMeshIO.cpp:32
float
float
Definition: my_point_types.h:154
cloudViewer::GenericMesh::hasTriangles
virtual bool hasTriangles() const
Definition: GenericMesh.h:60
NormsIndexesTableType
Array of compressed 3D normals (single index)
Definition: ecvAdvancedTypes.h:21
cloudViewer::t::geometry::TriangleMesh::HasTriangleAttr
bool HasTriangleAttr(const std::string &key) const
Definition: TriangleMesh.h:343
AutoIO.h
cloudViewer::t::geometry::TriangleMesh::SetTriangleAttr
void SetTriangleAttr(const std::string &key, const core::Tensor &value)
Definition: TriangleMesh.h:285
ccDrawableObject::showColors
virtual void showColors(bool state)
Sets colors visibility.
Definition: ecvDrawableObject.h:84
cloudViewer::t::geometry::TriangleMesh::GetVertexColors
core::Tensor & GetVertexColors()
Definition: TriangleMesh.h:152
cloudViewer::io::WriteTriangleMesh
bool 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)
Definition: TriangleMeshIO.cpp:255
cloudViewer::io::AddTrianglesByEarClipping
bool AddTrianglesByEarClipping(ccMesh &mesh, std::vector< unsigned int > &indices)
Definition: TriangleMeshIO.cpp:314
cloudViewer::t::geometry::TriangleMesh::HasVertexColors
bool HasVertexColors() const
Definition: TriangleMesh.h:330
ccMesh::addTriangle
void addTriangle(unsigned i1, unsigned i2, unsigned i3)
Adds a triangle to the mesh.
Definition: ecvMesh.cpp:2428
cloudViewer::io::CONTAINS_TRIANGLES
@ CONTAINS_TRIANGLES
Definition: FileFormatIO.h:19
y
normal_z y
Definition: my_point_types.h:168
ccMesh::hasNormals
bool hasNormals() const override
Returns whether normals are enabled or not.
Definition: ecvMesh.cpp:225
write_ascii
IsAscii write_ascii
Definition: PointCloudIO.cpp:48
cloudViewer::t::io::ReadTriangleMeshFromNPZ
bool ReadTriangleMeshFromNPZ(const std::string &filename, geometry::TriangleMesh &mesh, const cloudViewer::io::ReadTriangleMeshOptions &params)
Definition: TriangleMeshIO.cpp:148
cloudViewer::io::ReadTriangleMeshFromSTL
bool ReadTriangleMeshFromSTL(const std::string &filename, ccMesh &mesh, bool print_progress)
Definition: TriangleMeshIO.cpp:569
cloudViewer::io::ReadTriangleMeshFromGLTF
bool ReadTriangleMeshFromGLTF(const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &params)
Definition: TriangleMeshIO.cpp:1356
cloudViewer::utility::filesystem::GetFileNameWithoutDirectory
std::string GetFileNameWithoutDirectory(const std::string &filename)
Definition: FileSystem.cpp:301
ccMesh::GetMaxBound
virtual Eigen::Vector3d GetMaxBound() const override
Returns max bounds for geometry coordinates.
Definition: ecvMesh.cpp:828
ccMesh::addTriangleNorm
bool addTriangleNorm(const CCVector3 &N)
Definition: ecvMesh.cpp:3513
Vector3Tpl< PointCoordinateType >
compressed
Compressed compressed
Definition: PointCloudIO.cpp:49
ccMesh::getVertexColor
Eigen::Vector3d getVertexColor(size_t index) const
Definition: ecvMesh.cpp:2295
ccMesh::getVertexNormal
Eigen::Vector3d getVertexNormal(size_t index) const
Definition: ecvMesh.cpp:2251
cloudViewer::t::geometry::path
static const std::string path
Definition: PointCloud.cpp:59
cloudViewer::t::geometry::kernel::voxel_grid::index_t
int index_t
Definition: VoxelBlockGrid.h:23
cloudViewer::t::geometry::TriangleMesh::GetVertexAttr
const TensorMap & GetVertexAttr() const
Getter for vertex_attr_ TensorMap. Used in Pybind.
Definition: TriangleMesh.h:133
mesh_ptr
ccMesh * mesh_ptr
Definition: TriangleMeshIO.cpp:43
LogDebug
#define LogDebug(...)
Definition: Logging.h:90
ccMesh::HasVertexNormals
bool HasVertexNormals() const
Definition: ecvMesh.cpp:229
cloudViewer::io::IntArrayBase
Definition: TriangleMeshIO.cpp:1333
cloudViewer::io::ReadTriangleMeshFromOFF
bool ReadTriangleMeshFromOFF(const std::string &filename, ccMesh &mesh, const ReadTriangleMeshOptions &params)
Definition: TriangleMeshIO.cpp:1100
cloudViewer::t::io::WriteTriangleMeshToNPZ
bool WriteTriangleMeshToNPZ(const std::string &filename, const geometry::TriangleMesh &mesh, const bool write_ascii, const bool compressed, const bool write_vertex_normals, const bool write_vertex_colors, const bool write_triangle_uvs, const bool print_progress)
Definition: TriangleMeshIO.cpp:216
cloudViewer::io::WriteImage
bool WriteImage(const std::string &filename, const geometry::Image &image, int quality=kCloudViewerImageIODefaultQuality)
Definition: ImageIO.cpp:139
ecvMesh.h
cloudViewer::io::ReadFileGeometryTypeGLTF
FileGeometry ReadFileGeometryTypeGLTF(const std::string &path)
Definition: TriangleMeshIO.cpp:1352
cloudViewer::io::IntArray::adapter
ArrayAdapter< T > adapter
Definition: TriangleMeshIO.cpp:1342
cloudViewer::t::io::file_extension_to_trianglemesh_read_function
static const std::unordered_map< std::string, std::function< bool(const std::string &, geometry::TriangleMesh &, const cloudViewer::io::ReadTriangleMeshOptions &)> > file_extension_to_trianglemesh_read_function
Definition: TriangleMeshIO.cpp:27
GetNextLine
static QString GetNextLine(QTextStream &stream)
Definition: OFFFilter.cpp:107
ccPointCloud::addEigenColor
void addEigenColor(const Eigen::Vector3d &color)
Definition: ecvPointCloud.cpp:1721
cloudViewer::io::IsPointInsidePolygon
bool IsPointInsidePolygon(const Eigen::MatrixX2d &polygon, double x, double y)
Definition: TriangleMeshIO.cpp:288
cloudViewer::utility::filesystem::FOpen
FILE * FOpen(const std::string &filename, const std::string &mode)
Definition: FileSystem.cpp:609
face_num
long face_num
Definition: TriangleMeshIO.cpp:52
cloudViewer::io::ReadFileGeometryTypeSTL
FileGeometry ReadFileGeometryTypeSTL(const std::string &path)
Definition: TriangleMeshIO.cpp:565
cloudViewer::visualization::rendering::Material::SetScalarProperty
void SetScalarProperty(const std::string &key, float value)
Definition: Material.h:111
knncpp::Vector3i
Eigen::Matrix< Index, 3, 1 > Vector3i
Definition: knncpp.h:30
a
a[190]
Definition: essential_matrix_poly.h:19
image
std::shared_ptr< core::Tensor > image
Definition: FilamentRenderer.cpp:184
cloudViewer::visualization::rendering::Material::SetDefaultProperties
void SetDefaultProperties()
Definition: Material.cpp:16
cloudViewer::t::io::ReadTriangleMesh
bool ReadTriangleMesh(const std::string &filename, geometry::TriangleMesh &mesh, cloudViewer::io::ReadTriangleMeshOptions params)
Definition: TriangleMeshIO.cpp:74
cloudViewer::t::geometry::TriangleMesh::SetVertexPositions
void SetVertexPositions(const core::Tensor &value)
Definition: TriangleMesh.h:261
cloudViewer::utility::filesystem::GetFileParentDirectory
std::string GetFileParentDirectory(const std::string &filename)
Definition: FileSystem.cpp:314
ccPointCloud::addRGBColor
void addRGBColor(const ecvColor::Rgb &C)
Pushes an RGB color on stack.
Definition: ecvPointCloud.cpp:1712
ccMesh::hasEigenTextures
bool hasEigenTextures() const
Returns true if the mesh has texture.
Definition: ecvMesh.h:726
ccMesh::reservePerTriangleNormalIndexes
bool reservePerTriangleNormalIndexes()
Reserves memory to store per-triangle triplets of normal indexes.
Definition: ecvMesh.cpp:3328
cloudViewer::io::WriteTriangleMeshToOFF
bool 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)
Definition: TriangleMeshIO.cpp:1229
cloudViewer::t::geometry::TriangleMesh::SetTriangleNormals
void SetTriangleNormals(const core::Tensor &value)
Definition: TriangleMesh.h:298
face_index
long face_index
Definition: TriangleMeshIO.cpp:51
cloudViewer::io::ArrayAdapter::data_ptr
const unsigned char * data_ptr
Definition: TriangleMeshIO.cpp:1307
cloudViewer::io::ReadTriangleMeshOptions::update_progress
std::function< bool(double)> update_progress
Definition: AutoIO.h:34
ccPointCloud::resize
bool resize(unsigned numberOfPoints) override
Resizes all the active features arrays.
Definition: ecvPointCloud.cpp:1476
ccPointCloud::unallocateNorms
void unallocateNorms()
Erases the cloud normals.
Definition: ecvPointCloud.cpp:1159
cloudViewer::t::geometry::TriangleMesh::HasVertexPositions
bool HasVertexPositions() const
Definition: TriangleMesh.h:323
LogError
#define LogError(...)
Definition: Logging.h:60
cloudViewer::visualization::rendering::Material::SetMaterialName
void SetMaterialName(const std::string &material_name)
Set material name. The material name should match the name of a built.
Definition: Material.h:130
cloudViewer::utility::ConsoleProgressBar
Definition: Logging.h:309
cloudViewer::utility::CountingProgressReporter::SetTotal
void SetTotal(int64_t total)
Definition: ProgressReporters.h:24
ecvHObjectCaster.h
cloudViewer::t::geometry::TriangleMesh::GetTriangleAttr
const TensorMap & GetTriangleAttr() const
Getter for triangle_attr_ TensorMap. Used in Pybind.
Definition: TriangleMesh.h:159
ccMesh::materials_
std::vector< std::pair< std::string, Material > > materials_
Definition: ecvMesh.h:704
cloudViewer::io::CreateImageFromFile
std::shared_ptr< geometry::Image > CreateImageFromFile(const std::string &filename)
Definition: ImageIO.cpp:83
ccPointCloud::addEigenNorm
void addEigenNorm(const Eigen::Vector3d &N)
Definition: ecvPointCloud.cpp:1758
LogInfo
#define LogInfo(...)
Definition: Logging.h:81
count
int count
Definition: FileIOFactory.cpp:132
cloudViewer::t::geometry::TriangleMesh::SetVertexNormals
void SetVertexNormals(const core::Tensor &value)
Definition: TriangleMesh.h:275
uv
math::float2 uv
Definition: PointCloudBuffers.cpp:51
cloudViewer::data::KnotMesh
Data class for KnotMesh contains the KnotMesh.ply file.
Definition: Dataset.h:542
ccMesh::getTriNormsTable
NormsIndexesTableType * getTriNormsTable() const override
Returns per-triangle normals shared array.
Definition: ecvMesh.h:344
cloudViewer::t::io::ReadNpz
std::unordered_map< std::string, core::Tensor > ReadNpz(const std::string &file_name)
Definition: NumpyIO.cpp:675
cloudViewer::io::FileGeometry
FileGeometry
Definition: FileFormatIO.h:15
ccMesh::clear
void clear()
Definition: ecvMesh.cpp:2126
ecvColor::RgbTpl
RGB color structure.
Definition: ecvColorTypes.h:49
cloudViewer::t::io::WriteNpz
void WriteNpz(const std::string &file_name, const std::unordered_map< std::string, core::Tensor > &tensor_map)
Definition: NumpyIO.cpp:759
color_index
long color_index
Definition: TriangleMeshIO.cpp:48
cloudViewer::visualization::rendering::Material::IsValid
bool IsValid() const
Definition: Material.h:54
ccMesh
Triangular mesh.
Definition: ecvMesh.h:35
ccMesh::getVertice
Eigen::Vector3d getVertice(size_t index) const
Definition: ecvMesh.cpp:2213
polygon
boost::geometry::model::polygon< point_xy > polygon
Definition: TreeIso.cpp:37
cloudViewer::t::geometry::TriangleMesh::ToLegacy
ccMesh ToLegacy() const
Convert to a legacy CloudViewer TriangleMesh.
Definition: TriangleMesh.cpp:479
cloudViewer::io::WriteTriangleMeshToPLY
bool 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)
Definition: TriangleMeshIO.cpp:461
Tensor.h
ccMesh::GetMinBound
virtual Eigen::Vector3d GetMinBound() const override
Returns min bounds for geometry coordinates.
Definition: ecvMesh.cpp:820
LogWarning
#define LogWarning(...)
Definition: Logging.h:72
ccMesh::hasColors
bool hasColors() const override
Returns whether colors are enabled or not.
Definition: ecvMesh.cpp:221
cloudViewer::utility::ToUpper
std::string ToUpper(const std::string &s)
Convert string to the upper case.
Definition: Helper.cpp:249
cloudViewer::utility::CountingProgressReporter
Definition: ProgressReporters.h:19
cloudViewer::io::IntArray::IntArray
IntArray(const ArrayAdapter< T > &a)
Definition: TriangleMeshIO.cpp:1344
cloudViewer::io::ReadTriangleMeshOptions
Definition: AutoIO.h:24
cloudViewer::t::geometry::TriangleMesh::HasTriangleIndices
bool HasTriangleIndices() const
Definition: TriangleMesh.h:353
ccPointCloud::setPointNormal
void setPointNormal(size_t pointIndex, const CCVector3 &N)
Sets a particular point normal (shortcut)
Definition: ecvPointCloud.cpp:1681
cloudViewer::io::IntArrayBase::~IntArrayBase
virtual ~IntArrayBase()=default
normal_num
long normal_num
Definition: TriangleMeshIO.cpp:47
cloudViewer::t::geometry::BENCHMARK_CAPTURE
BENCHMARK_CAPTURE(VoxelDownSample, kReductionMean_0_01, core::Device("CPU:0"), 0.01, kReductionMean) -> Unit(benchmark::kMillisecond)
cloudViewer::t::geometry::TriangleMesh::FromLegacy
static geometry::TriangleMesh FromLegacy(const ccMesh &mesh_legacy, core::Dtype float_dtype=core::Float32, core::Dtype int_dtype=core::Int64, const core::Device &device=core::Device("CPU:0"))
Definition: TriangleMesh.cpp:379
ecvColor::RgbTpl::FromEigen
constexpr static RgbTpl FromEigen(const Eigen::Vector3d &t)
Definition: ecvColorTypes.h:86
Tuple3Tpl::u
Type u[3]
Definition: CVGeom.h:139
ccPointCloud::shrinkToFit
void shrinkToFit()
Removes unused capacity.
Definition: ecvPointCloud.h:357
ColorCompType
unsigned char ColorCompType
Default color components type (R,G and B)
Definition: ecvColorTypes.h:29
cloudViewer::io::IntArray
Definition: TriangleMeshIO.cpp:1341
cloudViewer::PointCloudTpl::addEigenPoint
void addEigenPoint(const Eigen::Vector3d &point)
Definition: PointCloudTpl.h:290
cloudViewer::io::ArrayAdapter::stride
const size_t stride
Definition: TriangleMeshIO.cpp:1311
ccHObject::addChild
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
Definition: ecvHObject.cpp:534
cloudViewer::t::geometry::TriangleMesh::SetTriangleIndices
void SetTriangleIndices(const core::Tensor &value)
Set the value of the "indices" attribute in triangle_attr_.
Definition: TriangleMesh.h:291
cloudViewer::t::geometry::TriangleMesh::GetVertexPositions
core::Tensor & GetVertexPositions()
Definition: TriangleMesh.h:148
ccObject::setEnabled
virtual void setEnabled(bool state)
Sets the "enabled" property.
Definition: ecvObject.h:102
patch::to_string
std::string to_string(const T &n)
Definition: Common.h:20
ccPointCloud::setPointColor
void setPointColor(size_t pointIndex, const ecvColor::Rgb &col)
Sets a particular point color.
Definition: ecvPointCloud.cpp:1649
cloudViewer::io::WriteTriangleMeshToSTL
bool 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)
Definition: TriangleMeshIO.cpp:662
cloudViewer::io::ArrayAdapter::operator[]
T operator[](size_t pos) const
Definition: TriangleMeshIO.cpp:1321
ecvPointCloud.h
cloudViewer::utility::StripString
std::string & StripString(std::string &str, const std::string &chars="\t\n\v\f\r ")
Definition: Helper.cpp:238
FileFormatIO.h
cloudViewer::t::geometry::IOReadLegacyTriangleMesh
void IOReadLegacyTriangleMesh(benchmark::State &state, const std::string &input_file_path)
Definition: TriangleMeshIO.cpp:22
cloudViewer::io::ReadFileGeometryTypeOFF
FileGeometry ReadFileGeometryTypeOFF(const std::string &path)
Definition: TriangleMeshIO.cpp:1096
ccMesh::textures_
std::vector< cloudViewer::geometry::Image > textures_
Textures of the image.
Definition: ecvMesh.h:709
ccPointCloud::reserveTheRGBTable
bool reserveTheRGBTable()
Reserves memory to store the RGB colors.
Definition: ecvPointCloud.cpp:1200
normal_index
long normal_index
Definition: TriangleMeshIO.cpp:46
ccMesh::getTriangleVertices
virtual void getTriangleVertices(unsigned triangleIndex, CCVector3 &A, CCVector3 &B, CCVector3 &C) const override
Returns the vertices of a given triangle.
Definition: ecvMesh.cpp:2187
ccMesh::HasVertices
bool HasVertices() const
Definition: ecvMesh.h:208
cloudViewer::io::CONTAINS_POINTS
@ CONTAINS_POINTS
Definition: FileFormatIO.h:17
cloudViewer::io::WriteTriangleMeshToGLTF
bool 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)
Definition: TriangleMeshIO.cpp:1670