CCCoreLib 31 May 2022
CloudCompare Core algorithms
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CCCoreLib::DgmOctreeReferenceCloud Class Reference

A kind of ReferenceCloud based on the DgmOctree::NeighboursSet structure. More...

#include <DgmOctreeReferenceCloud.h>

Inheritance diagram for CCCoreLib::DgmOctreeReferenceCloud:
Inheritance graph
[legend]
Collaboration diagram for CCCoreLib::DgmOctreeReferenceCloud:
Collaboration graph
[legend]

Public Member Functions

 DgmOctreeReferenceCloud (DgmOctree::NeighboursSet *associatedSet, unsigned count=0)
 Default constructor. More...
 
unsigned size () const override
 Returns the number of points. More...
 
void forEach (genericPointAction action) override
 Fast iteration mechanism. More...
 
void getBoundingBox (CCVector3 &bbMin, CCVector3 &bbMax) override
 Returns the cloud bounding box. More...
 
void placeIteratorAtBeginning () override
 Sets the cloud iterator at the beginning. More...
 
const CCVector3getNextPoint () override
 Returns the next point (relatively to the global iterator position) More...
 
bool enableScalarField () override
 Enables the scalar field associated to the cloud. More...
 
bool isScalarFieldEnabled () const override
 Returns true if the scalar field is enabled, false otherwise. More...
 
void setPointScalarValue (unsigned pointIndex, ScalarType value) override
 Sets the ith point associated scalar value. More...
 
ScalarType getPointScalarValue (unsigned pointIndex) const override
 Returns the ith point associated scalar value. More...
 
const CCVector3getPoint (unsigned index) const override
 Returns the ith point. More...
 
void getPoint (unsigned index, CCVector3 &P) const override
 Returns the ith point. More...
 
const CCVector3getPointPersistentPtr (unsigned index) const override
 Returns the ith point as a persistent pointer. More...
 
void forwardIterator ()
 Forwards global iterator.
 
- Public Member Functions inherited from CCCoreLib::GenericIndexedCloudPersist
 GenericIndexedCloudPersist ()=default
 Default constructor.
 
 GenericIndexedCloudPersist (const char *name, unsigned ID)
 Mock constructor for compatibility with the PointCloudTpl interface. More...
 
 ~GenericIndexedCloudPersist () override=default
 Default destructor.
 
virtual const CCVector3getPointPersistentPtr (unsigned index) const =0
 Returns the ith point as a persistent pointer. More...
 
- Public Member Functions inherited from CCCoreLib::GenericIndexedCloud
 GenericIndexedCloud ()=default
 Default constructor.
 
 ~GenericIndexedCloud () override=default
 Default destructor.
 
virtual const CCVector3getPoint (unsigned index) const =0
 Returns the ith point. More...
 
virtual void getPoint (unsigned index, CCVector3 &P) const =0
 Returns the ith point. More...
 
virtual bool normalsAvailable () const
 Returns whether normals are available. More...
 
virtual const CCVector3getNormal (unsigned index) const
 If per-point normals are available, returns the one at a specific index. More...
 
- Public Member Functions inherited from CCCoreLib::GenericCloud
 GenericCloud ()=default
 Default constructor.
 
virtual ~GenericCloud ()=default
 Default destructor.
 
virtual unsigned size () const =0
 Returns the number of points. More...
 
virtual void forEach (genericPointAction action)=0
 Fast iteration mechanism. More...
 
virtual void getBoundingBox (CCVector3 &bbMin, CCVector3 &bbMax)=0
 Returns the cloud bounding box. More...
 
virtual unsigned char testVisibility (const CCVector3 &P) const
 Returns a given point visibility state (relatively to a sensor for instance) More...
 
virtual void placeIteratorAtBeginning ()=0
 Sets the cloud iterator at the beginning. More...
 
virtual const CCVector3getNextPoint ()=0
 Returns the next point (relatively to the global iterator position) More...
 
virtual bool enableScalarField ()=0
 Enables the scalar field associated to the cloud. More...
 
virtual bool isScalarFieldEnabled () const =0
 Returns true if the scalar field is enabled, false otherwise. More...
 
virtual void setPointScalarValue (unsigned pointIndex, ScalarType value)=0
 Sets the ith point associated scalar value. More...
 
virtual ScalarType getPointScalarValue (unsigned pointIndex) const =0
 Returns the ith point associated scalar value. More...
 

Protected Member Functions

virtual void computeBB ()
 Computes the cloud bounding-box (internal)
 

Protected Attributes

unsigned m_globalIterator
 Iterator on the point references container.
 
CCVector3 m_bbMin
 Bounding-box min corner.
 
CCVector3 m_bbMax
 Bounding-box max corner.
 
bool m_validBB
 Bounding-box validity.
 
DgmOctree::NeighboursSetm_set
 Associated PointDescriptor set.
 
unsigned m_size
 Number of points.
 

Additional Inherited Members

- Public Types inherited from CCCoreLib::GenericCloud
using genericPointAction = std::function< void(const CCVector3 &, ScalarType &)>
 Generic function applied to a point (used by foreach)
 

Detailed Description

A kind of ReferenceCloud based on the DgmOctree::NeighboursSet structure.

Constructor & Destructor Documentation

◆ DgmOctreeReferenceCloud()

DgmOctreeReferenceCloud::DgmOctreeReferenceCloud ( DgmOctree::NeighboursSet associatedSet,
unsigned  count = 0 
)

