qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
|
A 3D cloud and its associated features (color, normals, scalar fields, etc.) More...
#include <ccPointCloud.h>
Classes | |
struct | Grid |
Grid structure. More... | |
struct | UnrollBaseParams |
struct | UnrollConeParams |
struct | UnrollCylinderParams |
class | VBO |
struct | vboSet |
VBO set. More... | |
Public Types | |
enum | CLONE_WARNINGS { WRN_OUT_OF_MEM_FOR_COLORS = 1 , WRN_OUT_OF_MEM_FOR_NORMALS = 2 , WRN_OUT_OF_MEM_FOR_SFS = 4 , WRN_OUT_OF_MEM_FOR_FWF = 8 } |
Warnings for the partialClone method (bit flags) | |
enum | UnrollMode { CYLINDER = 0 , CONE = 1 , STRAIGHTENED_CONE = 2 , STRAIGHTENED_CONE2 = 3 } |
using | BaseClass = CCCoreLib::PointCloudTpl< ccGenericPointCloud, QString > |
Base class (shortcut) | |
using | FWFDescriptorSet = QMap< uint8_t, WaveformDescriptor > |
Waveform descriptors set. | |
using | FWFDataContainer = std::vector< uint8_t > |
Waveform data container. | |
using | SharedFWFDataContainer = QSharedPointer< const FWFDataContainer > |
Public Member Functions | |
ccPointCloud (QString name=QString(), unsigned uniqueID=ccUniqueIDGenerator::InvalidUniqueID) throw () | |
Default constructor. More... | |
~ccPointCloud () override | |
Default destructor. | |
CC_CLASS_ENUM | getClassID () const override |
Returns class ID. | |
ccPointCloud * | partialClone (const CCCoreLib::ReferenceCloud *selection, int *warnings=nullptr) const |
Creates a new point cloud object from a ReferenceCloud (selection) More... | |
ccPointCloud * | cloneThis (ccPointCloud *destCloud=nullptr, bool ignoreChildren=false) |
Clones this entity. More... | |
ccGenericPointCloud * | clone (ccGenericPointCloud *destCloud=nullptr, bool ignoreChildren=false) override |
const ccPointCloud & | operator+= (ccPointCloud *) |
Fuses another 3D entity with this one. More... | |
void | clear () override |
Clears the entity from all its points and features. More... | |
void | unallocatePoints () |
Erases the cloud points. More... | |
void | unallocateColors () |
Erases the cloud colors. | |
void | unallocateNorms () |
Erases the cloud normals. | |
void | colorsHaveChanged () |
Notify a modification of color / scalar field display parameters or contents. | |
void | normalsHaveChanged () |
Notify a modification of normals display parameters or contents. | |
void | pointsHaveChanged () |
Notify a modification of points display parameters or contents. | |
bool | reserveThePointsTable (unsigned _numberOfPoints) |
Reserves memory to store the points coordinates. More... | |
bool | reserveTheRGBTable () |
Reserves memory to store the RGB colors. More... | |
bool | resizeTheRGBTable (bool fillWithWhite=false) |
Resizes the RGB colors array. More... | |
bool | reserveTheNormsTable () |
Reserves memory to store the compressed normals. More... | |
bool | resizeTheNormsTable () |
Resizes the compressed normals array. More... | |
bool | reserve (unsigned numberOfPoints) override |
Reserves memory for all the active features. More... | |
bool | resize (unsigned numberOfPoints) override |
Resizes all the active features arrays. More... | |
void | shrinkToFit () |
Removes unused capacity. | |
ccScalarField * | getCurrentDisplayedScalarField () const |
Returns the currently displayed scalar (or 0 if none) | |
int | getCurrentDisplayedScalarFieldIndex () const |
Returns the currently displayed scalar field index (or -1 if none) | |
void | setCurrentDisplayedScalarField (int index) |
Sets the currently displayed scalar field. More... | |
void | deleteScalarField (int index) override |
void | deleteAllScalarFields () override |
int | addScalarField (const char *uniqueName) override |
bool | sfColorScaleShown () const |
Returns whether color scale should be displayed or not. | |
void | showSFColorsScale (bool state) |
Sets whether color scale should be displayed or not. | |
size_t | gridCount () const |
Returns the number of associated grids. | |
Grid::Shared & | grid (size_t gridIndex) |
Returns an associated grid. | |
const Grid::Shared & | grid (size_t gridIndex) const |
Returns an associated grid (const version) | |
bool | addGrid (Grid::Shared grid) |
Adds an associated grid. | |
void | removeGrids () |
Remove all associated grids. | |
ccMesh * | triangulateGrid (const Grid &grid, double minTriangleAngle_deg=0.0) const |
Meshes a scan grid. More... | |
bool | computeNormalsWithGrids (double minTriangleAngle_deg=1.0, ccProgressDialog *pDlg=nullptr) |
Compute the normals with the associated grid structure(s) More... | |
bool | orientNormalsWithGrids (ccProgressDialog *pDlg=nullptr) |
Orient the normals with the associated grid structure(s) | |
bool | orientNormalsTowardViewPoint (CCVector3 &VP, ccProgressDialog *pDlg=nullptr) |
Normals are forced to point to O. | |
bool | computeNormalsWithOctree (CCCoreLib::LOCAL_MODEL_TYPES model, ccNormalVectors::Orientation preferredOrientation, PointCoordinateType defaultRadius, ccProgressDialog *pDlg=nullptr) |
Compute the normals by approximating the local surface around each point. | |
bool | orientNormalsWithMST (unsigned kNN=6, ccProgressDialog *pDlg=nullptr) |
Orient the normals with a Minimum Spanning Tree. | |
bool | orientNormalsWithFM (unsigned char level, ccProgressDialog *pDlg=nullptr) |
Orient normals with Fast Marching. | |
bool | hasFWF () const |
Returns whether the cloud has associated Full WaveForm data. | |
ccWaveformProxy | waveformProxy (unsigned index) const |
Returns a proxy on a given waveform. | |
FWFDescriptorSet & | fwfDescriptors () |
Gives access to the FWF descriptors. | |
const FWFDescriptorSet & | fwfDescriptors () const |
Gives access to the FWF descriptors (const version) | |
std::vector< ccWaveform > & | waveforms () |
Gives access to the associated FWF data. | |
const std::vector< ccWaveform > & | waveforms () const |
Gives access to the associated FWF data (const version) | |
bool | reserveTheFWFTable () |
Reserves the FWF table. | |
bool | resizeTheFWFTable () |
Resizes the FWF table. | |
SharedFWFDataContainer & | fwfData () |
Gives access to the associated FWF data container. | |
const SharedFWFDataContainer & | fwfData () const |
Gives access to the associated FWF data container (const version) | |
bool | compressFWFData () |
Compresses the associated FWF data container. More... | |
bool | computeFWFAmplitude (double &minVal, double &maxVal, ccProgressDialog *pDlg=nullptr) const |
Computes the maximum amplitude of all associated waveforms. | |
void | clearFWFData () |
Clears all associated FWF data. | |
CCVector3 | computeGravityCenter () |
Returns the cloud gravity center. More... | |
void | invalidateBoundingBox () override |
void | getDrawingParameters (glDrawParams ¶ms) const override |
unsigned | getUniqueIDForDisplay () const override |
bool | hasColors () const override |
bool | hasNormals () const override |
bool | hasScalarFields () const override |
bool | hasDisplayedScalarField () const override |
void | removeFromDisplay (const ccGenericGLDisplay *win) override |
void | setDisplay (ccGenericGLDisplay *win) override |
unsigned char | testVisibility (const CCVector3 &P) const override |
bool | normalsAvailable () const override |
const CCVector3 * | getNormal (unsigned pointIndex) const override |
const ccColor::Rgb * | geScalarValueColor (ScalarType d) const override |
const ccColor::Rgb * | getPointScalarValueColor (unsigned pointIndex) const override |
ScalarType | getPointDisplayedDistance (unsigned pointIndex) const override |
const ccColor::Rgba & | getPointColor (unsigned pointIndex) const override |
const CompressedNormType & | getPointNormalIndex (unsigned pointIndex) const override |
const CCVector3 & | getPointNormal (unsigned pointIndex) const override |
CCCoreLib::ReferenceCloud * | crop (const ccBBox &box, bool inside=true) override |
void | scale (PointCoordinateType fx, PointCoordinateType fy, PointCoordinateType fz, CCVector3 center=CCVector3(0, 0, 0)) override |
ccGenericPointCloud * | createNewCloudFromVisibilitySelection (bool removeSelectedPoints=false, VisibilityTableType *visTable=nullptr, bool silent=false) override |
void | applyRigidTransformation (const ccGLMatrix &trans) override |
void | refreshBB () override |
void | enableVisibilityCheck (bool state) |
Sets whether visibility check is enabled or not (e.g. during distances computation) More... | |
bool | hasSensor () const |
Returns whether the mesh as an associated sensor or not. | |
QSharedPointer< CCCoreLib::ReferenceCloud > | computeCPSet (ccGenericPointCloud &otherCloud, CCCoreLib::GenericProgressCallback *progressCb=nullptr, unsigned char octreeLevel=0) |
Comptes the closest point of this cloud relatively to another cloud. More... | |
bool | interpolateColorsFrom (ccGenericPointCloud *cloud, CCCoreLib::GenericProgressCallback *progressCb=nullptr, unsigned char octreeLevel=0) |
Interpolate colors from another cloud (nearest neighbor only) | |
void | setPointColor (unsigned pointIndex, const ccColor::Rgba &col) |
Sets a particular point color. More... | |
void | setPointColor (unsigned pointIndex, const ccColor::Rgb &col) |
Sets a particular point color. More... | |
void | setPointNormalIndex (unsigned pointIndex, CompressedNormType norm) |
Sets a particular point compressed normal. More... | |
void | setPointNormal (unsigned pointIndex, const CCVector3 &N) |
Sets a particular point normal (shortcut) More... | |
void | addNormIndex (CompressedNormType index) |
Pushes a compressed normal vector. More... | |
void | addNorm (const CCVector3 &N) |
Pushes a normal vector on stack (shortcut) More... | |
void | addNormAtIndex (const PointCoordinateType *N, unsigned index) |
Adds a normal vector to the one at a specific index. More... | |
void | setNormsTable (NormsIndexesTableType *norms) |
Sets the (compressed) normals table. | |
bool | convertNormalToRGB () |
Converts normals to RGB colors. More... | |
bool | convertNormalToDipDirSFs (ccScalarField *dipSF, ccScalarField *dipDirSF) |
Converts normals to two scalar fields: 'dip' and 'dip direction'. More... | |
void | addColor (const ccColor::Rgba &C) |
Pushes an RGBA color on stack. More... | |
void | addColor (const ccColor::Rgb &C) |
Pushes an RGB color on stack. More... | |
void | addColor (ColorCompType r, ColorCompType g, ColorCompType b, ColorCompType a=ccColor::MAX) |
Pushes an RGB color on stack (shortcut) More... | |
void | addGreyColor (ColorCompType g) |
Pushes a grey color on stack (shortcut) More... | |
bool | convertRGBToGreyScale () |
Converts RGB to grey scale colors. More... | |
bool | colorize (float r, float g, float b, float a=1.0f) |
Multiplies all color components of all points by coefficients. More... | |
bool | setRGBColorByHeight (unsigned char heightDim, ccColorScale::Shared colorScale) |
Assigns color to points proportionally to their 'height'. More... | |
bool | setRGBColorByBanding (unsigned char dim, double freq) |
Assigns color to points by 'banding'. More... | |
bool | convertCurrentScalarFieldToColors (bool mixWithExistingColor=false) |
Converts current scalar field (values & display parameters) to RGB colors. More... | |
bool | setColor (ColorCompType r, ColorCompType g, ColorCompType b, ColorCompType a=ccColor::MAX) |
Set a unique color for the whole cloud (shortcut) More... | |
bool | setColor (const ccColor::Rgb &col) |
Set a unique color for the whole cloud (RGB version) More... | |
bool | setColor (const ccColor::Rgba &col) |
Set a unique color for the whole cloud (RGBA version) More... | |
void | invertNormals () |
Inverts normals (if any) | |
void | translate (const CCVector3 &T) |
Translates cloud. More... | |
ccPointCloud * | filterPointsByScalarValue (ScalarType minVal, ScalarType maxVal, bool outside=false) |
Filters out points whose scalar values falls into an interval. More... | |
void | hidePointsByScalarValue (ScalarType minVal, ScalarType maxVal) |
Hides points whose scalar values falls into an interval. More... | |
ccPointCloud * | unroll (UnrollMode mode, UnrollBaseParams *params, bool exportDeviationSF=false, double startAngle_deg=0.0, double stopAngle_deg=360.0, CCCoreLib::GenericProgressCallback *progressCb=nullptr) const |
Unrolls the cloud and its normals on a cylinder or a cone. More... | |
void | addColorRampInfo (CC_DRAW_CONTEXT &context) |
Adds associated SF color ramp info to current GL context. | |
int | addScalarField (ccScalarField *sf) |
Adds an existing scalar field to this cloud. More... | |
RGBAColorsTableType * | rgbaColors () const |
Returns pointer on RGBA colors table. | |
NormsIndexesTableType * | normals () const |
Returns pointer on compressed normals indexes table. | |
CCCoreLib::ReferenceCloud * | crop2D (const ccPolyline *poly, unsigned char orthoDim, bool inside=true) |
Crops the cloud inside (or outside) a 2D polyline. More... | |
const ccPointCloud & | append (ccPointCloud *cloud, unsigned pointCountBefore, bool ignoreChildren=false) |
Appends a cloud to this one. More... | |
bool | enhanceRGBWithIntensitySF (int sfIdx, bool useCustomIntensityRange=false, double minI=0.0, double maxI=1.0) |
Enhances the RGB colors with the current scalar field (assuming it's intensities) | |
bool | exportCoordToSF (bool exportDims[3]) |
Exports the specified coordinate dimension(s) to scalar field(s) | |
bool | exportNormalToSF (bool exportDims[3]) |
Exports the specified normal dimension(s) to scalar field(s) | |
void | releaseVBOs () |
Release VBOs. | |
size_t | vboSize () const |
Returns the VBOs size (if any) | |
bool | initLOD () |
Initializes the LOD structure. More... | |
void | clearLOD () |
Clears the LOD structure. | |
Static Public Member Functions | |
static ccPointCloud * | From (const CCCoreLib::GenericIndexedCloud *cloud, const ccGenericPointCloud *sourceCloud=nullptr) |
Creates a new point cloud object from a GenericIndexedCloud. More... | |
static ccPointCloud * | From (CCCoreLib::GenericCloud *cloud, const ccGenericPointCloud *sourceCloud=nullptr) |
Creates a new point cloud object from a GenericCloud. More... | |
Protected Member Functions | |
void | drawMeOnly (CC_DRAW_CONTEXT &context) override |
void | applyGLTransformation (const ccGLMatrix &trans) override |
bool | toFile_MeOnly (QFile &out) const override |
bool | fromFile_MeOnly (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
void | notifyGeometryUpdate () override |
void | swapPoints (unsigned firstIndex, unsigned secondIndex) override |
bool | updateVBOs (const CC_DRAW_CONTEXT &context, const glDrawParams &glParams) |
Init/updates VBOs. | |
void | glChunkVertexPointer (const CC_DRAW_CONTEXT &context, size_t chunkIndex, unsigned decimStep, bool useVBOs) |
void | glChunkColorPointer (const CC_DRAW_CONTEXT &context, size_t chunkIndex, unsigned decimStep, bool useVBOs) |
void | glChunkSFPointer (const CC_DRAW_CONTEXT &context, size_t chunkIndex, unsigned decimStep, bool useVBOs) |
void | glChunkNormalPointer (const CC_DRAW_CONTEXT &context, size_t chunkIndex, unsigned decimStep, bool useVBOs) |
Protected Attributes | |
RGBAColorsTableType * | m_rgbaColors |
Colors. | |
NormsIndexesTableType * | m_normals |
Normals (compressed) | |
bool | m_sfColorScaleDisplayed |
Specifies whether current scalar field color scale should be displayed or not. | |
ccScalarField * | m_currentDisplayedScalarField |
Currently displayed scalar field. | |
int | m_currentDisplayedScalarFieldIndex |
Currently displayed scalar field index. | |
std::vector< Grid::Shared > | m_grids |
Associated grid structure. | |
bool | m_visibilityCheckEnabled |
Whether visibility check is available or not (during comparison) More... | |
vboSet | m_vboManager |
Set of VBOs attached to this cloud. | |
ccPointCloudLOD * | m_lod |
L.O.D. structure. | |
FWFDescriptorSet | m_fwfDescriptors |
General waveform descriptors. | |
std::vector< ccWaveform > | m_fwfWaveforms |
Per-point waveform accessors. | |
SharedFWFDataContainer | m_fwfData |
Waveforms raw data storage. | |
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
A point cloud can have multiple features:
ccPointCloud::ccPointCloud | ( | QString | name = QString() , |
unsigned | uniqueID = ccUniqueIDGenerator::InvalidUniqueID |
||
) | |||
throw | ( | ||
) |
Default constructor.
Creates an empty cloud without any feature. Each of them should be specifically instantiated/created (once the points have been added to this cloud, at least partially).
name | cloud name (optional) |
uniqueID | unique ID (handle with care) |
|
inline |
Pushes an RGB color on stack (shortcut)
r | red component |
g | green component |
b | blue component |
a | alpha component |
|
inline |
Pushes an RGB color on stack.
Will be converted to an RGBA color automatically.
C | RGB color |
void ccPointCloud::addColor | ( | const ccColor::Rgba & | C | ) |
Pushes an RGBA color on stack.
C | RGBA color |
|
inline |
Pushes a grey color on stack (shortcut)
Shortcut: color is converted to RGB(g, g, g)
g | grey component |
void ccPointCloud::addNorm | ( | const CCVector3 & | N | ) |
Pushes a normal vector on stack (shortcut)
N | normal vector |
void ccPointCloud::addNormAtIndex | ( | const PointCoordinateType * | N, |
unsigned | index | ||
) |
Adds a normal vector to the one at a specific index.
The resulting sum is automatically normalized and compressed.
N | normal vector to add (size: 3) |
index | normal index to modify |
void ccPointCloud::addNormIndex | ( | CompressedNormType | index | ) |
Pushes a compressed normal vector.
index | compressed normal vector |
int ccPointCloud::addScalarField | ( | ccScalarField * | sf | ) |
Adds an existing scalar field to this cloud.
Warning: the cloud takes ownership of it!
sf | existing scalar field |
const ccPointCloud & ccPointCloud::append | ( | ccPointCloud * | cloud, |
unsigned | pointCountBefore, | ||
bool | ignoreChildren = false |
||
) |
Appends a cloud to this one.
Same as the += operator with pointCountBefore == size()
cloud | cloud to be added |
pointCountBefore | the number of points previously contained in this cloud |
ignoreChildren | whether to copy input cloud's children or not |
|
override |
Clears the entity from all its points and features.
Display parameters are also reset to their default values.
ccPointCloud * ccPointCloud::cloneThis | ( | ccPointCloud * | destCloud = nullptr , |
bool | ignoreChildren = false |
||
) |
Clones this entity.
All the main features of the entity are cloned, except from the octree and the points visibility information.
destCloud | [optional] the destination cloud can be provided here |
ignoreChildren | [optional] whether to ignore the cloud's children or not (in which case they will be cloned as well) |
bool ccPointCloud::colorize | ( | float | r, |
float | g, | ||
float | b, | ||
float | a = 1.0f |
||
) |
Multiplies all color components of all points by coefficients.
If the cloud has no color, all points are considered white and the color array is automatically allocated.
r | red component |
g | green component |
b | blue component |
a | alpha component |
bool ccPointCloud::compressFWFData | ( | ) |
Compresses the associated FWF data container.
As the container is shared, the compressed version will be potentially added to the memory resulting in a decrease of the available memory...
QSharedPointer< CCCoreLib::ReferenceCloud > ccPointCloud::computeCPSet | ( | ccGenericPointCloud & | otherCloud, |
CCCoreLib::GenericProgressCallback * | progressCb = nullptr , |
||
unsigned char | octreeLevel = 0 |
||
) |
Comptes the closest point of this cloud relatively to another cloud.
The output (reference) clouds will have as many points as this cloud (with the indexes pointing on the closest point in the other cloud)
CCVector3 ccPointCloud::computeGravityCenter | ( | ) |
Returns the cloud gravity center.
bool ccPointCloud::computeNormalsWithGrids | ( | double | minTriangleAngle_deg = 1.0 , |
ccProgressDialog * | pDlg = nullptr |
||
) |
Compute the normals with the associated grid structure(s)
Can also orient the normals in the same run.
bool ccPointCloud::convertCurrentScalarFieldToColors | ( | bool | mixWithExistingColor = false | ) |
Converts current scalar field (values & display parameters) to RGB colors.
bool ccPointCloud::convertNormalToDipDirSFs | ( | ccScalarField * | dipSF, |
ccScalarField * | dipDirSF | ||
) |
Converts normals to two scalar fields: 'dip' and 'dip direction'.
One input scalar field may be empty if the corresponding value is not required
[out] | dipSF | dip values |
[out] | dipDirSF | dip direction values |
bool ccPointCloud::convertNormalToRGB | ( | ) |
bool ccPointCloud::convertRGBToGreyScale | ( | ) |
Converts RGB to grey scale colors.
|
override |
CCCoreLib::ReferenceCloud * ccPointCloud::crop2D | ( | const ccPolyline * | poly, |
unsigned char | orthoDim, | ||
bool | inside = true |
||
) |
Crops the cloud inside (or outside) a 2D polyline.
poly | cropping polyline |
orthoDim | dimension orthogonal to the plane in which the segmentation should occur (X=0, Y=1, Z=2) |
inside | whether selected points are inside or outside the polyline |
|
inline |
Sets whether visibility check is enabled or not (e.g. during distances computation)
See ccPointCloud::testVisibility.
ccPointCloud * ccPointCloud::filterPointsByScalarValue | ( | ScalarType | minVal, |
ScalarType | maxVal, | ||
bool | outside = false |
||
) |
Filters out points whose scalar values falls into an interval.
Threshold values should be expressed relatively to the current displayed scalar field.
minVal | minimum value |
maxVal | maximum value |
outside | whether to select the points inside or outside of the specified interval |
|
static |
Creates a new point cloud object from a GenericCloud.
"GenericCloud" is a very simple and light interface from CCCoreLib. It is meant to give access to points coordinates of any cloud (on the condition it implements the GenericCloud interface of course). See CClib documentation for more information about GenericClouds. As the GenericCloud interface is very simple, only points are imported. Note: throws an 'int' exception in case of error (see CTOR_ERRORS)
cloud | a GenericCloud structure |
sourceCloud | cloud from which main parameters will be imported (optional) |
|
static |
Creates a new point cloud object from a GenericIndexedCloud.
"GenericIndexedCloud" is an extension of GenericCloud (from CCCoreLib) which provides a const random accessor to points. See CClib documentation for more information about GenericIndexedCloud. As the GenericIndexedCloud interface is very simple, only points are imported. Note: throws an 'int' exception in case of error (see CTOR_ERRORS)
cloud | a GenericIndexedCloud structure |
sourceCloud | cloud from which main parameters will be imported (optional) |
void ccPointCloud::hidePointsByScalarValue | ( | ScalarType | minVal, |
ScalarType | maxVal | ||
) |
Hides points whose scalar values falls into an interval.
Values are taken from the current OUTPUT scalar field.
minVal | minimum value (below, points are hidden) |
maxVal | maximum value (above, points are hidden) |
bool ccPointCloud::initLOD | ( | ) |
Initializes the LOD structure.
const ccPointCloud & ccPointCloud::operator+= | ( | ccPointCloud * | addedCloud | ) |
Fuses another 3D entity with this one.
All the main features of the given entity are added, except from the octree and the points visibility information. Those features are deleted on this cloud.
ccPointCloud * ccPointCloud::partialClone | ( | const CCCoreLib::ReferenceCloud * | selection, |
int * | warnings = nullptr |
||
) | const |
Creates a new point cloud object from a ReferenceCloud (selection)
"Reference clouds" are a set of indexes referring to a real point cloud. See CClib documentation for more information about ReferenceClouds. Warning: the ReferenceCloud structure must refer to this cloud.
selection | a ReferenceCloud structure (pointing to source) | |
[out] | warnings | [optional] to determine if warnings (CTOR_ERRORS) occurred during the duplication process |
|
override |
Reserves memory for all the active features.
This method is meant to be called before increasing the cloud population. Only the already allocated features will be re-reserved.
bool ccPointCloud::reserveTheNormsTable | ( | ) |
Reserves memory to store the compressed normals.
Before adding normals to the cloud (with addNorm()) be sure to reserve the necessary amount of memory with this method. This method reserves memory for as many normals as the number of points in the cloud (effectively stored or reserved).
bool ccPointCloud::reserveThePointsTable | ( | unsigned | _numberOfPoints | ) |
Reserves memory to store the points coordinates.
Before adding points to the cloud (with addPoint()) be sure to reserve the necessary amount of memory with this method. If the number of new elements is smaller than the actual one, nothing will happen.
_numberOfPoints | number of points to reserve the memory for |
bool ccPointCloud::reserveTheRGBTable | ( | ) |
Reserves memory to store the RGB colors.
Before adding colors to the cloud (with addColor()) be sure to reserve the necessary amount of memory with this method. This method reserves memory for as many colors as the number of points in the cloud (effectively stored or reserved).
|
override |
Resizes all the active features arrays.
This method is meant to be called after having increased the cloud population (if the final number of inserted point is lower than the reserved size). Otherwise, it fills all new elements with blank values.
bool ccPointCloud::resizeTheNormsTable | ( | ) |
Resizes the compressed normals array.
If possible, the normals array is resized to fit exactly the number of points in the cloud (effectively stored or reserved). If the new size is inferior to the actual one, the last elements will be deleted. Otherwise, the array is filled with blank elements.
bool ccPointCloud::resizeTheRGBTable | ( | bool | fillWithWhite = false | ) |
Resizes the RGB colors array.
If possible, the colors array is resized to fit exactly the number of points in the cloud (effectively stored or reserved). If the new size is inferior to the actual one, the last elements will be deleted. Otherwise, the array is filled with zeros (default behavior) or "white" colors (is fillWithWhite).
fillWithWhite | whether to fill new array elements with zeros (false) or white color (true) |
|
inline |
Set a unique color for the whole cloud (shortcut)
Color array is automatically allocated if necessary.
r | red component |
g | green component |
b | blue component |
a | alpha component |
|
inline |
Set a unique color for the whole cloud (RGB version)
Color array is automatically allocated if necessary.
col | RGB color |
bool ccPointCloud::setColor | ( | const ccColor::Rgba & | col | ) |
Set a unique color for the whole cloud (RGBA version)
Color array is automatically allocated if necessary.
col | RGBA color |
void ccPointCloud::setCurrentDisplayedScalarField | ( | int | index | ) |
Sets the currently displayed scalar field.
Warning: this scalar field will automatically be set as the OUTPUT one!
|
inline |
Sets a particular point color.
void ccPointCloud::setPointColor | ( | unsigned | pointIndex, |
const ccColor::Rgba & | col | ||
) |
Sets a particular point color.
void ccPointCloud::setPointNormal | ( | unsigned | pointIndex, |
const CCVector3 & | N | ||
) |
Sets a particular point normal (shortcut)
void ccPointCloud::setPointNormalIndex | ( | unsigned | pointIndex, |
CompressedNormType | norm | ||
) |
Sets a particular point compressed normal.
bool ccPointCloud::setRGBColorByBanding | ( | unsigned char | dim, |
double | freq | ||
) |
Assigns color to points by 'banding'.
Banding is performed along the specified dimension Color array is automatically allocated if necessary.
dim | banding dimension (0:X, 1:Y, 2:Z) |
freq | banding frequency |
bool ccPointCloud::setRGBColorByHeight | ( | unsigned char | heightDim, |
ccColorScale::Shared | colorScale | ||
) |
Assigns color to points proportionally to their 'height'.
Height is defined wrt to the specified dimension (heightDim). Color array is automatically allocated if necessary.
heightDim | ramp dimension (0:X, 1:Y, 2:Z) |
colorScale | color scale to use |
|
overrideprotected |
void ccPointCloud::translate | ( | const CCVector3 & | T | ) |
Translates cloud.
T | translation vector |
ccMesh * ccPointCloud::triangulateGrid | ( | const Grid & | grid, |
double | minTriangleAngle_deg = 0.0 |
||
) | const |
Meshes a scan grid.
void ccPointCloud::unallocatePoints | ( | ) |
ccPointCloud * ccPointCloud::unroll | ( | UnrollMode | mode, |
UnrollBaseParams * | params, | ||
bool | exportDeviationSF = false , |
||
double | startAngle_deg = 0.0 , |
||
double | stopAngle_deg = 360.0 , |
||
CCCoreLib::GenericProgressCallback * | progressCb = nullptr |
||
) | const |
Unrolls the cloud and its normals on a cylinder or a cone.
This method is redundant with the "developCloudOnCylinder" method of CCCoreLib, apart that it can also handle the cloud normals.
mode | unrolling mode |
params | unrolling parameters (must match the unrolling mode) |
exportDeviationSF | to export the deviation fro the ideal cone as a scalar field |
startAngle_deg | start angle (in degrees) - 0 corresponds to +X (east) |
stopAngle_deg | stop angle (in degrees) |
progressCb | for progress notification |
|
protected |
Whether visibility check is available or not (during comparison)
See ccPointCloud::testVisibility