![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Triangular mesh. More...
#include <ecvMesh.h>


Classes | |
| struct | Material |
Public Types | |
| enum | MESH_SCALAR_FIELD_PROCESS { SMOOTH_MESH_SF , ENHANCE_MESH_SF } |
| Mesh scalar field processes. More... | |
| using | triangleIndexesContainer = ccArray< cloudViewer::VerticesIndexes, 3, unsigned > |
| Container of per-triangle vertices indexes (3) More... | |
| using | triangleMaterialIndexesSet = ccArray< int, 1, int > |
| Container of per-triangle material descriptors. More... | |
Public Types inherited from cloudViewer::GenericMesh | |
| enum class | SimplificationContraction { Average , Quadric } |
| Indicates the method that is used for mesh simplification if multiple vertices are combined to a single one. More... | |
| enum class | FilterScope { All , Color , Normal , Vertex } |
| Indicates the scope of filter operations. More... | |
| enum class | DeformAsRigidAsPossibleEnergy { Spokes , Smoothed } |
| using | genericTriangleAction = std::function< void(GenericTriangle &)> |
| Generic function to apply to a triangle (used by foreach) More... | |
Public Types inherited from ccHObject | |
| enum | DEPENDENCY_FLAGS { DP_NONE = 0 , DP_NOTIFY_OTHER_ON_DELETE = 1 , DP_NOTIFY_OTHER_ON_UPDATE , DP_DELETE_OTHER = 8 , DP_PARENT_OF_OTHER = 24 } |
| Dependency flags. More... | |
| enum | SelectionBehavior { SELECTION_AA_BBOX , SELECTION_FIT_BBOX , SELECTION_IGNORED } |
| Behavior when selected. More... | |
| using | Container = std::vector< ccHObject * > |
| Standard instances container (for children, etc.) More... | |
| using | Shared = QSharedPointer< ccHObject > |
| Shared pointer. More... | |
| using | SharedContainer = std::vector< Shared > |
| Shared instances container (for children, etc.) More... | |
| using | GlobalBoundingBox = cloudViewer::BoundingBoxTpl< double > |
| Global (non-shifted) bounding-box. More... | |
Public Types inherited from ccSerializableObject | |
| enum | DeserializationFlags { DF_POINT_COORDS_64_BITS , DF_SCALAR_VAL_32_BITS = 2 } |
| Deserialization flags (bit-field) More... | |
| typedef QMultiMap< unsigned, unsigned > | LoadedIDMap |
| Map of loaded unique IDs (old ID --> new ID) More... | |
Public Member Functions | |
| ccMesh (ccGenericPointCloud *vertices=nullptr) | |
| Default ccMesh constructor. More... | |
| ccMesh (const ccMesh &mesh) | |
| ccMesh (const std::vector< Eigen::Vector3d > &vertices, const std::vector< Eigen::Vector3i > &triangles) | |
| Parameterized Constructor. More... | |
| ccMesh (cloudViewer::GenericIndexedMesh *giMesh, ccGenericPointCloud *giVertices) | |
| ccMesh constructor (from a cloudViewer::GenericIndexedMesh) More... | |
| ~ccMesh () override | |
| Default destructor. More... | |
| CV_CLASS_ENUM | getClassID () const override |
| Returns class ID. More... | |
| void | setAssociatedCloud (ccGenericPointCloud *cloud) |
| Sets the associated vertices cloud (warning) More... | |
| ccMesh * | cloneMesh (ccGenericPointCloud *vertices=nullptr, ccMaterialSet *clonedMaterials=nullptr, NormsIndexesTableType *clonedNormsTable=nullptr, TextureCoordsContainer *cloneTexCoords=nullptr) |
| Clones this entity. More... | |
| ccMesh * | partialClone (const std::vector< unsigned > &triangleIndices, int *warnings=nullptr) const |
| Creates a new mesh from a selection of triangles (partial clone) More... | |
| bool | merge (const ccMesh *mesh, bool createSubMesh) |
| Merges another mesh into this one. More... | |
| ccMesh & | operator= (const ccMesh &mesh) |
| ccMesh & | operator+= (const ccMesh &mesh) |
| ccMesh | operator+ (const ccMesh &mesh) const |
| void | clear () |
| unsigned | getUniqueIDForDisplay () const override |
| Returns object unqiue ID used for display. More... | |
| ccBBox | getOwnBB (bool withGLFeatures=false) override |
| Returns the entity's own bounding-box. More... | |
| bool | isSerializable () const override |
| Returns whether object is serializable of not. More... | |
| const ccGLMatrix & | getGLTransformationHistory () const override |
| Returns the transformation 'history' matrix. More... | |
| ccGenericPointCloud * | getAssociatedCloud () const override |
| Returns the vertices cloud. More... | |
| void | refreshBB () override |
| Forces bounding-box update. More... | |
| bool | interpolateNormalsBC (unsigned triIndex, const CCVector3d &w, CCVector3 &N) override |
| Interpolates normal(s) inside a given triangle. More... | |
| bool | interpolateColors (unsigned triIndex, const CCVector3 &P, ecvColor::Rgb &C) override |
| Interpolates RGB colors inside a given triangle. More... | |
| void | computeInterpolationWeights (unsigned triIndex, const CCVector3 &P, CCVector3d &weights) const override |
| Returns the (barycentric) interpolation weights for a given triangle. More... | |
| bool | getColorFromMaterial (unsigned triIndex, const CCVector3 &P, ecvColor::Rgb &C, bool interpolateColorIfNoTexture) override |
| bool | getVertexColorFromMaterial (unsigned triIndex, unsigned char vertIndex, ecvColor::Rgb &C, bool returnColorIfNoTexture) override |
| unsigned | capacity () const override |
| Returns max capacity. More... | |
| void | forEach (genericTriangleAction action) override |
| Fast iteration mechanism. More... | |
| void | placeIteratorAtBeginning () override |
| Places the mesh iterator at the beginning. More... | |
| cloudViewer::GenericTriangle * | _getNextTriangle () override |
| Returns the next triangle (relatively to the global iterator position) More... | |
| cloudViewer::GenericTriangle * | _getTriangle (unsigned triangleIndex) override |
| Returns the ith triangle. More... | |
| cloudViewer::VerticesIndexes * | getNextTriangleVertIndexes () override |
| cloudViewer::VerticesIndexes * | getTriangleVertIndexes (unsigned triangleIndex) override |
| Returns the indexes of the vertices of a given triangle. More... | |
| virtual void | getTriangleVertices (unsigned triangleIndex, CCVector3 &A, CCVector3 &B, CCVector3 &C) const override |
| Returns the vertices of a given triangle. More... | |
| virtual void | getTriangleVertices (unsigned triangleIndex, double A[3], double B[3], double C[3]) const override |
| unsigned int | getVerticeSize () const |
| Eigen::Vector3d | getVertice (size_t index) const |
| void | setVertice (size_t index, const Eigen::Vector3d &vertice) |
| void | addVertice (const Eigen::Vector3d &vertice) |
| std::vector< Eigen::Vector3d > | getEigenVertices () const |
| void | addEigenVertices (const std::vector< Eigen::Vector3d > &vertices) |
| void | setEigenVertices (const std::vector< Eigen::Vector3d > &vertices) |
| Eigen::Vector3d | getVertexNormal (size_t index) const |
| void | setVertexNormal (size_t index, const Eigen::Vector3d &normal) |
| void | addVertexNormal (const Eigen::Vector3d &normal) |
| std::vector< Eigen::Vector3d > | getVertexNormals () const |
| void | addVertexNormals (const std::vector< Eigen::Vector3d > &normals) |
| void | setVertexNormals (const std::vector< Eigen::Vector3d > &normals) |
| Eigen::Vector3d | getVertexColor (size_t index) const |
| void | setVertexColor (size_t index, const Eigen::Vector3d &color) |
| void | addVertexColor (const Eigen::Vector3d &color) |
| std::vector< Eigen::Vector3d > | getVertexColors () const |
| ColorsTableType * | getVertexColorsPtr () |
| void | addVertexColors (const std::vector< Eigen::Vector3d > &colors) |
| void | setVertexColors (const std::vector< Eigen::Vector3d > &colors) |
| bool | HasVertices () const |
| std::vector< CCVector3 > & | getVerticesPtr () |
| const std::vector< CCVector3 > & | getVertices () const |
| virtual unsigned | size () const override |
| Returns the number of triangles. More... | |
| void | getBoundingBox (CCVector3 &bbMin, CCVector3 &bbMax) override |
| Returns the mesh bounding-box. More... | |
| bool | normalsAvailable () const override |
| Returns whether normals are available. More... | |
| bool | interpolateNormals (unsigned triIndex, const CCVector3 &P, CCVector3 &N) override |
| Interpolates normal(s) inside a given triangle. More... | |
| void | getTriangleVertIndexes (size_t triangleIndex, Eigen::Vector3i &vertIndx) const |
| virtual const cloudViewer::VerticesIndexes * | getTriangleVertIndexes (unsigned triangleIndex) const |
| bool | hasColors () const override |
| Returns whether colors are enabled or not. More... | |
| bool | hasNormals () const override |
| Returns whether normals are enabled or not. More... | |
| bool | HasVertexNormals () const |
| bool | hasScalarFields () const override |
| Returns whether one or more scalar fields are instantiated. More... | |
| bool | hasDisplayedScalarField () const override |
| Returns whether an active scalar field is available or not. More... | |
| bool | normalsShown () const override |
| Returns whether normals are shown or not. More... | |
| void | toggleMaterials () override |
| Toggles material display state. More... | |
| void | invertNormals () |
| Inverts normals (if any) More... | |
| void | shiftTriangleIndexes (unsigned shift) |
| Shifts all triangles indexes. More... | |
| void | flipTriangles () |
| Flips the triangle. More... | |
| void | addTriangle (unsigned i1, unsigned i2, unsigned i3) |
| Adds a triangle to the mesh. More... | |
| void | addTriangle (const cloudViewer::VerticesIndexes &triangle) |
| void | addTriangle (const Eigen::Vector3i &index) |
| void | addTriangles (const std::vector< Eigen::Vector3i > &triangles) |
| void | setTriangle (size_t index, const Eigen::Vector3i &triangle) |
| void | setTriangles (const std::vector< Eigen::Vector3i > &triangles) |
| Eigen::Vector3i | getTriangle (size_t index) const |
| std::vector< Eigen::Vector3i > | getTriangles () const |
| triangleIndexesContainer * | getTrianglesPtr () const |
| bool | reserve (std::size_t n) |
| Reserves the memory to store the vertex indexes (3 per triangle) More... | |
| bool | reserveAssociatedCloud (std::size_t n, bool init_color=false, bool init_normal=false) |
| bool | resize (size_t n) |
| Resizes the array of vertex indexes (3 per triangle) More... | |
| bool | resizeAssociatedCloud (std::size_t n) |
| void | shrinkToFit () |
| Removes unused capacity. More... | |
| void | shrinkVertexToFit () |
| bool | hasTriNormals () const override |
| Returns whether the mesh has per-triangle normals. More... | |
| bool | HasTriangleNormals () const |
| void | getTriangleNormalIndexes (unsigned triangleIndex, int &i1, int &i2, int &i3) const override |
| Returns a triplet of normal indexes for a given triangle (if any) More... | |
| bool | getTriangleNormals (unsigned triangleIndex, CCVector3 &Na, CCVector3 &Nb, CCVector3 &Nc) const override |
| Returns a given triangle normal. More... | |
| bool | getTriangleNormals (unsigned triangleIndex, double Na[3], double Nb[3], double Nc[3]) const override |
| bool | getTriangleNormals (unsigned triangleIndex, Eigen::Vector3d &Na, Eigen::Vector3d &Nb, Eigen::Vector3d &Nc) const override |
| std::vector< Eigen::Vector3d > | getTriangleNormals () const |
| std::vector< CCVector3 * > | getTriangleNormalsPtr () const |
| Eigen::Vector3d | getTriangleNorm (size_t index) const |
| bool | setTriangleNorm (size_t index, const Eigen::Vector3d &triangle_normal) |
| bool | setTriangleNormalIndexes (size_t triangleIndex, CompressedNormType value) |
| CompressedNormType | getTriangleNormalIndexes (size_t triangleIndex) |
| bool | addTriangleNorm (const CCVector3 &N) |
| bool | addTriangleNorm (const Eigen::Vector3d &N) |
| std::vector< Eigen::Vector3d > | getTriangleNorms () const |
| bool | setTriangleNorms (const std::vector< Eigen::Vector3d > &triangle_normals) |
| bool | addTriangleNorms (const std::vector< Eigen::Vector3d > &triangle_normals) |
| NormsIndexesTableType * | getTriNormsTable () const override |
| Returns per-triangle normals shared array. More... | |
| void | setTriNormsTable (NormsIndexesTableType *triNormsTable, bool autoReleaseOldTable=true) |
| Sets per-triangle normals array (may be shared) More... | |
| void | clearTriNormals () |
| Removes per-triangle normals. More... | |
| bool | arePerTriangleNormalsEnabled () const |
| Returns whether per triangle normals are enabled. More... | |
| bool | reservePerTriangleNormalIndexes () |
| Reserves memory to store per-triangle triplets of normal indexes. More... | |
| void | addTriangleNormalIndexes (int i1, int i2, int i3) |
| Adds a triplet of normal indexes for next triangle. More... | |
| void | setTriangleNormalIndexes (unsigned triangleIndex, int i1, int i2, int i3) |
| Sets a triplet of normal indexes for a given triangle. More... | |
| void | removePerTriangleNormalIndexes () |
| Removes any per-triangle triplets of normal indexes. More... | |
| void | invertPerTriangleNormals () |
| Invert per-triangle normals. More... | |
| bool | hasMaterials () const override |
| const ccMaterialSet * | getMaterialSet () const override |
| int | getTriangleMtlIndex (unsigned triangleIndex) const override |
| Returns a given triangle material indexes. More... | |
| bool | convertMaterialsToVertexColors () |
| Converts materials to vertex colors. More... | |
| bool | hasPerTriangleMtlIndexes () const |
| Returns whether this mesh as per-triangle material index. More... | |
| bool | reservePerTriangleMtlIndexes () |
| Reserves memory to store per-triangle material index. More... | |
| void | removePerTriangleMtlIndexes () |
| Removes any per-triangle material indexes. More... | |
| void | addTriangleMtlIndex (int mtlIndex) |
| Adds triangle material index for next triangle. More... | |
| void | setTriangleMtlIndexesTable (triangleMaterialIndexesSet *matIndexesTable, bool autoReleaseOldTable=true) |
| Sets per-triangle material indexes array. More... | |
| const triangleMaterialIndexesSet * | getTriangleMtlIndexesTable () const |
| Returns the per-triangle material indexes array. More... | |
| void | setTriangleMtlIndex (unsigned triangleIndex, int mtlIndex) |
| Sets triangle material indexes. More... | |
| void | setMaterialSet (ccMaterialSet *materialSet, bool autoReleaseOldMaterialSet=true) |
| Sets associated material set (may be shared) More... | |
| bool | hasTextures () const override |
| Returns whether textures are available for this mesh. More... | |
| TextureCoordsContainer * | getTexCoordinatesTable () const override |
| Returns per-triangle texture coordinates array. More... | |
| void | getTriangleTexCoordinates (unsigned triIndex, TexCoords2D *&tx1, TexCoords2D *&tx2, TexCoords2D *&tx3) const override |
| Returns per-triangle texture coordinates (pointer to) More... | |
| void | getTexCoordinates (unsigned index, TexCoords2D *&tx) const override |
| bool | hasPerTriangleTexCoordIndexes () const override |
| Returns whether this mesh as per-triangle triplets of tex coords indexes. More... | |
| void | getTriangleTexCoordinatesIndexes (unsigned triangleIndex, int &i1, int &i2, int &i3) const override |
| Returns the triplet of tex coords indexes for a given triangle. More... | |
| void | setTexCoordinatesTable (TextureCoordsContainer *texCoordsTable, bool autoReleaseOldTable=true) |
| Sets per-triangle texture coordinates array (may be shared) More... | |
| bool | reservePerTriangleTexCoordIndexes () |
| Reserves memory to store per-triangle triplets of tex coords indexes. More... | |
| void | removePerTriangleTexCoordIndexes () |
| Remove per-triangle tex coords indexes. More... | |
| void | addTriangleTexCoordIndexes (int i1, int i2, int i3) |
| Adds a triplet of tex coords indexes for next triangle. More... | |
| void | setTriangleTexCoordIndexes (unsigned triangleIndex, int i1, int i2, int i3) |
| Sets a triplet of tex coords indexes for a given triangle. More... | |
| bool | computeNormals (bool perVertex) |
| Computes normals. More... | |
| bool | computePerVertexNormals () |
| Computes per-vertex normals. More... | |
| bool | computePerTriangleNormals () |
| Computes per-triangle normals. More... | |
| bool | laplacianSmooth (unsigned nbIteration=100, PointCoordinateType factor=static_cast< PointCoordinateType >(0.01), ecvProgressDialog *progressCb=nullptr) |
| Laplacian smoothing. More... | |
| bool | processScalarField (MESH_SCALAR_FIELD_PROCESS process) |
| ccMesh * | subdivide (PointCoordinateType maxArea) const |
| ccMesh * | createNewMeshFromSelection (bool removeSelectedTriangles, std::vector< int > *newIndexesOfRemainingTriangles=nullptr, bool withChildEntities=false) |
| Creates a new mesh with the selected vertices only. More... | |
| void | swapTriangles (unsigned index1, unsigned index2) |
| Swaps two triangles. More... | |
| void | removeTriangles (size_t index) |
| void | transformTriNormals (const ccGLMatrix &trans) |
| Transforms the mesh per-triangle normals. More... | |
| bool | mergeDuplicatedVertices (unsigned char octreeLevel=DefaultMergeDulicateVerticesLevel, QWidget *parentWidget=nullptr) |
| Merges duplicated vertices. More... | |
| bool | hasAdjacencyList () const |
Returns true if the mesh contains adjacency normals. More... | |
| bool | hasTriangleUvs () const |
| bool | hasTriangleMaterialIds () const |
| bool | hasEigenTextures () const |
Returns true if the mesh has texture. More... | |
| virtual bool | IsEmpty () const override |
| virtual Eigen::Vector3d | GetMinBound () const override |
| Returns min bounds for geometry coordinates. More... | |
| virtual Eigen::Vector3d | GetMaxBound () const override |
| Returns max bounds for geometry coordinates. More... | |
| virtual Eigen::Vector3d | GetCenter () const override |
| Returns the center of the geometry coordinates. More... | |
| virtual ccBBox | GetAxisAlignedBoundingBox () const override |
| Returns an axis-aligned bounding box of the geometry. More... | |
| virtual ecvOrientedBBox | GetOrientedBoundingBox () const override |
| virtual ccMesh & | Transform (const Eigen::Matrix4d &transformation) override |
| Apply transformation (4x4 matrix) to the geometry coordinates. More... | |
| virtual ccMesh & | Translate (const Eigen::Vector3d &translation, bool relative=true) override |
| Apply translation to the geometry coordinates. More... | |
| virtual ccMesh & | Scale (const double s, const Eigen::Vector3d ¢er) override |
Apply scaling to the geometry coordinates. Given a scaling factor , and center , a given point is transformed according to . More... | |
| virtual ccMesh & | Rotate (const Eigen::Matrix3d &R, const Eigen::Vector3d ¢er) override |
Apply rotation to the geometry coordinates and normals. Given a rotation matrix , and center , a given point is transformed according to . More... | |
| ccMesh & | PaintUniformColor (const Eigen::Vector3d &color) |
| Assigns each vertex in the ccMesh the same color. More... | |
| std::tuple< std::shared_ptr< ccMesh >, std::vector< size_t > > | ComputeConvexHull () const |
| std::unordered_map< Eigen::Vector2i, double, cloudViewer::utility::hash_eigen< Eigen::Vector2i > > | ComputeEdgeWeightsCot (const std::unordered_map< Eigen::Vector2i, std::vector< int >, cloudViewer::utility::hash_eigen< Eigen::Vector2i >> &edges_to_vertices, double min_weight=std::numeric_limits< double >::lowest()) const |
| Function that computes for each edge in the triangle mesh and passed as parameter edges_to_vertices the cot weight. More... | |
| ccMesh & | ComputeTriangleNormals (bool normalized=true) |
| Function to compute triangle normals, usually called before rendering. More... | |
| ccMesh & | ComputeVertexNormals (bool normalized=true) |
| Function to compute vertex normals, usually called before rendering. More... | |
| ccMesh & | NormalizeNormals () |
| ccMesh & | ComputeAdjacencyList () |
| Function to compute adjacency list, call before adjacency list is. More... | |
| ccMesh & | RemoveDuplicatedVertices () |
| Function that removes duplicated verties, i.e., vertices that have identical coordinates. More... | |
| ccMesh & | RemoveDuplicatedTriangles () |
| Function that removes duplicated triangles, i.e., removes triangles that reference the same three vertices, independent of their order. More... | |
| ccMesh & | RemoveUnreferencedVertices () |
| This function removes vertices from the triangle mesh that are not referenced in any triangle of the mesh. More... | |
| ccMesh & | RemoveDegenerateTriangles () |
| Function that removes degenerate triangles, i.e., triangles that reference a single vertex multiple times in a single triangle. More... | |
| ccMesh & | RemoveNonManifoldEdges () |
Function that removes all non-manifold edges, by successively deleting triangles with the smallest surface area adjacent to the non-manifold edge until the number of adjacent triangles to the edge is <= 2. More... | |
| ccMesh & | MergeCloseVertices (double eps) |
| Function that will merge close by vertices to a single one. The vertex position, normal and color will be the average of the vertices. More... | |
| std::shared_ptr< ccMesh > | FilterSharpen (int number_of_iterations, double strength, FilterScope scope=FilterScope::All) const |
| Function to sharpen triangle mesh. More... | |
| std::shared_ptr< ccMesh > | FilterSmoothSimple (int number_of_iterations, FilterScope scope=FilterScope::All) const |
| Function to smooth triangle mesh with simple neighbour average. More... | |
| std::shared_ptr< ccMesh > | FilterSmoothLaplacian (int number_of_iterations, double lambda, FilterScope scope=FilterScope::All) const |
| Function to smooth triangle mesh using Laplacian. More... | |
| std::shared_ptr< ccMesh > | FilterSmoothTaubin (int number_of_iterations, double lambda=0.5, double mu=-0.53, FilterScope scope=FilterScope::All) const |
| Function to smooth triangle mesh using method of Taubin, "Curve and Surface Smoothing Without Shrinkage", 1995. Applies in each iteration two times FilterSmoothLaplacian, first with lambda and second with mu as smoothing parameter. This method avoids shrinkage of the triangle mesh. More... | |
| int | EulerPoincareCharacteristic () const |
| std::vector< Eigen::Vector2i > | GetNonManifoldEdges (bool allow_boundary_edges=true) const |
| bool | IsEdgeManifold (bool allow_boundary_edges=true) const |
| std::vector< int > | GetNonManifoldVertices () const |
| bool | IsVertexManifold () const |
| std::vector< Eigen::Vector2i > | GetSelfIntersectingTriangles () const |
| bool | IsSelfIntersecting () const |
| bool | IsBoundingBoxIntersecting (const ccMesh &other) const |
| bool | IsIntersecting (const ccMesh &other) const |
| bool | IsOrientable () const |
| bool | IsWatertight () const |
| bool | OrientTriangles () |
| std::unordered_map< Eigen::Vector2i, std::vector< int >, cloudViewer::utility::hash_eigen< Eigen::Vector2i > > | GetEdgeToTrianglesMap () const |
| std::unordered_map< Eigen::Vector2i, std::vector< int >, cloudViewer::utility::hash_eigen< Eigen::Vector2i > > | GetEdgeToVerticesMap () const |
| double | GetTriangleArea (size_t triangle_idx) const |
| double | GetSurfaceArea () const |
| double | GetSurfaceArea (std::vector< double > &triangle_areas) const |
| double | GetVolume () const |
| Eigen::Vector4d | GetTrianglePlane (size_t triangle_idx) const |
| std::shared_ptr< ccPointCloud > | SamplePointsUniformlyImpl (size_t number_of_points, std::vector< double > &triangle_areas, double surface_area, bool use_triangle_normal, int seed) |
| std::shared_ptr< ccPointCloud > | SamplePointsUniformly (size_t number_of_points, bool use_triangle_normal=false, int seed=-1) |
| std::shared_ptr< ccPointCloud > | SamplePointsPoissonDisk (size_t number_of_points, double init_factor=5, const std::shared_ptr< ccPointCloud > pcl_init=nullptr, bool use_triangle_normal=false, int seed=-1) |
| std::shared_ptr< ccMesh > | SubdivideMidpoint (int number_of_iterations) const |
| std::shared_ptr< ccMesh > | SubdivideLoop (int number_of_iterations) const |
| std::shared_ptr< ccMesh > | SimplifyVertexClustering (double voxel_size, SimplificationContraction contraction=SimplificationContraction::Average) const |
| std::shared_ptr< ccMesh > | SimplifyQuadricDecimation (int target_number_of_triangles, double maximum_error=std::numeric_limits< double >::infinity(), double boundary_weight=1.0) const |
| std::shared_ptr< ccMesh > | SelectByIndex (const std::vector< size_t > &indices, bool cleanup=true) const |
| std::shared_ptr< ccMesh > | Crop (const ccBBox &bbox) const |
| std::shared_ptr< ccMesh > | Crop (const ecvOrientedBBox &bbox) const |
| std::tuple< std::vector< int >, std::vector< size_t >, std::vector< double > > | ClusterConnectedTriangles () const |
| Function that clusters connected triangles, i.e., triangles that are connected via edges are assigned the same cluster index. More... | |
| void | RemoveTrianglesByIndex (const std::vector< size_t > &triangle_indices) |
This function removes the triangles with index in triangle_indices. Call RemoveUnreferencedVertices to clean up vertices afterwards. More... | |
| void | RemoveTrianglesByMask (const std::vector< bool > &triangle_mask) |
This function removes the triangles that are masked in triangle_mask. Call RemoveUnreferencedVertices to clean up vertices afterwards. More... | |
| void | RemoveVerticesByIndex (const std::vector< size_t > &vertex_indices) |
This function removes the vertices with index in vertex_indices. Note that also all triangles associated with the vertices are removeds. More... | |
| void | RemoveVerticesByMask (const std::vector< bool > &vertex_mask) |
This function removes the vertices that are masked in vertex_mask. Note that also all triangles associated with the vertices are removed.. More... | |
| std::shared_ptr< ccMesh > | DeformAsRigidAsPossible (const std::vector< int > &constraint_vertex_indices, const std::vector< Eigen::Vector3d > &constraint_vertex_positions, size_t max_iter, DeformAsRigidAsPossibleEnergy energy=DeformAsRigidAsPossibleEnergy::Spokes, double smoothed_alpha=0.01) const |
| This function deforms the mesh using the method by Sorkine and Alexa, "As-Rigid-As-Possible Surface Modeling", 2007. More... | |
Public Member Functions inherited from ccGenericMesh | |
| ccGenericMesh (QString name=QString()) | |
| Default constructor. More... | |
| ~ccGenericMesh () override=default | |
| Destructor. More... | |
| void | showNormals (bool state) override |
| Sets normals visibility. More... | |
| virtual bool | isShownAsWire () const |
| Returns whether the mesh is displayed as wired or with plain facets. More... | |
| virtual void | showWired (bool state) |
| Sets whether mesh should be displayed as a wire or with plain facets. More... | |
| virtual bool | isShownAsPoints () const |
| Returns whether the mesh is displayed as wired or with plain facets. More... | |
| virtual void | showPoints (bool state) |
| virtual bool | triNormsShown () const |
| Returns whether per-triangle normals are shown or not. More... | |
| virtual void | showTriNorms (bool state) |
| Sets whether to show or not per-triangle normals. More... | |
| virtual bool | materialsShown () const |
| Sets whether textures/material should be displayed or not. More... | |
| virtual void | showMaterials (bool state) |
| Sets whether textures should be displayed or not. More... | |
| virtual bool | stipplingEnabled () const |
| Returns whether polygon stippling is enabled or not. More... | |
| void | enableStippling (bool state) |
| Enables polygon stippling. More... | |
| ccPointCloud * | samplePoints (bool densityBased, double samplingParameter, bool withNormals, bool withRGB, bool withTexture, cloudViewer::GenericProgressCallback *pDlg=nullptr) |
| Samples points on a mesh. More... | |
| void | importParametersFrom (const ccGenericMesh *mesh) |
| Imports the parameters from another mesh. More... | |
| virtual bool | trianglePicking (const CCVector2d &clickPos, const ccGLCameraParameters &camera, int &nearestTriIndex, double &nearestSquareDist, CCVector3d &nearestPoint, CCVector3d *barycentricCoords=nullptr) const |
| Brute force triangle picking. More... | |
| virtual bool | trianglePicking (unsigned triIndex, const CCVector2d &clickPos, const ccGLCameraParameters &camera, CCVector3d &point, CCVector3d *barycentricCoords=nullptr) const |
| Triangle picking (single triangle) More... | |
| bool | computePointPosition (unsigned triIndex, const CCVector2d &uv, CCVector3 &P, bool warningIfOutside=true) const |
| void | setGlobalShift (const CCVector3d &shift) override |
| Sets shift applied to original coordinates (information storage only) More... | |
| void | setGlobalScale (double scale) override |
| const CCVector3d & | getGlobalShift () const override |
| Returns the shift applied to original coordinates. More... | |
| double | getGlobalScale () const override |
| Returns the scale applied to original coordinates. More... | |
| bool | updateTextures (const std::string &texture_file) |
| bool | updateTextures (const std::vector< std::string > &texture_files) |
Public Member Functions inherited from cloudViewer::GenericIndexedMesh | |
| GenericIndexedMesh ()=default | |
| ~GenericIndexedMesh () override=default | |
| Default destructor. More... | |
Public Member Functions inherited from cloudViewer::GenericMesh | |
| GenericMesh ()=default | |
| virtual | ~GenericMesh ()=default |
| Default destructor. More... | |
| virtual bool | hasTriangles () const |
Public Member Functions inherited from ccShiftedObject | |
| ccShiftedObject (QString name=QString()) | |
| Default constructor. More... | |
| ccShiftedObject (const ccShiftedObject &s) | |
| Copy constructor. More... | |
| void | copyGlobalShiftAndScale (const ccShiftedObject &s) |
| Copies the Global Shift and Scale from another entity. More... | |
| virtual void | setGlobalShift (double x, double y, double z) |
| Sets shift applied to original coordinates (information storage only) More... | |
| bool | isShifted () const |
| Returns whether the cloud is shifted or not. More... | |
| template<typename T > | |
| CCVector3d | toGlobal3d (const Vector3Tpl< T > &Plocal) const |
| Returns the point back-projected into the original coordinates system. More... | |
| template<typename T > | |
| CCVector3d | toLocal3d (const Vector3Tpl< T > &Pglobal) const |
| Returns the point projected into the local (shifted) coordinates system. More... | |
| template<typename T > | |
| CCVector3 | toLocal3pc (const Vector3Tpl< T > &Pglobal) const |
| Returns the point projected into the local (shifted) coordinates system. More... | |
| bool | getOwnGlobalBB (CCVector3d &minCorner, CCVector3d &maxCorner) override |
| GlobalBoundingBox | getOwnGlobalBB (bool withGLFeatures=false) override |
Public Member Functions inherited from ccHObject | |
| ccHObject (QString name=QString()) | |
| Default constructor. More... | |
| ccHObject (const ccHObject &object) | |
| Copy constructor. More... | |
| virtual | ~ccHObject () override |
| Default destructor. More... | |
| virtual Eigen::Vector2d | GetMin2DBound () const |
| virtual Eigen::Vector2d | GetMax2DBound () const |
| virtual ccHObject & | Scale (const double s) |
| virtual ccHObject & | Rotate (const Eigen::Matrix3d &R) |
| QString | getViewId () const |
| bool | isGroup () const |
| Returns whether the instance is a group. More... | |
| ccHObject * | getParent () const |
| Returns parent object. More... | |
| virtual QIcon | getIcon () const |
| Returns the icon associated to this entity. More... | |
| void | addDependency (ccHObject *otherObject, int flags, bool additive=true) |
| Adds a new dependence (additive or not) More... | |
| int | getDependencyFlagsWith (const ccHObject *otherObject) |
| Returns the dependency flags with a given object. More... | |
| void | removeDependencyWith (ccHObject *otherObject) |
| Removes any dependency flags with a given object. More... | |
| void | removeDependencyFlag (ccHObject *otherObject, DEPENDENCY_FLAGS flag) |
| Removes a given dependency flag. More... | |
| virtual bool | addChild (ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1) |
| Adds a child. More... | |
| unsigned | getChildrenNumber () const |
| Returns the number of children. More... | |
| unsigned int | getChildCountRecursive () const |
| Returns the total number of children under this object recursively. More... | |
| ccHObject * | getChild (unsigned childPos) const |
| Returns the ith child. More... | |
| ccHObject * | find (unsigned uniqueID) |
| Finds an entity in this object hierarchy. More... | |
| unsigned | filterChildren (Container &filteredChildren, bool recursive=false, CV_CLASS_ENUM filter=CV_TYPES::OBJECT, bool strict=false) const |
| Collects the children corresponding to a certain pattern. More... | |
| void | detachChild (ccHObject *child) |
| Detaches a specific child. More... | |
| void | detachAllChildren () |
| Removes a specific child. More... | |
| void | getTypeID_recursive (std::vector< removeInfo > &rmInfos, bool relative) |
| void | getTypeID_recursive (std::vector< hideInfo > &hdInfos, bool relative) |
| void | removeChild (ccHObject *child) |
| void | removeChild (int pos) |
| Removes a specific child given its index. More... | |
| void | removeAllChildren () |
| Removes all children. More... | |
| int | getChildIndex (const ccHObject *aChild) const |
| Returns child index. More... | |
| void | swapChildren (unsigned firstChildIndex, unsigned secondChildIndex) |
| Swaps two children. More... | |
| int | getIndex () const |
| Returns index relatively to its parent or -1 if no parent. More... | |
| void | transferChild (ccHObject *child, ccHObject &newParent) |
| Transfer a given child to another parent. More... | |
| void | transferChildren (ccHObject &newParent, bool forceFatherDependent=false) |
| Transfer all children to another parent. More... | |
| ccHObject * | getFirstChild () const |
| Shortcut: returns first child. More... | |
| ccHObject * | getLastChild () const |
| Shortcut: returns last child. More... | |
| bool | isAncestorOf (const ccHObject *anObject) const |
| Returns true if the current object is an ancestor of the specified one. More... | |
| void | removeFromRenderScreen (bool recursive=true) |
| void | hideObject_recursive (bool recursive) |
| void | hideBB (CC_DRAW_CONTEXT context) |
| void | showBB (CC_DRAW_CONTEXT context) |
| void | setRedrawFlagRecursive (bool redraw=false) |
| void | setForceRedrawRecursive (bool redraw=false) |
| void | setPointSizeRecursive (int pSize) |
| void | setLineWidthRecursive (PointCoordinateType width) |
| virtual ccBBox | getBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true) |
| Returns the bounding-box of this entity and it's children. More... | |
| virtual GlobalBoundingBox | getGlobalBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true) |
| Returns the global bounding-box of this entity and it's children. More... | |
| virtual ccBBox | getDisplayBB_recursive (bool relative) |
| Returns the bounding-box of this entity and it's children WHEN DISPLAYED. More... | |
| virtual ccBBox | getOwnFitBB (ccGLMatrix &trans) |
| Returns best-fit bounding-box (if available) More... | |
| virtual void | drawBB (CC_DRAW_CONTEXT &context, const ecvColor::Rgb &col) |
| Draws the entity (and its children) bounding-box. More... | |
| void | draw (CC_DRAW_CONTEXT &context) override |
| Draws entity and its children. More... | |
| void | updateNameIn3DRecursive () |
| void | setHideShowType (CC_DRAW_CONTEXT &context) |
| void | setRemoveType (CC_DRAW_CONTEXT &context) |
| ENTITY_TYPE | getEntityType () const |
| virtual void | redrawDisplay (bool forceRedraw=true, bool only2D=false) |
| Redraws associated display. More... | |
| bool | getAbsoluteGLTransformation (ccGLMatrix &trans) const |
| virtual bool | isDisplayed () const |
| Returns whether the object is actually displayed (visible) or not. More... | |
| virtual bool | isBranchEnabled () const |
| Returns whether the object and all its ancestors are enabled. More... | |
| virtual void | redrawDisplay_recursive (bool p) |
| virtual void | refreshDisplay_recursive (bool p) |
| virtual void | setSelected_recursive (bool p) |
| virtual void | toggleActivation_recursive () |
| virtual void | toggleVisibility_recursive () |
| virtual void | toggleColors_recursive () |
| virtual void | resetGLTransformationHistory_recursive () |
| virtual void | toggleNormals_recursive () |
| virtual void | toggleSF_recursive () |
| virtual void | toggleShowName_recursive () |
| unsigned | findMaxUniqueID_recursive () const |
| Returns the max 'unique ID' of this entity and its siblings. More... | |
| void | applyGLTransformation_recursive (const ccGLMatrix *trans=nullptr) |
| Applies the active OpenGL transformation to the entity (recursive) More... | |
| virtual void | notifyGeometryUpdate () |
| bool | toFile (QFile &out, short dataVersion) const override |
| Saves data to binary stream. More... | |
| bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
| Loads data from binary stream. More... | |
| short | minimumFileVersion () const override |
| Returns the minimum file version required to save this instance. More... | |
| bool | fromFileNoChildren (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) |
| Custom version of ccSerializableObject::fromFile. More... | |
| virtual bool | isShareable () const |
| Returns whether object is shareable or not. More... | |
| virtual void | setSelectionBehavior (SelectionBehavior mode) |
| Sets selection behavior (when displayed) More... | |
| virtual SelectionBehavior | getSelectionBehavior () const |
| Returns selection behavior. More... | |
| virtual void | setGLTransformationHistory (const ccGLMatrix &mat) |
| Sets the transformation 'history' matrix (handle with care!) More... | |
| virtual void | resetGLTransformationHistory () |
| Resets the transformation 'history' matrix. More... | |
| bool | pushDisplayState () override |
| Pushes the current display state (overridden) More... | |
| void | popDisplayState (bool apply=true) override |
| Pops the last pushed display state (overridden) More... | |
Public Member Functions inherited from ccObject | |
| ccObject (QString name=QString()) | |
| Default constructor. More... | |
| ccObject (const ccObject &object) | |
| Copy constructor. More... | |
| virtual QString | getName () const |
| Returns object name. More... | |
| virtual void | setName (const QString &name) |
| Sets object name. More... | |
| virtual void | setRemoveFlag (bool removeFlag) |
| Sets removeFlag. More... | |
| virtual bool | getRemoveFlag () |
| Returns removeFlag. More... | |
| virtual unsigned | getUniqueID () const |
| Returns object unique ID. More... | |
| virtual void | setUniqueID (unsigned ID) |
| Changes unique ID. More... | |
| virtual bool | isEnabled () const |
| Returns whether the object is enabled or not. More... | |
| virtual void | setEnabled (bool state) |
| Sets the "enabled" property. More... | |
| virtual void | toggleActivation () |
| Toggles the "enabled" property. More... | |
| virtual bool | isLocked () const |
| Returns whether the object is locked or not. More... | |
| virtual void | setLocked (bool state) |
| Sets the "enabled" property. More... | |
| bool | isLeaf () const |
| bool | isCustom () const |
| bool | isHierarchy () const |
| bool | isKindOf (CV_CLASS_ENUM type) const |
| bool | isA (CV_CLASS_ENUM type) const |
| QVariant | getMetaData (const QString &key) const |
| Returns a given associated meta data. More... | |
| bool | removeMetaData (const QString &key) |
| Removes a given associated meta-data. More... | |
| void | setMetaData (const QString &key, const QVariant &data) |
| Sets a meta-data element. More... | |
| void | setMetaData (const QVariantMap &dataset, bool overwrite=false) |
| Sets several meta-data elements at a time. More... | |
| bool | hasMetaData (const QString &key) const |
| Returns whether a meta-data element with the given key exists or not. More... | |
| const QVariantMap & | metaData () const |
| Returns meta-data map (const only) More... | |
| void | setBaseName (const QString &baseName) |
| QString | getBaseName () const |
| void | setFullPath (const QString &fullPaht) |
| QString | getFullPath () const |
Public Member Functions inherited from ccSerializableObject | |
| virtual | ~ccSerializableObject ()=default |
| Destructor. More... | |
Public Member Functions inherited from ccDrawableObject | |
| ccDrawableObject () | |
| Default constructor. More... | |
| ccDrawableObject (const ccDrawableObject &object) | |
| Copy constructor. More... | |
| virtual | ~ccDrawableObject ()=default |
| virtual bool | isVisible () const |
| Returns whether entity is visible or not. More... | |
| virtual void | setVisible (bool state) |
| Sets entity visibility. More... | |
| virtual void | toggleVisibility () |
| Toggles visibility. More... | |
| virtual bool | isRedraw () const |
| Returns whether entity is to be redraw. More... | |
| virtual void | setRedraw (bool state) |
| Sets entity redraw mode. More... | |
| virtual void | setForceRedraw (bool state) |
| Sets force redraw. More... | |
| virtual void | setFixedId (bool state) |
| virtual bool | isFixedId () |
| virtual bool | isVisibilityLocked () const |
| Returns whether visibility is locked or not. More... | |
| virtual void | lockVisibility (bool state) |
| Locks/unlocks visibility. More... | |
| virtual bool | isSelected () const |
| Returns whether entity is selected or not. More... | |
| virtual void | setSelected (bool state) |
| Selects/Unselects entity. More... | |
| virtual void | getDrawingParameters (glDrawParams ¶ms) const |
| Returns main OpenGL parameters for this entity. More... | |
| virtual bool | colorsShown () const |
| Returns whether colors are shown or not. More... | |
| virtual void | showColors (bool state) |
| Sets colors visibility. More... | |
| virtual void | toggleColors () |
| Toggles colors display state. More... | |
| virtual void | toggleNormals () |
| Toggles normals display state. More... | |
| virtual void | showSF (bool state) |
| Sets active scalarfield visibility. More... | |
| virtual void | toggleSF () |
| Toggles SF display state. More... | |
| virtual bool | sfShown () const |
| Returns whether active scalar field is visible. More... | |
| virtual void | showNameIn3D (bool state) |
| Sets whether name should be displayed in 3D. More... | |
| virtual bool | nameShownIn3D () const |
| Returns whether name is displayed in 3D or not. More... | |
| virtual void | toggleShowName () |
| Toggles name in 3D display state. More... | |
| virtual bool | isColorOverridden () const |
| virtual const ecvColor::Rgb & | getTempColor () const |
| Returns current temporary (unique) color. More... | |
| virtual void | setTempColor (const ecvColor::Rgb &col, bool autoActivate=true) |
| Sets current temporary (unique) More... | |
| virtual void | enableTempColor (bool state) |
| Set temporary color activation state. More... | |
| virtual float | getOpacity () const |
| virtual void | setOpacity (float opacity) |
| Set opacity activation state. More... | |
| virtual void | setGLTransformation (const ccGLMatrix &trans) |
| Associates entity with a GL transformation (rotation + translation) More... | |
| virtual void | enableGLTransformation (bool state) |
| Enables/disables associated GL transformation. More... | |
| virtual bool | isGLTransEnabled () const |
| Returns whether a GL transformation is enabled or not. More... | |
| virtual const ccGLMatrix & | getGLTransformation () const |
| Returns associated GL transformation. More... | |
| virtual void | resetGLTransformation () |
| Resets associated GL transformation. More... | |
| virtual void | rotateGL (const ccGLMatrix &rotMat) |
| Multiplies (left) current GL transformation by a rotation matrix. More... | |
| virtual void | translateGL (const CCVector3 &trans) |
| Translates current GL transformation by a rotation matrix. More... | |
| virtual void | removeAllClipPlanes () |
| Removes all clipping planes (if any) More... | |
| virtual bool | addClipPlanes (const ccClipPlane &plane) |
| Registers a new clipping plane. More... | |
| virtual void | toggleClipPlanes (CC_DRAW_CONTEXT &context, bool enable) |
| Enables or disables clipping planes (OpenGL) More... | |
| virtual void | applyDisplayState (const DisplayState &state) |
| Applies a display state. More... | |
Static Public Member Functions | |
| static cloudViewer::VerticesIndexes | GetOrderedTriangle (int vidx0, int vidx1, int vidx2) |
| static ccMesh * | Triangulate (ccGenericPointCloud *cloud, cloudViewer::TRIANGULATION_TYPES type, bool updateNormals=false, PointCoordinateType maxEdgeLength=0, unsigned char dim=2) |
| Creates a Delaunay 2.5D mesh from a point cloud. More... | |
| static ccMesh * | TriangulateTwoPolylines (ccPolyline *p1, ccPolyline *p2, CCVector3 *projectionDir=nullptr) |
| Creates a Delaunay 2.5D mesh from two polylines. More... | |
| static double | ComputeTriangleArea (const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2) |
| Function that computes the area of a mesh triangle. More... | |
| static Eigen::Vector3i | GetEigneOrderedTriangle (int vidx0, int vidx1, int vidx2) |
| static Eigen::Vector4d | ComputeTrianglePlane (const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, const Eigen::Vector3d &p2) |
| static Eigen::Vector2i | GetOrderedEdge (int vidx0, int vidx1) |
| Helper function to get an edge with ordered vertex indices. More... | |
| static std::shared_ptr< ccMesh > | CreateFromPointCloudAlphaShape (const ccPointCloud &pcd, double alpha, std::shared_ptr< cloudViewer::geometry::TetraMesh > tetra_mesh=nullptr, std::vector< size_t > *pt_map=nullptr) |
| Alpha shapes are a generalization of the convex hull. With decreasing alpha value the shape schrinks and creates cavities. See Edelsbrunner and Muecke, "Three-Dimensional Alpha Shapes", 1994. More... | |
| static std::shared_ptr< ccMesh > | CreateFromPointCloudBallPivoting (const ccPointCloud &pcd, const std::vector< double > &radii) |
| static std::tuple< std::shared_ptr< ccMesh >, std::vector< double > > | CreateFromPointCloudPoisson (const ccPointCloud &pcd, size_t depth=8, size_t width=0, float scale=1.1f, bool linear_fit=false, float point_weight=2.f, float samples_per_node=1.5f, int boundary_type=2, int n_threads=-1) |
| Function that computes a triangle mesh from a oriented PointCloud pcd. This implements the Screened Poisson Reconstruction proposed in Kazhdan and Hoppe, "Screened Poisson Surface Reconstruction", 2013. This function uses the original implementation by Kazhdan. See https://github.com/mkazhdan/PoissonRecon. More... | |
| static std::shared_ptr< ccMesh > | CreateTetrahedron (double radius=1.0, bool create_uv_map=false) |
| static std::shared_ptr< ccMesh > | CreateOctahedron (double radius=1.0, bool create_uv_map=false) |
| static std::shared_ptr< ccMesh > | CreateIcosahedron (double radius=1.0, bool create_uv_map=false) |
| static std::shared_ptr< ccMesh > | CreatePlane (double width=1.0, double height=1.0, bool create_uv_map=false) |
| static std::shared_ptr< ccMesh > | CreateBox (double width=1.0, double height=1.0, double depth=1.0, bool create_uv_map=false, bool map_texture_to_each_face=false) |
| static std::shared_ptr< ccMesh > | CreateSphere (double radius=1.0, int resolution=20, bool create_uv_map=false) |
| static std::shared_ptr< ccMesh > | CreateCylinder (double radius=1.0, double height=2.0, int resolution=20, int split=4, bool create_uv_map=false) |
| static std::shared_ptr< ccMesh > | CreateCone (double radius=1.0, double height=2.0, int resolution=20, int split=1, bool create_uv_map=false) |
| static std::shared_ptr< ccMesh > | CreateTorus (double torus_radius=1.0, double tube_radius=0.5, int radial_resolution=30, int tubular_resolution=20) |
| static std::shared_ptr< ccMesh > | CreateArrow (double cylinder_radius=1.0, double cone_radius=1.5, double cylinder_height=5.0, double cone_height=4.0, int resolution=20, int cylinder_split=4, int cone_split=1) |
| static std::shared_ptr< ccMesh > | CreateCoordinateFrame (double size=1.0, const Eigen::Vector3d &origin=Eigen::Vector3d(0.0, 0.0, 0.0)) |
| static std::shared_ptr< ccMesh > | CreateMobius (int length_split=70, int width_split=15, int twists=1, double radius=1, double flatness=1, double width=1, double scale=1) |
Static Public Member Functions inherited from ccGenericMesh | |
| static bool | IsCloudVerticesOfMesh (ccGenericPointCloud *cloud, ccGenericMesh **mesh=nullptr) |
| Helper to determine if the input cloud acts as vertices of a mesh. More... | |
Static Public Member Functions inherited from ccHObject | |
| static ccHObject * | New (CV_CLASS_ENUM objectType, const char *name=nullptr) |
| Static factory. More... | |
| static ccHObject * | New (const QString &pluginId, const QString &classId, const char *name=nullptr) |
| Static factory (version to be used by external plugin factories) More... | |
| static Eigen::Vector3d | ComputeMinBound (const std::vector< Eigen::Vector3d > &points) |
| Compute min bound of a list points. More... | |
| static Eigen::Vector3d | ComputeMaxBound (const std::vector< Eigen::Vector3d > &points) |
| Compute max bound of a list points. More... | |
| static Eigen::Vector3d | ComputeCenter (const std::vector< Eigen::Vector3d > &points) |
| Computer center of a list of points. More... | |
| static void | ResizeAndPaintUniformColor (std::vector< Eigen::Vector3d > &colors, std::size_t size, const Eigen::Vector3d &color) |
| Resizes the colors vector and paints a uniform color. More... | |
| static void | TransformPoints (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points) |
| Transforms all points with the transformation matrix. More... | |
| static void | TransformNormals (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals) |
| Transforms the normals with the transformation matrix. More... | |
| static void | TransformCovariances (const Eigen::Matrix4d &transformation, std::vector< Eigen::Matrix3d > &covariances) |
| Transforms all covariance matrices with the transformation. More... | |
| static void | TranslatePoints (const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative) |
| Apply translation to the geometry coordinates. More... | |
| static void | ScalePoints (const double scale, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d ¢er) |
Scale the coordinates of all points by the scaling factor scale. More... | |
| static void | RotatePoints (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d ¢er) |
Rotate all points with the rotation matrix R. More... | |
| static void | RotateNormals (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &normals) |
Rotate all normals with the rotation matrix R. More... | |
| static void | RotateCovariances (const Eigen::Matrix3d &R, std::vector< Eigen::Matrix3d > &covariances) |
Rotate all covariance matrices with the rotation matrix R. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromXYZ (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from XYZ RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromYZX (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from YZX RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromZXY (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from ZXY RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromXZY (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from XZY RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromZYX (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from ZYX RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromYXZ (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from YXZ RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromAxisAngle (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from AxisAngle RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromQuaternion (const Eigen::Vector4d &rotation) |
| Get Rotation Matrix from Quaternion. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromEulerAngle (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from Euler angle. More... | |
Static Public Member Functions inherited from ccObject | |
| static unsigned | GetCurrentDBVersion () |
| Returns current database version. More... | |
| static void | SetUniqueIDGenerator (ccUniqueIDGenerator::Shared generator) |
| Sets the unique ID generator. More... | |
| static ccUniqueIDGenerator::Shared | GetUniqueIDGenerator () |
| Returns the unique ID generator. More... | |
| static unsigned | GetNextUniqueID () |
| Returns a new unassigned unique ID. More... | |
| static unsigned | GetLastUniqueID () |
| Returns last assigned unique ID. More... | |
| static CV_CLASS_ENUM | ReadClassIDFromFile (QFile &in, short dataVersion) |
| Helper: reads out class ID from a binary stream. More... | |
Static Public Member Functions inherited from ccSerializableObject | |
| static bool | WriteError () |
| Sends a custom error message (write error) and returns 'false'. More... | |
| static bool | ReadError () |
| Sends a custom error message (read error) and returns 'false'. More... | |
| static bool | MemoryError () |
| Sends a custom error message (not enough memory) and returns 'false'. More... | |
| static bool | CorruptError () |
| Sends a custom error message (corrupted file) and returns 'false'. More... | |
Public Attributes | |
| std::vector< std::unordered_set< int > > | adjacency_list_ |
| std::vector< Eigen::Vector2d > | triangle_uvs_ |
| List of uv coordinates per triangle. More... | |
| std::vector< std::pair< std::string, Material > > | materials_ |
| std::vector< int > | triangle_material_ids_ |
| List of material ids. More... | |
| std::vector< cloudViewer::geometry::Image > | textures_ |
| Textures of the image. More... | |
Static Public Attributes | |
| static const unsigned char | DefaultMergeDulicateVerticesLevel = 10 |
| Default octree level for the 'mergeDuplicatedVertices' algorithm. More... | |
Protected Types | |
| using | triangleTexCoordIndexesSet = ccArray< Tuple3i, 3, int > |
| Set of triplets of indexes referring to mesh texture coordinates. More... | |
| using | triangleNormalsIndexesSet = ccArray< Tuple3i, 3, int > |
| Set of triplets of indexes referring to mesh normals. More... | |
Protected Member Functions | |
| void | FilterSmoothLaplacianHelper (std::shared_ptr< ccMesh > &mesh, const std::vector< CCVector3 > &prev_vertices, const std::vector< CCVector3 > &prev_vertex_normals, const ColorsTableType &prev_vertex_colors, const std::vector< std::unordered_set< int >> &adjacency_list, double lambda, bool filter_vertex, bool filter_normal, bool filter_color) const |
| void | drawMeOnly (CC_DRAW_CONTEXT &context) override |
| Enables (OpenGL) stipple mask. More... | |
| bool | toFile_MeOnly (QFile &out, short dataVersion) const override |
| Save own object data. More... | |
| short | minimumFileVersion_MeOnly () const override |
| bool | fromFile_MeOnly (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
| Loads own object data. More... | |
| void | applyGLTransformation (const ccGLMatrix &trans) override |
| Applies a GL transformation to the entity. More... | |
| void | onUpdateOf (ccHObject *obj) override |
| This method is called when another object (geometry) is updated. More... | |
| void | onDeletionOf (const ccHObject *obj) override |
| This method is called when another object is deleted. More... | |
| void | computeInterpolationWeights (const cloudViewer::VerticesIndexes &vertIndexes, const CCVector3 &P, CCVector3d &weights) const |
| bool | interpolateNormals (const cloudViewer::VerticesIndexes &vertIndexes, const CCVector3d &w, CCVector3 &N, const Tuple3i *triNormIndexes=nullptr) |
| bool | interpolateColors (const cloudViewer::VerticesIndexes &vertIndexes, const CCVector3 &P, ecvColor::Rgb &C) |
| bool | pushSubdivide (unsigned indexA, unsigned indexB, unsigned indexC) |
| Used internally by 'subdivide'. More... | |
| virtual void | showNormals_extended (bool p) |
Protected Member Functions inherited from ccGenericMesh | |
| virtual bool | trianglePicking (unsigned triIndex, const CCVector2d &clickPos, const ccGLMatrix &trans, bool noGLTrans, const ccGenericPointCloud &vertices, const ccGLCameraParameters &camera, CCVector3d &point, CCVector3d *barycentricCoords=nullptr) const |
| Triangle picking (single triangle) More... | |
| void | handleColorRamp (CC_DRAW_CONTEXT &context) |
| Handles the color ramp display. More... | |
Protected Member Functions inherited from ccShiftedObject | |
| bool | saveShiftInfoToFile (QFile &out) const |
| Serialization helper (output) More... | |
| bool | loadShiftInfoFromFile (QFile &in) |
| Serialization helper (input) More... | |
Protected Member Functions inherited from ccHObject | |
| virtual void | setParent (ccHObject *anObject) |
| Sets parent object. More... | |
| virtual void | drawNameIn3D () |
| Draws the entity name in 3D. More... | |
Protected Member Functions inherited from ccObject | |
| virtual bool | getFlagState (CV_OBJECT_FLAG flag) const |
| Returns flag state. More... | |
| virtual void | setFlagState (CV_OBJECT_FLAG flag, bool state) |
| Sets flag state. More... | |
| bool | toFile (QFile &out, short dataVersion) const override |
| Saves data to binary stream. More... | |
| short | minimumFileVersion () const override |
| Returns the minimum file version required to save this instance. More... | |
| bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
| Reimplemented from ccSerializableObject::fromFile. More... | |
Protected Attributes | |
| ccGenericPointCloud * | m_associatedCloud |
| associated cloud (vertices) More... | |
| NormsIndexesTableType * | m_triNormals |
| Per-triangle normals. More... | |
| TextureCoordsContainer * | m_texCoords |
| Texture coordinates. More... | |
| ccMaterialSet * | m_materials |
| Materials. More... | |
| triangleIndexesContainer * | m_triVertIndexes |
| Triangles' vertices indexes (3 per triangle) More... | |
| unsigned | m_globalIterator |
| Iterator on the list of triangles. More... | |
| cloudViewer::SimpleRefTriangle | m_currentTriangle |
| Dump triangle structure to transmit temporary data. More... | |
| ccBBox | m_bBox |
| Bounding-box. More... | |
| triangleMaterialIndexesSet * | m_triMtlIndexes |
| Per-triangle material indexes. More... | |
| triangleTexCoordIndexesSet * | m_texCoordIndexes |
| Mesh tex coords indexes (per-triangle) More... | |
| triangleNormalsIndexesSet * | m_triNormalIndexes |
| Mesh normals indexes (per-triangle) More... | |
Protected Attributes inherited from ccGenericMesh | |
| bool | m_triNormsShown |
| Per-triangle normals display flag. More... | |
| bool | m_materialsShown |
| Texture/material display flag. More... | |
| bool | m_showWired |
| Wireframe display mode. More... | |
| bool | m_showPoints |
| points display mode More... | |
| bool | m_stippling |
| Polygon stippling state. More... | |
Protected Attributes inherited from ccShiftedObject | |
| CCVector3d | m_globalShift |
| Global shift (typically applied at loading time) More... | |
| double | m_globalScale |
| Global scale (typically applied at loading time) More... | |
Protected Attributes inherited from ccHObject | |
| ccHObject * | m_parent |
| Parent. More... | |
| Container | m_children |
| Children. More... | |
| SelectionBehavior | m_selectionBehavior |
| Selection behavior. More... | |
| std::map< ccHObject *, int > | m_dependencies |
| Dependencies map. More... | |
| ccGLMatrix | m_glTransHistory |
| Cumulative GL transformation. More... | |
| bool | m_isDeleting |
| Flag to safely handle dependencies when the object is being deleted. More... | |
Protected Attributes inherited from ccObject | |
| QString | m_name |
| Object name. More... | |
| QString | m_baseName |
| QString | m_filePath |
| bool | m_removeFlag |
| unsigned | m_flags |
| Object flags. More... | |
| QVariantMap | m_metaData |
| Associated meta-data. More... | |
Protected Attributes inherited from ccDrawableObject | |
| bool | m_fixedId |
| bool | m_modelRedraw |
| bool | m_forceRedraw |
| float | m_opacity |
| bool | m_visible |
| Specifies whether the object is visible or not. More... | |
| bool | m_selected |
| Specifies whether the object is selected or not. More... | |
| bool | m_lockedVisibility |
| Specifies whether the visibility can be changed by user or not. More... | |
| bool | m_colorsDisplayed |
| Specifies whether colors should be displayed. More... | |
| bool | m_normalsDisplayed |
| Specifies whether normals should be displayed. More... | |
| bool | m_sfDisplayed |
| Specifies whether scalar field should be displayed. More... | |
| ecvColor::Rgb | m_tempColor |
| Temporary (unique) color. More... | |
| bool | m_colorIsOverridden |
| Temporary (unique) color activation state. More... | |
| ccGLMatrix | m_glTrans |
| Current GL transformation. More... | |
| bool | m_glTransEnabled |
| Current GL transformation activation state. More... | |
| bool | m_showNameIn3D |
| Whether name is displayed in 3D or not. More... | |
| CCVector3d | m_nameIn3DPos |
| Last 2D position of the '3D' name. More... | |
| ccClipPlaneSet | m_clipPlanes |
| Active clipping planes (used for display only) More... | |
| std::vector< DisplayState::Shared > | m_displayStateStack |
| The stack of pushed display states. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from ccGenericMesh | |
| static CCVector3 * | GetVertexBuffer () |
| static CCVector3 * | GetNormalsBuffer () |
| static ecvColor::Rgb * | GetColorsBuffer () |
| static unsigned * | GetWireVertexIndexes () |
| Returns a pre-initialized array of vertex indexes for wired display. More... | |
| using ccMesh::triangleIndexesContainer = ccArray<cloudViewer::VerticesIndexes, 3, unsigned> |
| using ccMesh::triangleMaterialIndexesSet = ccArray<int, 1, int> |
|
protected |
|
protected |
|
explicit |
Default ccMesh constructor.
| vertices | the vertices cloud |
Definition at line 42 of file ecvMesh.cpp.
References CCShareable::link(), m_triVertIndexes, and setAssociatedCloud().
Referenced by cloneMesh(), createNewMeshFromSelection(), operator+(), partialClone(), subdivide(), Triangulate(), and TriangulateTwoPolylines().
| ccMesh::ccMesh | ( | const ccMesh & | mesh | ) |
Definition at line 59 of file ecvMesh.cpp.
References ccHObject::addChild(), ccHObject::getChildrenNumber(), m_associatedCloud, ccObject::setEnabled(), and ccObject::setLocked().
|
explicit |
Parameterized Constructor.
| vertices | list of vertices. |
| triangles | list of triangles. |
Definition at line 70 of file ecvMesh.cpp.
References ccHObject::addChild(), m_associatedCloud, ccPointCloud::resize(), setEigenVertices(), ccObject::setEnabled(), ccObject::setLocked(), setTriangles(), and ccHObjectCaster::ToPointCloud().
|
explicit |
ccMesh constructor (from a cloudViewer::GenericIndexedMesh)
The GenericIndexedMesh should refer to a known ccGenericPointCloud.
| giMesh | the GenericIndexedMesh |
| giVertices | giMesh vertices |
Definition at line 86 of file ecvMesh.cpp.
References addTriangle(), ccDrawableObject::colorsShown(), cloudViewer::GenericIndexedMesh::getNextTriangleVertIndexes(), ccDrawableObject::hasColors(), ccDrawableObject::hasDisplayedScalarField(), ccDrawableObject::hasNormals(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, CCShareable::link(), m_triVertIndexes, cloudViewer::GenericMesh::placeIteratorAtBeginning(), reserve(), setAssociatedCloud(), ccDrawableObject::sfShown(), ccDrawableObject::showColors(), ccGenericMesh::showNormals(), ccDrawableObject::showSF(), and cloudViewer::GenericMesh::size().
|
override |
Default destructor.
Definition at line 122 of file ecvMesh.cpp.
References clearTriNormals(), m_texCoordIndexes, m_triMtlIndexes, m_triNormalIndexes, m_triVertIndexes, CCShareable::release(), setMaterialSet(), and setTexCoordinatesTable().
|
overridevirtual |
Returns the next triangle (relatively to the global iterator position)
Virtual method to handle the mesh global iterator. Global iterator position should be increased each time this method is called. The returned object can be temporary.
Implements cloudViewer::GenericMesh.
Definition at line 2165 of file ecvMesh.cpp.
References _getTriangle(), m_globalIterator, and size().
Referenced by qVoxFallProcess::Compute().
|
overridevirtual |
Returns the ith triangle.
Virtual method to request a triangle with a specific index. The returned object can be temporary.
| triangleIndex | of the requested triangle (between 0 and the mesh size-1) |
Implements cloudViewer::GenericIndexedMesh.
Definition at line 2173 of file ecvMesh.cpp.
References cloudViewer::SimpleRefTriangle::A, cloudViewer::SimpleRefTriangle::B, cloudViewer::SimpleRefTriangle::C, cloudViewer::GenericIndexedCloud::getPoint(), ccArray< Type, N, ComponentType >::getValue(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_associatedCloud, m_currentTriangle, m_triVertIndexes, and size().
Referenced by _getNextTriangle(), ccSubMesh::_getNextTriangle(), ccSubMesh::_getTriangle(), ccSubMesh::forEach(), and ccSubMesh::refreshBB().
| void ccMesh::addEigenVertices | ( | const std::vector< Eigen::Vector3d > & | vertices | ) |
Definition at line 2377 of file ecvMesh.cpp.
References cloudViewer::PointCloudTpl< T >::addPoints(), m_associatedCloud, ccPointCloud::reserveThePointsTable(), cloudViewer::PointCloudTpl< T >::size(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::t::geometry::TriangleMesh::ToLegacy().
| void ccMesh::addTriangle | ( | const cloudViewer::VerticesIndexes & | triangle | ) |
Definition at line 2432 of file ecvMesh.cpp.
References m_triVertIndexes.
|
inline |
| void ccMesh::addTriangle | ( | unsigned | i1, |
| unsigned | i2, | ||
| unsigned | i3 | ||
| ) |
Adds a triangle to the mesh.
| i1 | first vertex index (relatively to the vertex cloud) |
| i2 | second vertex index (relatively to the vertex cloud) |
| i3 | third vertex index (relatively to the vertex cloud) |
Definition at line 2428 of file ecvMesh.cpp.
References m_triVertIndexes.
Referenced by MeshWrapper< Real >::addTriangle(), cloudViewer::io::AddTrianglesByEarClipping(), ccCone::buildUp(), ccDisc::buildUp(), ccDish::buildUp(), ccExtru::buildUp(), ccPlane::buildUp(), ccQuadric::buildUp(), ccSphere::buildUp(), ccTorus::buildUp(), ccMesh(), cloneMesh(), pcl2cc::Convert(), DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertProfileToMesh(), vtk2cc::ConvertToMesh(), define_ccMesh(), face_cb(), FromFbxMesh(), STEPFilter::importStepFile(), STLFilter::loadASCIIFile(), STLFilter::loadBinaryFile(), CSVMatrixFilter::loadFile(), ObjFilter::loadFile(), OFFFilter::loadFile(), VTKFilter::loadFile(), DRCFilter::loadFile(), merge(), ccGenericPrimitive::operator+=(), partialClone(), pushSubdivide(), cloudViewer::io::ReadTriangleMeshFromGLTF(), cloudViewer::io::ReadTriangleMeshFromOBJ(), cloudViewer::io::ReadTriangleMeshUsingASSIMP(), cloudViewer::t::geometry::TriangleMesh::ToLegacy(), Cloth::toMesh(), ccPointCloud::triangulateGrid(), and GrainsAsEllipsoids::updateMeshAndLineSet().
| void ccMesh::addTriangleMtlIndex | ( | int | mtlIndex | ) |
Adds triangle material index for next triangle.
Cf. ccMesh::reservePerTriangleMtlIndexes.
| mtlIndex | triangle material index |
Definition at line 3751 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::isAllocated(), and m_triMtlIndexes.
Referenced by DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertProfileToMesh(), createNewMeshFromSelection(), ccCropTool::Crop(), FromFbxMesh(), CSVMatrixFilter::loadFile(), ObjFilter::loadFile(), PlyFilter::loadFile(), partialClone(), and ccPlane::SetQuadTexture().
| bool ccMesh::addTriangleNorm | ( | const CCVector3 & | N | ) |
Definition at line 3513 of file ecvMesh.cpp.
References addTriangleNormalIndexes(), arePerTriangleNormalsEnabled(), ccNormalVectors::GetNormIndex(), m_triNormals, CCShareable::release(), reservePerTriangleNormalIndexes(), setTriNormsTable(), Tuple3Tpl< Type >::u, and CVLog::Warning().
Referenced by addTriangleNorm(), and addTriangleNorms().
| bool ccMesh::addTriangleNorm | ( | const Eigen::Vector3d & | N | ) |
Definition at line 3531 of file ecvMesh.cpp.
References addTriangleNorm(), and Vector3Tpl< PointCoordinateType >::fromArray().
| void ccMesh::addTriangleNormalIndexes | ( | int | i1, |
| int | i2, | ||
| int | i3 | ||
| ) |
Adds a triplet of normal indexes for next triangle.
Make sure per-triangle normal indexes array is allocated (see reservePerTriangleNormalIndexes)
| i1 | first vertex normal index |
| i2 | second vertex normal index |
| i3 | third vertex normal index |
Definition at line 3340 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::isAllocated(), and m_triNormalIndexes.
Referenced by addTriangleNorm(), ccCone::buildUp(), ccDisc::buildUp(), ccExtru::buildUp(), ccPlane::buildUp(), ccTorus::buildUp(), computePerTriangleNormals(), createNewMeshFromSelection(), FromFbxMesh(), STLFilter::loadASCIIFile(), STLFilter::loadBinaryFile(), ObjFilter::loadFile(), VTKFilter::loadFile(), ccGenericPrimitive::operator+=(), and partialClone().
| bool ccMesh::addTriangleNorms | ( | const std::vector< Eigen::Vector3d > & | triangle_normals | ) |
Definition at line 3571 of file ecvMesh.cpp.
References addTriangleNorm(), LogWarning, normal, reserve(), and size().
|
inline |
Definition at line 265 of file ecvMesh.h.
Referenced by define_ccMesh().
| void ccMesh::addTriangleTexCoordIndexes | ( | int | i1, |
| int | i2, | ||
| int | i3 | ||
| ) |
Adds a triplet of tex coords indexes for next triangle.
Make sure per-triangle tex coords indexes array is allocated (see reservePerTriangleTexCoordIndexes)
| i1 | first vertex tex coords index |
| i2 | second vertex tex coords index |
| i3 | third vertex tex coords index |
Definition at line 3678 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::isAllocated(), and m_texCoordIndexes.
Referenced by DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertProfileToMesh(), createNewMeshFromSelection(), ccCropTool::Crop(), FromFbxMesh(), CSVMatrixFilter::loadFile(), ObjFilter::loadFile(), PlyFilter::loadFile(), partialClone(), and ccPlane::SetQuadTexture().
| void ccMesh::addVertexColor | ( | const Eigen::Vector3d & | color | ) |
Definition at line 2289 of file ecvMesh.cpp.
References ccPointCloud::addEigenColor(), color, m_associatedCloud, and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::io::ReadTriangleMeshUsingASSIMP().
| void ccMesh::addVertexColors | ( | const std::vector< Eigen::Vector3d > & | colors | ) |
Definition at line 2327 of file ecvMesh.cpp.
References ccPointCloud::addEigenColors(), colors, m_associatedCloud, ccPointCloud::reserveTheRGBTable(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::t::geometry::TriangleMesh::ToLegacy().
| void ccMesh::addVertexNormal | ( | const Eigen::Vector3d & | normal | ) |
Definition at line 2244 of file ecvMesh.cpp.
References ccPointCloud::addEigenNorm(), m_associatedCloud, normal, and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::io::ReadTriangleMeshUsingASSIMP().
| void ccMesh::addVertexNormals | ( | const std::vector< Eigen::Vector3d > & | normals | ) |
Definition at line 2273 of file ecvMesh.cpp.
References ccPointCloud::addEigenNorms(), m_associatedCloud, normals, ccPointCloud::reserveTheNormsTable(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::t::geometry::TriangleMesh::ToLegacy().
| void ccMesh::addVertice | ( | const Eigen::Vector3d & | vertice | ) |
Definition at line 2230 of file ecvMesh.cpp.
References cloudViewer::PointCloudTpl< T >::addEigenPoint(), getAssociatedCloud(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::io::ReadTriangleMeshUsingASSIMP().
|
overrideprotectedvirtual |
Applies a GL transformation to the entity.
this = rotMat*(this-rotCenter)+(rotCenter+trans)
| trans | a ccGLMatrix structure |
Reimplemented from ccHObject.
Definition at line 514 of file ecvMesh.cpp.
References ccHObject::applyGLTransformation(), and transformTriNormals().
Referenced by ccGenericPrimitive::applyGLTransformation().
| bool ccMesh::arePerTriangleNormalsEnabled | ( | ) | const |
Returns whether per triangle normals are enabled.
To enable per triangle normals, you should:
Definition at line 3319 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::isAllocated(), and m_triNormalIndexes.
Referenced by addTriangleNorm().
|
overridevirtual |
Returns max capacity.
Implements ccGenericMesh.
Definition at line 2147 of file ecvMesh.cpp.
References m_triVertIndexes.
Referenced by MeshWrapper< Real >::checkMeshCapacity(), face_cb(), STEPFilter::importStepFile(), STLFilter::loadASCIIFile(), ObjFilter::loadFile(), OFFFilter::loadFile(), VTKFilter::loadFile(), and pushSubdivide().
| void ccMesh::clear | ( | ) |
Definition at line 2126 of file ecvMesh.cpp.
References adjacency_list_, ccPointCloud::clear(), clearTriNormals(), getAssociatedCloud(), cloudViewer::GenericCloud::hasPoints(), materials_, resize(), textures_, ccHObjectCaster::ToPointCloud(), triangle_material_ids_, and triangle_uvs_.
Referenced by ComputeAdjacencyList(), cloudViewer::io::ReadTriangleMeshFromGLTF(), cloudViewer::io::ReadTriangleMeshFromOBJ(), cloudViewer::io::ReadTriangleMeshFromPLY(), and cloudViewer::io::ReadTriangleMeshUsingASSIMP().
|
inline |
Removes per-triangle normals.
Definition at line 353 of file ecvMesh.h.
Referenced by clear(), ccEntityAction::clearProperty(), CommandClearNormals::process(), and ~ccMesh().
| ccMesh * ccMesh::cloneMesh | ( | ccGenericPointCloud * | vertices = nullptr, |
| ccMaterialSet * | clonedMaterials = nullptr, |
||
| NormsIndexesTableType * | clonedNormsTable = nullptr, |
||
| TextureCoordsContainer * | cloneTexCoords = nullptr |
||
| ) |
Clones this entity.
All the main features of the entity are cloned, except from the octree
| vertices | vertices set to use (will be automatically - AND OPTIMALLY - cloned if 0) |
| clonedMaterials | for internal use |
| clonedNormsTable | for internal use |
| cloneTexCoords | for internal use |
Definition at line 1109 of file ecvMesh.cpp.
References ccHObject::addChild(), cloudViewer::ReferenceCloud::addPointIndex(), addTriangle(), ccMesh(), ccMaterialSet::clone(), NormsIndexesTableType::clone(), TextureCoordsContainer::clone(), ccGenericPointCloud::clone(), ccDrawableObject::colorsShown(), computeNormals(), ccArray< Type, N, ComponentType >::copy(), CVLog::Error(), getMaterialSet(), ccObject::getName(), getNextTriangleVertIndexes(), hasNormals(), hasTriNormals(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, ccGenericMesh::importParametersFrom(), ccObject::isA(), ccObject::isEnabled(), ccDrawableObject::isVisible(), m_associatedCloud, m_materials, m_texCoordIndexes, m_texCoords, m_triMtlIndexes, m_triNormalIndexes, m_triNormals, ccGenericMesh::materialsShown(), normalsShown(), partialClone(), placeIteratorAtBeginning(), CV_TYPES::POINT_CLOUD, removePerTriangleMtlIndexes(), removePerTriangleNormalIndexes(), removePerTriangleTexCoordIndexes(), reserve(), cloudViewer::ReferenceCloud::reserve(), reservePerTriangleMtlIndexes(), reservePerTriangleNormalIndexes(), reservePerTriangleTexCoordIndexes(), ccObject::setEnabled(), setMaterialSet(), ccObject::setName(), setTexCoordinatesTable(), setTriNormsTable(), ccDrawableObject::setVisible(), ccDrawableObject::sfShown(), ccDrawableObject::showColors(), ccGenericMesh::showMaterials(), ccGenericMesh::showNormals(), ccDrawableObject::showSF(), cloudViewer::GenericCloud::size(), cloudViewer::ReferenceCloud::size(), size(), and CVLog::Warning().
Referenced by ccPointCloud::append(), ccFacet::clone(), and qVoxFallProcess::Compute().
| std::tuple< std::vector< int >, std::vector< size_t >, std::vector< double > > ccMesh::ClusterConnectedTriangles | ( | ) | const |
Function that clusters connected triangles, i.e., triangles that are connected via edges are assigned the same cluster index.
Definition at line 1175 of file TriangleMeshFactory.cpp.
References cloudViewer::t::geometry::GetEdgeToTrianglesMap(), cloudViewer::t::geometry::GetOrderedEdge(), LogDebug, and size.
| ccMesh & ccMesh::ComputeAdjacencyList | ( | ) |
Function to compute adjacency list, call before adjacency list is.
Definition at line 1416 of file TriangleMeshFactory.cpp.
| std::tuple< std::shared_ptr< ccMesh >, std::vector< size_t > > ccMesh::ComputeConvexHull | ( | ) | const |
Definition at line 409 of file TriangleMeshFactory.cpp.
References cloudViewer::geometry::Qhull::ComputeConvexHull().
| std::unordered_map< Eigen::Vector2i, double, utility::hash_eigen< Eigen::Vector2i > > ccMesh::ComputeEdgeWeightsCot | ( | const std::unordered_map< Eigen::Vector2i, std::vector< int >, cloudViewer::utility::hash_eigen< Eigen::Vector2i >> & | edges_to_vertices, |
| double | min_weight = std::numeric_limits<double>::lowest() |
||
| ) | const |
Function that computes for each edge in the triangle mesh and passed as parameter edges_to_vertices the cot weight.
| edges_to_vertices | map from edge to vector of neighbouring vertices. |
| min_weight | minimum weight returned. Weights smaller than this get clamped. |
Definition at line 1346 of file TriangleMeshFactory.cpp.
References a.
|
protected |
Same as other 'computeInterpolationWeights' method with a set of 3 vertices indexes
Definition at line 4032 of file ecvMesh.cpp.
References cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_associatedCloud, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
|
overridevirtual |
Returns the (barycentric) interpolation weights for a given triangle.
Reimplemented from ccGenericMesh.
Definition at line 4023 of file ecvMesh.cpp.
References m_triVertIndexes, and size().
Referenced by getColorFromMaterial(), and interpolateColors().
| bool ccMesh::computeNormals | ( | bool | perVertex | ) |
Computes normals.
| perVertex | whether normals should be computed per-vertex or per-triangle |
Definition at line 242 of file ecvMesh.cpp.
References computePerTriangleNormals(), and computePerVertexNormals().
Referenced by ccQuadric::buildUp(), cloneMesh(), qPoissonRecon::doAction(), laplacianSmooth(), partialClone(), ecvPoissonReconDlg::start(), subdivide(), and Triangulate().
| bool ccMesh::computePerTriangleNormals | ( | ) |
Computes per-triangle normals.
Definition at line 331 of file ecvMesh.cpp.
References addTriangleNormalIndexes(), ccNormalVectors::GetNormIndex(), cloudViewer::GenericIndexedCloud::getPoint(), ccArray< Type, N, ComponentType >::getValue(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_associatedCloud, m_triNormalIndexes, m_triVertIndexes, CCShareable::release(), removePerTriangleNormalIndexes(), reservePerTriangleNormalIndexes(), ccArray< Type, N, ComponentType >::reserveSafe(), setTriNormsTable(), showNormals_extended(), size(), Tuple3Tpl< Type >::u, and CVLog::Warning().
Referenced by computeNormals(), qVoxFallTransform::CreateVoxelMesh(), ccCropTool::Crop(), and STEPFilter::importStepFile().
| bool ccMesh::computePerVertexNormals | ( | ) |
Computes per-vertex normals.
normalsWereAllocated &&
Definition at line 246 of file ecvMesh.cpp.
References getNextTriangleVertIndexes(), cloudViewer::PointCloudTpl< T >::getPoint(), ccPointCloud::hasNormals(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, ccObject::isA(), m_associatedCloud, Vector3Tpl< Type >::normalize(), placeIteratorAtBeginning(), CV_TYPES::POINT_CLOUD, ccPointCloud::resize(), s_blankNorm, ccPointCloud::setPointNormal(), ccDrawableObject::showNormals(), showNormals_extended(), cloudViewer::GenericCloud::size(), size(), and CVLog::Warning().
Referenced by computeNormals(), ccCropTool::Crop(), qCSF::doAction(), and CSVMatrixFilter::loadFile().
|
static |
Function that computes the area of a mesh triangle.
Definition at line 1628 of file TriangleMeshFactory.cpp.
| ccMesh & ccMesh::ComputeTriangleNormals | ( | bool | normalized = true | ) |
Function to compute triangle normals, usually called before rendering.
Definition at line 1380 of file TriangleMeshFactory.cpp.
|
static |
Function that computes the plane equation from the three points. If the three points are co-linear, then this function returns the invalid plane (0, 0, 0, 0).
Definition at line 1697 of file TriangleMeshFactory.cpp.
Referenced by ccPointCloud::SegmentPlane().
| ccMesh & ccMesh::ComputeVertexNormals | ( | bool | normalized = true | ) |
Function to compute vertex normals, usually called before rendering.
Definition at line 1388 of file TriangleMeshFactory.cpp.
Referenced by main(), and colmap::mvs::MvsTexturing::TextureMesh().
| bool ccMesh::convertMaterialsToVertexColors | ( | ) |
Converts materials to vertex colors.
Warning: this method will overwrite colors (if any)
Definition at line 4718 of file ecvMesh.cpp.
References getNextTriangleVertIndexes(), getVertexColorFromMaterial(), hasMaterials(), cloudViewer::VerticesIndexes::i, ccObject::isA(), m_associatedCloud, placeIteratorAtBeginning(), CV_TYPES::POINT_CLOUD, ccPointCloud::resizeTheRGBTable(), ccPointCloud::setPointColor(), size(), and CVLog::Warning().
Referenced by ccEntityAction::convertTextureToColor().
|
static |
Factory function to create an arrow mesh (TriangleMeshFactory.cpp) The axis of the cone with cone_radius will be along the z-axis. The cylinder with cylinder_radius is from (0, 0, 0) to (0, 0, cylinder_height), and the cone is from (0, 0, cylinder_height) to (0, 0, cylinder_height + cone_height). The cone will be split into resolution segments. The cylinder_height will be split into cylinder_split segments. The cone_height will be split into cone_split segments.
| cylinder_radius | defines the radius of the cylinder. |
| cone_radius | defines the radius of the cone. |
| cylinder_height | defines the height of the cylinder. The cylinder is from (0, 0, 0) to (0, 0, cylinder_height) |
| cone_height | defines the height of the cone. The axis of the cone will be from (0, 0, cylinder_height) to (0, 0, cylinder_height + cone_height). |
| resolution | defines the cone will be split into resolution segments. |
| cylinder_split | defines the cylinder_height will be split into cylinder_split segments. |
| cone_split | defines the cone_height will be split into cone_split segments. |
Definition at line 2766 of file TriangleMeshFactory.cpp.
References LogError.
Referenced by cloudViewer::t::geometry::TriangleMesh::CreateArrow(), and ccFacet::getNormalVectorMesh().
|
static |
Factory function to create a box mesh (TriangleMeshFactory.cpp) The left bottom corner on the front will be placed at (0, 0, 0).
| width | is x-directional length. |
| height | is y-directional length. |
| depth | is z-directional length. |
| create_uv_map | add default UV map to the shape. |
| map_texture_to_each_face | if true, maps the entire texture image to each face. If false, sets the default uv map to the mesh. |
Definition at line 2091 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::getPointPtr(), height, LogError, normals, ccPointCloud::resize(), ccObject::setEnabled(), ccObject::setLocked(), ccPointCloud::shrinkToFit(), and width.
|
static |
Factory function to create a cone mesh (TriangleMeshFactory.cpp) The axis of the cone will be from (0, 0, 0) to (0, 0, height). The circle with radius will be split into resolution segments. The height will be split into split segments.
| radius | defines the radius of the cone. |
| height | defines the height of the cone. |
| resolution | defines that the circle will be split into resolution segments |
| split | defines that the height will be split into split segments. |
| create_uv_map | add default UV map to the mesh. |
Definition at line 2544 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::getPointPtr(), height, LogError, M_PI, cloudViewer::core::make_pair(), normals, ccPointCloud::resize(), cloudViewer::PointCloudTpl< T >::setEigenPoint(), ccObject::setEnabled(), ccObject::setLocked(), and ccPointCloud::shrinkToFit().
Referenced by cloudViewer::t::geometry::TriangleMesh::CreateCone().
|
static |
Factory function to create a coordinate frame mesh (TriangleMeshFactory.cpp). arrows respectively.
| size | is the length of the axes. |
| size | defines the size of the coordinate frame. |
| origin | defines the origin of the cooridnate frame. |
Definition at line 2808 of file TriangleMeshFactory.cpp.
References LogError, origin, and size.
Referenced by cloudViewer::visualization::Visualizer::BuildUtilities(), cloudViewer::t::geometry::TriangleMesh::CreateCoordinateFrame(), and cloudViewer::visualization::Visualizer::ResetViewPoint().
|
static |
Factory function to create a cylinder mesh (TriangleMeshFactory.cpp) The axis of the cylinder will be from (0, 0, -height/2) to (0, 0, height/2). The circle with radius will be split into resolution segments. The height will be split into split segments.
| radius | defines the radius of the cylinder. |
| height | defines the height of the cylinder. |
| resolution | defines that the circle will be split into resolution segments |
| split | defines that the height will be split into split segments. |
| create_uv_map | add default UV map to the mesh. |
Definition at line 2368 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::getPointPtr(), height, LogError, M_PI, cloudViewer::core::make_pair(), normals, ccPointCloud::resize(), cloudViewer::PointCloudTpl< T >::setEigenPoint(), ccObject::setEnabled(), ccObject::setLocked(), and ccPointCloud::shrinkToFit().
Referenced by cloudViewer::t::geometry::TriangleMesh::CreateCylinder().
|
static |
Alpha shapes are a generalization of the convex hull. With decreasing alpha value the shape schrinks and creates cavities. See Edelsbrunner and Muecke, "Three-Dimensional Alpha Shapes", 1994.
| pcd | PointCloud for what the alpha shape should be computed. |
| alpha | parameter to controll the shape. A very big value will give a shape close to the convex hull. |
| tetra_mesh | If not a nullptr, than uses this to construct the alpha shape. Otherwise, ComputeDelaunayTetrahedralization is called. |
| pt_map | Optional map from tetra_mesh vertex indices to pcd points. |
Definition at line 20 of file SurfaceReconstructionAlphaShape.cpp.
References a, cloudViewer::PointCloudTpl< T >::addPoints(), cloudViewer::geometry::Qhull::ComputeDelaunayTetrahedralization(), GetOrderedTriangle(), ccPointCloud::getPointColor(), ccPointCloud::getPointNormal(), cloudViewer::PointCloudTpl< T >::getPoints(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), LogDebug, LogError, normals, ccPointCloud::resizeTheNormsTable(), ccPointCloud::resizeTheRGBTable(), ccObject::setEnabled(), ccObject::setLocked(), ccPointCloud::setPointColor(), ccPointCloud::setPointNormal(), and ccPointCloud::shrinkToFit().
|
static |
Function that computes a triangle mesh from a oriented PointCloud
| pcd. | This implements the Ball Pivoting algorithm proposed in F. Bernardini et al., "The ball-pivoting algorithm for surface reconstruction", 1999. The implementation is also based on the algorithms outlined in Digne, "An Analysis and Implementation of a Parallel Ball Pivoting Algorithm", 2014. The surface reconstruction is done by rolling a ball with a given radius (cf. |
| radii) | over the point cloud, whenever the ball touches three points a triangle is created. |
| pcd | defines the PointCloud from which the ccMesh surface is reconstructed. Has to contain normals. |
| radii | defines the radii of the ball that are used for the surface reconstruction. |
Definition at line 770 of file SurfaceReconstructionBallPivoting.cpp.
References radii, and BallPivoting::Run().
Referenced by cloudViewer::pipelines::registration::BenchmarkCreateFromPointCloudBallPivoting().
|
static |
Function that computes a triangle mesh from a oriented PointCloud pcd. This implements the Screened Poisson Reconstruction proposed in Kazhdan and Hoppe, "Screened Poisson Surface Reconstruction", 2013. This function uses the original implementation by Kazhdan. See https://github.com/mkazhdan/PoissonRecon.
| pcd | PointCloud with normals and optionally colors. |
| depth | Maximum depth of the tree that will be used for surface reconstruction. Running at depth d corresponds to solving on a grid whose resolution is no larger than 2^d x 2^d x 2^d. Note that since the reconstructor adapts the octree to the sampling density, the specified reconstruction depth is only an upper bound. |
| width | Specifies the target width of the finest level octree cells. This parameter is ignored if depth is specified. |
| scale | Specifies the ratio between the diameter of the cube used for reconstruction and the diameter of the samples' bounding cube. |
| linear_fit | If true, the reconstructor use linear interpolation to estimate the positions of iso-vertices. |
| point_weight | The importance that interpolation of the point samples is given in the formulation of the screened Poisson equation. The results of the original (unscreened) Poisson Reconstruction can be obtained by setting this value to 0 |
| samples_per_node | The minimum number of sample points that should fall within an octree node as the octree construction is adapted to sampling density. This parameter specifies the minimum number of points that should fall within an octree node. For noise-free samples, small values in the range [1.0 - 5.0] can be used. For more noisy samples, larger values in the range [15.0 - 20.0] may be needed to provide a smoother, noise-reduced, reconstruction. |
| boundary_type | Boundary type for the finite elements |
| n_threads | Number of threads used for reconstruction. Set to -1 to automatically determine it. |
Definition at line 768 of file SurfaceReconstructionPoisson.cpp.
References poisson::DEFAULT_FEM_DEGREE, poisson::DIMENSION, ccPointCloud::hasNormals(), LogError, and width.
Referenced by doReconstruct().
|
static |
Factory function to create an icosahedron mesh (trianglemeshfactory.cpp). The mesh centroid will be at (0,0,0) and
| radius | defines the distance from the center to the mesh vertices. |
| create_uv_map | add default UV map to the mesh. |
Definition at line 1959 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::addEigenPoint(), LogError, normals, ccObject::setEnabled(), ccObject::setLocked(), and ccPointCloud::shrinkToFit().
Referenced by cloudViewer::t::geometry::TriangleMesh::CreateIcosahedron().
|
static |
Factory function to create a Mobius strip.
| length_split | defines the number of segments along the Mobius strip. |
| width_split | defines the number of segments along the width of the Mobius strip. |
| twists | defines the number of twists of the strip. |
| radius | defines the radius of the Mobius strip. |
| flatness | controls the height of the strip. |
| width | controls the width of the Mobius strip. |
| scale | is used to scale the entire Mobius strip. |
Definition at line 2850 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::getPointPtr(), LogError, M_PI, normals, ccPointCloud::resize(), ccObject::setEnabled(), ccObject::setLocked(), ccPointCloud::shrinkToFit(), width, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by cloudViewer::t::geometry::TriangleMesh::CreateMobius().
| ccMesh * ccMesh::createNewMeshFromSelection | ( | bool | removeSelectedTriangles, |
| std::vector< int > * | newIndexesOfRemainingTriangles = nullptr, |
||
| bool | withChildEntities = false |
||
| ) |
Creates a new mesh with the selected vertices only.
This method is called after a graphical segmentation. It creates a new mesh structure with the vertices that are tagged as "visible" (see ccGenericPointCloud::visibilityArray). This method will also update this mesh if removeSelectedFaces is true. In this case, all "selected" triangles will be removed from this mesh's instance.
\param removeSelectedTriangles specifies if the
faces composed only of 'selected' vertices should be removed or not. If true, the visibility array will be automatically unallocated on completion
| newIndexesOfRemainingTriangles | the new indexes of the remaining triangles (if removeSelectedTriangles is true - optional). Must be initially empty or have the same size as the original mesh. |
| withChildEntities | whether child entities should be transferred as well (see ccHObjectCaster::CloneChildren) |
Definition at line 2747 of file ecvMesh.cpp.
References ccHObject::addChild(), addTriangleMtlIndex(), addTriangleNormalIndexes(), addTriangleTexCoordIndexes(), ccMesh(), ccHObjectCaster::CloneChildren(), ccDrawableObject::colorsShown(), ccGenericPointCloud::createNewCloudFromVisibilitySelection(), ccSubMesh::createNewSubMeshFromSelection(), ccHObject::filterChildren(), ccObject::getName(), ccGenericPointCloud::getTheVisibilityArray(), ccArray< Type, N, ComponentType >::getValue(), cloudViewer::VerticesIndexes::i, ccGenericMesh::importParametersFrom(), ccObject::isEnabled(), ccDrawableObject::isVisible(), CCShareable::link(), m_associatedCloud, m_materials, m_texCoordIndexes, m_texCoords, m_triMtlIndexes, m_triNormalIndexes, m_triNormals, m_triVertIndexes, ccGenericMesh::materialsShown(), normalsShown(), ccHObject::notifyGeometryUpdate(), POINT_HIDDEN, CCShareable::release(), ccHObject::removeChild(), removePerTriangleMtlIndexes(), removePerTriangleNormalIndexes(), removePerTriangleTexCoordIndexes(), ccGenericPointCloud::removeVisiblePoints(), reservePerTriangleMtlIndexes(), reservePerTriangleNormalIndexes(), reservePerTriangleTexCoordIndexes(), ccArray< Type, N, ComponentType >::reserveSafe(), resize(), cloudViewer::ManualSegmentationTools::segmentMesh(), ccSubMesh::setAssociatedMesh(), ccObject::setEnabled(), setMaterialSet(), ccObject::setName(), setTexCoordinatesTable(), setTriNormsTable(), ccArray< Type, N, ComponentType >::setValue(), ccDrawableObject::setVisible(), ccDrawableObject::sfShown(), ccDrawableObject::showColors(), ccGenericMesh::showMaterials(), ccGenericMesh::showNormals(), ccDrawableObject::showSF(), cloudViewer::GenericCloud::size(), cloudViewer::ReferenceCloud::size(), size(), ccSubMesh::size(), CV_TYPES::SUB_MESH, Tuple3Tpl< Type >::u, ccGenericPointCloud::unallocateVisibilityArray(), and CVLog::Warning().
Referenced by ecvFilterByLabelDlg::apply(), and ccGraphicalSegmentationTool::applySegmentation().
|
static |
Factory function to create an octahedron mesh (trianglemeshfactory.cpp). the mesh centroid will be at (0,0,0) and radius defines the distance from the center to the mesh vertices.
| radius | defines the distance from centroid to mesh vetices. |
| create_uv_map | add default UV map to the mesh. |
Definition at line 1902 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::addEigenPoint(), LogError, normals, ccObject::setEnabled(), ccObject::setLocked(), and ccPointCloud::shrinkToFit().
Referenced by cloudViewer::t::geometry::TriangleMesh::CreateOctahedron().
|
static |
Factory function to create a plane mesh (TriangleMeshFactory.cpp) The left bottom corner on the front will be placed at (0, 0, 0).
| width | is x-directional length. |
| height | is y-directional length. |
| create_uv_map | add default UV map to the shape. |
Definition at line 2047 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::getPointPtr(), height, LogError, normals, ccPointCloud::resize(), ccObject::setEnabled(), ccObject::setLocked(), ccPointCloud::shrinkToFit(), and width.
|
static |
Factory function to create a sphere mesh (TriangleMeshFactory.cpp) The sphere with radius will be centered at (0, 0, 0). Its axis is aligned with z-axis.
| radius | defines radius of the sphere. |
| resolution | defines the resolution of the sphere. The longitudes will be split into resolution segments (i.e. there are resolution + 1 latitude lines including the north and south pole). The latitudes will be split into `2 * resolution segments (i.e. there are 2 * resolution longitude lines.) |
| create_uv_map | add default UV map to the mesh. |
Definition at line 2180 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::getPointPtr(), LogError, M_PI, cloudViewer::core::make_pair(), normals, ccPointCloud::resize(), cloudViewer::PointCloudTpl< T >::setEigenPoint(), ccObject::setEnabled(), ccObject::setLocked(), ccPointCloud::shrinkToFit(), and width.
Referenced by cloudViewer::t::geometry::TriangleMesh::CreateSphere(), and cloudViewer::visualization::rendering::LightDirectionInteractorLogic::StartMouseDrag().
|
static |
Factory function to create a tetrahedron mesh (trianglemeshfactory.cpp). the mesh centroid will be at (0,0,0) and radius defines the distance from the center to the mesh vertices.
| radius | defines the distance from centroid to mesh vetices. |
| create_uv_map | add default UV map to the mesh. |
Definition at line 1851 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::addEigenPoint(), LogError, normals, ccObject::setEnabled(), ccObject::setLocked(), and ccPointCloud::shrinkToFit().
Referenced by cloudViewer::t::geometry::TriangleMesh::CreateTetrahedron().
|
static |
Factory function to create a torus mesh (TriangleMeshFactory.cpp) The torus will be centered at (0, 0, 0) and a radius of torus_radius. The tube of the torus will have a radius of tube_radius. The number of segments in radial and tubular direction are radial_resolution and tubular_resolution respectively.
| torus_radius | defines the radius from the center of the torus to the center of the tube. |
| tube_radius | defines the radius of the torus tube. |
| radial_resolution | defines the he number of segments along the radial direction. |
| tubular_resolution | defines the number of segments along the tubular direction. |
Definition at line 2689 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::getPointPtr(), LogError, M_PI, normals, ccPointCloud::resize(), ccObject::setEnabled(), ccObject::setLocked(), and ccPointCloud::shrinkToFit().
Referenced by cloudViewer::t::geometry::TriangleMesh::CreateTorus().
Function to crop pointcloud into output pointcloud All points with coordinates outside the bounding box
| bbox | are clipped. |
| bbox | defines the input Axis Aligned Bounding Box. |
Definition at line 992 of file ecvMesh.cpp.
References cloudViewer::BoundingBoxTpl< T >::GetPointIndicesWithinBoundingBox(), getVertices(), cloudViewer::BoundingBoxTpl< T >::isValid(), LogError, and SelectByIndex().
| std::shared_ptr< ccMesh > ccMesh::Crop | ( | const ecvOrientedBBox & | bbox | ) | const |
Function to crop pointcloud into output pointcloud All points with coordinates outside the bounding box
| bbox | are clipped. |
| bbox | defines the input Oriented Bounding Box. |
Definition at line 1002 of file ecvMesh.cpp.
References cloudViewer::OrientedBoundingBox::GetPointIndicesWithinBoundingBox(), cloudViewer::PointCloudTpl< T >::getPoints(), ecvOrientedBBox::IsEmpty(), LogError, m_associatedCloud, SelectByIndex(), and ccHObjectCaster::ToPointCloud().
| std::shared_ptr< ccMesh > ccMesh::DeformAsRigidAsPossible | ( | const std::vector< int > & | constraint_vertex_indices, |
| const std::vector< Eigen::Vector3d > & | constraint_vertex_positions, | ||
| size_t | max_iter, | ||
| DeformAsRigidAsPossibleEnergy | energy = DeformAsRigidAsPossibleEnergy::Spokes, |
||
| double | smoothed_alpha = 0.01 |
||
| ) | const |
This function deforms the mesh using the method by Sorkine and Alexa, "As-Rigid-As-Possible Surface Modeling", 2007.
| constraint_vertex_indices | Indices of the triangle vertices that should be constrained by the vertex positions in constraint_vertex_positions. |
| constraint_vertex_positions | Vertex positions used for the constraints. |
| max_iter | maximum number of iterations to minimize energy functional. |
| energy | energy model that should be optimized |
| smoothed_alpha | alpha parameter of the smoothed ARAP model |
Definition at line 21 of file TriangleMeshDeformation.cpp.
References cloudViewer::PointCloudTpl< T >::addPoints(), cloudViewer::t::geometry::GetOrderedEdge(), cloudViewer::PointCloudTpl< T >::getPointPtr(), LogDebug, LogError, normals, ccObject::setEnabled(), ccObject::setLocked(), ccPointCloud::shrinkToFit(), and std::swap().
|
overrideprotectedvirtual |
Enables (OpenGL) stipple mask.
Reimplemented from ccGenericMesh.
Reimplemented in ccPlane.
Definition at line 2635 of file ecvMesh.cpp.
References ccScalarField::areNaNValuesShownInGrey(), cloudViewer::utility::ceil(), context, ecvDisplayTools::Draw(), ECV_POINTS_MODE, ECV_SURFACE_MODE, ECV_WIREFRAME_MODE, ccPointCloud::getCurrentDisplayedScalarField(), ccDrawableObject::getDrawingParameters(), ecvDisplayTools::GetMainWindow(), ccGenericPointCloud::getTheVisibilityArray(), ccGenericMesh::handleColorRamp(), hasMaterials(), ccDrawableObject::hasNormals(), hasTextures(), hasTriNormals(), ccObject::isA(), ccDrawableObject::isColorOverridden(), ccGenericMesh::isShownAsPoints(), ccGenericMesh::isShownAsWire(), ecvColor::lightGrey(), m_associatedCloud, ccDrawableObject::m_normalsDisplayed, ccDrawableObject::m_tempColor, m_triVertIndexes, MACRO_Draw3D, MACRO_EntityPicking, MACRO_FastEntityPicking, MACRO_LightIsEnabled, MACRO_LODActivated, ccGenericMesh::materialsShown(), CV_TYPES::POINT_CLOUD, glDrawParams::showColors, glDrawParams::showNorms, glDrawParams::showSF, ccGenericMesh::showWired(), cloudViewer::GenericCloud::size(), and ccGenericMesh::triNormsShown().
Referenced by ccCoordinateSystem::drawMeOnly(), and ccPlane::drawMeOnly().
| int ccMesh::EulerPoincareCharacteristic | ( | ) | const |
Function that computes the Euler-Poincaré characteristic, i.e., V + F - E, where V is the number of vertices, F is the number of triangles, and E is the number of edges.
Definition at line 879 of file TriangleMeshFactory.cpp.
References cloudViewer::t::geometry::GetOrderedEdge(), and size.
| std::shared_ptr< ccMesh > ccMesh::FilterSharpen | ( | int | number_of_iterations, |
| double | strength, | ||
| FilterScope | scope = FilterScope::All |
||
| ) | const |
Function to sharpen triangle mesh.
The output value ($v_o$) is the input value ($v_i$) plus strength times the input value minus the sum of he adjacent values. $v_o = v_i x strength (v_i * |N| - \sum_{n \in N} v_n)$.
| number_of_iterations | defines the number of repetitions of this operation. |
| strength | - The strength of the filter. |
Definition at line 413 of file TriangleMeshFactory.cpp.
References ccPointCloud::getPointNormals(), cloudViewer::PointCloudTpl< T >::getPoints(), ccArray< Type, N, ComponentType >::getValue(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), normals, ccPointCloud::resize(), ccPointCloud::resizeTheNormsTable(), ccPointCloud::resizeTheRGBTable(), ccPointCloud::rgbColors(), ccObject::setEnabled(), ccObject::setLocked(), cloudViewer::PointCloudTpl< T >::setPoint(), ccPointCloud::setPointColor(), ccPointCloud::setPointNormal(), ccPointCloud::shrinkToFit(), cloudViewer::PointCloudTpl< T >::size(), std::swap(), ecvColor::RgbTpl< Type >::ToEigen(), and ccHObjectCaster::ToPointCloud().
| std::shared_ptr< ccMesh > ccMesh::FilterSmoothLaplacian | ( | int | number_of_iterations, |
| double | lambda, | ||
| FilterScope | scope = FilterScope::All |
||
| ) | const |
Function to smooth triangle mesh using Laplacian.
$v_o = v_i \cdot \lambda (sum_{n \in N} w_n v_n - v_i)$, with $v_i$ being the input value, $v_o$ the output value, $N$ is the set of adjacent neighbours, $w_n$ is the weighting of the neighbour based on the inverse distance (closer neighbours have higher weight),
| number_of_iterations | defines the number of repetitions of this operation. |
| lambda | is the smoothing parameter. |
Definition at line 706 of file TriangleMeshFactory.cpp.
References ccPointCloud::getPointNormals(), cloudViewer::PointCloudTpl< T >::getPoints(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), normals, ccPointCloud::resize(), ccPointCloud::resizeTheNormsTable(), ccPointCloud::resizeTheRGBTable(), ccPointCloud::rgbColors(), ccObject::setEnabled(), ccObject::setLocked(), ccPointCloud::shrinkToFit(), cloudViewer::PointCloudTpl< T >::size(), std::swap(), and ccHObjectCaster::ToPointCloud().
|
protected |
| std::shared_ptr< ccMesh > ccMesh::FilterSmoothSimple | ( | int | number_of_iterations, |
| FilterScope | scope = FilterScope::All |
||
| ) | const |
Function to smooth triangle mesh with simple neighbour average.
$v_o = \frac{v_i + \sum_{n \in N} v_n)}{|N| + 1}$, with $v_i$ being the input value, $v_o$ the output value, and $N$ is the set of adjacent neighbours.
| number_of_iterations | defines the number of repetitions of this operation. |
Definition at line 535 of file TriangleMeshFactory.cpp.
References ccPointCloud::getPointNormals(), cloudViewer::PointCloudTpl< T >::getPoints(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), normals, ccPointCloud::resize(), ccPointCloud::resizeTheNormsTable(), ccPointCloud::resizeTheRGBTable(), ccPointCloud::rgbColors(), ccObject::setEnabled(), ccObject::setLocked(), cloudViewer::PointCloudTpl< T >::setPoint(), ccPointCloud::setPointColor(), ccPointCloud::setPointNormal(), ccPointCloud::shrinkToFit(), cloudViewer::PointCloudTpl< T >::size(), std::swap(), ecvColor::RgbTpl< Type >::ToEigen(), and ccHObjectCaster::ToPointCloud().
| std::shared_ptr< ccMesh > ccMesh::FilterSmoothTaubin | ( | int | number_of_iterations, |
| double | lambda = 0.5, |
||
| double | mu = -0.53, |
||
| FilterScope | scope = FilterScope::All |
||
| ) | const |
Function to smooth triangle mesh using method of Taubin, "Curve and Surface Smoothing Without Shrinkage", 1995. Applies in each iteration two times FilterSmoothLaplacian, first with lambda and second with mu as smoothing parameter. This method avoids shrinkage of the triangle mesh.
| number_of_iterations | defines the number of repetitions of this operation. |
| lambda | is the filter parameter |
| mu | is the filter parameter |
Definition at line 785 of file TriangleMeshFactory.cpp.
References ccPointCloud::getPointNormals(), cloudViewer::PointCloudTpl< T >::getPoints(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), normals, ccPointCloud::resize(), ccPointCloud::resizeTheNormsTable(), ccPointCloud::resizeTheRGBTable(), ccPointCloud::rgbColors(), ccObject::setEnabled(), ccObject::setLocked(), ccPointCloud::shrinkToFit(), cloudViewer::PointCloudTpl< T >::size(), std::swap(), and ccHObjectCaster::ToPointCloud().
| void ccMesh::flipTriangles | ( | ) |
Flips the triangle.
Swaps the second and third vertices indexes
Definition at line 3309 of file ecvMesh.cpp.
References m_triVertIndexes, and std::swap().
|
overridevirtual |
Fast iteration mechanism.
Virtual method to apply a function to the whole mesh
| action | function to apply (see GenericMesh::genericTriangleAction) |
Implements cloudViewer::GenericMesh.
Definition at line 2151 of file ecvMesh.cpp.
References cloudViewer::SimpleRefTriangle::A, cloudViewer::SimpleRefTriangle::B, cloudViewer::SimpleRefTriangle::C, cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_associatedCloud, m_currentTriangle, and m_triVertIndexes.
|
overrideprotectedvirtual |
Loads own object data.
Called by 'fromFile' (recursive scheme) To be overloaded (but still called ;) by subclass.
| in | input file |
| dataVersion | file version |
| flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
| oldToNewIDMap | map to link old IDs with new IDs |
Reimplemented from ccGenericMesh.
Reimplemented in ccTorus, ccSphere, ccQuadric, and ccPlane.
Definition at line 3877 of file ecvMesh.cpp.
|
inlineoverridevirtual |
Returns the vertices cloud.
Implements ccGenericMesh.
Definition at line 143 of file ecvMesh.h.
Referenced by addVertice(), ccPointCloud::append(), cloudViewer::io::AutoReadEntity(), CCMeshToDraco(), clear(), ccEntityAction::clearProperty(), ConvexConcaveHullReconstruction::compute(), GreedyTriangulation::compute(), MarchingCubeReconstruction::compute(), NurbsSurfaceReconstruction::compute(), PoissonReconstruction::compute(), cloudViewer::visualization::SelectionPolygonVolume::CropTriangleMesh(), cloudViewer::visualization::SelectionPolygon::CropTriangleMesh(), ccSubMesh::getAssociatedCloud(), GetCenter(), getEigenVertices(), GetMaxBound(), GetMinBound(), cvIsoSurfaceFilter::getOutput(), cvSliceFilter::getOutput(), getVertice(), getVertices(), getVerticeSize(), getVerticesPtr(), STLFilter::loadFile(), merge(), ccGenericPrimitive::operator+=(), operator=(), CommandClearNormals::process(), CommandDelaunayTri::process(), ccEntityAction::processMeshSF(), pushSubdivide(), cloudViewer::io::ReadTriangleMesh(), cloudViewer::io::ReadTriangleMeshFromOBJ(), cloudViewer::io::ReadTriangleMeshFromPLY(), cloudViewer::io::ReadTriangleMeshUsingASSIMP(), VTKFilter::saveToFile(), SelectByIndex(), ccEntityAction::setColor(), cloudViewer::pipelines::color_map::SetGeometryColorAverage(), ccPlane::SetQuadTexture(), cloudViewer::io::rpc::SetTriangleMesh(), setVertice(), ecvPoissonReconDlg::start(), subdivide(), colmap::mvs::MvsTexturing::TextureMesh(), and Triangulate().
|
overridevirtual |
Returns an axis-aligned bounding box of the geometry.
Reimplemented from ccHObject.
Definition at line 844 of file ecvMesh.cpp.
References ccBBox::CreateFromPoints(), and getVertices().
Referenced by cloudViewer::visualization::rendering::TriangleMeshBuffersBuilder::ComputeAABB(), and ccFacet::GetAxisAlignedBoundingBox().
Returns the mesh bounding-box.
Virtual method to request the mesh bounding-box limits. It is equivalent to the bounding-box of the cloud composed of the mesh vertexes.
| bbMin | lower bounding-box limits (Xmin,Ymin,Zmin) |
| bbMax | higher bounding-box limits (Xmax,Ymax,Zmax) |
Implements cloudViewer::GenericMesh.
Definition at line 2406 of file ecvMesh.cpp.
References m_bBox, cloudViewer::BoundingBoxTpl< T >::maxCorner(), cloudViewer::BoundingBoxTpl< T >::minCorner(), and refreshBB().
|
overridevirtual |
Returns the center of the geometry coordinates.
Reimplemented from ccHObject.
Definition at line 836 of file ecvMesh.cpp.
References ccHObject::ComputeCenter(), getAssociatedCloud(), cloudViewer::PointCloudTpl< T >::getEigenPoints(), and ccHObjectCaster::ToPointCloud().
Referenced by ccFacet::GetCenter().
|
inlineoverridevirtual |
|
overridevirtual |
! Returns RGB color from a given triangle material/texture **
| triIndex | triangle index |
Implements ccGenericMesh.
Definition at line 4228 of file ecvMesh.cpp.
References ecvColor::RgbaTpl< Type >::b, computeInterpolationWeights(), cloudViewer::utility::floor(), ecvColor::RgbaTpl< Type >::g, ccArray< Type, N, ComponentType >::getValue(), hasMaterials(), interpolateColors(), m_materials, m_texCoordIndexes, m_texCoords, m_triMtlIndexes, ecvColor::MAX, ecvColor::RgbaTpl< Type >::r, rgb, size(), TexCoords2D::tx, TexCoords2D::ty, Tuple3Tpl< Type >::u, x, y, and ZERO_TOLERANCE_D.
Referenced by ccSubMesh::getColorFromMaterial().
| std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen< Eigen::Vector2i > > ccMesh::GetEdgeToTrianglesMap | ( | ) | const |
Function that returns a map from edges (vertex0, vertex1) to the triangle indices the given edge belongs to.
Definition at line 1589 of file TriangleMeshFactory.cpp.
References cloudViewer::t::geometry::GetOrderedEdge(), and size.
| std::unordered_map< Eigen::Vector2i, std::vector< int >, utility::hash_eigen< Eigen::Vector2i > > ccMesh::GetEdgeToVerticesMap | ( | ) | const |
Function that returns a map from edges (vertex0, vertex1) to the vertex (vertex2) indices the given edge belongs to.
Definition at line 1610 of file TriangleMeshFactory.cpp.
References cloudViewer::t::geometry::GetOrderedEdge(), and size.
| std::vector< Eigen::Vector3d > ccMesh::getEigenVertices | ( | ) | const |
Definition at line 2368 of file ecvMesh.cpp.
References getAssociatedCloud(), cloudViewer::PointCloudTpl< T >::getEigenPoints(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::geometry::LineSet::CreateFromTriangleMesh(), cloudViewer::pipelines::color_map::CreateVertexAndImageVisibility(), and cloudViewer::t::geometry::TriangleMesh::FromLegacy().
|
inlinestatic |
Definition at line 965 of file ecvMesh.h.
References std::swap().
|
overridevirtual |
Returns the transformation 'history' matrix.
Reimplemented from ccHObject.
Definition at line 2419 of file ecvMesh.cpp.
References ccHObject::getGLTransformationHistory(), m_associatedCloud, and ccHObject::m_glTransHistory.
|
inlineoverridevirtual |
Implements ccGenericMesh.
Definition at line 412 of file ecvMesh.h.
Referenced by cloneMesh(), ccSubMesh::getMaterialSet(), partialClone(), ccPlane::SetQuadTexture(), and ToFbxMesh().
|
overridevirtual |
Returns max bounds for geometry coordinates.
Reimplemented from ccHObject.
Definition at line 828 of file ecvMesh.cpp.
References ccHObject::ComputeMaxBound(), getAssociatedCloud(), cloudViewer::PointCloudTpl< T >::getEigenPoints(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::geometry::VoxelGrid::CreateFromTriangleMesh(), ccFacet::GetMaxBound(), and IsBoundingBoxIntersecting().
|
overridevirtual |
Returns min bounds for geometry coordinates.
Reimplemented from ccHObject.
Definition at line 820 of file ecvMesh.cpp.
References ccHObject::ComputeMinBound(), getAssociatedCloud(), cloudViewer::PointCloudTpl< T >::getEigenPoints(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::geometry::VoxelGrid::CreateFromTriangleMesh(), ccFacet::GetMinBound(), and IsBoundingBoxIntersecting().
|
overridevirtual |
Returns the indexes of the vertices of the next triangle (relatively to the global iterator position)
Implements cloudViewer::GenericIndexedMesh.
Definition at line 2618 of file ecvMesh.cpp.
References getTriangleVertIndexes(), m_globalIterator, and size().
Referenced by cloneMesh(), computePerVertexNormals(), convertMaterialsToVertexColors(), laplacianSmooth(), processScalarField(), and VTKFilter::saveToFile().
| std::vector< Eigen::Vector2i > ccMesh::GetNonManifoldEdges | ( | bool | allow_boundary_edges = true | ) | const |
Function that returns the non-manifold edges of the triangle mesh. If
| allow_boundary_edges | is set to false, than also boundary edges are returned |
Definition at line 895 of file TriangleMeshFactory.cpp.
References cloudViewer::t::geometry::GetEdgeToTrianglesMap().
| std::vector< int > ccMesh::GetNonManifoldVertices | ( | ) | const |
Function that returns a list of non-manifold vertex indices. A vertex is manifold if its star is edge‐manifold and edge‐connected. (Two or more faces connected only by a vertex and not by an edge.)
Definition at line 921 of file TriangleMeshFactory.cpp.
|
inlinestatic |
Helper function to get an edge with ordered vertex indices.
Definition at line 1005 of file ecvMesh.h.
Referenced by OrientTriangleHelper().
|
inlinestatic |
Definition at line 92 of file ecvMesh.h.
References std::swap().
Referenced by CreateFromPointCloudAlphaShape().
|
overridevirtual |
Reimplemented from ccHObject.
Definition at line 848 of file ecvMesh.cpp.
References ecvOrientedBBox::CreateFromPoints(), and getVertices().
Referenced by ccFacet::GetOrientedBoundingBox().
|
overridevirtual |
Returns the entity's own bounding-box.
Children bboxes are ignored.
| withGLFeatures | whether to take into account display-only elements (if any) |
Reimplemented from ccHObject.
Definition at line 2413 of file ecvMesh.cpp.
References m_bBox, and refreshBB().
Referenced by ccDBRoot::alignCameraWithEntity(), and ccSphere::drawNameIn3D().
| std::vector< Eigen::Vector2i > ccMesh::GetSelfIntersectingTriangles | ( | ) | const |
Function that returns a list of triangles that are intersecting the mesh.
Definition at line 981 of file TriangleMeshFactory.cpp.
References size, and cloudViewer::utility::IntersectionTest::TriangleTriangle3d().
| double ccMesh::GetSurfaceArea | ( | ) | const |
Function that computes the surface area of the mesh, i.e. the sum of the individual triangle surfaces.
Definition at line 1644 of file TriangleMeshFactory.cpp.
References size.
| double ccMesh::GetSurfaceArea | ( | std::vector< double > & | triangle_areas | ) | const |
Function that computes the surface area of the mesh, i.e. the sum of the individual triangle surfaces.
Definition at line 1653 of file TriangleMeshFactory.cpp.
References size.
|
overridevirtual |
Implements ccGenericMesh.
Definition at line 3653 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::getValue(), and m_texCoords.
Referenced by ccSubMesh::getTexCoordinates().
|
inlineoverridevirtual |
Returns per-triangle texture coordinates array.
Implements ccGenericMesh.
Definition at line 476 of file ecvMesh.h.
Referenced by CCMeshToDraco(), ccSubMesh::getTexCoordinatesTable(), ccPlane::SetQuadTexture(), and ToFbxMesh().
| Eigen::Vector3i ccMesh::getTriangle | ( | size_t | index | ) | const |
Definition at line 2448 of file ecvMesh.cpp.
References getTriangleVertIndexes(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, and cloudViewer::VerticesIndexes::i3.
Referenced by getTriangles(), and IsIntersecting().
| double ccMesh::GetTriangleArea | ( | size_t | triangle_idx | ) | const |
Function that computes the area of a mesh triangle identified by the triangle index
Definition at line 1637 of file TriangleMeshFactory.cpp.
|
overridevirtual |
Returns a given triangle material indexes.
Implements ccGenericMesh.
Definition at line 3761 of file ecvMesh.cpp.
References m_triMtlIndexes.
Referenced by ccCropTool::Crop(), ccSubMesh::getTriangleMtlIndex(), partialClone(), and ToFbxMesh().
|
inline |
Returns the per-triangle material indexes array.
Definition at line 454 of file ecvMesh.h.
Referenced by PlyFilter::loadFile().
| Eigen::Vector3d ccMesh::getTriangleNorm | ( | size_t | index | ) | const |
Definition at line 3474 of file ecvMesh.cpp.
References ccNormalVectors::getNormal(), ccNormalVectors::GetUniqueInstance(), ccArray< Type, N, ComponentType >::getValue(), m_triNormals, and Tuple3Tpl< Type >::u.
Referenced by getTriangleNormals(), getTriangleNorms(), and SelectByIndex().
| CompressedNormType ccMesh::getTriangleNormalIndexes | ( | size_t | triangleIndex | ) |
Definition at line 3505 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::getValue(), hasTriNormals(), and m_triNormals.
|
overridevirtual |
Returns a triplet of normal indexes for a given triangle (if any)
| [in] | triangleIndex | triangle index |
| [out] | i1 | first vertex normal index (or -1 if none) |
| [out] | i2 | second vertex normal index (or -1 if none) |
| [out] | i3 | third vertex normal index (or -1 if none) |
Implements ccGenericMesh.
Definition at line 3353 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::getValue(), m_triNormalIndexes, and Tuple3Tpl< Type >::u.
Referenced by ccSubMesh::getTriangleNormalIndexes(), partialClone(), VTKFilter::saveToFile(), and ToFbxMesh().
| std::vector< Eigen::Vector3d > ccMesh::getTriangleNormals | ( | ) | const |
Definition at line 3456 of file ecvMesh.cpp.
References getTriangleNorm(), and size().
Referenced by getTriangleNormals().
|
overridevirtual |
Returns a given triangle normal.
Mesh must have triangle normals associated (see hasTriNormals)
Implements ccGenericMesh.
Definition at line 3367 of file ecvMesh.cpp.
References ccNormalVectors::getNormal(), ccNormalVectors::GetUniqueInstance(), ccArray< Type, N, ComponentType >::getValue(), m_triNormalIndexes, m_triNormals, and Tuple3Tpl< Type >::u.
Referenced by ccSubMesh::getTriangleNormals().
|
overridevirtual |
Reimplemented from ccGenericMesh.
Definition at line 3396 of file ecvMesh.cpp.
References ccNormalVectors::getNormal(), ccNormalVectors::GetUniqueInstance(), ccArray< Type, N, ComponentType >::getValue(), m_triNormalIndexes, m_triNormals, and Tuple3Tpl< Type >::u.
|
overridevirtual |
Reimplemented from ccGenericMesh.
Definition at line 3449 of file ecvMesh.cpp.
References getTriangleNormals().
| std::vector< CCVector3 * > ccMesh::getTriangleNormalsPtr | ( | ) | const |
Definition at line 3465 of file ecvMesh.cpp.
References ccNormalVectors::getNormal(), ccNormalVectors::GetUniqueInstance(), ccArray< Type, N, ComponentType >::getValue(), m_triNormals, and size().
Referenced by cloudViewer::io::rpc::SetTriangleMesh().
| std::vector< Eigen::Vector3d > ccMesh::getTriangleNorms | ( | ) | const |
Definition at line 3535 of file ecvMesh.cpp.
References getTriangleNorm(), hasTriNormals(), LogWarning, and m_triNormals.
| Eigen::Vector4d ccMesh::GetTrianglePlane | ( | size_t | triangle_idx | ) | const |
Function that computes the plane equation of a mesh triangle identified by the triangle index.
Definition at line 1713 of file TriangleMeshFactory.cpp.
| std::vector< Eigen::Vector3i > ccMesh::getTriangles | ( | ) | const |
Definition at line 2462 of file ecvMesh.cpp.
References getTriangle(), cloudViewer::GenericMesh::hasTriangles(), LogWarning, and size().
|
inline |
Definition at line 279 of file ecvMesh.h.
Referenced by cloudViewer::io::rpc::SetTriangleMesh().
|
overridevirtual |
Returns per-triangle texture coordinates (pointer to)
Implements ccGenericMesh.
Definition at line 3620 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::getValue(), m_texCoordIndexes, m_texCoords, Tuple3Tpl< Type >::u, and CVLog::Warning().
Referenced by ccSubMesh::getTriangleTexCoordinates().
|
overridevirtual |
Returns the triplet of tex coords indexes for a given triangle.
| triangleIndex | triangle index |
| i1 | first vertex tex coords index |
| i2 | second vertex tex coords index |
| i3 | third vertex tex coords index |
Implements ccGenericMesh.
Definition at line 3691 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::getValue(), m_texCoordIndexes, and Tuple3Tpl< Type >::u.
Referenced by ccSubMesh::getTriangleTexCoordinatesIndexes(), partialClone(), and ToFbxMesh().
|
overridevirtual |
Returns the vertices of a given triangle.
| [in] | triangleIndex | index of the triangle (between 0 and the size(mesh)-1) |
| [out] | A | first vertex |
| [out] | B | second vertex |
| [out] | C | third vertex |
Implements cloudViewer::GenericIndexedMesh.
Definition at line 2187 of file ecvMesh.cpp.
References cloudViewer::GenericIndexedCloud::getPoint(), ccArray< Type, N, ComponentType >::getValue(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_associatedCloud, m_triVertIndexes, and size().
Referenced by cloudViewer::geometry::VoxelGrid::CreateFromTriangleMeshWithinBounds(), and ccSubMesh::getTriangleVertices().
|
overridevirtual |
Implements cloudViewer::GenericIndexedMesh.
Definition at line 2200 of file ecvMesh.cpp.
References cloudViewer::GenericIndexedCloud::getPoint(), ccArray< Type, N, ComponentType >::getValue(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_associatedCloud, m_triVertIndexes, and size().
| void ccMesh::getTriangleVertIndexes | ( | size_t | triangleIndex, |
| Eigen::Vector3i & | vertIndx | ||
| ) | const |
Definition at line 2609 of file ecvMesh.cpp.
References getTriangleVertIndexes(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, and cloudViewer::VerticesIndexes::i3.
|
virtual |
Definition at line 2604 of file ecvMesh.cpp.
References m_triVertIndexes.
|
overridevirtual |
Returns the indexes of the vertices of a given triangle.
| triangleIndex | index of the triangle (between 0 and size(mesh)-1) |
Implements cloudViewer::GenericIndexedMesh.
Definition at line 2599 of file ecvMesh.cpp.
References m_triVertIndexes.
Referenced by CCMeshToDraco(), cloudViewer::geometry::LineSet::CreateFromTriangleMesh(), ccSubMesh::createNewSubMeshFromSelection(), ccCropTool::Crop(), cloudViewer::t::geometry::TriangleMesh::FromLegacy(), colmap::mvs::GenerateCandidate(), getNextTriangleVertIndexes(), ccSubMesh::getNextTriangleVertIndexes(), getTriangle(), getTriangleVertIndexes(), ccSubMesh::getTriangleVertIndexes(), CSVMatrixFilter::loadFile(), PlyFilter::loadFile(), merge(), mergeDuplicatedVertices(), ccGenericPrimitive::operator+=(), partialClone(), and SelectByIndex().
|
inlineoverridevirtual |
Returns per-triangle normals shared array.
Implements ccGenericMesh.
Definition at line 344 of file ecvMesh.h.
Referenced by pcl2cc::Convert(), vtk2cc::ConvertToMesh(), ccOctree::DrawCellAsAPrimitive(), ccSubMesh::getTriNormsTable(), STLFilter::loadASCIIFile(), STLFilter::loadBinaryFile(), STLFilter::loadFile(), main(), ccGenericPrimitive::operator+=(), VTKFilter::saveToFile(), and ToFbxMesh().
|
overridevirtual |
Returns object unqiue ID used for display.
Reimplemented from ccHObject.
Definition at line 2626 of file ecvMesh.cpp.
References CV_TYPES::FACET, ccHObject::getParent(), ccObject::getUniqueID(), ccObject::isA(), and ccHObject::m_parent.
| Eigen::Vector3d ccMesh::getVertexColor | ( | size_t | index | ) | const |
Definition at line 2295 of file ecvMesh.cpp.
References ccPointCloud::getEigenColor(), m_associatedCloud, and ccHObjectCaster::ToPointCloud().
|
overridevirtual |
! Returns RGB color of a vertex from a given triangle material/texture **
| triIndex | triangle index |
Implements ccGenericMesh.
Definition at line 4154 of file ecvMesh.cpp.
References CVLog::Error(), cloudViewer::utility::floor(), ecvColor::FromQRgb(), ecvColor::FromRgbafToRgb(), ccGenericPointCloud::getPointColor(), ccArray< Type, N, ComponentType >::getValue(), hasColors(), hasMaterials(), cloudViewer::VerticesIndexes::i, m_associatedCloud, m_materials, m_texCoordIndexes, m_texCoords, m_triMtlIndexes, m_triVertIndexes, rgb, size(), TexCoords2D::tx, TexCoords2D::ty, and Tuple3Tpl< Type >::u.
Referenced by convertMaterialsToVertexColors(), and ccSubMesh::getVertexColorFromMaterial().
| std::vector< Eigen::Vector3d > ccMesh::getVertexColors | ( | ) | const |
Definition at line 2311 of file ecvMesh.cpp.
References ccPointCloud::getEigenColors(), m_associatedCloud, and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::t::geometry::TriangleMesh::FromLegacy().
| ColorsTableType * ccMesh::getVertexColorsPtr | ( | ) |
Definition at line 2319 of file ecvMesh.cpp.
References m_associatedCloud, ccPointCloud::rgbColors(), and ccHObjectCaster::ToPointCloud().
| Eigen::Vector3d ccMesh::getVertexNormal | ( | size_t | index | ) | const |
Definition at line 2251 of file ecvMesh.cpp.
References ccPointCloud::getEigenNormal(), m_associatedCloud, and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::visualization::rendering::TriangleMeshBuffersBuilder::ConstructBuffers().
| std::vector< Eigen::Vector3d > ccMesh::getVertexNormals | ( | ) | const |
Definition at line 2266 of file ecvMesh.cpp.
References ccPointCloud::getEigenNormals(), m_associatedCloud, and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::t::geometry::TriangleMesh::FromLegacy().
| Eigen::Vector3d ccMesh::getVertice | ( | size_t | index | ) | const |
Definition at line 2213 of file ecvMesh.cpp.
References getAssociatedCloud(), cloudViewer::PointCloudTpl< T >::getEigenPoint(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::io::AddTrianglesByEarClipping(), cloudViewer::pipelines::color_map::ComputeJacobianAndResidualNonRigid(), cloudViewer::pipelines::color_map::ComputeJacobianAndResidualRigid(), and IsIntersecting().
| const std::vector< CCVector3 > & ccMesh::getVertices | ( | ) | const |
Definition at line 2352 of file ecvMesh.cpp.
References getAssociatedCloud(), cloudViewer::PointCloudTpl< T >::getPoints(), LogError, and ccHObjectCaster::ToPointCloud().
Referenced by Crop(), GetAxisAlignedBoundingBox(), and GetOrientedBoundingBox().
| unsigned int ccMesh::getVerticeSize | ( | ) | const |
Definition at line 2336 of file ecvMesh.cpp.
References getAssociatedCloud(), and cloudViewer::GenericCloud::size().
Referenced by cloudViewer::visualization::rendering::TriangleMeshBuffersBuilder::ConstructBuffers(), cloudViewer::pipelines::color_map::CreateVertexAndImageVisibility(), cloudViewer::io::ReadTriangleMesh(), cloudViewer::pipelines::color_map::RunNonRigidOptimizer(), SelectByIndex(), cloudViewer::pipelines::color_map::SetGeometryColorAverage(), and cloudViewer::pipelines::color_map::SetProxyIntensityForVertex().
| std::vector< CCVector3 > & ccMesh::getVerticesPtr | ( | ) |
Definition at line 2344 of file ecvMesh.cpp.
References getAssociatedCloud(), cloudViewer::PointCloudTpl< T >::getPoints(), LogError, and ccHObjectCaster::ToPointCloud().
| double ccMesh::GetVolume | ( | ) | const |
Function that computes the volume of the mesh, under the condition that it is watertight and orientable. See Zhang and Chen, "Efficient feature extraction for 2D/3D objects in mesh representation", 2001.
Definition at line 1664 of file TriangleMeshFactory.cpp.
|
inline |
|
overridevirtual |
Returns whether colors are enabled or not.
Reimplemented from ccDrawableObject.
Definition at line 221 of file ecvMesh.cpp.
References ccDrawableObject::hasColors(), and m_associatedCloud.
Referenced by ccEntityAction::convertTextureToColor(), getVertexColorFromMaterial(), interpolateColors(), SelectByIndex(), cloudViewer::io::rpc::SetTriangleMesh(), and subdivide().
|
overridevirtual |
Returns whether an active scalar field is available or not.
Reimplemented from ccDrawableObject.
Definition at line 233 of file ecvMesh.cpp.
References ccDrawableObject::hasDisplayedScalarField(), and m_associatedCloud.
|
inline |
|
overridevirtual |
Implements ccGenericMesh.
Definition at line 3713 of file ecvMesh.cpp.
References m_materials, m_triMtlIndexes, and m_triVertIndexes.
Referenced by convertMaterialsToVertexColors(), ccEntityAction::convertTextureToColor(), drawMeOnly(), getColorFromMaterial(), getVertexColorFromMaterial(), hasTextures(), PlyFilter::loadFile(), merge(), and ToFbxMesh().
|
overridevirtual |
Returns whether normals are enabled or not.
Reimplemented from ccDrawableObject.
Definition at line 225 of file ecvMesh.cpp.
References hasTriNormals(), and HasVertexNormals().
Referenced by ccEntityAction::clearProperty(), cloneMesh(), cloudViewer::visualization::rendering::TriangleMeshBuffersBuilder::ConstructBuffers(), qCork::doAction(), interpolateNormals(), interpolateNormalsBC(), ccEntityAction::invertNormals(), laplacianSmooth(), VTKFilter::loadFile(), partialClone(), CommandInvertNormal::process(), SelectByIndex(), cloudViewer::io::rpc::SetTriangleMesh(), and subdivide().
|
inline |
Returns whether this mesh as per-triangle material index.
Definition at line 421 of file ecvMesh.h.
Referenced by FromFbxMesh(), and ccPlane::SetQuadTexture().
|
inlineoverridevirtual |
Returns whether this mesh as per-triangle triplets of tex coords indexes.
Implements ccGenericMesh.
Definition at line 484 of file ecvMesh.h.
Referenced by ccSubMesh::hasPerTriangleTexCoordIndexes(), ccPlane::SetQuadTexture(), and ToFbxMesh().
|
overridevirtual |
Returns whether one or more scalar fields are instantiated.
WARNING: doesn't mean a scalar field is currently displayed (see ccDrawableObject::hasDisplayedScalarField).
Reimplemented from ccDrawableObject.
Definition at line 238 of file ecvMesh.cpp.
References ccDrawableObject::hasScalarFields(), and m_associatedCloud.
|
overridevirtual |
Returns whether textures are available for this mesh.
Implements ccGenericMesh.
Definition at line 3703 of file ecvMesh.cpp.
References hasMaterials(), ccArray< Type, N, ComponentType >::isAllocated(), m_texCoordIndexes, m_texCoords, and m_triVertIndexes.
Referenced by drawMeOnly(), cloudViewer::io::rpc::SetTriangleMesh(), and ToFbxMesh().
|
inline |
Definition at line 721 of file ecvMesh.h.
References cloudViewer::GenericMesh::hasTriangles(), and cloudViewer::GenericMesh::size().
|
inline |
Definition at line 314 of file ecvMesh.h.
References ccGenericMesh::hasTriNormals().
Referenced by merge().
|
inline |
Definition at line 717 of file ecvMesh.h.
References cloudViewer::GenericMesh::hasTriangles(), and cloudViewer::GenericMesh::size().
Referenced by cloudViewer::visualization::rendering::TriangleMeshBuffersBuilder::ConstructBuffers(), cloudViewer::t::geometry::TriangleMesh::FromLegacy(), SelectByIndex(), and cloudViewer::io::rpc::SetTriangleMesh().
|
overridevirtual |
Returns whether the mesh has per-triangle normals.
Implements ccGenericMesh.
Definition at line 3589 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::isAllocated(), m_triNormalIndexes, m_triNormals, and m_triVertIndexes.
Referenced by ccGraphicalTransformationTool::apply(), ccEntityAction::clearProperty(), cloneMesh(), qCork::doAction(), drawMeOnly(), ccDBRoot::gatherRecursiveInformation(), getTriangleNormalIndexes(), getTriangleNorms(), hasNormals(), interpolateNormals(), interpolateNormalsBC(), laplacianSmooth(), VTKFilter::loadFile(), ccGenericPrimitive::operator+=(), partialClone(), VTKFilter::saveToFile(), SelectByIndex(), cloudViewer::io::rpc::SetTriangleMesh(), setTriangleNorm(), setTriangleNormalIndexes(), and subdivide().
| bool ccMesh::HasVertexNormals | ( | ) | const |
Definition at line 229 of file ecvMesh.cpp.
References ccDrawableObject::hasNormals(), and m_associatedCloud.
Referenced by hasNormals().
|
inline |
Definition at line 208 of file ecvMesh.h.
Referenced by cloudViewer::t::geometry::TriangleMesh::FromLegacy(), and cloudViewer::io::ReadTriangleMesh().
|
protected |
Same as other 'interpolateColors' method with a set of 3 vertices indexes
Definition at line 4133 of file ecvMesh.cpp.
References ecvColor::RgbTpl< Type >::b, computeInterpolationWeights(), cloudViewer::utility::floor(), ecvColor::RgbTpl< Type >::g, ccGenericPointCloud::getPointColor(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_associatedCloud, ecvColor::RgbTpl< Type >::r, rgb, and Tuple3Tpl< Type >::u.
|
overridevirtual |
Interpolates RGB colors inside a given triangle.
| triIndex | triangle index | |
| P | point where to interpolate (should be inside the triangle!) | |
| [out] | C | interpolated color |
Implements ccGenericMesh.
Definition at line 4120 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::getValue(), hasColors(), m_triVertIndexes, and size().
Referenced by getColorFromMaterial(), ccSubMesh::interpolateColors(), and pushSubdivide().
|
protected |
Same as other 'interpolateNormals' method with a set of 3 vertices indexes
Definition at line 4065 of file ecvMesh.cpp.
References ccNormalVectors::GetNormal(), ccGenericPointCloud::getPointNormal(), ccArray< Type, N, ComponentType >::getValue(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_associatedCloud, m_triNormals, Vector3Tpl< Type >::normalize(), Vector3Tpl< Type >::toDouble(), Vector3Tpl< Type >::toPC(), and Tuple3Tpl< Type >::u.
|
overridevirtual |
Interpolates normal(s) inside a given triangle.
This method should be ideally overriden by the child class if normals are supported
| [in] | triIndex | triangle index |
| [in] | P | point where to interpolate (should be inside the triangle!) |
| [out] | N | interpolated normal |
Reimplemented from cloudViewer::GenericIndexedMesh.
Definition at line 4050 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::getValue(), hasNormals(), hasTriNormals(), m_triNormalIndexes, m_triVertIndexes, and size().
Referenced by ccSubMesh::interpolateNormals(), and interpolateNormalsBC().
|
overridevirtual |
Interpolates normal(s) inside a given triangle.
| triIndex | triangle index | |
| w | barycentric coordinates | |
| [out] | N | interpolated normal |
Implements ccGenericMesh.
Definition at line 4105 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::getValue(), hasNormals(), hasTriNormals(), interpolateNormals(), m_triNormalIndexes, m_triVertIndexes, and size().
Referenced by ccSubMesh::interpolateNormalsBC().
| void ccMesh::invertNormals | ( | ) |
Inverts normals (if any)
Either the per-triangle normals, or the per-vertex ones
Definition at line 3288 of file ecvMesh.cpp.
References ccPointCloud::hasNormals(), ccPointCloud::invertNormals(), invertPerTriangleNormals(), m_associatedCloud, and m_triNormals.
Referenced by ccEntityAction::invertNormals(), and CommandInvertNormal::process().
| void ccMesh::invertPerTriangleNormals | ( | ) |
Invert per-triangle normals.
Definition at line 3301 of file ecvMesh.cpp.
References ccNormalCompressor::InvertNormal(), and m_triNormals.
Referenced by invertNormals().
| bool ccMesh::IsBoundingBoxIntersecting | ( | const ccMesh & | other | ) | const |
Function that tests if the bounding boxes of the triangle meshes are intersecting.
Definition at line 1020 of file TriangleMeshFactory.cpp.
References cloudViewer::utility::IntersectionTest::AABBAABB(), GetMaxBound(), and GetMinBound().
| bool ccMesh::IsEdgeManifold | ( | bool | allow_boundary_edges = true | ) | const |
Function that checks if the given triangle mesh is edge-manifold. A mesh is edge-manifold if each edge is bounding either one or two triangles. If allow_boundary_edges is set to false, then this function returns false if there exists boundary edges.
Definition at line 909 of file TriangleMeshFactory.cpp.
References cloudViewer::t::geometry::GetEdgeToTrianglesMap().
|
inlineoverridevirtual |
Reimplemented from ccHObject.
Definition at line 735 of file ecvMesh.h.
References cloudViewer::GenericMesh::hasTriangles().
Referenced by cloudViewer::io::AutoReadEntity(), doReconstruct(), and main().
| bool ccMesh::IsIntersecting | ( | const ccMesh & | other | ) | const |
Function that tests if the triangle mesh intersects another triangle mesh. Tests each triangle against each other triangle.
Definition at line 1026 of file TriangleMeshFactory.cpp.
References getTriangle(), getVertice(), size, size(), and cloudViewer::utility::IntersectionTest::TriangleTriangle3d().
| bool ccMesh::IsOrientable | ( | ) | const |
Function that tests if the given triangle mesh is orientable, i.e. the triangles can oriented in such a way that all normals point towards the outside.
Definition at line 1157 of file TriangleMeshFactory.cpp.
References OrientTriangleHelper().
| bool ccMesh::IsSelfIntersecting | ( | ) | const |
Function that tests if the triangle mesh is self-intersecting. Tests each triangle pair for intersection.
Definition at line 1016 of file TriangleMeshFactory.cpp.
|
inlineoverridevirtual |
Returns whether object is serializable of not.
Reimplemented from ccGenericMesh.
| bool ccMesh::IsVertexManifold | ( | ) | const |
Function that checks if all vertices in the triangle mesh are manifold. A vertex is manifold if its star is edge‐manifold and edge‐connected. (Two or more faces connected only by a vertex and not by an edge.)
Definition at line 977 of file TriangleMeshFactory.cpp.
| bool ccMesh::IsWatertight | ( | ) | const |
Function that tests if the given triangle mesh is watertight by checking if it is vertex manifold and edge-manifold with no boundary edges, but not self-intersecting.
Definition at line 1162 of file TriangleMeshFactory.cpp.
| bool ccMesh::laplacianSmooth | ( | unsigned | nbIteration = 100, |
| PointCoordinateType | factor = static_cast<PointCoordinateType>(0.01), |
||
| ecvProgressDialog * | progressCb = nullptr |
||
| ) |
Laplacian smoothing.
| nbIteration | smoothing iterations |
| factor | smoothing 'force' |
| progressCb | progress dialog callback |
Definition at line 1013 of file ecvMesh.cpp.
References computeNormals(), getNextTriangleVertIndexes(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::GenericIndexedCloudPersist::getPointPersistentPtr(), hasNormals(), hasTriNormals(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_associatedCloud, ccHObject::notifyGeometryUpdate(), nProgress, cloudViewer::NormalizedProgress::oneStep(), placeIteratorAtBeginning(), ecvProgressDialog::setInfo(), ecvProgressDialog::setMethodTitle(), cloudViewer::GenericCloud::size(), size(), and ecvProgressDialog::start().
| bool ccMesh::merge | ( | const ccMesh * | mesh, |
| bool | createSubMesh | ||
| ) |
Merges another mesh into this one.
| mesh | mesh to be merged in this one |
| createSubMesh | whether to create a submesh entity corresponding to the added mesh |
Definition at line 1788 of file ecvMesh.cpp.
References ccHObject::addChild(), ccMaterialSet::addMaterial(), addTriangle(), ccSubMesh::addTriangleIndex(), adjacency_list_, ccDrawableObject::colorsShown(), ccGenericMesh::enableStippling(), getAssociatedCloud(), ccObject::getName(), getTriangleVertIndexes(), ccArray< Type, N, ComponentType >::getValue(), hasMaterials(), HasTriangleNormals(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, ccObject::isA(), ccObject::isEnabled(), ccGenericMesh::isShownAsPoints(), ccGenericMesh::isShownAsWire(), ccDrawableObject::isVisible(), m_associatedCloud, m_materials, m_texCoordIndexes, m_texCoords, m_triMtlIndexes, m_triNormalIndexes, m_triNormals, ccGenericMesh::materialsShown(), normalsShown(), CV_TYPES::POINT_CLOUD, ccSubMesh::reserve(), reserve(), reservePerTriangleMtlIndexes(), reservePerTriangleNormalIndexes(), reservePerTriangleTexCoordIndexes(), ccArray< Type, N, ComponentType >::reserveSafe(), resize(), ccObject::setEnabled(), setMaterialSet(), ccObject::setName(), setTexCoordinatesTable(), setTriNormsTable(), ccDrawableObject::setVisible(), ccDrawableObject::sfShown(), ccDrawableObject::showColors(), ccGenericMesh::showMaterials(), ccGenericMesh::showNormals(), ccGenericMesh::showPoints(), ccDrawableObject::showSF(), ccGenericMesh::showTriNorms(), ccGenericMesh::showWired(), cloudViewer::GenericCloud::size(), size(), ccGenericMesh::stipplingEnabled(), textures_, triangle_material_ids_, triangle_uvs_, ccGenericMesh::triNormsShown(), Tuple3Tpl< Type >::u, and CVLog::Warning().
Referenced by cloudViewer::io::AutoReadEntity(), qVoxFallProcess::Compute(), operator+=(), and operator=().
| ccMesh & ccMesh::MergeCloseVertices | ( | double | eps | ) |
Function that will merge close by vertices to a single one. The vertex position, normal and color will be the average of the vertices.
| eps | defines the maximum distance of close by vertices. This function might help to close triangle soups. |
Definition at line 309 of file TriangleMeshFactory.cpp.
References color, ecvColor::RgbTpl< Type >::FromEigen(), cloudViewer::PointCloudTpl< T >::getPoints(), LogDebug, normal, ccPointCloud::rgbColors(), cloudViewer::geometry::KDTreeFlann::SearchRadius(), ccPointCloud::setPointNormals(), std::swap(), and ccHObjectCaster::ToPointCloud().
| bool ccMesh::mergeDuplicatedVertices | ( | unsigned char | octreeLevel = DefaultMergeDulicateVerticesLevel, |
| QWidget * | parentWidget = nullptr |
||
| ) |
Merges duplicated vertices.
Definition at line 661 of file ecvMesh.cpp.
References ccHObject::addChild(), cloudViewer::ReferenceCloud::addPointIndex(), cloudViewer::DgmOctree::build(), cloudViewer::DgmOctree::executeFunctionForAllCellsAtLevel(), ccPointCloud::From(), ccHObject::getChildIndex(), getTriangleVertIndexes(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, ccObject::isKindOf(), m_associatedCloud, octree, partialClone(), CV_TYPES::POINT_CLOUD, CVLog::Print(), ccHObject::removeChild(), cloudViewer::ReferenceCloud::reserve(), resize(), result, setAssociatedCloud(), cloudViewer::GenericCloud::size(), size(), swapTriangles(), TagDuplicatedVertices(), and CVLog::Warning().
Referenced by STEPFilter::importStepFile(), and STLFilter::loadFile().
|
overrideprotectedvirtual |
Returns the minimum file version required to save this instance's own data To be overloaded (but still called ;) by subclass. Used internally by minimumFileVersion() to compute the overall minimum.
Reimplemented from ccGenericMesh.
Reimplemented in ccTorus, ccSphere, ccQuadric, and ccPlane.
Definition at line 3870 of file ecvMesh.cpp.
References ccSerializationHelper::GenericArrayToFileMinVersion(), and ccGenericMesh::minimumFileVersion_MeOnly().
Referenced by ccGenericPrimitive::minimumFileVersion_MeOnly().
| ccMesh & ccMesh::NormalizeNormals | ( | ) |
Normalize both triangle normals and vertex normals to length 1. Normalize point normals to length 1.
Definition at line 1400 of file TriangleMeshFactory.cpp.
References ccNormalVectors::GetNormalPtr(), ccPointCloud::hasNormals(), Vector3Tpl< Type >::normalize(), ccPointCloud::NormalizeNormals(), and ccHObjectCaster::ToPointCloud().
|
inlineoverridevirtual |
Returns whether normals are available.
Reimplemented from ccGenericMesh.
Definition at line 215 of file ecvMesh.h.
References ccDrawableObject::hasNormals().
|
overridevirtual |
Returns whether normals are shown or not.
Reimplemented from ccDrawableObject.
Definition at line 388 of file ecvMesh.cpp.
References ccDrawableObject::normalsShown(), and ccGenericMesh::triNormsShown().
Referenced by ccSubMesh::ccSubMesh(), cloneMesh(), createNewMeshFromSelection(), qCork::doAction(), cvSelectionExporter::exportFromSourceMesh(), ccGenericPrimitive::finishCloneJob(), ObjFilter::loadFile(), merge(), partialClone(), and subdivide().
|
overrideprotectedvirtual |
This method is called when another object is deleted.
For internal use.
Reimplemented from ccHObject.
Definition at line 215 of file ecvMesh.cpp.
References m_associatedCloud, ccHObject::onDeletionOf(), and setAssociatedCloud().
|
overrideprotectedvirtual |
This method is called when another object (geometry) is updated.
For internal use.
Reimplemented from ccHObject.
Definition at line 206 of file ecvMesh.cpp.
References m_associatedCloud, m_bBox, ccHObject::notifyGeometryUpdate(), ccHObject::onUpdateOf(), and cloudViewer::BoundingBoxTpl< T >::setValidity().
Definition at line 165 of file ecvMesh.cpp.
References ccMesh().
Definition at line 155 of file ecvMesh.cpp.
References adjacency_list_, CVLog::Error(), and merge().
Definition at line 133 of file ecvMesh.cpp.
References ccHObject::addChild(), adjacency_list_, ccPointCloud::clear(), getAssociatedCloud(), merge(), resize(), setAssociatedCloud(), ccObject::setEnabled(), ccObject::setLocked(), ccObject::setName(), and ccHObjectCaster::ToPointCloud().
| bool ccMesh::OrientTriangles | ( | ) |
If the mesh is orientable then this function rearranges the triangles such that all normals point towards the outside/inside.
Definition at line 1166 of file TriangleMeshFactory.cpp.
References OrientTriangleHelper(), and std::swap().
| ccMesh & ccMesh::PaintUniformColor | ( | const Eigen::Vector3d & | color | ) |
Assigns each vertex in the ccMesh the same color.
| color | RGB colors of vertices. |
Definition at line 398 of file TriangleMeshFactory.cpp.
References color, ccPointCloud::PaintUniformColor(), CV_TYPES::POINT_CLOUD, and ccHObjectCaster::ToPointCloud().
| ccMesh * ccMesh::partialClone | ( | const std::vector< unsigned > & | triangleIndices, |
| int * | warnings = nullptr |
||
| ) | const |
Creates a new mesh from a selection of triangles (partial clone)
Similar to ccPointCloud::partialClone but for meshes.
| triangleIndices | Indices of triangles to include in the partial clone |
| warnings | [optional] to store warnings |
Definition at line 1347 of file ecvMesh.cpp.
References ccHObject::addChild(), cloudViewer::ReferenceCloud::addPointIndex(), addTriangle(), addTriangleMtlIndex(), addTriangleNormalIndexes(), addTriangleTexCoordIndexes(), ccMesh(), ccMaterialSet::clone(), NormsIndexesTableType::clone(), TextureCoordsContainer::clone(), ccGenericPointCloud::clone(), ccDrawableObject::colorsShown(), computeNormals(), CVLog::Error(), getMaterialSet(), ccObject::getName(), getTriangleMtlIndex(), getTriangleNormalIndexes(), getTriangleTexCoordinatesIndexes(), getTriangleVertIndexes(), hasNormals(), hasTriNormals(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, ccGenericMesh::importParametersFrom(), ccObject::isA(), ccObject::isEnabled(), ccDrawableObject::isVisible(), m_associatedCloud, m_materials, m_texCoordIndexes, m_texCoords, m_triMtlIndexes, m_triNormalIndexes, m_triNormals, ccGenericMesh::materialsShown(), normalsShown(), CV_TYPES::POINT_CLOUD, CVLog::Print(), removePerTriangleMtlIndexes(), removePerTriangleNormalIndexes(), removePerTriangleTexCoordIndexes(), reserve(), cloudViewer::ReferenceCloud::reserve(), reservePerTriangleMtlIndexes(), reservePerTriangleNormalIndexes(), reservePerTriangleTexCoordIndexes(), ccObject::setEnabled(), setMaterialSet(), ccObject::setName(), setTexCoordinatesTable(), setTriNormsTable(), ccDrawableObject::setVisible(), ccDrawableObject::sfShown(), ccDrawableObject::showColors(), ccGenericMesh::showMaterials(), ccGenericMesh::showNormals(), ccDrawableObject::showSF(), size(), and CVLog::Warning().
Referenced by cloneMesh(), cvSelectionExporter::exportFromSourceMesh(), and mergeDuplicatedVertices().
|
overridevirtual |
Places the mesh iterator at the beginning.
Virtual method to handle the mesh global iterator
Implements cloudViewer::GenericMesh.
Definition at line 2163 of file ecvMesh.cpp.
References m_globalIterator.
Referenced by cloneMesh(), qVoxFallProcess::Compute(), computePerVertexNormals(), convertMaterialsToVertexColors(), laplacianSmooth(), processScalarField(), and VTKFilter::saveToFile().
| bool ccMesh::processScalarField | ( | MESH_SCALAR_FIELD_PROCESS | process | ) |
Applies process to the mesh scalar field (the one associated to its vertices in fact) A very simple smoothing/enhancement algorithm based on each vertex direct neighbours. Prior to calling this method, one should check first that the vertices are associated to a scalar field. Warning: the processed scalar field must be enabled for both INPUT & OUTPUT! (see ccGenericCloud::setCurrentScalarField)
| process | either 'smooth' or 'enhance' |
Definition at line 392 of file ecvMesh.cpp.
References count, ENHANCE_MESH_SF, getNextTriangleVertIndexes(), cloudViewer::GenericCloud::getPointScalarValue(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, cloudViewer::GenericCloud::isScalarFieldEnabled(), m_associatedCloud, placeIteratorAtBeginning(), cloudViewer::GenericCloud::setPointScalarValue(), cloudViewer::GenericCloud::size(), size(), and SMOOTH_MESH_SF.
Referenced by ccEntityAction::processMeshSF().
|
protected |
Used internally by 'subdivide'.
Definition at line 4343 of file ecvMesh.cpp.
References cloudViewer::PointCloudTpl< T >::addPoint(), ccPointCloud::addRGBColor(), addTriangle(), cloudViewer::PointCloudTpl< T >::capacity(), capacity(), CVLog::Error(), GenerateKey(), getAssociatedCloud(), cloudViewer::PointCloudTpl< T >::getPoint(), ccPointCloud::hasColors(), interpolateColors(), ccObject::isA(), CV_TYPES::POINT_CLOUD, reserve(), ccPointCloud::reserve(), s_alreadyCreatedVertices, s_defaultSubdivideGrowRate, s_maxSubdivideArea, cloudViewer::PointCloudTpl< T >::size(), size(), and ZERO_TOLERANCE_F.
Referenced by subdivide().
|
overridevirtual |
Forces bounding-box update.
Implements ccGenericMesh.
Definition at line 2387 of file ecvMesh.cpp.
References cloudViewer::BoundingBoxTpl< T >::add(), cloudViewer::BoundingBoxTpl< T >::clear(), count, cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, cloudViewer::BoundingBoxTpl< T >::isValid(), m_associatedCloud, m_bBox, m_triVertIndexes, ccHObject::notifyGeometryUpdate(), and cloudViewer::GenericCloud::size().
Referenced by getBoundingBox(), and getOwnBB().
| ccMesh & ccMesh::RemoveDegenerateTriangles | ( | ) |
Function that removes degenerate triangles, i.e., triangles that reference a single vertex multiple times in a single triangle.
They are usually the product of removing duplicated vertices.
Definition at line 193 of file TriangleMeshFactory.cpp.
References LogDebug, LogWarning, and size.
Referenced by cloudViewer::geometry::HalfEdgeTriangleMesh::CreateFromTriangleMesh().
| ccMesh & ccMesh::RemoveDuplicatedTriangles | ( | ) |
Function that removes duplicated triangles, i.e., removes triangles that reference the same three vertices, independent of their order.
Definition at line 84 of file TriangleMeshFactory.cpp.
References LogDebug, LogWarning, and size.
Referenced by cloudViewer::geometry::HalfEdgeTriangleMesh::CreateFromTriangleMesh().
| ccMesh & ccMesh::RemoveDuplicatedVertices | ( | ) |
Function that removes duplicated verties, i.e., vertices that have identical coordinates.
Definition at line 31 of file TriangleMeshFactory.cpp.
References LogDebug, ccPointCloud::resize(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::geometry::HalfEdgeTriangleMesh::CreateFromTriangleMesh().
| ccMesh & ccMesh::RemoveNonManifoldEdges | ( | ) |
Function that removes all non-manifold edges, by successively deleting triangles with the smallest surface area adjacent to the non-manifold edge until the number of adjacent triangles to the edge is <= 2.
Definition at line 225 of file TriangleMeshFactory.cpp.
References cloudViewer::t::geometry::GetEdgeToTrianglesMap(), LogWarning, and size.
| void ccMesh::removePerTriangleMtlIndexes | ( | ) |
Removes any per-triangle material indexes.
Definition at line 3746 of file ecvMesh.cpp.
References m_triMtlIndexes, and CCShareable::release().
Referenced by cloneMesh(), createNewMeshFromSelection(), PlyFilter::loadFile(), partialClone(), setMaterialSet(), and ccPlane::SetQuadTexture().
| void ccMesh::removePerTriangleNormalIndexes | ( | ) |
Removes any per-triangle triplets of normal indexes.
Definition at line 3323 of file ecvMesh.cpp.
References m_triNormalIndexes, and CCShareable::release().
Referenced by ccBox::buildUp(), ccCoordinateSystem::buildUp(), cloneMesh(), computePerTriangleNormals(), createNewMeshFromSelection(), ccGenericPrimitive::init(), STLFilter::loadASCIIFile(), STLFilter::loadBinaryFile(), partialClone(), and setTriNormsTable().
| void ccMesh::removePerTriangleTexCoordIndexes | ( | ) |
Remove per-triangle tex coords indexes.
Definition at line 3671 of file ecvMesh.cpp.
References m_texCoordIndexes, and CCShareable::release().
Referenced by cloneMesh(), DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertProfileToMesh(), createNewMeshFromSelection(), PlyFilter::loadFile(), partialClone(), ccPlane::SetQuadTexture(), and setTexCoordinatesTable().
| void ccMesh::removeTriangles | ( | size_t | index | ) |
Definition at line 2583 of file ecvMesh.cpp.
References LogWarning, m_texCoordIndexes, m_triMtlIndexes, m_triNormalIndexes, m_triVertIndexes, and size().
| void ccMesh::RemoveTrianglesByIndex | ( | const std::vector< size_t > & | triangle_indices | ) |
This function removes the triangles with index in triangle_indices. Call RemoveUnreferencedVertices to clean up vertices afterwards.
| triangle_indices | Indices of the triangles that should be removed. |
Definition at line 1243 of file TriangleMeshFactory.cpp.
References LogWarning, and size.
| void ccMesh::RemoveTrianglesByMask | ( | const std::vector< bool > & | triangle_mask | ) |
This function removes the triangles that are masked in triangle_mask. Call RemoveUnreferencedVertices to clean up vertices afterwards.
| triangle_mask | Mask of triangles that should be removed. Should have same size as triangles_. |
Definition at line 1260 of file TriangleMeshFactory.cpp.
| ccMesh & ccMesh::RemoveUnreferencedVertices | ( | ) |
This function removes vertices from the triangle mesh that are not referenced in any triangle of the mesh.
Definition at line 139 of file TriangleMeshFactory.cpp.
References LogDebug, ccPointCloud::resize(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::geometry::HalfEdgeTriangleMesh::CreateFromTriangleMesh().
| void ccMesh::RemoveVerticesByIndex | ( | const std::vector< size_t > & | vertex_indices | ) |
This function removes the vertices with index in vertex_indices. Note that also all triangles associated with the vertices are removeds.
| triangle_indices | Indices of the triangles that should be removed. |
Definition at line 1283 of file TriangleMeshFactory.cpp.
References LogWarning.
| void ccMesh::RemoveVerticesByMask | ( | const std::vector< bool > & | vertex_mask | ) |
This function removes the vertices that are masked in vertex_mask. Note that also all triangles associated with the vertices are removed..
| vertex_mask | Mask of vertices that should be removed. Should have same size as vertices_. |
Definition at line 1299 of file TriangleMeshFactory.cpp.
References cloudViewer::PointCloudTpl< T >::getPoint(), ccPointCloud::getPointColor(), ccPointCloud::getPointNormal(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), cloudViewer::VerticesIndexes::i, LogError, ccPointCloud::resize(), cloudViewer::PointCloudTpl< T >::setPoint(), ccPointCloud::setPointColor(), ccPointCloud::setPointNormal(), cloudViewer::PointCloudTpl< T >::size(), size, and ccHObjectCaster::ToPointCloud().
| bool ccMesh::reserve | ( | std::size_t | n | ) |
Reserves the memory to store the vertex indexes (3 per triangle)
| n | the number of triangles to reserve |
Definition at line 2475 of file ecvMesh.cpp.
References m_texCoordIndexes, m_triMtlIndexes, m_triNormalIndexes, m_triVertIndexes, and ccArray< Type, N, ComponentType >::reserveSafe().
Referenced by addTriangleNorms(), ccMesh(), MeshWrapper< Real >::checkMeshCapacity(), cloneMesh(), pcl2cc::Convert(), DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertProfileToMesh(), vtk2cc::ConvertToMesh(), face_cb(), FromFbxMesh(), STEPFilter::importStepFile(), ccGenericPrimitive::init(), STLFilter::loadASCIIFile(), STLFilter::loadBinaryFile(), CSVMatrixFilter::loadFile(), ObjFilter::loadFile(), OFFFilter::loadFile(), VTKFilter::loadFile(), DRCFilter::loadFile(), PlyFilter::loadFile(), merge(), ccGenericPrimitive::operator+=(), partialClone(), pushSubdivide(), subdivide(), Cloth::toMesh(), and ccPointCloud::triangulateGrid().
| bool ccMesh::reserveAssociatedCloud | ( | std::size_t | n, |
| bool | init_color = false, |
||
| bool | init_normal = false |
||
| ) |
Definition at line 2539 of file ecvMesh.cpp.
References LogError, LogWarning, m_associatedCloud, ccPointCloud::reserveTheNormsTable(), ccPointCloud::reserveThePointsTable(), ccPointCloud::reserveTheRGBTable(), and ccHObjectCaster::ToPointCloud().
Referenced by cloudViewer::io::ReadTriangleMeshUsingASSIMP().
| bool ccMesh::reservePerTriangleMtlIndexes | ( | ) |
Reserves memory to store per-triangle material index.
Before adding per-triangle material index to the mesh (with ccMesh::addTriangleMtlIndex()) be sure to reserve the necessary amount of memory with this method. This method reserves memory for as many material descriptors as the number of triangles in the mesh (effictively stored or reserved - a call to ccMesh::reserve prior to this one is mandatory).
Definition at line 3734 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::isAllocated(), CCShareable::link(), m_triMtlIndexes, m_triVertIndexes, and ccArray< Type, N, ComponentType >::reserveSafe().
Referenced by cloneMesh(), DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertProfileToMesh(), createNewMeshFromSelection(), ccCropTool::Crop(), FromFbxMesh(), CSVMatrixFilter::loadFile(), ObjFilter::loadFile(), PlyFilter::loadFile(), merge(), partialClone(), and ccPlane::SetQuadTexture().
| bool ccMesh::reservePerTriangleNormalIndexes | ( | ) |
Reserves memory to store per-triangle triplets of normal indexes.
Before adding per-triangle normal indexes triplets to the mesh (with ccMesh::addTriangleNormalsIndexes()) be sure to reserve the necessary amount of memory with this method. This method reserves memory for as many normals indexes triplets as the number of triangles in the mesh (effictively stored or reserved - a call to ccMesh::reserve prior to this one is mandatory).
Definition at line 3328 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::isAllocated(), CCShareable::link(), m_triNormalIndexes, m_triVertIndexes, and ccArray< Type, N, ComponentType >::reserveSafe().
Referenced by addTriangleNorm(), cloneMesh(), computePerTriangleNormals(), createNewMeshFromSelection(), FromFbxMesh(), ccGenericPrimitive::init(), STLFilter::loadASCIIFile(), STLFilter::loadBinaryFile(), ObjFilter::loadFile(), VTKFilter::loadFile(), merge(), ccGenericPrimitive::operator+=(), and partialClone().
| bool ccMesh::reservePerTriangleTexCoordIndexes | ( | ) |
Reserves memory to store per-triangle triplets of tex coords indexes.
Before adding per-triangle tex coords indexes triplets to the mesh (with ccMesh::addTriangleTexCoordIndexes()) be sure to reserve the necessary amount of memory with this method. This method reserves memory for as many tex coords indexes triplets as the number of triangles in the mesh (effictively stored or reserved - a call to ccMesh::reserve prior to this one is mandatory).
Definition at line 3659 of file ecvMesh.cpp.
References ccArray< Type, N, ComponentType >::isAllocated(), CCShareable::link(), m_texCoordIndexes, m_triVertIndexes, and ccArray< Type, N, ComponentType >::reserveSafe().
Referenced by cloneMesh(), DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertProfileToMesh(), createNewMeshFromSelection(), FromFbxMesh(), CSVMatrixFilter::loadFile(), ObjFilter::loadFile(), PlyFilter::loadFile(), merge(), partialClone(), and ccPlane::SetQuadTexture().
| bool ccMesh::resize | ( | size_t | n | ) |
Resizes the array of vertex indexes (3 per triangle)
If the new number of elements is smaller than the actual size, the overflooding elements will be deleted.
| n | the new number of triangles |
Definition at line 2488 of file ecvMesh.cpp.
References m_bBox, m_texCoordIndexes, m_triMtlIndexes, m_triNormalIndexes, m_triVertIndexes, ccHObject::notifyGeometryUpdate(), ccArray< Type, N, ComponentType >::resizeSafe(), and cloudViewer::BoundingBoxTpl< T >::setValidity().
Referenced by clear(), createNewMeshFromSelection(), PlyFilter::loadFile(), merge(), mergeDuplicatedVertices(), operator=(), setTriangleNorms(), and setTriangles().
| bool ccMesh::resizeAssociatedCloud | ( | std::size_t | n | ) |
Definition at line 2513 of file ecvMesh.cpp.
References ccPointCloud::hasColors(), ccPointCloud::hasNormals(), LogError, LogWarning, m_associatedCloud, ccPointCloud::resize(), ccPointCloud::resizeTheNormsTable(), ccPointCloud::resizeTheRGBTable(), and ccHObjectCaster::ToPointCloud().
|
overridevirtual |
Apply rotation to the geometry coordinates and normals. Given a rotation matrix
, and center
, a given point
is transformed according to
.
| R | A 3x3 rotation matrix |
| center | Rotation center that is used for the rotation. |
Reimplemented from ccHObject.
Definition at line 882 of file ecvMesh.cpp.
References ccPointCloud::applyRigidTransformation(), m_associatedCloud, ccGLMatrixTpl< T >::setRotation(), ccGLMatrixTpl< T >::shiftRotationCenter(), ccHObjectCaster::ToPointCloud(), and transformTriNormals().
Referenced by ccFacet::Rotate().
| std::shared_ptr< ccPointCloud > ccMesh::SamplePointsPoissonDisk | ( | size_t | number_of_points, |
| double | init_factor = 5, |
||
| const std::shared_ptr< ccPointCloud > | pcl_init = nullptr, |
||
| bool | use_triangle_normal = false, |
||
| int | seed = -1 |
||
| ) |
Function to sample number_of_points points (blue noise). Based on the method presented in Yuksel, "Sample Elimination for
Generating Poisson Disk Sample Sets", EUROGRAPHICS, 2015 The PointCloud pcl_init is used for sample elimination if given, otherwise a PointCloud is first uniformly sampled with init_number_of_points x number_of_points number of points. use_triangle_normal Set to true to assign the triangle normals to the returned points instead of the interpolated vertex normals. The triangle normals will be computed and added to the mesh if necessary. seed Sets the seed value used in the random generator, set to -1 to use a random seed value with each function call.
Definition at line 1431 of file TriangleMeshFactory.cpp.
References a, LogError, cloudViewer::geometry::KDTreeFlann::SearchRadius(), and size.
| std::shared_ptr< ccPointCloud > ccMesh::SamplePointsUniformly | ( | size_t | number_of_points, |
| bool | use_triangle_normal = false, |
||
| int | seed = -1 |
||
| ) |
Function to sample
| number_of_points | points uniformly from the mesh. |
| use_triangle_normal | Set to true to assign the triangle normals to the returned points instead of the interpolated vertex normals. The triangle normals will be computed and added to the mesh if necessary. |
| seed | Sets the seed value used in the random generator, set to -1 to use a random seed value with each function call. |
Definition at line 1831 of file TriangleMeshFactory.cpp.
| std::shared_ptr< ccPointCloud > ccMesh::SamplePointsUniformlyImpl | ( | size_t | number_of_points, |
| std::vector< double > & | triangle_areas, | ||
| double | surface_area, | ||
| bool | use_triangle_normal, | ||
| int | seed | ||
| ) |
Function to sample
| number_of_points | points uniformly from the mesh. |
Definition at line 1720 of file TriangleMeshFactory.cpp.
References a, ccEntityAction::computeNormals(), ccPointCloud::getEigenColor(), ccPointCloud::getEigenNormal(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, size, and uv.
|
overridevirtual |
Apply scaling to the geometry coordinates. Given a scaling factor
, and center
, a given point
is transformed according to
.
| scale | The scale parameter that is multiplied to the points/vertices of the geometry. |
| center | Scale center that is used to resize the geometry. |
Reimplemented from ccHObject.
Definition at line 872 of file ecvMesh.cpp.
References m_associatedCloud, ccPointCloud::Scale(), and ccHObjectCaster::ToPointCloud().
Referenced by ccFacet::Scale().
| std::shared_ptr< ccMesh > ccMesh::SelectByIndex | ( | const std::vector< size_t > & | indices, |
| bool | cleanup = true |
||
| ) | const |
Function to select points from input ccMesh into output ccMesh Vertices with indices in indices are selected.
| indices | defines Indices of vertices to be selected. |
| cleanup | If true it automatically calls ccMesh::RemoveDuplicatedVertices, ccMesh::RemoveDuplicatedTriangles, ccMesh::RemoveUnreferencedVertices, and ccMesh::RemoveDegenerateTriangles |
Definition at line 898 of file ecvMesh.cpp.
References ccPointCloud::addNorm(), cloudViewer::PointCloudTpl< T >::addPoint(), ccPointCloud::addRGBColor(), getAssociatedCloud(), getTriangleNorm(), getTriangleVertIndexes(), getVerticeSize(), hasColors(), ccPointCloud::hasColors(), hasNormals(), ccPointCloud::hasNormals(), hasTriangleUvs(), hasTriNormals(), LogDebug, LogWarning, normals, ccPointCloud::reserveTheNormsTable(), ccPointCloud::reserveTheRGBTable(), ccObject::setEnabled(), ccObject::setLocked(), ccPointCloud::shrinkToFit(), and size().
Referenced by Crop().
| void ccMesh::setAssociatedCloud | ( | ccGenericPointCloud * | cloud | ) |
Sets the associated vertices cloud (warning)
Definition at line 169 of file ecvMesh.cpp.
References ccHObject::addDependency(), ccHObject::DP_NOTIFY_OTHER_ON_DELETE, ccHObject::DP_NOTIFY_OTHER_ON_UPDATE, m_associatedCloud, m_bBox, and cloudViewer::BoundingBoxTpl< T >::setValidity().
Referenced by ccMesh(), define_ccMesh(), mergeDuplicatedVertices(), onDeletionOf(), and operator=().
| void ccMesh::setEigenVertices | ( | const std::vector< Eigen::Vector3d > & | vertices | ) |
Definition at line 2361 of file ecvMesh.cpp.
References m_associatedCloud, cloudViewer::PointCloudTpl< T >::setEigenPoints(), cloudViewer::GenericCloud::size(), and ccHObjectCaster::ToPointCloud().
Referenced by ccMesh().
| void ccMesh::setMaterialSet | ( | ccMaterialSet * | materialSet, |
| bool | autoReleaseOldMaterialSet = true |
||
| ) |
Sets associated material set (may be shared)
Definition at line 492 of file ecvMesh.cpp.
References ccHObject::addChild(), ccHObject::getChildIndex(), CCShareable::link(), m_materials, CCShareable::release(), ccHObject::removeChild(), and removePerTriangleMtlIndexes().
Referenced by cloneMesh(), DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertProfileToMesh(), createNewMeshFromSelection(), ccCropTool::Crop(), FromFbxMesh(), ObjFilter::loadFile(), DRCFilter::loadFile(), PlyFilter::loadFile(), merge(), partialClone(), ccPlane::SetQuadTexture(), GrainsAsEllipsoids::updateMeshAndLineSet(), and ~ccMesh().
| void ccMesh::setTexCoordinatesTable | ( | TextureCoordsContainer * | texCoordsTable, |
| bool | autoReleaseOldTable = true |
||
| ) |
Sets per-triangle texture coordinates array (may be shared)
Definition at line 3598 of file ecvMesh.cpp.
References ccHObject::addChild(), ccHObject::getChildIndex(), CCShareable::link(), m_texCoords, CCShareable::release(), ccHObject::removeChild(), and removePerTriangleTexCoordIndexes().
Referenced by cloneMesh(), DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertProfileToMesh(), createNewMeshFromSelection(), ccCropTool::Crop(), FromFbxMesh(), CSVMatrixFilter::loadFile(), ObjFilter::loadFile(), DRCFilter::loadFile(), PlyFilter::loadFile(), merge(), partialClone(), ccPlane::SetQuadTexture(), and ~ccMesh().
| void ccMesh::setTriangle | ( | size_t | index, |
| const Eigen::Vector3i & | triangle | ||
| ) |
Definition at line 2436 of file ecvMesh.cpp.
References LogWarning, and m_triVertIndexes.
Referenced by setTriangles().
| void ccMesh::setTriangleMtlIndex | ( | unsigned | triangleIndex, |
| int | mtlIndex | ||
| ) |
Sets triangle material indexes.
Cf. ccMesh::reservePerTriangleMtlIndexes.
| triangleIndex | triangle index |
| mtlIndex | triangle material index |
Definition at line 3756 of file ecvMesh.cpp.
References m_triMtlIndexes, and ccArray< Type, N, ComponentType >::setValue().
Referenced by ccCropTool::Crop().
| void ccMesh::setTriangleMtlIndexesTable | ( | triangleMaterialIndexesSet * | matIndexesTable, |
| bool | autoReleaseOldTable = true |
||
| ) |
Sets per-triangle material indexes array.
Definition at line 3718 of file ecvMesh.cpp.
References CCShareable::link(), m_triMtlIndexes, and CCShareable::release().
Referenced by PlyFilter::loadFile().
| bool ccMesh::setTriangleNorm | ( | size_t | index, |
| const Eigen::Vector3d & | triangle_normal | ||
| ) |
Definition at line 3483 of file ecvMesh.cpp.
References Vector3Tpl< PointCoordinateType >::fromArray(), ccNormalVectors::GetNormIndex(), hasTriNormals(), m_triNormals, and setTriangleNormalIndexes().
Referenced by setTriangleNorms().
| bool ccMesh::setTriangleNormalIndexes | ( | size_t | triangleIndex, |
| CompressedNormType | value | ||
| ) |
Definition at line 3495 of file ecvMesh.cpp.
References hasTriNormals(), m_triNormals, and ccArray< Type, N, ComponentType >::setValue().
Referenced by setTriangleNorm().
| void ccMesh::setTriangleNormalIndexes | ( | unsigned | triangleIndex, |
| int | i1, | ||
| int | i2, | ||
| int | i3 | ||
| ) |
Sets a triplet of normal indexes for a given triangle.
| triangleIndex | triangle index |
| i1 | first vertex normal index |
| i2 | second vertex normal index |
| i3 | third vertex normal index |
Definition at line 3345 of file ecvMesh.cpp.
References m_triNormalIndexes, and ccArray< Type, N, ComponentType >::setValue().
| bool ccMesh::setTriangleNorms | ( | const std::vector< Eigen::Vector3d > & | triangle_normals | ) |
Definition at line 3550 of file ecvMesh.cpp.
References LogWarning, m_triNormals, resize(), ccArray< Type, N, ComponentType >::resizeSafe(), and setTriangleNorm().
| void ccMesh::setTriangles | ( | const std::vector< Eigen::Vector3i > & | triangles | ) |
Definition at line 2455 of file ecvMesh.cpp.
References resize(), setTriangle(), and size().
Referenced by ccMesh().
| void ccMesh::setTriangleTexCoordIndexes | ( | unsigned | triangleIndex, |
| int | i1, | ||
| int | i2, | ||
| int | i3 | ||
| ) |
Sets a triplet of tex coords indexes for a given triangle.
| triangleIndex | triangle index |
| i1 | first vertex tex coords index |
| i2 | second vertex tex coords index |
| i3 | third vertex tex coords index |
Definition at line 3683 of file ecvMesh.cpp.
References m_texCoordIndexes, and ccArray< Type, N, ComponentType >::setValue().
| void ccMesh::setTriNormsTable | ( | NormsIndexesTableType * | triNormsTable, |
| bool | autoReleaseOldTable = true |
||
| ) |
Sets per-triangle normals array (may be shared)
Definition at line 470 of file ecvMesh.cpp.
References ccHObject::addChild(), ccHObject::getChildIndex(), CCShareable::link(), m_triNormals, CCShareable::release(), ccHObject::removeChild(), and removePerTriangleNormalIndexes().
Referenced by addTriangleNorm(), cloneMesh(), computePerTriangleNormals(), createNewMeshFromSelection(), FromFbxMesh(), ccGenericPrimitive::init(), STLFilter::loadASCIIFile(), STLFilter::loadBinaryFile(), ObjFilter::loadFile(), STLFilter::loadFile(), VTKFilter::loadFile(), merge(), ccGenericPrimitive::operator+=(), and partialClone().
| void ccMesh::setVertexColor | ( | size_t | index, |
| const Eigen::Vector3d & | color | ||
| ) |
Definition at line 2282 of file ecvMesh.cpp.
References color, m_associatedCloud, ccPointCloud::setPointColor(), and ccHObjectCaster::ToPointCloud().
| void ccMesh::setVertexColors | ( | const std::vector< Eigen::Vector3d > & | colors | ) |
Definition at line 2304 of file ecvMesh.cpp.
References colors, m_associatedCloud, ccPointCloud::setEigenColors(), cloudViewer::GenericCloud::size(), and ccHObjectCaster::ToPointCloud().
| void ccMesh::setVertexNormal | ( | size_t | index, |
| const Eigen::Vector3d & | normal | ||
| ) |
Definition at line 2237 of file ecvMesh.cpp.
References m_associatedCloud, normal, ccPointCloud::setPointNormal(), and ccHObjectCaster::ToPointCloud().
| void ccMesh::setVertexNormals | ( | const std::vector< Eigen::Vector3d > & | normals | ) |
Definition at line 2259 of file ecvMesh.cpp.
References m_associatedCloud, normals, ccPointCloud::setEigenNormals(), cloudViewer::GenericCloud::size(), and ccHObjectCaster::ToPointCloud().
| void ccMesh::setVertice | ( | size_t | index, |
| const Eigen::Vector3d & | vertice | ||
| ) |
Definition at line 2222 of file ecvMesh.cpp.
References getAssociatedCloud(), cloudViewer::PointCloudTpl< T >::setEigenPoint(), and ccHObjectCaster::ToPointCloud().
| void ccMesh::shiftTriangleIndexes | ( | unsigned | shift | ) |
Shifts all triangles indexes.
| shift | index shift (positive) |
Definition at line 3279 of file ecvMesh.cpp.
References cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, and m_triVertIndexes.
Referenced by ccPointCloud::append().
|
inlineprotectedvirtual |
Definition at line 1487 of file ecvMesh.h.
Referenced by computePerTriangleNormals(), and computePerVertexNormals().
|
inline |
Removes unused capacity.
Definition at line 302 of file ecvMesh.h.
References ccGenericMesh::capacity(), and cloudViewer::GenericMesh::size().
Referenced by pcl2cc::Convert(), vtk2cc::ConvertToMesh(), STEPFilter::importStepFile(), ObjFilter::loadFile(), OFFFilter::loadFile(), STLFilter::loadFile(), VTKFilter::loadFile(), DRCFilter::loadFile(), PlyFilter::loadFile(), main(), subdivide(), and ccPointCloud::triangulateGrid().
| void ccMesh::shrinkVertexToFit | ( | ) |
Definition at line 2568 of file ecvMesh.cpp.
References m_associatedCloud, ccPointCloud::shrinkToFit(), and ccHObjectCaster::ToPointCloud().
| std::shared_ptr< ccMesh > ccMesh::SimplifyQuadricDecimation | ( | int | target_number_of_triangles, |
| double | maximum_error = std::numeric_limits<double>::infinity(), |
||
| double | boundary_weight = 1.0 |
||
| ) | const |
Function to simplify mesh using Quadric Error Metric Decimation by Garland and Heckbert.
| target_number_of_triangles | defines the number of triangles that the simplified mesh should have. It is not guaranteed that this number will be reached. |
| maximum_error | defines the maximum error where a vertex is allowed to be merged |
| boundary_weight | a weight applied to edge vertices used to preserve boundaries |
Definition at line 272 of file TriangleMeshSimplification.cpp.
References a, Quadric::Eval(), cloudViewer::t::geometry::GetEdgeToTrianglesMap(), ccPointCloud::getEigenColor(), ccPointCloud::getEigenNormal(), cloudViewer::PointCloudTpl< T >::getEigenPoint(), cloudViewer::PointCloudTpl< T >::getPoint(), ccPointCloud::getPointColor(), ccPointCloud::getPointNormal(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), cloudViewer::VerticesIndexes::i, cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, Quadric::IsInvertible(), LogError, LogWarning, Quadric::Minimum(), ccPointCloud::resize(), ccPointCloud::resizeTheNormsTable(), ccPointCloud::resizeTheRGBTable(), ccPointCloud::setEigenColor(), ccPointCloud::setEigenNormal(), ccObject::setEnabled(), ccObject::setLocked(), cloudViewer::PointCloudTpl< T >::setPoint(), ccPointCloud::setPointColor(), ccPointCloud::setPointNormal(), cloudViewer::PointCloudTpl< T >::size(), size, and ccHObjectCaster::ToPointCloud().
| std::shared_ptr< ccMesh > ccMesh::SimplifyVertexClustering | ( | double | voxel_size, |
| SimplificationContraction | contraction = SimplificationContraction::Average |
||
| ) | const |
Function to simplify mesh using Vertex Clustering. The result can be a non-manifold mesh.
| voxel_size | - The size of the voxel within vertices are pooled. |
| contraction | - Method to aggregate vertex information. Average computes a simple average, Quadric minimizes the distance to the adjacent planes. |
Definition at line 75 of file TriangleMeshSimplification.cpp.
References cloudViewer::utility::floor(), ccPointCloud::getEigenColor(), ccPointCloud::getEigenNormal(), cloudViewer::PointCloudTpl< T >::getEigenPoint(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, Quadric::IsInvertible(), LogError, LogWarning, Quadric::Minimum(), ccPointCloud::resize(), ccPointCloud::resizeTheNormsTable(), ccPointCloud::resizeTheRGBTable(), ccObject::setEnabled(), ccObject::setLocked(), cloudViewer::PointCloudTpl< T >::setPoint(), ccPointCloud::setPointColor(), ccPointCloud::setPointNormal(), ccDrawableObject::showColors(), ccDrawableObject::showNormals(), cloudViewer::PointCloudTpl< T >::size(), size, ccHObjectCaster::ToPointCloud(), and voxel_size.
|
overridevirtual |
Returns the number of triangles.
Virtual method to request the mesh size
Implements cloudViewer::GenericMesh.
Definition at line 2143 of file ecvMesh.cpp.
References m_triVertIndexes.
Referenced by _getNextTriangle(), _getTriangle(), addTriangleNorms(), ccGraphicalSegmentationTool::applySegmentation(), ccBox::buildUp(), ccCoordinateSystem::buildUp(), CCMeshToDraco(), MeshWrapper< Real >::checkMeshCapacity(), cloneMesh(), ConvexConcaveHullReconstruction::compute(), GreedyTriangulation::compute(), MarchingCubeReconstruction::compute(), NurbsSurfaceReconstruction::compute(), PoissonReconstruction::compute(), qVoxFallProcess::Compute(), computeInterpolationWeights(), computePerTriangleNormals(), computePerVertexNormals(), convertMaterialsToVertexColors(), cloudViewer::geometry::LineSet::CreateFromTriangleMesh(), cloudViewer::geometry::VoxelGrid::CreateFromTriangleMeshWithinBounds(), createNewMeshFromSelection(), ccSubMesh::createNewSubMeshFromSelection(), ccCropTool::Crop(), cloudViewer::visualization::SelectionPolygonVolume::CropTriangleMesh(), cloudViewer::visualization::SelectionPolygon::CropTriangleMesh(), qPoissonRecon::doAction(), cvSelectionExporter::exportFromSourceMesh(), cvSelectionExporter::exportToMesh(), face_cb(), FromFbxMesh(), cloudViewer::t::geometry::TriangleMesh::FromLegacy(), ccDBRoot::gatherRecursiveInformation(), getColorFromMaterial(), getNextTriangleVertIndexes(), cvViewSelectionManager::getSourceMesh(), getTriangleNormals(), getTriangleNormalsPtr(), getTriangles(), getTriangleVertices(), getVertexColorFromMaterial(), interpolateColors(), interpolateNormals(), interpolateNormalsBC(), ccFacet::IsEmpty(), IsIntersecting(), laplacianSmooth(), CSVMatrixFilter::loadFile(), ObjFilter::loadFile(), OFFFilter::loadFile(), STLFilter::loadFile(), VTKFilter::loadFile(), DRCFilter::loadFile(), PlyFilter::loadFile(), merge(), mergeDuplicatedVertices(), ccGenericPrimitive::operator+=(), partialClone(), CommandCrossSection::process(), CommandDelaunayTri::process(), processScalarField(), pushSubdivide(), cloudViewer::io::ReadTriangleMesh(), cloudViewer::io::ReadTriangleMeshFromOBJ(), removeTriangles(), VTKFilter::saveToFile(), SelectByIndex(), ccPlane::SetQuadTexture(), setTriangles(), ecvPoissonReconDlg::start(), subdivide(), swapTriangles(), colmap::mvs::MvsTexturing::TextureMesh(), ToFbxMesh(), ccPointCloud::triangulateGrid(), and TriangulateTwoPolylines().
| ccMesh * ccMesh::subdivide | ( | PointCoordinateType | maxArea | ) | const |
Subdivides mesh (so as to ensure that all triangles are falls below 'maxArea')
Definition at line 4502 of file ecvMesh.cpp.
References ccHObject::addChild(), ccMesh(), ccDrawableObject::colorsShown(), computeNormals(), CVLog::Error(), ccPointCloud::From(), GenerateKey(), getAssociatedCloud(), ccArray< Type, N, ComponentType >::getValue(), hasColors(), hasNormals(), hasTriNormals(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, ccObject::isA(), ccDrawableObject::isVisible(), cloudViewer::LessThanEpsilon(), m_triVertIndexes, normalsShown(), CV_TYPES::POINT_CLOUD, pushSubdivide(), reserve(), s_alreadyCreatedVertices, s_maxSubdivideArea, ccDrawableObject::setVisible(), ccDrawableObject::showColors(), ccGenericMesh::showNormals(), shrinkToFit(), ccPointCloud::shrinkToFit(), cloudViewer::GenericCloud::size(), and size().
| std::shared_ptr< ccMesh > ccMesh::SubdivideLoop | ( | int | number_of_iterations | ) | const |
Function to subdivide triangle mesh using Loop's scheme. Cf. Charles T. Loop, "Smooth subdivision surfaces based on triangles",
| number_of_iterations | defines a single iteration splits each triangle into four triangles that cover the same surface. |
Definition at line 113 of file TriangleMeshSubdivide.cpp.
References e2, ccPointCloud::getEigenColor(), ccPointCloud::getEigenNormal(), cloudViewer::PointCloudTpl< T >::getEigenPoint(), cloudViewer::t::geometry::GetOrderedEdge(), cloudViewer::PointCloudTpl< T >::getPoint(), ccPointCloud::getPointNormal(), cloudViewer::PointCloudTpl< T >::getPointPtr(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), LogError, LogWarning, ccPointCloud::resize(), ccPointCloud::resizeTheNormsTable(), ccPointCloud::resizeTheRGBTable(), ccPointCloud::setEigenColor(), ccPointCloud::setEigenNormal(), ccObject::setEnabled(), ccObject::setLocked(), cloudViewer::PointCloudTpl< T >::setPoint(), ccPointCloud::setPointNormal(), cloudViewer::PointCloudTpl< T >::size(), size, and ccHObjectCaster::ToPointCloud().
| std::shared_ptr< ccMesh > ccMesh::SubdivideMidpoint | ( | int | number_of_iterations | ) | const |
Function to subdivide triangle mesh using the simple midpoint algorithm. Each triangle is subdivided into four triangles per iteration and the new vertices lie on the midpoint of the triangle edges.
| number_of_iterations | defines a single iteration splits each triangle into four triangles that cover the same surface. |
Definition at line 21 of file TriangleMeshSubdivide.cpp.
References ccPointCloud::addEigenColor(), ccPointCloud::addEigenNorm(), cloudViewer::PointCloudTpl< T >::addEigenPoint(), ccPointCloud::getEigenColor(), ccPointCloud::getEigenNormal(), cloudViewer::PointCloudTpl< T >::getEigenPoint(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), LogError, LogWarning, ccObject::setEnabled(), ccObject::setLocked(), cloudViewer::PointCloudTpl< T >::size(), and ccHObjectCaster::ToPointCloud().
| void ccMesh::swapTriangles | ( | unsigned | index1, |
| unsigned | index2 | ||
| ) |
Swaps two triangles.
Automatically updates internal structures (i.e. lookup tables for material, normals, etc.).
Definition at line 2574 of file ecvMesh.cpp.
References m_texCoordIndexes, m_triMtlIndexes, m_triNormalIndexes, m_triVertIndexes, size(), and ccArray< Type, N, ComponentType >::swap().
Referenced by mergeDuplicatedVertices().
|
overrideprotectedvirtual |
Save own object data.
Called by 'toFile' (recursive scheme) To be overloaded (but still called ;) by subclass.
| out | output file |
| dataVersion | target file version for compatibility control |
Reimplemented from ccGenericMesh.
Reimplemented in ccTorus, ccSphere, ccQuadric, and ccPlane.
Definition at line 3766 of file ecvMesh.cpp.
|
inlineoverridevirtual |
Toggles material display state.
Reimplemented from ccDrawableObject.
Definition at line 233 of file ecvMesh.h.
References ccGenericMesh::materialsShown(), and ccGenericMesh::showMaterials().
|
overridevirtual |
Apply transformation (4x4 matrix) to the geometry coordinates.
Reimplemented from ccHObject.
Definition at line 852 of file ecvMesh.cpp.
References ccPointCloud::applyRigidTransformation(), ccGLMatrixTpl< float >::FromEigenMatrix(), m_associatedCloud, ccHObjectCaster::ToPointCloud(), and transformTriNormals().
Referenced by cloudViewer::io::ReadTriangleMeshFromGLTF(), and ccFacet::Transform().
| void ccMesh::transformTriNormals | ( | const ccGLMatrix & | trans | ) |
Transforms the mesh per-triangle normals.
Definition at line 524 of file ecvMesh.cpp.
References ccGLMatrixTpl< T >::applyRotation(), ccArray< Type, N, ComponentType >::clear(), ccNormalVectors::GetNormal(), ccNormalVectors::GetNormIndex(), ccNormalVectors::GetNumberOfVectors(), ccHObject::getParent(), ccArray< Type, N, ComponentType >::getValue(), ccObject::isKindOf(), m_triNormals, CV_TYPES::MESH, CCShareable::release(), ccArray< Type, N, ComponentType >::setValue(), and Tuple3Tpl< Type >::u.
Referenced by ccGraphicalTransformationTool::apply(), applyGLTransformation(), Rotate(), and Transform().
|
overridevirtual |
Apply translation to the geometry coordinates.
| translation | A 3D vector to transform the geometry. |
| relative | If true, the translation is directly applied to the geometry. Otherwise, the geometry center is moved to the translation. |
Reimplemented from ccHObject.
Definition at line 863 of file ecvMesh.cpp.
References m_associatedCloud, ccHObjectCaster::ToPointCloud(), and ccPointCloud::Translate().
Referenced by cloudViewer::io::ReadTriangleMeshFromGLTF(), and ccFacet::Translate().
|
static |
Creates a Delaunay 2.5D mesh from a point cloud.
See cloudViewer::PointProjectionTools::computeTriangulation.
Definition at line 1732 of file ecvMesh.cpp.
References ccMesh(), computeNormals(), cloudViewer::PointProjectionTools::computeTriangulation(), getAssociatedCloud(), ccShiftedObject::getGlobalScale(), ccShiftedObject::getGlobalShift(), ccObject::getName(), ccDrawableObject::hasColors(), ccDrawableObject::hasNormals(), ccShiftedObject::setGlobalScale(), ccShiftedObject::setGlobalShift(), ccObject::setName(), ccGenericMesh::showNormals(), cloudViewer::GenericCloud::size(), type, and CVLog::Warning().
Referenced by CommandDelaunayTri::process().
|
static |
Creates a Delaunay 2.5D mesh from two polylines.
Definition at line 1538 of file ecvMesh.cpp.
References ccHObject::addChild(), cloudViewer::PointCloudTpl< T >::addPoint(), cloudViewer::Delaunay2dMesh::buildMesh(), ccMesh(), Vector3Tpl< Type >::cross(), Vector3Tpl< Type >::dot(), cloudViewer::PointProjectionTools::extractConvexHull2D(), ccShiftedObject::getGlobalScale(), ccShiftedObject::getGlobalShift(), cloudViewer::Neighbourhood::getGravityCenter(), cloudViewer::Neighbourhood::getLSPlane(), cloudViewer::Neighbourhood::getLSPlaneX(), cloudViewer::Neighbourhood::getLSPlaneY(), cloudViewer::ReferenceCloud::getPoint(), cloudViewer::Polyline::isClosed(), cloudViewer::Delaunay2dMesh::linkMeshWith(), Vector3Tpl< Type >::orthogonal(), cloudViewer::Delaunay2dMesh::removeOuterTriangles(), ccPointCloud::reserve(), ccPolyline::segmentCount(), ccObject::setEnabled(), ccShiftedObject::setGlobalScale(), ccShiftedObject::setGlobalShift(), ccDrawableObject::setVisible(), cloudViewer::Delaunay2dMesh::size(), cloudViewer::PointCloudTpl< T >::size(), cloudViewer::ReferenceCloud::size(), size(), CVLog::Warning(), and X.
| std::vector<std::unordered_set<int> > ccMesh::adjacency_list_ |
The set adjacency_list[i] contains the indices of adjacent vertices of vertex i.
Definition at line 622 of file ecvMesh.h.
Referenced by clear(), merge(), operator+=(), and operator=().
|
static |
Default octree level for the 'mergeDuplicatedVertices' algorithm.
Definition at line 612 of file ecvMesh.h.
Referenced by STEPFilter::importStepFile(), and STLFilter::loadFile().
|
protected |
associated cloud (vertices)
Definition at line 1490 of file ecvMesh.h.
Referenced by _getTriangle(), addEigenVertices(), addVertexColor(), addVertexColors(), addVertexNormal(), addVertexNormals(), ccMesh(), cloneMesh(), computeInterpolationWeights(), computePerTriangleNormals(), computePerVertexNormals(), convertMaterialsToVertexColors(), createNewMeshFromSelection(), Crop(), drawMeOnly(), ccGenericPrimitive::finishCloneJob(), forEach(), getGLTransformationHistory(), getTriangleVertices(), getVertexColor(), getVertexColorFromMaterial(), getVertexColors(), getVertexColorsPtr(), getVertexNormal(), getVertexNormals(), hasColors(), hasDisplayedScalarField(), hasScalarFields(), HasVertexNormals(), interpolateColors(), interpolateNormals(), invertNormals(), laplacianSmooth(), merge(), mergeDuplicatedVertices(), onDeletionOf(), onUpdateOf(), partialClone(), processScalarField(), refreshBB(), reserveAssociatedCloud(), resizeAssociatedCloud(), Rotate(), Scale(), setAssociatedCloud(), ccGenericPrimitive::setColor(), setEigenVertices(), setVertexColor(), setVertexColors(), setVertexNormal(), setVertexNormals(), shrinkVertexToFit(), Transform(), Translate(), and ccGenericPrimitive::vertices().
|
protected |
Bounding-box.
Definition at line 1510 of file ecvMesh.h.
Referenced by getBoundingBox(), getOwnBB(), onUpdateOf(), refreshBB(), resize(), and setAssociatedCloud().
|
protected |
Dump triangle structure to transmit temporary data.
Definition at line 1507 of file ecvMesh.h.
Referenced by _getTriangle(), and forEach().
|
protected |
Iterator on the list of triangles.
Definition at line 1505 of file ecvMesh.h.
Referenced by _getNextTriangle(), getNextTriangleVertIndexes(), and placeIteratorAtBeginning().
|
protected |
Materials.
Definition at line 1499 of file ecvMesh.h.
Referenced by cloneMesh(), createNewMeshFromSelection(), getColorFromMaterial(), getVertexColorFromMaterial(), hasMaterials(), merge(), partialClone(), and setMaterialSet().
|
protected |
Mesh tex coords indexes (per-triangle)
Definition at line 1518 of file ecvMesh.h.
Referenced by addTriangleTexCoordIndexes(), cloneMesh(), createNewMeshFromSelection(), getColorFromMaterial(), getTriangleTexCoordinates(), getTriangleTexCoordinatesIndexes(), getVertexColorFromMaterial(), hasTextures(), merge(), partialClone(), removePerTriangleTexCoordIndexes(), removeTriangles(), reserve(), reservePerTriangleTexCoordIndexes(), resize(), setTriangleTexCoordIndexes(), swapTriangles(), and ~ccMesh().
|
protected |
Texture coordinates.
Definition at line 1496 of file ecvMesh.h.
Referenced by cloneMesh(), createNewMeshFromSelection(), getColorFromMaterial(), getTexCoordinates(), getTriangleTexCoordinates(), getVertexColorFromMaterial(), hasTextures(), merge(), partialClone(), and setTexCoordinatesTable().
|
protected |
Per-triangle material indexes.
Definition at line 1513 of file ecvMesh.h.
Referenced by addTriangleMtlIndex(), cloneMesh(), createNewMeshFromSelection(), getColorFromMaterial(), getTriangleMtlIndex(), getVertexColorFromMaterial(), hasMaterials(), merge(), partialClone(), removePerTriangleMtlIndexes(), removeTriangles(), reserve(), reservePerTriangleMtlIndexes(), resize(), setTriangleMtlIndex(), setTriangleMtlIndexesTable(), swapTriangles(), and ~ccMesh().
|
protected |
Mesh normals indexes (per-triangle)
Definition at line 1523 of file ecvMesh.h.
Referenced by addTriangleNormalIndexes(), arePerTriangleNormalsEnabled(), cloneMesh(), computePerTriangleNormals(), createNewMeshFromSelection(), getTriangleNormalIndexes(), getTriangleNormals(), hasTriNormals(), interpolateNormals(), interpolateNormalsBC(), merge(), ccGenericPrimitive::operator+=(), partialClone(), removePerTriangleNormalIndexes(), removeTriangles(), reserve(), reservePerTriangleNormalIndexes(), resize(), setTriangleNormalIndexes(), swapTriangles(), and ~ccMesh().
|
protected |
Per-triangle normals.
Definition at line 1493 of file ecvMesh.h.
Referenced by addTriangleNorm(), ccBox::buildUp(), ccCone::buildUp(), ccCoordinateSystem::buildUp(), ccDisc::buildUp(), ccExtru::buildUp(), ccPlane::buildUp(), ccTorus::buildUp(), cloneMesh(), createNewMeshFromSelection(), getTriangleNorm(), getTriangleNormalIndexes(), getTriangleNormals(), getTriangleNormalsPtr(), getTriangleNorms(), hasTriNormals(), ccGenericPrimitive::init(), interpolateNormals(), invertNormals(), invertPerTriangleNormals(), merge(), ccGenericPrimitive::operator+=(), partialClone(), setTriangleNorm(), setTriangleNormalIndexes(), setTriangleNorms(), setTriNormsTable(), and transformTriNormals().
|
protected |
Triangles' vertices indexes (3 per triangle)
Definition at line 1502 of file ecvMesh.h.
Referenced by _getTriangle(), addTriangle(), ccBox::buildUp(), ccCone::buildUp(), ccCoordinateSystem::buildUp(), ccDisc::buildUp(), ccSphere::buildUp(), ccTorus::buildUp(), capacity(), ccMesh(), computeInterpolationWeights(), computePerTriangleNormals(), createNewMeshFromSelection(), drawMeOnly(), flipTriangles(), forEach(), getTriangleVertices(), getTriangleVertIndexes(), getVertexColorFromMaterial(), hasMaterials(), hasTextures(), hasTriNormals(), ccGenericPrimitive::init(), interpolateColors(), interpolateNormals(), interpolateNormalsBC(), refreshBB(), removeTriangles(), reserve(), reservePerTriangleMtlIndexes(), reservePerTriangleNormalIndexes(), reservePerTriangleTexCoordIndexes(), resize(), setTriangle(), shiftTriangleIndexes(), size(), subdivide(), swapTriangles(), and ~ccMesh().
| std::vector<std::pair<std::string, Material> > ccMesh::materials_ |
Definition at line 704 of file ecvMesh.h.
Referenced by clear(), cloudViewer::t::geometry::TriangleMesh::FromLegacy(), cloudViewer::io::ReadTriangleMeshFromOBJ(), cloudViewer::io::ReadTriangleMeshUsingASSIMP(), and cloudViewer::t::geometry::TriangleMesh::ToLegacy().
| std::vector<cloudViewer::geometry::Image> ccMesh::textures_ |
Textures of the image.
Definition at line 709 of file ecvMesh.h.
Referenced by clear(), merge(), cloudViewer::io::ReadTriangleMeshFromOBJ(), cloudViewer::io::ReadTriangleMeshUsingASSIMP(), and cloudViewer::io::rpc::SetTriangleMesh().
| std::vector<int> ccMesh::triangle_material_ids_ |
List of material ids.
Definition at line 707 of file ecvMesh.h.
Referenced by clear(), merge(), cloudViewer::io::ReadTriangleMeshFromOBJ(), and cloudViewer::io::ReadTriangleMeshUsingASSIMP().
| std::vector<Eigen::Vector2d> ccMesh::triangle_uvs_ |
List of uv coordinates per triangle.
Definition at line 625 of file ecvMesh.h.
Referenced by clear(), cloudViewer::t::geometry::TriangleMesh::FromLegacy(), merge(), cloudViewer::io::ReadTriangleMeshFromOBJ(), cloudViewer::io::ReadTriangleMeshUsingASSIMP(), cloudViewer::io::rpc::SetTriangleMesh(), and cloudViewer::t::geometry::TriangleMesh::ToLegacy().