 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
18 #include <unordered_map>
19 #include <unordered_set>
48 explicit ccMesh(
const std::vector<Eigen::Vector3d>& vertices,
49 const std::vector<Eigen::Vector3i>& triangles);
69 bool CreateInternalCloud();
89 ccMesh* partialClone(
const std::vector<unsigned>& triangleIndices,
90 int* warnings =
nullptr)
const;
105 static_cast<unsigned int>(vidx1),
106 static_cast<unsigned int>(vidx2));
114 bool updateNormals =
false,
116 unsigned char dim = 2);
128 bool merge(
const ccMesh* mesh,
bool createSubMesh);
144 return m_associatedCloud;
159 bool interpolateColorIfNoTexture)
override;
161 unsigned char vertIndex,
163 bool returnColorIfNoTexture)
override;
167 void forEach(genericTriangleAction action)
override;
171 unsigned triangleIndex)
override;
174 unsigned triangleIndex)
override;
182 double C[3])
const override;
184 unsigned int getVerticeSize()
const;
186 Eigen::Vector3d getVertice(
size_t index)
const;
187 void setVertice(
size_t index,
const Eigen::Vector3d& vertice);
188 void addVertice(
const Eigen::Vector3d& vertice);
189 std::vector<Eigen::Vector3d> getEigenVertices()
const;
190 void addEigenVertices(
const std::vector<Eigen::Vector3d>& vertices);
191 void setEigenVertices(
const std::vector<Eigen::Vector3d>& vertices);
193 Eigen::Vector3d getVertexNormal(
size_t index)
const;
194 void setVertexNormal(
size_t index,
const Eigen::Vector3d&
normal);
195 void addVertexNormal(
const Eigen::Vector3d&
normal);
196 std::vector<Eigen::Vector3d> getVertexNormals()
const;
197 void addVertexNormals(
const std::vector<Eigen::Vector3d>&
normals);
198 void setVertexNormals(
const std::vector<Eigen::Vector3d>&
normals);
200 Eigen::Vector3d getVertexColor(
size_t index)
const;
201 void setVertexColor(
size_t index,
const Eigen::Vector3d&
color);
202 void addVertexColor(
const Eigen::Vector3d&
color);
203 std::vector<Eigen::Vector3d> getVertexColors()
const;
205 void addVertexColors(
const std::vector<Eigen::Vector3d>&
colors);
206 void setVertexColors(
const std::vector<Eigen::Vector3d>&
colors);
210 std::vector<CCVector3>& getVerticesPtr();
211 const std::vector<CCVector3>& getVertices()
const;
213 virtual unsigned size()
const override;
224 unsigned triangleIndex)
const;
229 bool HasVertexNormals()
const;
243 void shiftTriangleIndexes(
unsigned shift);
248 void flipTriangles();
258 void addTriangle(
unsigned i1,
unsigned i2,
unsigned i3);
261 addTriangle(
static_cast<unsigned>(index[0]),
262 static_cast<unsigned>(index[1]),
263 static_cast<unsigned>(index[2]));
265 inline void addTriangles(
const std::vector<Eigen::Vector3i>& triangles) {
266 for (
auto& tri : triangles) {
272 void setTriangles(
const std::vector<Eigen::Vector3i>& triangles);
274 std::vector<Eigen::Vector3i> getTriangles()
const;
277 using triangleIndexesContainer =
280 return m_triVertIndexes;
287 bool reserve(std::size_t n);
288 bool reserveAssociatedCloud(std::size_t n,
289 bool init_color =
false,
290 bool init_normal =
false);
298 bool resize(
size_t n);
299 bool resizeAssociatedCloud(std::size_t n);
305 void shrinkVertexToFit();
318 int& i3)
const override;
326 double Nc[3])
const override;
330 Eigen::Vector3d& Nc)
const override;
332 std::vector<CCVector3*> getTriangleNormalsPtr()
const;
333 Eigen::Vector3d getTriangleNorm(
size_t index)
const;
334 bool setTriangleNorm(
size_t index,
const Eigen::Vector3d& triangle_normal);
335 bool setTriangleNormalIndexes(
size_t triangleIndex,
338 bool addTriangleNorm(
const CCVector3& N);
339 bool addTriangleNorm(
const Eigen::Vector3d& N);
340 std::vector<Eigen::Vector3d> getTriangleNorms()
const;
341 bool setTriangleNorms(
const std::vector<Eigen::Vector3d>& triangle_normals);
342 bool addTriangleNorms(
const std::vector<Eigen::Vector3d>& triangle_normals);
350 bool autoReleaseOldTable =
true);
366 bool arePerTriangleNormalsEnabled()
const;
378 bool reservePerTriangleNormalIndexes();
387 void addTriangleNormalIndexes(
int i1,
int i2,
int i3);
395 void setTriangleNormalIndexes(
unsigned triangleIndex,
401 void removePerTriangleNormalIndexes();
404 void invertPerTriangleNormals();
418 bool convertMaterialsToVertexColors();
422 return m_triMtlIndexes && m_triMtlIndexes->isAllocated();
435 bool reservePerTriangleMtlIndexes();
438 void removePerTriangleMtlIndexes();
444 void addTriangleMtlIndex(
int mtlIndex);
451 bool autoReleaseOldTable =
true);
456 return m_triMtlIndexes;
464 void setTriangleMtlIndex(
unsigned triangleIndex,
int mtlIndex);
468 bool autoReleaseOldMaterialSet =
true);
485 return m_texCoordIndexes && m_texCoordIndexes->isAllocated();
490 int& i3)
const override;
494 bool autoReleaseOldTable =
true);
506 bool reservePerTriangleTexCoordIndexes();
509 void removePerTriangleTexCoordIndexes();
518 void addTriangleTexCoordIndexes(
int i1,
int i2,
int i3);
526 void setTriangleTexCoordIndexes(
unsigned triangleIndex,
538 bool computePerVertexNormals();
541 bool computePerTriangleNormals();
548 bool laplacianSmooth(
549 unsigned nbIteration = 100,
569 bool processScalarField(MESH_SCALAR_FIELD_PROCESS process);
595 ccMesh* createNewMeshFromSelection(
596 bool removeSelectedTriangles,
597 std::vector<int>* newIndexesOfRemainingTriangles =
nullptr,
598 bool withChildEntities =
false);
604 void swapTriangles(
unsigned index1,
unsigned index2);
606 void removeTriangles(
size_t index);
609 void transformTriNormals(
const ccGLMatrix& trans);
612 static const unsigned char DefaultMergeDulicateVerticesLevel = 10;
615 bool mergeDuplicatedVertices(
616 unsigned char octreeLevel = DefaultMergeDulicateVerticesLevel,
617 QWidget* parentWidget =
nullptr);
672 return {r, g, b, 1.f};
675 float r()
const {
return f4[0]; }
676 float g()
const {
return f4[1]; }
677 float b()
const {
return f4[2]; }
678 float a()
const {
return f4[3]; }
682 float baseMetallic = 0.f;
683 float baseRoughness = 1.f;
684 float baseReflectance = 0.5f;
685 float baseClearCoat = 0.f;
686 float baseClearCoatRoughness = 0.f;
687 float baseAnisotropy = 0.f;
689 std::shared_ptr<cloudViewer::geometry::Image>
albedo;
690 std::shared_ptr<cloudViewer::geometry::Image>
normalMap;
692 std::shared_ptr<cloudViewer::geometry::Image>
metallic;
693 std::shared_ptr<cloudViewer::geometry::Image>
roughness;
695 std::shared_ptr<cloudViewer::geometry::Image>
clearCoat;
700 std::unordered_map<std::string, cloudViewer::geometry::Image>
713 return getVerticeSize() > 0 &&
714 adjacency_list_.size() == getVerticeSize();
727 bool is_all_texture_valid = std::accumulate(
728 textures_.begin(), textures_.end(),
true,
730 return a && !b.IsEmpty();
732 return !textures_.empty() && is_all_texture_valid;
735 inline virtual bool IsEmpty()
const override {
739 virtual Eigen::Vector3d
GetMinBound()
const override;
740 virtual Eigen::Vector3d
GetMaxBound()
const override;
741 virtual Eigen::Vector3d
GetCenter()
const override;
744 virtual ccMesh&
Transform(
const Eigen::Matrix4d& transformation)
override;
746 bool relative =
true)
override;
748 const Eigen::Vector3d& center)
override;
750 const Eigen::Vector3d& center)
override;
755 ccMesh& PaintUniformColor(
const Eigen::Vector3d&
color);
757 std::tuple<std::shared_ptr<ccMesh>, std::vector<size_t>> ComputeConvexHull()
771 ComputeEdgeWeightsCot(
772 const std::unordered_map<
777 double min_weight = std::numeric_limits<double>::lowest())
const;
781 ccMesh& ComputeTriangleNormals(
bool normalized =
true);
785 ccMesh& ComputeVertexNormals(
bool normalized =
true);
789 ccMesh& NormalizeNormals();
792 ccMesh& ComputeAdjacencyList();
796 ccMesh& RemoveDuplicatedVertices();
801 ccMesh& RemoveDuplicatedTriangles();
805 ccMesh& RemoveUnreferencedVertices();
811 ccMesh& RemoveDegenerateTriangles();
817 ccMesh& RemoveNonManifoldEdges();
825 ccMesh& MergeCloseVertices(
double eps);
836 std::shared_ptr<ccMesh> FilterSharpen(
837 int number_of_iterations,
839 FilterScope scope = FilterScope::All)
const;
849 std::shared_ptr<ccMesh> FilterSmoothSimple(
850 int number_of_iterations,
851 FilterScope scope = FilterScope::All)
const;
863 std::shared_ptr<ccMesh> FilterSmoothLaplacian(
864 int number_of_iterations,
866 FilterScope scope = FilterScope::All)
const;
878 std::shared_ptr<ccMesh> FilterSmoothTaubin(
879 int number_of_iterations,
882 FilterScope scope = FilterScope::All)
const;
887 int EulerPoincareCharacteristic()
const;
892 std::vector<Eigen::Vector2i> GetNonManifoldEdges(
893 bool allow_boundary_edges =
true)
const;
899 bool IsEdgeManifold(
bool allow_boundary_edges =
true)
const;
904 std::vector<int> GetNonManifoldVertices()
const;
909 bool IsVertexManifold()
const;
913 std::vector<Eigen::Vector2i> GetSelfIntersectingTriangles()
const;
917 bool IsSelfIntersecting()
const;
921 bool IsBoundingBoxIntersecting(
const ccMesh& other)
const;
925 bool IsIntersecting(
const ccMesh& other)
const;
930 bool IsOrientable()
const;
935 bool IsWatertight()
const;
940 bool OrientTriangles();
954 GetEdgeToVerticesMap()
const;
958 double GetTriangleArea(
size_t triangle_idx)
const;
961 static double ComputeTriangleArea(
const Eigen::Vector3d& p0,
962 const Eigen::Vector3d& p1,
963 const Eigen::Vector3d& p2);
982 double GetSurfaceArea()
const;
986 double GetSurfaceArea(std::vector<double>& triangle_areas)
const;
991 double GetVolume()
const;
996 static Eigen::Vector4d ComputeTrianglePlane(
const Eigen::Vector3d& p0,
997 const Eigen::Vector3d& p1,
998 const Eigen::Vector3d& p2);
1002 Eigen::Vector4d GetTrianglePlane(
size_t triangle_idx)
const;
1006 return Eigen::Vector2i(std::min(vidx0, vidx1), std::max(vidx0, vidx1));
1011 std::shared_ptr<ccPointCloud> SamplePointsUniformlyImpl(
1012 size_t number_of_points,
1013 std::vector<double>& triangle_areas,
1014 double surface_area,
1015 bool use_triangle_normal,
1025 std::shared_ptr<ccPointCloud> SamplePointsUniformly(
1026 size_t number_of_points,
1027 bool use_triangle_normal =
false,
1041 std::shared_ptr<ccPointCloud> SamplePointsPoissonDisk(
1042 size_t number_of_points,
1043 double init_factor = 5,
1044 const std::shared_ptr<ccPointCloud> pcl_init =
nullptr,
1045 bool use_triangle_normal =
false,
1053 std::shared_ptr<ccMesh> SubdivideMidpoint(
int number_of_iterations)
const;
1060 std::shared_ptr<ccMesh> SubdivideLoop(
int number_of_iterations)
const;
1068 std::shared_ptr<ccMesh> SimplifyVertexClustering(
1070 SimplificationContraction contraction =
1071 SimplificationContraction::Average)
const;
1080 std::shared_ptr<ccMesh> SimplifyQuadricDecimation(
1081 int target_number_of_triangles,
1082 double maximum_error = std::numeric_limits<double>::infinity(),
1083 double boundary_weight = 1.0)
const;
1094 std::shared_ptr<ccMesh>
SelectByIndex(
const std::vector<size_t>& indices,
1095 bool cleanup =
true)
const;
1101 std::shared_ptr<ccMesh> Crop(
const ccBBox& bbox)
const;
1115 std::tuple<std::vector<int>, std::vector<size_t>, std::vector<double>>
1116 ClusterConnectedTriangles()
const;
1124 void RemoveTrianglesByIndex(
const std::vector<size_t>& triangle_indices);
1132 void RemoveTrianglesByMask(
const std::vector<bool>& triangle_mask);
1140 void RemoveVerticesByIndex(
const std::vector<size_t>& vertex_indices);
1148 void RemoveVerticesByMask(
const std::vector<bool>& vertex_mask);
1163 std::shared_ptr<ccMesh> DeformAsRigidAsPossible(
1164 const std::vector<int>& constraint_vertex_indices,
1165 const std::vector<Eigen::Vector3d>& constraint_vertex_positions,
1167 DeformAsRigidAsPossibleEnergy energy =
1168 DeformAsRigidAsPossibleEnergy::Spokes,
1169 double smoothed_alpha = 0.01)
const;
1182 static std::shared_ptr<ccMesh> CreateFromPointCloudAlphaShape(
1185 std::shared_ptr<cloudViewer::geometry::TetraMesh> tetra_mesh =
1187 std::vector<size_t>* pt_map =
nullptr);
1201 static std::shared_ptr<ccMesh> CreateFromPointCloudBallPivoting(
1240 static std::tuple<std::shared_ptr<ccMesh>, std::vector<double>>
1245 bool linear_fit =
false,
1246 float point_weight = 2.f,
1247 float samples_per_node = 1.5f,
1248 int boundary_type = 2 ,
1249 int n_threads = -1);
1256 static std::shared_ptr<ccMesh> CreateTetrahedron(
1257 double radius = 1.0,
bool create_uv_map =
false);
1264 static std::shared_ptr<ccMesh> CreateOctahedron(
double radius = 1.0,
1265 bool create_uv_map =
false);
1271 static std::shared_ptr<ccMesh> CreateIcosahedron(
1272 double radius = 1.0,
bool create_uv_map =
false);
1281 bool create_uv_map =
false);
1291 static std::shared_ptr<ccMesh> CreateBox(
1295 bool create_uv_map =
false,
1296 bool map_texture_to_each_face =
false);
1308 static std::shared_ptr<ccMesh> CreateSphere(
double radius = 1.0,
1309 int resolution = 20,
1310 bool create_uv_map =
false);
1323 static std::shared_ptr<ccMesh> CreateCylinder(
double radius = 1.0,
1325 int resolution = 20,
1327 bool create_uv_map =
false);
1339 static std::shared_ptr<ccMesh> CreateCone(
double radius = 1.0,
1341 int resolution = 20,
1343 bool create_uv_map =
false);
1355 static std::shared_ptr<ccMesh> CreateTorus(
double torus_radius = 1.0,
1356 double tube_radius = 0.5,
1357 int radial_resolution = 30,
1358 int tubular_resolution = 20);
1380 static std::shared_ptr<ccMesh> CreateArrow(
double cylinder_radius = 1.0,
1381 double cone_radius = 1.5,
1382 double cylinder_height = 5.0,
1383 double cone_height = 4.0,
1384 int resolution = 20,
1385 int cylinder_split = 4,
1386 int cone_split = 1);
1393 static std::shared_ptr<ccMesh> CreateCoordinateFrame(
1395 const Eigen::Vector3d&
origin = Eigen::Vector3d(0.0, 0.0, 0.0));
1407 static std::shared_ptr<ccMesh> CreateMobius(
int length_split = 70,
1408 int width_split = 15,
1411 double flatness = 1,
1416 void FilterSmoothLaplacianHelper(
1417 std::shared_ptr<ccMesh>& mesh,
1418 const std::vector<CCVector3>& prev_vertices,
1419 const std::vector<CCVector3>& prev_vertex_normals,
1421 const std::vector<std::unordered_set<int>>& adjacency_list,
1425 bool filter_color)
const;
1430 bool toFile_MeOnly(QFile& out,
short dataVersion)
const override;
1435 LoadedIDMap& oldToNewIDMap)
override;
1451 const Tuple3i* triNormIndexes =
nullptr);
1459 bool pushSubdivide(
unsigned indexA,
1466 #define ccMesh_extended_call0(baseName, recursiveName) \
1467 inline virtual void recursiveName() { \
1469 for (Container::iterator it = m_children.begin(); \
1470 it != m_children.end(); ++it) \
1471 if ((*it)->isA(CV_TYPES::SUB_MESH)) \
1472 static_cast<ccGenericMesh*>(*it)->baseName(); \
1476 #define ccMesh_extended_call1(baseName, param1Type, recursiveName) \
1477 inline virtual void recursiveName(param1Type p) { \
1479 for (Container::iterator it = m_children.begin(); \
1480 it != m_children.end(); ++it) \
1481 if ((*it)->isA(CV_TYPES::SUB_MESH)) \
1482 static_cast<ccGenericMesh*>(*it)->baseName(p); \
1505 unsigned m_globalIterator;
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
double colors[3]
Definition: TriangleMeshIO.cpp:53
virtual bool materialsShown() const
Sets whether textures/material should be displayed or not.
Definition: ecvGenericMesh.h:198
2D texture coordinates
Definition: ecvAdvancedTypes.h:138
bool hasAdjacencyList() const
Returns true if the mesh contains adjacency normals.
Definition: ecvMesh.h:712
CV_CLASS_ENUM getClassID() const override
Returns class ID.
Definition: ecvMesh.h:63
Definition: ecvMesh.h:628
static Eigen::Vector2i GetOrderedEdge(int vidx0, int vidx1)
Helper function to get an edge with ordered vertex indices.
Definition: ecvMesh.h:1005
std::shared_ptr< cloudViewer::geometry::Image > reflectance
Definition: ecvMesh.h:694
virtual void getTriangleTexCoordinatesIndexes(unsigned triangleIndex, int &i1, int &i2, int &i3) const =0
Returns the triplet of tex coords indexes for a given triangle.
virtual bool getTriangleNormals(unsigned triangleIndex, CCVector3 &Na, CCVector3 &Nb, CCVector3 &Nc) const =0
Returns a given triangle normal.
virtual void onUpdateOf(ccHObject *obj)
This method is called when another object (geometry) is updated.
Definition: ecvHObject.h:706
virtual unsigned size() const =0
Returns the number of triangles.
virtual bool normalsShown() const
Returns whether normals are shown or not.
Definition: ecvDrawableObject.h:91
Eigen::Matrix< Index, 2, 1 > Vector2i
Definition: knncpp.h:29
virtual bool hasTriNormals() const =0
Returns whether the mesh has per-triangle normals.
virtual int getTriangleMtlIndex(unsigned triangleIndex) const =0
Returns a given triangle material indexes.
virtual void computeInterpolationWeights(unsigned triIndex, const CCVector3 &P, CCVector3d &weights) const
Returns the (barycentric) interpolation weights for a given triangle.
Definition: ecvGenericMesh.cpp:476
Triangle described by the indexes of its 3 vertices.
Definition: GenericIndexedMesh.h:16
virtual void applyGLTransformation(const ccGLMatrix &trans)
Applies a GL transformation to the entity.
Definition: ecvHObject.cpp:944
double normal[3]
Definition: FileIOFactory.cpp:53
bool hasTriangleMaterialIds() const
Definition: ecvMesh.h:721
float g() const
Definition: ecvMesh.h:676
void SelectByIndex(benchmark::State &state, bool remove_duplicates, const core::Device &device)
Definition: PointCloud.cpp:149
void addTriangles(const std::vector< Eigen::Vector3i > &triangles)
Definition: ecvMesh.h:265
@ MESH
Definition: CVTypes.h:105
triangleIndexesContainer * getTrianglesPtr() const
Definition: ecvMesh.h:279
std::shared_ptr< cloudViewer::geometry::Image > ambientOcclusion
Definition: ecvMesh.h:691
MaterialParameter(const float v1, const float v2, const float v3)
Definition: ecvMesh.h:648
Bounding box structure.
Definition: ecvBBox.h:25
@ ENHANCE_MESH_SF
Definition: ecvMesh.h:556
virtual void getTexCoordinates(unsigned index, TexCoords2D *&tx) const =0
virtual void onDeletionOf(const ccHObject *obj)
This method is called when another object is deleted.
Definition: ecvHObject.cpp:519
MaterialParameter()
Definition: ecvMesh.h:631
virtual Eigen::Vector3d GetCenter() const
Returns the center of the geometry coordinates.
Definition: ecvHObject.h:150
bool HasTriangleNormals() const
Definition: ecvMesh.h:314
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
std::vector< int > triangle_material_ids_
List of material ids.
Definition: ecvMesh.h:707
static Eigen::Vector3i GetEigneOrderedTriangle(int vidx0, int vidx1, int vidx2)
Definition: ecvMesh.h:965
virtual void getTriangleTexCoordinates(unsigned triIndex, TexCoords2D *&tx1, TexCoords2D *&tx2, TexCoords2D *&tx3) const =0
Returns per-triangle texture coordinates (pointer to)
MaterialParameter(const float v1)
Definition: ecvMesh.h:662
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
Definition: ecvGenericMesh.cpp:253
math::float4 color
Definition: LineSetBuffers.cpp:46
bool hasTriangleUvs() const
Definition: ecvMesh.h:717
std::shared_ptr< cloudViewer::geometry::Image > roughness
Definition: ecvMesh.h:693
virtual bool hasTextures() const =0
Returns whether textures are available for this mesh.
std::vector< Eigen::Vector2d > triangle_uvs_
List of uv coordinates per triangle.
Definition: ecvMesh.h:625
virtual bool hasMaterials() const =0
ccGenericPointCloud * getAssociatedCloud() const override
Returns the vertices cloud.
Definition: ecvMesh.h:143
virtual ccHObject & Rotate(const Eigen::Matrix3d &R, const Eigen::Vector3d ¢er)
Apply rotation to the geometry coordinates and normals. Given a rotation matrix , and center ,...
Definition: ecvHObject.h:186
void shrinkToFit()
Removes unused capacity.
Definition: ecvMesh.h:302
void toggleMaterials() override
Toggles material display state.
Definition: ecvMesh.h:233
virtual bool hasScalarFields() const
Returns whether one or more scalar fields are instantiated.
Definition: ecvDrawableObject.h:105
virtual bool hasNormals() const
Returns whether normals are enabled or not.
Definition: ecvDrawableObject.h:89
bool normalsAvailable() const override
Returns whether normals are available.
Definition: ecvMesh.h:215
MaterialParameter(const float v1, const float v2, const float v3, const float v4)
Definition: ecvMesh.h:638
double normals[3]
Definition: TriangleMeshIO.cpp:54
int width
Definition: FileIOFactory.cpp:142
virtual bool hasTriangles() const
Definition: GenericMesh.h:60
Array of compressed 3D normals (single index)
Definition: ecvAdvancedTypes.h:21
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Definition: CVTypes.h:97
ImGuiContext * context
Definition: Window.cpp:76
virtual void getTriangleVertices(unsigned triangleIndex, CCVector3 &A, CCVector3 &B, CCVector3 &C) const =0
Returns the vertices of a given triangle.
int size
Definition: FileIOFactory.cpp:130
Shareable array that can be properly inserted in the DB tree.
Definition: ecvArray.h:21
int height
Definition: FileIOFactory.cpp:143
virtual bool interpolateNormalsBC(unsigned triIndex, const CCVector3d &w, CCVector3 &N)=0
Interpolates normal(s) inside a given triangle.
virtual void forEach(genericTriangleAction action)=0
Fast iteration mechanism.
A 3D cloud interface with associated features (color, normals, octree, etc.)
Definition: ecvGenericPointCloud.h:45
std::shared_ptr< cloudViewer::geometry::Image > anisotropy
Definition: ecvMesh.h:697
virtual ecvOrientedBBox GetOrientedBoundingBox() const
Definition: ecvHObject.cpp:449
bool hasPerTriangleMtlIndexes() const
Returns whether this mesh as per-triangle material index.
Definition: ecvMesh.h:421
virtual VerticesIndexes * getNextTriangleVertIndexes()=0
std::shared_ptr< cloudViewer::geometry::Image > clearCoat
Definition: ecvMesh.h:695
std::shared_ptr< cloudViewer::geometry::Image > albedo
Definition: ecvMesh.h:689
void addTriangle(const Eigen::Vector3i &index)
Definition: ecvMesh.h:260
std::unordered_map< std::string, cloudViewer::geometry::Image > additionalMaps
Definition: ecvMesh.h:701
virtual GenericTriangle * _getNextTriangle()=0
Returns the next triangle (relatively to the global iterator position)
virtual void placeIteratorAtBeginning()=0
Places the mesh iterator at the beginning.
void swap(cloudViewer::core::SmallVectorImpl< T > &LHS, cloudViewer::core::SmallVectorImpl< T > &RHS)
Implement std::swap in terms of SmallVector swap.
Definition: SmallVector.h:1370
virtual bool interpolateNormals(unsigned triIndex, const CCVector3 &P, CCVector3 &N)
Interpolates normal(s) inside a given triangle.
Definition: GenericIndexedMesh.h:89
static MaterialParameter CreateRGB(const float r, const float g, const float b)
Definition: ecvMesh.h:669
std::shared_ptr< cloudViewer::geometry::Image > normalMap
Definition: ecvMesh.h:690
std::shared_ptr< cloudViewer::geometry::Image > metallic
Definition: ecvMesh.h:692
bool hasPerTriangleTexCoordIndexes() const override
Returns whether this mesh as per-triangle triplets of tex coords indexes.
Definition: ecvMesh.h:484
float a() const
Definition: ecvMesh.h:678
virtual bool hasDisplayedScalarField() const
Returns whether an active scalar field is available or not.
Definition: ecvDrawableObject.h:99
Tensor operator+(T scalar_lhs, const Tensor &rhs)
Definition: Tensor.h:1417
Graphical progress indicator (thread-safe)
Definition: ecvProgressDialog.h:27
unsigned int CompressedNormType
Compressed normals type.
Definition: ecvBasicTypes.h:16
short minimumFileVersion_MeOnly() const override
Definition: ecvGenericMesh.cpp:289
virtual Eigen::Vector3d GetMaxBound() const
Returns max bounds for geometry coordinates.
Definition: ecvHObject.h:147
Generic mesh interface.
Definition: ecvGenericMesh.h:28
Array of 2D texture coordinates.
Definition: ecvAdvancedTypes.h:151
Eigen::Matrix< Index, 3, 1 > Vector3i
Definition: knncpp.h:30
a[190]
Definition: essential_matrix_poly.h:19
#define ccMesh_extended_call1(baseName, param1Type, recursiveName)
Definition: ecvMesh.h:1476
virtual ccHObject & Transform(const Eigen::Matrix4d &transformation)
Apply transformation (4x4 matrix) to the geometry coordinates.
Definition: ecvHObject.h:157
static std::unordered_map< Edge< T >, std::vector< size_t >, utility::hash_tuple< Edge< T > > > GetEdgeToTrianglesMap(const core::Tensor &tris_cpu)
Definition: TriangleMesh.cpp:1680
A generic mesh with index-based vertex access.
Definition: GenericIndexedMesh.h:37
bool hasEigenTextures() const
Returns true if the mesh has texture.
Definition: ecvMesh.h:726
float b() const
Definition: ecvMesh.h:677
virtual bool interpolateColors(unsigned triIndex, const CCVector3 &P, ecvColor::Rgb &C)=0
Interpolates RGB colors inside a given triangle.
bool invertNormals(const ccHObject::Container &selectedEntities)
Definition: ecvEntityAction.cpp:1818
Definition: ecvMesh.h:627
virtual unsigned getUniqueIDForDisplay() const
Returns object unqiue ID used for display.
Definition: ecvHObject.h:626
Eigen::Vector3d origin
Definition: VoxelGridIO.cpp:26
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
Definition: ecvGenericMesh.cpp:294
bool isSerializable() const override
Returns whether object is serializable of not.
Definition: ecvMesh.h:139
virtual VerticesIndexes * getTriangleVertIndexes(unsigned triangleIndex)=0
Returns the indexes of the vertices of a given triangle.
const ccMaterialSet * getMaterialSet() const override
Definition: ecvMesh.h:412
virtual void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax)=0
Returns the mesh bounding-box.
virtual void refreshBB()=0
Forces bounding-box update.
std::vector< std::pair< std::string, Material > > materials_
Definition: ecvMesh.h:704
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
MESH_SCALAR_FIELD_PROCESS
Mesh scalar field processes.
Definition: ecvMesh.h:554
virtual GenericTriangle * _getTriangle(unsigned triangleIndex)=0
Returns the ith triangle.
FN_SPECIFIERS void operator+=(MiniVec< T, N > &a, const MiniVec< T, N > &b)
Definition: MiniVec.h:150
MaterialParameter(const float v1, const float v2)
Definition: ecvMesh.h:655
virtual void showMaterials(bool state)
Sets whether textures should be displayed or not.
Definition: ecvGenericMesh.h:201
virtual ccBBox GetAxisAlignedBoundingBox() const
Returns an axis-aligned bounding box of the geometry.
Definition: ecvHObject.cpp:447
NormsIndexesTableType * getTriNormsTable() const override
Returns per-triangle normals shared array.
Definition: ecvMesh.h:344
static cloudViewer::VerticesIndexes GetOrderedTriangle(int vidx0, int vidx1, int vidx2)
Definition: ecvMesh.h:92
MaterialParameter baseColor
Definition: ecvMesh.h:681
RGB color structure.
Definition: ecvColorTypes.h:49
TextureCoordsContainer * getTexCoordinatesTable() const override
Returns per-triangle texture coordinates array.
Definition: ecvMesh.h:476
Triangular mesh.
Definition: ecvMesh.h:35
@ SMOOTH_MESH_SF
Definition: ecvMesh.h:555
virtual Eigen::Vector3d GetMinBound() const
Returns min bounds for geometry coordinates.
Definition: ecvHObject.h:144
Definition: ecvOrientedBBox.h:29
virtual bool hasColors() const
Returns whether colors are enabled or not.
Definition: ecvDrawableObject.h:80
Mesh (triangle) material.
Definition: ecvMaterialSet.h:16
virtual unsigned capacity() const =0
Returns max capacity.
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
virtual ccBBox getOwnBB(bool withGLFeatures=false)
Returns the entity's own bounding-box.
Definition: ecvHObject.cpp:757
std::shared_ptr< cloudViewer::geometry::Image > clearCoatRoughness
Definition: ecvMesh.h:696
virtual bool IsEmpty() const override
Definition: ecvMesh.h:735
virtual void getTriangleNormalIndexes(unsigned triangleIndex, int &i1, int &i2, int &i3) const =0
Returns a triplet of normal indexes for a given triangle (if any)
#define CV_DB_LIB_API
Definition: CV_db.h:15
Display context.
Definition: ecvDrawContext.h:365
virtual ccHObject & Translate(const Eigen::Vector3d &translation, bool relative=true)
Apply translation to the geometry coordinates.
Definition: ecvHObject.h:165
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
std::vector< std::unordered_set< int > > adjacency_list_
Definition: ecvMesh.h:622
virtual const ccGLMatrix & getGLTransformationHistory() const
Returns the transformation 'history' matrix.
Definition: ecvHObject.h:631
virtual bool getColorFromMaterial(unsigned triIndex, const CCVector3 &P, ecvColor::Rgb &C, bool interpolateColorIfNoTexture)=0
virtual ccHObject & Scale(const double s, const Eigen::Vector3d ¢er)
Apply scaling to the geometry coordinates. Given a scaling factor , and center , a given point is tr...
Definition: ecvHObject.h:176
void drawMeOnly(CC_DRAW_CONTEXT &context) override
Enables (OpenGL) stipple mask.
Definition: ecvGenericMesh.cpp:138
virtual bool getVertexColorFromMaterial(unsigned triIndex, unsigned char vertIndex, ecvColor::Rgb &C, bool returnColorIfNoTexture)=0
bool computeNormals(const ccHObject::Container &selectedEntities, QWidget *parent)
Definition: ecvEntityAction.cpp:1570
std::unordered_map< std::string, MaterialParameter > floatParameters
Definition: ecvMesh.h:699
TRIANGULATION_TYPES
Triangulation types.
Definition: PointProjectionTools.h:22
char type
Definition: FileIOFactory.cpp:131
A generic triangle interface.
Definition: GenericTriangle.h:18
const triangleMaterialIndexesSet * getTriangleMtlIndexesTable() const
Returns the per-triangle material indexes array.
Definition: ecvMesh.h:454
The Image class stores image with customizable width, height, num of channels and bytes per channel.
Definition: Image.h:33
double voxel_size
Definition: VoxelGridIO.cpp:28
std::vector< cloudViewer::geometry::Image > textures_
Textures of the image.
Definition: ecvMesh.h:709
Array of RGB colors for each point.
Definition: ecvAdvancedTypes.h:82
void clearTriNormals()
Removes per-triangle normals.
Definition: ecvMesh.h:353
Colored polyline.
Definition: ecvPolyline.h:23
float r() const
Definition: ecvMesh.h:675
bool HasVertices() const
Definition: ecvMesh.h:208