17 class GenericIndexedMesh;
27 static constexpr
int IGNORE_MAX_EDGE_LENGTH = 0;
29 static constexpr
bool DUPLICATE_VERTICES =
true;
30 static constexpr
bool DO_NOT_DUPLICATE_VERTICES =
false;
36 FLAG_GRAVITY_CENTER = 1,
42 enum CurvatureType { GAUSSIAN_CURV = 1, MEAN_CURV, NORMAL_CHANGE_RATE };
57 return m_associatedCloud;
69 std::string& outputErrorStr);
88 template <
class Vec2D>
90 std::vector<Vec2D>& points2D,
97 unsigned count = (m_associatedCloud ? m_associatedCloud->size() : 0);
98 if (!
count)
return false;
101 if (!planeEquation) {
102 planeEquation = getLSPlane();
103 if (!planeEquation)
return false;
108 points2D.resize(
count);
109 }
catch (
const std::bad_alloc&) {
115 CCVector3 G(0, 0, 0), u(1, 0, 0), v(0, 1, 0);
116 if ((vectorsUsage == UseOXYasBase) && O &&
X && Y) {
122 if ((vectorsUsage == UseYAsUpDir) && Y) {
123 v = (*Y - Y->dot(N) * N);
130 const CCVector3* _G = getGravityCenter();
136 for (
unsigned i = 0; i <
count; ++i) {
138 const CCVector3 P = *m_associatedCloud->getPoint(i) - G;
141 points2D[i] = Vec2D(P.
dot(u), P.
dot(v));
145 if (vectorsUsage != UseOXYasBase) {
181 double computeFeature(GeomFeature feature);
187 ScalarType computeMomentOrder1(
const CCVector3& P);
196 ScalarType computeRoughness(
const CCVector3& P,
197 const CCVector3* roughnessUpDir =
nullptr);
203 ScalarType computeCurvature(
const CCVector3& P, CurvatureType cType);
216 void setGravityCenter(
const CCVector3& G);
268 bool compute3DQuadric(
double quadricEquation[10]);
312 void computeGravityCenter();
314 bool computeLeastSquareBestFittingPlane();
316 bool computeQuadric();
float PointCoordinateType
Type of the coordinates of a (N-D) point.
void normalize()
Sets vector norm to unity.
Type dot(const Vector3Tpl &v) const
Dot product.
Vector3Tpl cross(const Vector3Tpl &v) const
Cross product.
A generic 3D point cloud with index-based and presistent access to points.
A generic mesh with index-based vertex access.
bool projectPointsOn2DPlane(std::vector< Vec2D > &points2D, const PointCoordinateType *planeEquation=nullptr, CCVector3 *O=nullptr, CCVector3 *X=nullptr, CCVector3 *Y=nullptr, InputVectorsUsage vectorsUsage=None)
Projects points on the best fitting LS plane.
virtual ~Neighbourhood()=default
Default destructor.
GeomFeature
Geometric feature computed from eigen values/vectors.
CCVector3 m_gravityCenter
Gravity center.
GenericIndexedCloudPersist * associatedCloud() const
Returns associated cloud.
CurvatureType
Curvature type.
GenericIndexedCloudPersist * m_associatedCloud
Associated cloud.
unsigned char m_structuresValidity
Geometrical elements validity (flags)
Tuple3ub m_quadricEquationDirections
2.5D Quadric equation dimensions
Generic file read and write utility for python interface.