32 return static_cast<unsigned>(
33 GetUniqueInstance()->m_theNormalVectors.size());
38 return GetUniqueInstance()->getNormal(normIndex);
41 return GetUniqueInstance()->getNormal(normIndex);
43 static inline const std::vector<CCVector3>&
GetNormals() {
44 return GetUniqueInstance()->getNormals();
47 return GetUniqueInstance()->getNormals();
52 return m_theNormalVectors[normIndex];
55 return m_theNormalVectors[normIndex];
57 inline const std::vector<CCVector3>&
getNormals()
const {
58 return m_theNormalVectors;
60 inline std::vector<CCVector3>&
getNormals() {
return m_theNormalVectors; }
66 return GetNormIndex(N.
u);
225 return m_theNormalHSVColors;
271 void** additionalParameters,
276 void** additionalParameters,
281 void** additionalParameters,
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Array of compressed 3D normals (single index)
A 3D cloud interface with associated features (color, normals, octree, etc.)
Compressed normal vectors handler.
static PointCoordinateType GuessBestRadius(ccGenericPointCloud *cloud, cloudViewer::DgmOctree *cloudOctree=nullptr, cloudViewer::GenericProgressCallback *progressCb=nullptr)
static CCVector3 ConvertDipAndDipDirToNormal(PointCoordinateType dip_deg, PointCoordinateType dipDir_deg, bool upward=true)
bool init()
Inits internal structures.
static bool UpdateNormalOrientations(ccGenericPointCloud *theCloud, NormsIndexesTableType &theNormsCodes, Orientation preferredOrientation)
Updates normals orientation based on a preferred orientation.
static bool ComputeNormsAtLevelWithLS(const cloudViewer::DgmOctree::octreeCell &cell, void **additionalParameters, cloudViewer::NormalizedProgress *nProgress=nullptr)
Cellular method for octree-based normal computation.
static bool ComputeNormalWithTri(cloudViewer::GenericIndexedCloudPersist *pointAndNeighbors, CCVector3 &N)
Helper: computes the normal (with Delaunay 2.5D)
const std::vector< CCVector3 > & getNormals() const
static QString ConvertDipAndDipDirToString(PointCoordinateType dip_deg, PointCoordinateType dipDir_deg)
Converts geological 'dip direction & dip' parameters to a string.
const std::vector< ecvColor::Rgb > & getNormalHSVColorArray() const
Returns the HSV color array.
static CompressedNormType GetNormIndex(const CCVector3 &N)
Returns the compressed index corresponding to a normal vector (shortcut)
const ecvColor::Rgb & getNormalHSVColor(unsigned index) const
Returns the HSV color equivalent to a given compressed normal index.
const CCVector3 & getNormal(unsigned normIndex) const
Returns the precomputed normal corresponding to a given compressed index.
static ecvColor::Rgb ConvertNormalToRGB(const CCVector3 &N)
Converts a normal vector to RGB color space.
std::vector< CCVector3 > m_theNormalVectors
Compressed normal vectors.
static bool ComputeNormsAtLevelWithTri(const cloudViewer::DgmOctree::octreeCell &cell, void **additionalParameters, cloudViewer::NormalizedProgress *nProgress=nullptr)
Cellular method for octree-based normal computation.
static void ConvertNormalToStrikeAndDip(const CCVector3 &N, PointCoordinateType &strike_deg, PointCoordinateType &dip_deg)
ccNormalVectors()
Default constructor.
std::vector< CCVector3 > & getNormals()
static void ConvertNormalToDipAndDipDir(const CCVector3 &N, PointCoordinateType &dip_deg, PointCoordinateType &dipDir_deg)
Converts a normal vector to geological 'dip direction & dip' parameters.
static void ConvertNormalToHSV(const CCVector3 &N, float &H, float &S, float &V)
Converts a normal vector to HSV color space.
std::vector< ecvColor::Rgb > m_theNormalHSVColors
'HSV' colors corresponding to each compressed normal index
static std::vector< CCVector3 > & GetNormalsPtr()
static bool ComputeNormalWithLS(cloudViewer::GenericIndexedCloudPersist *pointAndNeighbors, CCVector3 &N)
Helper: computes the normal (with best LS fit)
static ccNormalVectors * GetUniqueInstance()
Returns unique instance.
static QString ConvertStrikeAndDipToString(double &strike_deg, double &dip_deg)
static const CCVector3 & GetNormal(unsigned normIndex)
Static access to ccNormalVectors::getNormal.
static PointCoordinateType GuessNaiveRadius(ccGenericPointCloud *cloud)
static unsigned GetNumberOfVectors()
Returns the number of compressed normal vectors.
Orientation
'Default' orientations
static bool ComputeNormalWithQuadric(cloudViewer::GenericIndexedCloudPersist *points, const CCVector3 &P, CCVector3 &N)
Helper: computes the normal (with Delaunay 2.5D)
static const std::vector< CCVector3 > & GetNormals()
static CCVector3 & GetNormalPtr(unsigned normIndex)
CCVector3 & getNormal(unsigned normIndex)
static CompressedNormType GetNormIndex(const PointCoordinateType N[])
Returns the compressed index corresponding to a normal vector.
virtual ~ccNormalVectors()
Default destructor.
static bool ComputeCloudNormals(ccGenericPointCloud *cloud, NormsIndexesTableType &theNormsCodes, CV_LOCAL_MODEL_TYPES localModel, PointCoordinateType localRadius, Orientation preferredOrientation=UNDEFINED, cloudViewer::GenericProgressCallback *progressCb=nullptr, cloudViewer::DgmOctree *inputOctree=nullptr)
Computes normal at each point of a given cloud.
static bool ComputeNormsAtLevelWithQuadric(const cloudViewer::DgmOctree::octreeCell &cell, void **additionalParameters, cloudViewer::NormalizedProgress *nProgress=nullptr)
Cellular method for octree-based normal computation.
bool enableNormalHSVColorsArray()
Allocates normal HSV colors array.
static void ReleaseUniqueInstance()
Releases unique instance.
The octree structure used throughout the library.
A generic 3D point cloud with index-based and presistent access to points.
unsigned int CompressedNormType
Compressed normals type.