CCCoreLib 31 May 2022
CloudCompare Core algorithms
Public Types | Public Member Functions | List of all members
CCCoreLib::GenericCloud Class Referenceabstract

A generic 3D point cloud interface for data communication between library and client applications. More...

#include <GenericCloud.h>

Inheritance diagram for CCCoreLib::GenericCloud:
Inheritance graph
[legend]

Public Types

using genericPointAction = std::function< void(const CCVector3 &, ScalarType &)>
 Generic function applied to a point (used by foreach)
 

Public Member Functions

 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...
 

Detailed Description

A generic 3D point cloud interface for data communication between library and client applications.

Member Function Documentation

◆ enableScalarField()

virtual bool CCCoreLib::GenericCloud::enableScalarField ( )
pure virtual

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.

Implemented in CCCoreLib::DgmOctreeReferenceCloud, and CCCoreLib::ReferenceCloud.

◆ forEach()

virtual void CCCoreLib::GenericCloud::forEach ( genericPointAction  action)
pure virtual

Fast iteration mechanism.

Virtual method to apply a function to the whole cloud

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

Implemented in CCCoreLib::DgmOctreeReferenceCloud, and CCCoreLib::ReferenceCloud.

◆ getBoundingBox()

virtual void CCCoreLib::GenericCloud::getBoundingBox ( CCVector3 bbMin,
CCVector3 bbMax 
)
pure virtual

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)

Implemented in CCCoreLib::DgmOctreeReferenceCloud, and CCCoreLib::ReferenceCloud.

◆ getNextPoint()

virtual const CCVector3 * CCCoreLib::GenericCloud::getNextPoint ( )
pure virtual

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)

Implemented in CCCoreLib::DgmOctreeReferenceCloud, and CCCoreLib::ReferenceCloud.

◆ getPointScalarValue()

virtual ScalarType CCCoreLib::GenericCloud::getPointScalarValue ( unsigned  pointIndex) const
pure virtual

Returns the ith point associated scalar value.

Implemented in CCCoreLib::DgmOctreeReferenceCloud, and CCCoreLib::ReferenceCloud.

◆ isScalarFieldEnabled()

virtual bool CCCoreLib::GenericCloud::isScalarFieldEnabled ( ) const
pure virtual

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

Implemented in CCCoreLib::DgmOctreeReferenceCloud, and CCCoreLib::ReferenceCloud.

◆ placeIteratorAtBeginning()

virtual void CCCoreLib::GenericCloud::placeIteratorAtBeginning ( )
pure virtual

Sets the cloud iterator at the beginning.

Virtual method to handle the cloud global iterator

Implemented in CCCoreLib::DgmOctreeReferenceCloud, and CCCoreLib::ReferenceCloud.

◆ setPointScalarValue()

virtual void CCCoreLib::GenericCloud::setPointScalarValue ( unsigned  pointIndex,
ScalarType  value 
)
pure virtual

Sets the ith point associated scalar value.

Implemented in CCCoreLib::DgmOctreeReferenceCloud, and CCCoreLib::ReferenceCloud.

◆ size()

virtual unsigned CCCoreLib::GenericCloud::size ( ) const
pure virtual

Returns the number of points.

Virtual method to request the cloud size

Returns
the cloud size

Implemented in CCCoreLib::DgmOctreeReferenceCloud, and CCCoreLib::ReferenceCloud.

◆ testVisibility()

virtual unsigned char CCCoreLib::GenericCloud::testVisibility ( const CCVector3 P) const
inlinevirtual

Returns a given point visibility state (relatively to a sensor for instance)

Generic method to request a point visibility (should be overloaded if this functionality is required). The point visibility is such as defined in Daniel Girardeau-Montaut's PhD manuscript (see Chapter 2, section 2-3-3). In this case, a ground based laser sensor model should be used to determine it. This method is called before performing any point-to-cloud comparison. If the result is not POINT_VISIBLE, then the comparison won't be performed and the scalar field value associated to this point will be this visibility value.

Parameters
Pthe 3D point to test
Returns
visibility (default: POINT_VISIBLE)

Reimplemented in CCCoreLib::ReferenceCloud.


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