qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
Classes | Public Types | Signals | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ccOctree Class Reference

Octree structure. More...

#include <ccOctree.h>

Inheritance diagram for ccOctree:
Inheritance graph
[legend]
Collaboration diagram for ccOctree:
Collaboration graph
[legend]

Classes

struct  BestRadiusParams
 Parameters for the GuessBestRadius method. More...
 

Public Types

enum  DisplayMode { WIRE = 0 , MEAN_POINTS = 1 , MEAN_CUBES = 2 }
 Octree displaying methods. More...
 
typedef QSharedPointer< ccOctreeShared
 Shared pointer.
 

Signals

void updated ()
 Signal sent when the octree organization is modified (cleared, etc.)
 

Public Member Functions

 ccOctree (ccGenericPointCloud *cloud)
 Default constructor. More...
 
virtual ~ccOctree ()
 Destructor.
 
void multiplyBoundingBox (const PointCoordinateType multFactor)
 Multiplies the bounding-box of the octree. More...
 
void translateBoundingBox (const CCVector3 &T)
 Translates the bounding-box of the octree. More...
 
ccBBox getSquareBB () const
 Returns the octree (square) bounding-box.
 
ccBBox getPointsBB () const
 Returns the points bounding-box.
 
virtual void clear () override
 
int getDisplayedLevel () const
 Returns the currently displayed octree level.
 
void setDisplayedLevel (int level)
 Sets the currently displayed octree level.
 
DisplayMode getDisplayMode () const
 Returns the currently display mode.
 
void setDisplayMode (DisplayMode mode)
 Sets the currently display mode.
 
void draw (CC_DRAW_CONTEXT &context)
 Draws the octree.
 
bool intersectWithFrustum (ccCameraSensor *sensor, std::vector< unsigned > &inCameraFrustum)
 Intersects octree with a camera sensor.
 
bool pointPicking (const CCVector2d &clickPos, const ccGLCameraParameters &camera, PointDescriptor &output, double pickWidth_pix=3.0) const
 Octree-driven point picking algorithm.
 

Static Public Member Functions

static void ComputeAverageColor (CCCoreLib::ReferenceCloud *subset, ccGenericPointCloud *sourceCloud, ColorCompType meanCol[])
 Computes the average color of a set of points.
 
static CCVector3 ComputeAverageNorm (CCCoreLib::ReferenceCloud *subset, ccGenericPointCloud *sourceCloud)
 Computes the average normal of a set of points.
 
static PointCoordinateType GuessNaiveRadius (ccGenericPointCloud *cloud)
 Tries to guess a very naive 'local radius' for octree-based computation. More...
 
static PointCoordinateType GuessBestRadius (ccGenericPointCloud *cloud, const BestRadiusParams &params, CCCoreLib::DgmOctree *cloudOctree=nullptr, CCCoreLib::GenericProgressCallback *progressCb=nullptr)
 Tries to guess the best 'local radius' for octree-based computation. More...
 
static PointCoordinateType GuessBestRadiusAutoComputeOctree (ccGenericPointCloud *cloud, const BestRadiusParams &params, QWidget *parentWidget=nullptr)
 Tries to guess the best 'local radius' for octree-based computation (auto-computes the octree if necessary) More...
 

Static Protected Member Functions

static bool DrawCellAsABox (const CCCoreLib::DgmOctree::octreeCell &cell, void **additionalParameters, CCCoreLib::NormalizedProgress *nProgress=0)
 
static bool DrawCellAsAPoint (const CCCoreLib::DgmOctree::octreeCell &cell, void **additionalParameters, CCCoreLib::NormalizedProgress *nProgress=0)
 
static bool DrawCellAsAPrimitive (const CCCoreLib::DgmOctree::octreeCell &cell, void **additionalParameters, CCCoreLib::NormalizedProgress *nProgress=0)
 

Protected Attributes

ccGenericPointCloudm_theAssociatedCloudAsGPC
 Associated cloud (as a ccGenericPointCloud)
 
int m_displayedLevel
 Displayed level.
 
DisplayMode m_displayMode
 Display mode.
 
GLuint m_glListID
 OpenGL display list.
 
bool m_glListIsDeprecated
 Whether the display (list) should be refreshed or not.
 
ccOctreeFrustumIntersectorm_frustumIntersector
 For frustum intersection.
 

Detailed Description

Octree structure.

Extends the CCCoreLib::DgmOctree class.

Member Enumeration Documentation

◆ DisplayMode

Octree displaying methods.

Enumerator
WIRE 

The octree is displayed as wired boxes (one box per cell)

MEAN_POINTS 

The octree is displayed as points (one point per cell = the center of gravity of the points lying in it)

MEAN_CUBES 

The octree is displayed as plain 3D cubes (one cube per cell)

Constructor & Destructor Documentation

◆ ccOctree()

ccOctree::ccOctree ( ccGenericPointCloud cloud)
explicit

Default constructor.

Parameters
clouda point cloud

Member Function Documentation

◆ GuessBestRadius()

PointCoordinateType ccOctree::GuessBestRadius ( ccGenericPointCloud cloud,
const BestRadiusParams params,
CCCoreLib::DgmOctree *  cloudOctree = nullptr,
CCCoreLib::GenericProgressCallback *  progressCb = nullptr 
)
static

Tries to guess the best 'local radius' for octree-based computation.

The ideal radius is determined by randomly sampling up to 200 points and looking at their neighborhood.

Parameters
cloudpoint cloud on which to process the normals.
paramsparameters
cloudOctreeinput cloud octree (optional)
progressCbprogress notification (optional)
Returns
the best radius (strictly positive value) or 0 if an error occurred

◆ GuessBestRadiusAutoComputeOctree()

PointCoordinateType ccOctree::GuessBestRadiusAutoComputeOctree ( ccGenericPointCloud cloud,
const BestRadiusParams params,
QWidget *  parentWidget = nullptr 
)
static

Tries to guess the best 'local radius' for octree-based computation (auto-computes the octree if necessary)

The ideal radius is determined by randomly sampling up to 200 points and looking at their neighborhood.

Parameters
cloudpoint cloud on which to process the normals.
paramsparameters
parentWidgetparent widget (for the progress dialog, if any has to be shown)
Returns
the best radius (strictly positive value) or 0 if an error occurred

◆ GuessNaiveRadius()

PointCoordinateType ccOctree::GuessNaiveRadius ( ccGenericPointCloud cloud)
static

Tries to guess a very naive 'local radius' for octree-based computation.

Parameters
cloudpoint cloud on which to process the normals.
Returns
naive radius (one percent of the cloud largest dimension by default, unless the cloud have very few points)

◆ multiplyBoundingBox()

void ccOctree::multiplyBoundingBox ( const PointCoordinateType  multFactor)

Multiplies the bounding-box of the octree.

If the cloud coordinates are simply multiplied by the same factor, there is no use in recomputing the octree structure. It's sufficient to update its bounding-box.

Parameters
multFactormultiplication factor

◆ translateBoundingBox()

void ccOctree::translateBoundingBox ( const CCVector3 &  T)

Translates the bounding-box of the octree.

If the cloud has been simply translated, there is no use to recompute the octree structure. It's sufficient to update its bounding-box.

Parameters
Ttranslation vector

The documentation for this class was generated from the following files: