ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
GenericMesh.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <functional>
11 
12 // Local
13 #include "CVGeom.h"
14 
15 namespace cloudViewer {
16 
17 class GenericTriangle;
18 
22 public:
23  GenericMesh() = default;
25  virtual ~GenericMesh() = default;
26 
35  enum class SimplificationContraction { Average, Quadric };
36 
44  enum class FilterScope { All, Color, Normal, Vertex };
45 
50  enum class DeformAsRigidAsPossibleEnergy { Spokes, Smoothed };
51 
53  using genericTriangleAction = std::function<void(GenericTriangle&)>;
54 
56 
59  virtual unsigned size() const = 0;
60  virtual bool hasTriangles() const { return size() != 0; }
61 
63 
67  virtual void forEach(genericTriangleAction action) = 0;
68 
70 
75  virtual void getBoundingBox(CCVector3& bbMin, CCVector3& bbMax) = 0;
76 
78 
80  virtual void placeIteratorAtBeginning() = 0;
81 
83 
88  virtual GenericTriangle* _getNextTriangle() = 0; // temporary
89 };
90 
91 } // namespace cloudViewer
#define CV_CORE_LIB_API
Definition: CVCoreLibWin.h:15
int size
virtual unsigned size() const =0
Returns the number of triangles.
virtual void getBoundingBox(CCVector3 &bbMin, CCVector3 &bbMax)=0
Returns the mesh bounding-box.
virtual GenericTriangle * _getNextTriangle()=0
Returns the next triangle (relatively to the global iterator position)
std::function< void(GenericTriangle &)> genericTriangleAction
Generic function to apply to a triangle (used by foreach)
Definition: GenericMesh.h:53
virtual ~GenericMesh()=default
Default destructor.
FilterScope
Indicates the scope of filter operations.
Definition: GenericMesh.h:44
virtual void placeIteratorAtBeginning()=0
Places the mesh iterator at the beginning.
virtual void forEach(genericTriangleAction action)=0
Fast iteration mechanism.
SimplificationContraction
Indicates the method that is used for mesh simplification if multiple vertices are combined to a sing...
Definition: GenericMesh.h:35
virtual bool hasTriangles() const
Definition: GenericMesh.h:60
A generic triangle interface.
Generic file read and write utility for python interface.