ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::DgmOctreeReferenceCloud Class Reference

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

#include <DgmOctreeReferenceCloud.h>

Inheritance diagram for cloudViewer::DgmOctreeReferenceCloud:
Collaboration diagram for cloudViewer::DgmOctreeReferenceCloud:

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...
 
void getPoint (unsigned index, double P[3]) const override
 
const CCVector3getPointPersistentPtr (unsigned index) override
 Returns the ith point as a persistent pointer. More...
 
void forwardIterator ()
 Forwards global iterator. More...
 
- Public Member Functions inherited from cloudViewer::GenericIndexedCloudPersist
 ~GenericIndexedCloudPersist () override=default
 Default destructor. More...
 
- Public Member Functions inherited from cloudViewer::GenericIndexedCloud
 ~GenericIndexedCloud () override=default
 Default destructor. 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 cloudViewer::GenericCloud
 GenericCloud ()=default
 Default constructor. More...
 
virtual ~GenericCloud ()=default
 Default destructor. More...
 
virtual bool hasPoints () const
 
virtual unsigned char testVisibility (const CCVector3 &P) const
 

Protected Member Functions

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

Protected Attributes

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

Additional Inherited Members

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

Detailed Description

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

Definition at line 17 of file DgmOctreeReferenceCloud.h.

Constructor & Destructor Documentation

◆ DgmOctreeReferenceCloud()

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

Default constructor.

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

Definition at line 12 of file DgmOctreeReferenceCloud.cpp.

Member Function Documentation

◆ computeBB()

void DgmOctreeReferenceCloud::computeBB ( )
protectedvirtual

Computes the cloud bounding-box (internal)

Definition at line 22 of file DgmOctreeReferenceCloud.cpp.

References count, m_bbMax, m_bbMin, m_set, m_validBB, size(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by getBoundingBox().

◆ enableScalarField()

bool cloudViewer::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.

Implements cloudViewer::GenericCloud.

Definition at line 38 of file DgmOctreeReferenceCloud.h.

◆ 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 cloudViewer::GenericCloud.

Definition at line 65 of file DgmOctreeReferenceCloud.cpp.

References count, m_set, and size().

◆ forwardIterator()

void cloudViewer::DgmOctreeReferenceCloud::forwardIterator ( )
inline

Forwards global iterator.

Definition at line 75 of file DgmOctreeReferenceCloud.h.

Referenced by define_DgmOctreeReferenceCloud().

◆ 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 cloudViewer::GenericCloud.

Definition at line 57 of file DgmOctreeReferenceCloud.cpp.

References computeBB(), m_bbMax, m_bbMin, and m_validBB.

◆ getNextPoint()

const CCVector3* cloudViewer::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 cloudViewer::GenericCloud.

Definition at line 34 of file DgmOctreeReferenceCloud.h.

References size.

◆ getPoint() [1/3]

const CCVector3* cloudViewer::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 cloudViewer::GenericIndexedCloud.

Definition at line 54 of file DgmOctreeReferenceCloud.h.

References size.

Referenced by cloudViewer::CloudSamplingTools::applyNoiseFilterAtLevel(), and ccTrace::getSegmentCostCurve().

◆ getPoint() [2/3]

void cloudViewer::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 cloudViewer::GenericIndexedCloud.

Definition at line 58 of file DgmOctreeReferenceCloud.h.

References size.

◆ getPoint() [3/3]

void cloudViewer::DgmOctreeReferenceCloud::getPoint ( unsigned  index,
double  P[3] 
) const
inlineoverridevirtual

Reimplemented from cloudViewer::GenericIndexedCloud.

Definition at line 62 of file DgmOctreeReferenceCloud.h.

References size.

◆ getPointPersistentPtr()

const CCVector3* cloudViewer::DgmOctreeReferenceCloud::getPointPersistentPtr ( unsigned  index)
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 cloudViewer::GenericIndexedCloudPersist.

Definition at line 69 of file DgmOctreeReferenceCloud.h.

References size.

◆ getPointScalarValue()

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

Returns the ith point associated scalar value.

Implements cloudViewer::GenericCloud.

Definition at line 49 of file DgmOctreeReferenceCloud.h.

References size.

◆ isScalarFieldEnabled()

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

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

Implements cloudViewer::GenericCloud.

Definition at line 41 of file DgmOctreeReferenceCloud.h.

◆ placeIteratorAtBeginning()

void cloudViewer::DgmOctreeReferenceCloud::placeIteratorAtBeginning ( )
inlineoverridevirtual

Sets the cloud iterator at the beginning.

Virtual method to handle the cloud global iterator

Implements cloudViewer::GenericCloud.

Definition at line 33 of file DgmOctreeReferenceCloud.h.

◆ setPointScalarValue()

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

Sets the ith point associated scalar value.

Implements cloudViewer::GenericCloud.

Definition at line 44 of file DgmOctreeReferenceCloud.h.

References size.

◆ size()

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

Returns the number of points.

Virtual method to request the cloud size

Returns
the cloud size

Implements cloudViewer::GenericCloud.

Definition at line 28 of file DgmOctreeReferenceCloud.h.

Referenced by computeBB(), and forEach().

Member Data Documentation

◆ m_bbMax

CCVector3 cloudViewer::DgmOctreeReferenceCloud::m_bbMax
protected

Bounding-box max corner.

Definition at line 87 of file DgmOctreeReferenceCloud.h.

Referenced by computeBB(), and getBoundingBox().

◆ m_bbMin

CCVector3 cloudViewer::DgmOctreeReferenceCloud::m_bbMin
protected

Bounding-box min corner.

Definition at line 85 of file DgmOctreeReferenceCloud.h.

Referenced by computeBB(), and getBoundingBox().

◆ m_globalIterator

unsigned cloudViewer::DgmOctreeReferenceCloud::m_globalIterator
protected

Iterator on the point references container.

Definition at line 82 of file DgmOctreeReferenceCloud.h.

◆ m_set

DgmOctree::NeighboursSet* cloudViewer::DgmOctreeReferenceCloud::m_set
protected

Associated PointDescriptor set.

Definition at line 92 of file DgmOctreeReferenceCloud.h.

Referenced by computeBB(), and forEach().

◆ m_size

unsigned cloudViewer::DgmOctreeReferenceCloud::m_size
protected

Number of points.

Definition at line 95 of file DgmOctreeReferenceCloud.h.

◆ m_validBB

bool cloudViewer::DgmOctreeReferenceCloud::m_validBB
protected

Bounding-box validity.

Definition at line 89 of file DgmOctreeReferenceCloud.h.

Referenced by computeBB(), and getBoundingBox().


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