Default constructor.

Parameters
associatedSetassociated NeighboursSet
countnumber of values to use (0 = all)

Member Function Documentation

◆ enableScalarField()

bool CCCoreLib::DgmOctreeReferenceCloud::enableScalarField ( )
inlineoverridevirtual

Enables the scalar field associated to the cloud.

If the scalar field structure is not yet initialized/allocated, this method gives the signal for its creation. Otherwise, if possible the structure size should be pre-reserved with the same number of elements as the point cloud.

Warning
If the cloud is empty, the scalar field will be empty as well. The scalar field will be reserved with the same capacity as the cloud.

Implements CCCoreLib::GenericCloud.

◆ forEach()

void DgmOctreeReferenceCloud::forEach ( genericPointAction  action)
overridevirtual

Fast iteration mechanism.

Virtual method to apply a function to the whole cloud

Parameters
actionthe function to apply (see GenericCloud::genericPointAction)

Implements CCCoreLib::GenericCloud.

◆ getBoundingBox()

void DgmOctreeReferenceCloud::getBoundingBox ( CCVector3 bbMin,
CCVector3 bbMax 
)
overridevirtual

Returns the cloud bounding box.

Virtual method to request the cloud bounding box limits

Parameters
bbMinlower bounding-box limits (Xmin,Ymin,Zmin)
bbMaxhigher bounding-box limits (Xmax,Ymax,Zmax)

Implements CCCoreLib::GenericCloud.

◆ getNextPoint()

const CCVector3 * CCCoreLib::DgmOctreeReferenceCloud::getNextPoint ( )
inlineoverridevirtual

Returns the next point (relatively to the global iterator position)

Virtual method to handle the cloud global iterator. Global iterator position should be increased by one each time this method is called. Warning:

  • the returned object may not be persistent!
  • THIS METHOD MAY NOT BE COMPATIBLE WITH PARALLEL STRATEGIES (see the DgmOctree::executeFunctionForAllCellsAtLevel_MT and DgmOctree::executeFunctionForAllCellsAtStartingLevel_MT methods).
    Returns
    pointer on next point (or 0 if no more)

Implements CCCoreLib::GenericCloud.

◆ getPoint() [1/2]

const CCVector3 * CCCoreLib::DgmOctreeReferenceCloud::getPoint ( unsigned  index) const
inlineoverridevirtual

Returns the ith point.

Virtual method to request a point with a specific index. WARNINGS:

  • the returned object may not be persistent!
  • THIS METHOD MAY NOT BE COMPATIBLE WITH PARALLEL STRATEGIES (see the DgmOctree::executeFunctionForAllCellsAtLevel_MT and DgmOctree::executeFunctionForAllCellsAtStartingLevel_MT methods). Consider the other version of getPoint instead or the GenericIndexedCloudPersist class.
    Parameters
    indexof the requested point (between 0 and the cloud size minus 1)
    Returns
    the requested point (undefined behavior if index is invalid)

Implements CCCoreLib::GenericIndexedCloud.

◆ getPoint() [2/2]

void CCCoreLib::DgmOctreeReferenceCloud::getPoint ( unsigned  index,
CCVector3 P 
) const
inlineoverridevirtual

Returns the ith point.

Virtual method to request a point with a specific index. Index must be valid (undefined behavior if index is invalid)

Parameters
indexof the requested point (between 0 and the cloud size minus 1)
Poutput point

Implements CCCoreLib::GenericIndexedCloud.

◆ getPointPersistentPtr()

const CCVector3 * CCCoreLib::DgmOctreeReferenceCloud::getPointPersistentPtr ( unsigned  index) const
inlineoverridevirtual

Returns the ith point as a persistent pointer.

Virtual method to request a point with a specific index. WARNING: the returned object MUST be persistent in order to be compatible with parallel strategies!

Parameters
indexof the requested point (between 0 and the cloud size minus 1)
Returns
the requested point (or 0 if index is invalid)

Implements CCCoreLib::GenericIndexedCloudPersist.

◆ getPointScalarValue()

ScalarType CCCoreLib::DgmOctreeReferenceCloud::getPointScalarValue ( unsigned  pointIndex) const
inlineoverridevirtual

Returns the ith point associated scalar value.

Implements CCCoreLib::GenericCloud.

◆ isScalarFieldEnabled()

bool CCCoreLib::DgmOctreeReferenceCloud::isScalarFieldEnabled ( ) const
inlineoverridevirtual

Returns true if the scalar field is enabled, false otherwise.

Implements CCCoreLib::GenericCloud.

◆ placeIteratorAtBeginning()

void CCCoreLib::DgmOctreeReferenceCloud::placeIteratorAtBeginning ( )
inlineoverridevirtual

Sets the cloud iterator at the beginning.

Virtual method to handle the cloud global iterator

Implements CCCoreLib::GenericCloud.

◆ setPointScalarValue()

void CCCoreLib::DgmOctreeReferenceCloud::setPointScalarValue ( unsigned  pointIndex,
ScalarType  value 
)
inlineoverridevirtual

Sets the ith point associated scalar value.

Implements CCCoreLib::GenericCloud.

◆ size()

unsigned CCCoreLib::DgmOctreeReferenceCloud::size ( ) const
inlineoverridevirtual

Returns the number of points.

Virtual method to request the cloud size

Returns
the cloud size

Implements CCCoreLib::GenericCloud.


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