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

A generic 3D point cloud with index-based point access. More...

#include <GenericIndexedCloud.h>

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

Public Member Functions

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

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 generic 3D point cloud with index-based point access.

Implements the GenericCloud interface.

Member Function Documentation

◆ getNormal()

virtual const CCVector3 * CCCoreLib::GenericIndexedCloud::getNormal ( unsigned  index) const
inlinevirtual

If per-point normals are available, returns the one at a specific index.

Warning
If overriden, this method should return a valid normal for all points

Reimplemented in CCCoreLib::ReferenceCloud, and CCCoreLib::PointCloud.

◆ getPoint() [1/2]

virtual const CCVector3 * CCCoreLib::GenericIndexedCloud::getPoint ( unsigned  index) const
pure virtual

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)

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

◆ getPoint() [2/2]

virtual void CCCoreLib::GenericIndexedCloud::getPoint ( unsigned  index,
CCVector3 P 
) const
pure virtual

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

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

◆ normalsAvailable()

virtual bool CCCoreLib::GenericIndexedCloud::normalsAvailable ( ) const
inlinevirtual

Returns whether normals are available.

Reimplemented in CCCoreLib::PointCloud, and CCCoreLib::ReferenceCloud.


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