ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccPointCloud Class Reference

A 3D cloud and its associated features (color, normals, scalar fields, etc.) More...

#include <ecvPointCloud.h>

Inheritance diagram for ccPointCloud:
Collaboration diagram for ccPointCloud:

Classes

struct  Grid
 Grid structure. More...
 
struct  RgbFilterOptions
 RGB filter options. 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) More...
 
enum  RGB_FILTER_TYPES {
  NONE , BILATERAL , GAUSSIAN , MEAN ,
  MEDIAN
}
 RGB filter types. More...
 
enum  UnrollMode { CYLINDER = 0 , CONE = 1 , STRAIGHTENED_CONE = 2 , STRAIGHTENED_CONE2 = 3 }
 
using BaseClass = cloudViewer::PointCloudTpl< ccGenericPointCloud >
 Base class (shortcut) More...
 
using FWFDescriptorSet = QMap< uint8_t, WaveformDescriptor >
 Waveform descriptors set. More...
 
using FWFDataContainer = std::vector< uint8_t >
 Waveform data container. More...
 
using SharedFWFDataContainer = QSharedPointer< const FWFDataContainer >
 
- Public Types inherited from ccGenericPointCloud
using VisibilityTableType = std::vector< unsigned char >
 Array of "visibility" information for each point. More...
 
- Public Types inherited from ccHObject
enum  DEPENDENCY_FLAGS {
  DP_NONE = 0 , DP_NOTIFY_OTHER_ON_DELETE = 1 , DP_NOTIFY_OTHER_ON_UPDATE , DP_DELETE_OTHER = 8 ,
  DP_PARENT_OF_OTHER = 24
}
 Dependency flags. More...
 
enum  SelectionBehavior { SELECTION_AA_BBOX , SELECTION_FIT_BBOX , SELECTION_IGNORED }
 Behavior when selected. More...
 
using Container = std::vector< ccHObject * >
 Standard instances container (for children, etc.) More...
 
using Shared = QSharedPointer< ccHObject >
 Shared pointer. More...
 
using SharedContainer = std::vector< Shared >
 Shared instances container (for children, etc.) More...
 
using GlobalBoundingBox = cloudViewer::BoundingBoxTpl< double >
 Global (non-shifted) bounding-box. More...
 
- Public Types inherited from ccSerializableObject
enum  DeserializationFlags { DF_POINT_COORDS_64_BITS , DF_SCALAR_VAL_32_BITS = 2 }
 Deserialization flags (bit-field) More...
 
typedef QMultiMap< unsigned, unsigned > LoadedIDMap
 Map of loaded unique IDs (old ID --> new ID) More...
 
- Public Types inherited from cloudViewer::GenericCloud
using genericPointAction = std::function< void(const CCVector3 &, ScalarType &)>
 Generic function applied to a point (used by foreach) More...
 

Public Member Functions

 ccPointCloud (QString name=QString()) throw ()
 Default constructor. More...
 
 ccPointCloud (const ccPointCloud &cloud)
 
 ccPointCloud (const std::vector< Eigen::Vector3d > &points, const std::string &name="cloud")
 
 ~ccPointCloud () override
 Default destructor. More...
 
CV_CLASS_ENUM getClassID () const override
 Returns class ID. More...
 
ccPointCloudpartialClone (const cloudViewer::ReferenceCloud *selection, int *warnings=nullptr, bool withChildEntities=true) const
 Creates a new point cloud object from a ReferenceCloud (selection) More...
 
ccPointCloudcloneThis (ccPointCloud *destCloud=nullptr, bool ignoreChildren=false)
 Clones this entity. More...
 
ccGenericPointCloudclone (ccGenericPointCloud *destCloud=nullptr, bool ignoreChildren=false) override
 Clones this entity. More...
 
ccPointCloudoperator= (const ccPointCloud &cloud)
 Fuses another 3D entity with this one. More...
 
const ccPointCloudoperator+= (const ccPointCloud &cloud)
 
const ccPointCloudoperator+= (ccPointCloud *)
 
ccPointCloud operator+ (const ccPointCloud &cloud) const
 
void clear () override
 Clears the entity from all its points and features. More...
 
void unalloactePoints ()
 Erases the cloud points. More...
 
void unallocateColors ()
 Erases the cloud colors. More...
 
void unallocateNorms ()
 Erases the cloud normals. More...
 
void colorsHaveChanged ()
 
void normalsHaveChanged ()
 Notify a modification of normals display parameters or contents. More...
 
void pointsHaveChanged ()
 Notify a modification of points display parameters or contents. More...
 
bool reserve (unsigned numberOfPoints) override
 Reserves memory for all the active features. More...
 
bool reserveThePointsTable (unsigned _numberOfPoints)
 Reserves memory to store the points coordinates. More...
 
bool reserveTheRGBTable ()
 Reserves memory to store the RGB colors. More...
 
bool reserveTheNormsTable ()
 Reserves memory to store the compressed normals. More...
 
bool resize (unsigned numberOfPoints) override
 Resizes all the active features arrays. More...
 
bool resizeTheRGBTable (bool fillWithWhite=false)
 Resizes the RGB colors array. More...
 
bool resizeTheNormsTable ()
 Resizes the compressed normals array. More...
 
void shrinkToFit ()
 Removes unused capacity. More...
 
ccScalarFieldgetCurrentDisplayedScalarField () const
 Returns the currently displayed scalar (or 0 if none) More...
 
int getCurrentDisplayedScalarFieldIndex () const
 Returns the currently displayed scalar field index (or -1 if none) More...
 
void setCurrentDisplayedScalarField (int index)
 Sets the currently displayed scalar field. More...
 
void deleteScalarField (int index) override
 Deletes a specific scalar field. More...
 
void deleteAllScalarFields () override
 Deletes all scalar fields associated to this cloud. More...
 
int addScalarField (const char *uniqueName) override
 Creates a new scalar field and registers it. More...
 
bool sfColorScaleShown () const
 Returns whether color scale should be displayed or not. More...
 
void showSFColorsScale (bool state)
 Sets whether color scale should be displayed or not. More...
 
size_t gridCount () const
 Returns the number of associated grids. More...
 
Grid::Sharedgrid (size_t gridIndex)
 Returns an associated grid. More...
 
const Grid::Sharedgrid (size_t gridIndex) const
 Returns an associated grid (const verson) More...
 
bool addGrid (Grid::Shared grid)
 Adds an associated grid. More...
 
void removeGrids ()
 Remove all associated grids. More...
 
ccMeshtriangulateGrid (const Grid &grid, double minTriangleAngle_deg=0.0) const
 Meshes a scan grid. More...
 
bool computeNormalsWithGrids (double minTriangleAngle_deg=1.0, ecvProgressDialog *pDlg=nullptr)
 Compute the normals with the associated grid structure(s) More...
 
bool orientNormalsWithGrids (ecvProgressDialog *pDlg=nullptr)
 Orient the normals with the associated grid structure(s) More...
 
bool orientNormalsTowardViewPoint (CCVector3 &VP, ecvProgressDialog *pDlg=nullptr)
 Normals are forced to point to O. More...
 
bool computeNormalsWithOctree (CV_LOCAL_MODEL_TYPES model, ccNormalVectors::Orientation preferredOrientation, PointCoordinateType defaultRadius, ecvProgressDialog *pDlg=nullptr)
 Compute the normals by approximating the local surface around each point. More...
 
bool orientNormalsWithMST (unsigned kNN=6, ecvProgressDialog *pDlg=nullptr)
 Orient the normals with a Minimum Spanning Tree. More...
 
bool orientNormalsWithFM (unsigned char level, ecvProgressDialog *pDlg=nullptr)
 Orient normals with Fast Marching. More...
 
bool hasFWF () const
 Returns whether the cloud has associated Full WaveForm data. More...
 
ccWaveformProxy waveformProxy (unsigned index) const
 Returns a proxy on a given waveform. More...
 
FWFDescriptorSetfwfDescriptors ()
 Gives access to the FWF descriptors. More...
 
const FWFDescriptorSetfwfDescriptors () const
 Gives access to the FWF descriptors (const version) More...
 
std::vector< ccWaveform > & waveforms ()
 Gives access to the associated FWF data. More...
 
const std::vector< ccWaveform > & waveforms () const
 Gives access to the associated FWF data (const version) More...
 
bool reserveTheFWFTable ()
 Reserves the FWF table. More...
 
bool resizeTheFWFTable ()
 Resizes the FWF table. More...
 
SharedFWFDataContainerfwfData ()
 Gives access to the associated FWF data container. More...
 
const SharedFWFDataContainerfwfData () const
 Gives access to the associated FWF data container (const version) More...
 
bool compressFWFData ()
 Compresses the associated FWF data container. More...
 
bool computeFWFAmplitude (double &minVal, double &maxVal, ecvProgressDialog *pDlg=nullptr) const
 Computes the maximum amplitude of all associated waveforms. More...
 
void clearFWFData ()
 Clears all associated FWF data. More...
 
CCVector3 computeGravityCenter ()
 Returns the cloud gravity center. More...
 
void invalidateBoundingBox () override
 Invalidates bounding box. More...
 
void getDrawingParameters (glDrawParams &params) const override
 Returns main OpenGL parameters for this entity. More...
 
unsigned getUniqueIDForDisplay () const override
 Returns object unqiue ID used for display. More...
 
bool hasColors () const override
 Returns whether colors are enabled or not. More...
 
bool hasNormals () const override
 Returns whether normals are enabled or not. More...
 
bool hasScalarFields () const override
 Returns whether one or more scalar fields are instantiated. More...
 
bool hasDisplayedScalarField () const override
 Returns whether an active scalar field is available or not. More...
 
unsigned char testVisibility (const CCVector3 &P) const override
 
bool normalsAvailable () const override
 Returns whether normals are available. More...
 
const CCVector3getNormal (unsigned pointIndex) const override
 If per-point normals are available, returns the one at a specific index. More...
 
const ecvColor::RgbgetScalarValueColor (ScalarType d) const override
 Returns color corresponding to a given scalar value. More...
 
const ecvColor::RgbgetPointScalarValueColor (unsigned pointIndex) const override
 Returns color corresponding to a given point associated scalar value. More...
 
ScalarType getPointDisplayedDistance (unsigned pointIndex) const override
 Returns scalar value associated to a given point. More...
 
const ecvColor::RgbgetPointColor (unsigned pointIndex) const override
 Returns color corresponding to a given point. More...
 
const ColorsTableTypegetPointColors () const
 
ecvColor::RgbgetPointColorPtr (size_t pointIndex)
 
Eigen::Vector3d getEigenColor (size_t index) const
 
std::vector< Eigen::Vector3d > getEigenColors () const
 
void setEigenColors (const std::vector< Eigen::Vector3d > &colors)
 
const CompressedNormTypegetPointNormalIndex (unsigned pointIndex) const override
 Returns compressed normal corresponding to a given point. More...
 
const CCVector3getPointNormal (unsigned pointIndex) const override
 Returns normal corresponding to a given point. More...
 
CCVector3getPointNormalPtr (size_t pointIndex) const
 
std::vector< CCVector3getPointNormals () const
 
std::vector< CCVector3 * > getPointNormalsPtr () const
 
void setPointNormals (const std::vector< CCVector3 > &normals)
 
Eigen::Vector3d getEigenNormal (size_t index) const
 
std::vector< Eigen::Vector3d > getEigenNormals () const
 
void setEigenNormals (const std::vector< Eigen::Vector3d > &normals)
 
cloudViewer::ReferenceCloudcrop (const ccBBox &box, bool inside=true) override
 Crops the cloud inside (or outside) a bounding box. More...
 
cloudViewer::ReferenceCloudcrop (const ecvOrientedBBox &bbox) override
 
virtual void applyRigidTransformation (const ccGLMatrix &trans) override
 Applies a rigid transformation (rotation + translation) More...
 
virtual void scale (PointCoordinateType fx, PointCoordinateType fy, PointCoordinateType fz, CCVector3 center=CCVector3(0, 0, 0)) override
 Multiplies all coordinates by constant factors (one per dimension) More...
 
void refreshBB () override
 Forces bounding-box update. More...
 
ccGenericPointCloudcreateNewCloudFromVisibilitySelection (bool removeSelectedPoints=false, VisibilityTableType *visTable=nullptr, std::vector< int > *newIndexesOfRemainingPoints=nullptr, bool silent=false, cloudViewer::ReferenceCloud *selection=nullptr) override
 
bool removeVisiblePoints (VisibilityTableType *visTable=nullptr, std::vector< int > *newIndexes=nullptr) override
 Removes all the 'visible' points (as defined by the visibility array) More...
 
void enableVisibilityCheck (bool state)
 
bool hasSensor () const
 Returns whether the mesh as an associated sensor or not. More...
 
QSharedPointer< cloudViewer::ReferenceCloudcomputeCPSet (ccGenericPointCloud &otherCloud, cloudViewer::GenericProgressCallback *progressCb=nullptr, unsigned char octreeLevel=0)
 Computes the closest point of this cloud relatively to another cloud. More...
 
bool interpolateColorsFrom (ccGenericPointCloud *cloud, cloudViewer::GenericProgressCallback *progressCb=nullptr, unsigned char octreeLevel=0)
 Interpolate colors from another cloud (nearest neighbor only) More...
 
void setPointColor (size_t pointIndex, const ecvColor::Rgb &col)
 Sets a particular point color. More...
 
void setPointColor (size_t pointIndex, const ecvColor::Rgba &col)
 
void setPointColor (size_t pointIndex, const Eigen::Vector3d &col)
 
void setEigenColor (size_t index, const Eigen::Vector3d &color)
 
void setPointNormalIndex (size_t pointIndex, CompressedNormType norm)
 Sets a particular point compressed normal. More...
 
void setPointNormal (size_t pointIndex, const CCVector3 &N)
 Sets a particular point normal (shortcut) More...
 
void setEigenNormal (size_t index, const Eigen::Vector3d &normal)
 
void addNormIndex (CompressedNormType index)
 Pushes a compressed normal vector. More...
 
void addNorm (const CCVector3 &N)
 Pushes a normal vector on stack (shortcut) More...
 
void addEigenNorm (const Eigen::Vector3d &N)
 
void addEigenNorms (const std::vector< Eigen::Vector3d > &normals)
 
void addNorms (const std::vector< CCVector3 > &Ns)
 
void addNorms (const std::vector< CompressedNormType > &idxes)
 
std::vector< CompressedNormTypegetNorms () const
 
void getNorms (std::vector< CompressedNormType > &idxes) const
 
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. More...
 
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 addRGBColor (const ecvColor::Rgb &C)
 Pushes an RGB color on stack. More...
 
void addRGBColors (const std::vector< ecvColor::Rgb > &colors)
 
void addEigenColor (const Eigen::Vector3d &color)
 
void addEigenColors (const std::vector< Eigen::Vector3d > &colors)
 
void addRGBColor (ColorCompType r, ColorCompType g, ColorCompType b)
 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)
 Multiplies all color components of all points by coefficients. More...
 
bool setRGBColorByHeight (unsigned char heightDim, ccColorScale::Shared colorScale)
 Assigns color to points proportionnaly to their 'height'. More...
 
bool setRGBColorByBanding (unsigned char dim, double freq)
 Assigns color to points by 'banding'. More...
 
bool convertCurrentScalarFieldToColors (bool mixWithExistingColor=false)
 
bool setRGBColorWithCurrentScalarField (bool mixWithExistingColor=false)
 Sets RGB colors with current scalar field (values & parameters) More...
 
bool setRGBColor (ColorCompType r, ColorCompType g, ColorCompType b)
 Set a unique color for the whole cloud (shortcut) More...
 
bool setRGBColor (const ecvColor::Rgb &col)
 Set a unique color for the whole cloud. More...
 
bool applyFilterToRGB (PointCoordinateType sigma, PointCoordinateType sigmaSF, RgbFilterOptions filterParams, cloudViewer::GenericProgressCallback *progressCb=nullptr)
 Applies a spatial Gaussian filter on RGB colors. More...
 
void invertNormals ()
 Inverts normals (if any) More...
 
ccPointCloudfilterPointsByScalarValue (ScalarType minVal, ScalarType maxVal, bool outside=false)
 Filters out points whose scalar values falls into an interval. More...
 
ccPointCloudfilterPointsByScalarValue (std::vector< ScalarType > values, 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...
 
void hidePointsByScalarValue (std::vector< ScalarType > values)
 Hides points whose scalar values falls into an interval. More...
 
ccPointCloudunroll (UnrollMode mode, UnrollBaseParams *params, bool exportDeviationSF=false, double startAngle_deg=0.0, double stopAngle_deg=360.0, cloudViewer::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. More...
 
int addScalarField (ccScalarField *sf)
 Adds an existing scalar field to this cloud. More...
 
ColorsTableTypergbColors () const
 Returns pointer on RGB colors table. More...
 
NormsIndexesTableTypenormals () const
 Returns pointer on compressed normals indexes table. More...
 
cloudViewer::ReferenceCloudcrop2D (const ccPolyline *poly, unsigned char orthoDim, bool inside=true)
 Crops the cloud inside (or outside) a 2D polyline. More...
 
const ccPointCloudappend (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)
 
bool exportCoordToSF (bool exportDims[3])
 Exports the specified coordinate dimension(s) to scalar field(s) More...
 
bool setCoordFromSF (bool importDims[3], cloudViewer::ScalarField *sf, PointCoordinateType defaultValueForNaN)
 Sets coordinate(s) from a scalar field. More...
 
bool exportNormalToSF (bool exportDims[3])
 Exports the specified normal dimension(s) to scalar field(s) More...
 
virtual bool IsEmpty () const override
 
virtual Eigen::Vector3d GetMinBound () const override
 Returns min bounds for geometry coordinates. More...
 
virtual Eigen::Vector3d GetMaxBound () const override
 Returns max bounds for geometry coordinates. More...
 
virtual Eigen::Vector3d GetCenter () const override
 Returns the center of the geometry coordinates. More...
 
virtual ccBBox GetAxisAlignedBoundingBox () const override
 Returns an axis-aligned bounding box of the geometry. More...
 
virtual ecvOrientedBBox GetOrientedBoundingBox () const override
 
virtual ccPointCloudTransform (const Eigen::Matrix4d &trans) override
 Apply transformation (4x4 matrix) to the geometry coordinates. More...
 
virtual ccPointCloudTranslate (const Eigen::Vector3d &translation, bool relative=true) override
 Apply translation to the geometry coordinates. More...
 
ccPointCloudTranslate (const CCVector3 &T)
 
virtual ccPointCloudScale (const double s, const Eigen::Vector3d &center) override
 Apply scaling to the geometry coordinates. Given a scaling factor $s$, and center $c$, a given point $p$ is transformed according to $s (p - c) + c$. More...
 
virtual ccPointCloudRotate (const Eigen::Matrix3d &R, const Eigen::Vector3d &center) override
 Apply rotation to the geometry coordinates and normals. Given a rotation matrix $R$, and center $c$, a given point $p$ is transformed according to $R (p - c) + c$. More...
 
bool HasCovariances () const
 Returns 'true' if the point cloud contains per-point covariance matrix. More...
 
ccPointCloudNormalizeNormals ()
 Normalize point normals to length 1.`. More...
 
std::shared_ptr< ccPointCloudSelectByIndex (const std::vector< size_t > &indices, bool invert=false) const
 Function to select points from input ccPointCloud into output ccPointCloud. More...
 
ccPointCloudRemoveNonFinitePoints (bool remove_nan=true, bool remove_infinite=true)
 Remove all points fromt he point cloud that have a nan entry, or infinite entries. More...
 
std::shared_ptr< ccPointCloudVoxelDownSample (double voxel_size)
 Function to downsample input ccPointCloud into output ccPointCloud with a voxel. More...
 
std::tuple< std::shared_ptr< ccPointCloud >, Eigen::MatrixXi, std::vector< std::vector< int > > > VoxelDownSampleAndTrace (double voxel_size, const Eigen::Vector3d &min_bound, const Eigen::Vector3d &max_bound, bool approximate_class=false) const
 Function to downsample using geometry.ccPointCloud.VoxelDownSample. More...
 
std::shared_ptr< ccPointCloudUniformDownSample (size_t every_k_points) const
 Function to downsample input ccPointCloud into output ccPointCloud uniformly. More...
 
std::shared_ptr< ccPointCloudRandomDownSample (double sampling_ratio) const
 Function to downsample input pointcloud into output pointcloud randomly. More...
 
std::shared_ptr< ccPointCloudFarthestPointDownSample (const size_t num_samples, const size_t start_index=0) const
 Function to downsample input pointcloud into output pointcloud with a set of points has farthest distance. More...
 
std::shared_ptr< ccPointCloudCrop (const ccBBox &bbox) const
 Function to crop ccPointCloud into output ccPointCloud. More...
 
std::shared_ptr< ccPointCloudCrop (const ecvOrientedBBox &bbox) const
 Function to crop ccPointCloud into output ccPointCloud. More...
 
std::tuple< std::shared_ptr< ccPointCloud >, std::vector< size_t > > RemoveRadiusOutliers (size_t nb_points, double search_radius) const
 Function to remove points that have less than nb_points in a sphere of a given radius. More...
 
std::tuple< std::shared_ptr< ccPointCloud >, std::vector< size_t > > RemoveStatisticalOutliers (size_t nb_neighbors, double std_ratio) const
 Function to remove points that are further away from their nb_neighbor neighbors in average. More...
 
bool EstimateNormals (const cloudViewer::geometry::KDTreeSearchParam &search_param=cloudViewer::geometry::KDTreeSearchParamKNN(), bool fast_normal_computation=true)
 Function to compute the normals of a point cloud. More...
 
bool OrientNormalsToAlignWithDirection (const Eigen::Vector3d &orientation_reference=Eigen::Vector3d(0.0, 0.0, 1.0))
 Function to orient the normals of a point cloud. More...
 
bool OrientNormalsTowardsCameraLocation (const Eigen::Vector3d &camera_location=Eigen::Vector3d::Zero())
 Function to orient the normals of a point cloud. More...
 
void OrientNormalsConsistentTangentPlane (size_t k)
 Function to consistently orient estimated normals based on consistent tangent planes as described in Hoppe et al., "Surface Reconstruction from Unorganized Points", 1992. More...
 
std::vector< double > ComputePointCloudDistance (const ccPointCloud &target)
 Function to compute the point to point distances between point clouds. More...
 
void EstimateCovariances (const cloudViewer::geometry::KDTreeSearchParam &search_param=cloudViewer::geometry::KDTreeSearchParamKNN())
 Function to compute the covariance matrix for each point of a point cloud. More...
 
std::vector< double > ComputeMahalanobisDistance () const
 Function to compute the Mahalanobis distance for points in an input point cloud. More...
 
std::vector< double > ComputeNearestNeighborDistance () const
 
double ComputeResolution () const
 
std::tuple< std::shared_ptr< ccMesh >, std::vector< size_t > > ComputeConvexHull () const
 Function that computes the convex hull of the point cloud using qhull. More...
 
std::tuple< std::shared_ptr< ccMesh >, std::vector< size_t > > HiddenPointRemoval (const Eigen::Vector3d &camera_location, const double radius) const
 This is an implementation of the Hidden Point Removal operator described in Katz et. al. 'Direct Visibility of Point Sets', 2007. More...
 
std::vector< int > ClusterDBSCAN (double eps, size_t min_points, bool print_progress=false) const
 Cluster ccPointCloud using the DBSCAN algorithm Ester et al., "A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise", 1996. More...
 
std::tuple< Eigen::Vector4d, std::vector< size_t > > SegmentPlane (const double distance_threshold=0.01, const int ransac_n=3, const int num_iterations=100) const
 Segment ccPointCloud plane using the RANSAC algorithm. More...
 
std::shared_ptr< ccPointCloudCreateFromVoxelGrid (const cloudViewer::geometry::VoxelGrid &voxel_grid)
 Function to create a PointCloud from a VoxelGrid. More...
 
ccPointCloudPaintUniformColor (const Eigen::Vector3d &color)
 Assigns each vertex in the ccMesh the same color. More...
 
bool initLOD ()
 Intializes the LOD structure. More...
 
void clearLOD ()
 Clears the LOD structure. More...
 
- Public Member Functions inherited from cloudViewer::PointCloudTpl< ccGenericPointCloud >
 PointCloudTpl ()
 Default constructor. More...
 
virtual ~PointCloudTpl ()
 Default destructor. More...
 
unsigned size () const override
 
void forEach (GenericCloud::genericPointAction action) override
 
void getBoundingBox (CCVector3 &bbMin, CCVector3 &bbMax) override
 
void placeIteratorAtBeginning () override
 
const CCVector3getNextPoint () override
 
bool enableScalarField () override
 
bool isScalarFieldEnabled () const override
 
void setPointScalarValue (unsigned pointIndex, ScalarType value) override
 
ScalarType getPointScalarValue (unsigned pointIndex) const override
 
const CCVector3getPoint (unsigned index) const override
 
void getPoint (unsigned index, CCVector3 &P) const override
 
void getPoint (unsigned index, double P[3]) const override
 
CCVector3getPointPtr (size_t index)
 
std::vector< CCVector3 > & getPoints ()
 
const std::vector< CCVector3 > & getPoints () const
 
const CCVector3getPointPersistentPtr (unsigned index) override
 
const CCVector3getPointPersistentPtr (unsigned index) const
 
void reset ()
 Clears the cloud database. More...
 
void addPoint (const CCVector3 &P)
 Adds a 3D point to the database. More...
 
void addPoint (double x, double y, double z)
 
void addPoint (double xyz[3])
 
void setPoint (size_t index, const CCVector3 &P)
 
void setEigenPoint (size_t index, const Eigen::Vector3d &point)
 
void addEigenPoint (const Eigen::Vector3d &point)
 
void addPoints (const std::vector< CCVector3 > &points)
 
void addPoints (const std::vector< Eigen::Vector3d > &points)
 
Eigen::Vector3d getEigenPoint (size_t index) const
 
std::vector< Eigen::Vector3d > getEigenPoints () const
 
void setEigenPoints (const std::vector< Eigen::Vector3d > &points)
 
unsigned getNumberOfScalarFields () const
 Returns the number of associated (and active) scalar fields. More...
 
ScalarFieldgetScalarField (int index) const
 Returns a pointer to a specific scalar field. More...
 
const char * getScalarFieldName (int index) const
 Returns the name of a specific scalar field. More...
 
int getScalarFieldIndexByName (const char *name) const
 Returns the index of a scalar field represented by its name. More...
 
ScalarFieldgetCurrentInScalarField () const
 Returns the scalar field currently associated to the cloud input. More...
 
ScalarFieldgetCurrentOutScalarField () const
 Returns the scalar field currently associated to the cloud output. More...
 
void setCurrentInScalarField (int index)
 Sets the INPUT scalar field. More...
 
int getCurrentInScalarFieldIndex ()
 Returns current INPUT scalar field index (or -1 if none) More...
 
void setCurrentOutScalarField (int index)
 Sets the OUTPUT scalar field. More...
 
int getCurrentOutScalarFieldIndex ()
 Returns current OUTPUT scalar field index (or -1 if none) More...
 
void setCurrentScalarField (int index)
 Sets both the INPUT & OUTPUT scalar field. More...
 
bool renameScalarField (int index, const char *newName)
 Renames a specific scalar field. More...
 
unsigned capacity () const
 Returns cloud capacity (i.e. reserved size) More...
 
- Public Member Functions inherited from ccGenericPointCloud
 ccGenericPointCloud (QString name=QString())
 Default constructor. More...
 
 ccGenericPointCloud (const ccGenericPointCloud &cloud)
 Copy constructor. More...
 
 ~ccGenericPointCloud () override
 Default destructor. More...
 
virtual ccOctree::Shared computeOctree (cloudViewer::GenericProgressCallback *progressCb=nullptr, bool autoAddChild=true)
 Computes the cloud octree. More...
 
virtual ccOctree::Shared getOctree () const
 Returns the associated octree (if any) More...
 
virtual void setOctree (ccOctree::Shared octree, bool autoAddChild=true)
 Sets the associated octree. More...
 
virtual ccOctreeProxygetOctreeProxy () const
 Returns the associated octree proxy (if any) More...
 
virtual void deleteOctree ()
 Erases the octree. More...
 
virtual VisibilityTableTypegetTheVisibilityArray ()
 Returns associated visibility array. More...
 
virtual const VisibilityTableTypegetTheVisibilityArray () const
 Returns associated visibility array (const version) More...
 
virtual cloudViewer::ReferenceCloudgetTheVisiblePoints (const VisibilityTableType *visTable=nullptr, bool silent=false, cloudViewer::ReferenceCloud *selection=nullptr) const
 Returns a ReferenceCloud equivalent to the visibility array. More...
 
virtual bool isVisibilityTableInstantiated () const
 Returns whether the visibility array is allocated or not. More...
 
virtual bool resetVisibilityArray ()
 Resets the associated visibility array. More...
 
virtual void invertVisibilityArray ()
 Inverts the visibility array. More...
 
virtual void unallocateVisibilityArray ()
 Erases the points visibility information. More...
 
ccBBox getOwnBB (bool withGLFeatures=false) override
 Returns the entity's own bounding-box. More...
 
bool isSerializable () const override
 Returns whether object is serializable of not. More...
 
void setPointSize (unsigned size=0)
 Sets point size. More...
 
unsigned char getPointSize () const
 Returns current point size. More...
 
void importParametersFrom (const ccGenericPointCloud *cloud)
 Imports the parameters from another cloud. More...
 
bool pointPicking (const CCVector2d &clickPos, const ccGLCameraParameters &camera, int &nearestPointIndex, double &nearestSquareDist, double pickWidth=2.0, double pickHeight=2.0, bool autoComputeOctree=false)
 Point picking (brute force or octree-driven) More...
 
std::tuple< Eigen::Vector3d, Eigen::Matrix3d > computeMeanAndCovariance () const
 
cloudViewer::SquareMatrixd computeCovariance () const
 
- Public Member Functions inherited from ccShiftedObject
 ccShiftedObject (QString name=QString())
 Default constructor. More...
 
 ccShiftedObject (const ccShiftedObject &s)
 Copy constructor. More...
 
void copyGlobalShiftAndScale (const ccShiftedObject &s)
 Copies the Global Shift and Scale from another entity. More...
 
virtual void setGlobalShift (double x, double y, double z)
 Sets shift applied to original coordinates (information storage only) More...
 
virtual void setGlobalShift (const CCVector3d &shift)
 Sets shift applied to original coordinates (information storage only) More...
 
virtual const CCVector3dgetGlobalShift () const
 Returns the shift applied to original coordinates. More...
 
virtual void setGlobalScale (double scale)
 
virtual double getGlobalScale () const
 Returns the scale applied to original coordinates. More...
 
bool isShifted () const
 Returns whether the cloud is shifted or not. More...
 
template<typename T >
CCVector3d toGlobal3d (const Vector3Tpl< T > &Plocal) const
 Returns the point back-projected into the original coordinates system. More...
 
template<typename T >
CCVector3d toLocal3d (const Vector3Tpl< T > &Pglobal) const
 Returns the point projected into the local (shifted) coordinates system. More...
 
template<typename T >
CCVector3 toLocal3pc (const Vector3Tpl< T > &Pglobal) const
 Returns the point projected into the local (shifted) coordinates system. More...
 
bool getOwnGlobalBB (CCVector3d &minCorner, CCVector3d &maxCorner) override
 
GlobalBoundingBox getOwnGlobalBB (bool withGLFeatures=false) override
 
- Public Member Functions inherited from ccHObject
 ccHObject (QString name=QString())
 Default constructor. More...
 
 ccHObject (const ccHObject &object)
 Copy constructor. More...
 
virtual ~ccHObject () override
 Default destructor. More...
 
virtual Eigen::Vector2d GetMin2DBound () const
 
virtual Eigen::Vector2d GetMax2DBound () const
 
virtual ccHObjectScale (const double s)
 
virtual ccHObjectRotate (const Eigen::Matrix3d &R)
 
QString getViewId () const
 
bool isGroup () const
 Returns whether the instance is a group. More...
 
ccHObjectgetParent () const
 Returns parent object. More...
 
virtual QIcon getIcon () const
 Returns the icon associated to this entity. More...
 
void addDependency (ccHObject *otherObject, int flags, bool additive=true)
 Adds a new dependence (additive or not) More...
 
int getDependencyFlagsWith (const ccHObject *otherObject)
 Returns the dependency flags with a given object. More...
 
void removeDependencyWith (ccHObject *otherObject)
 Removes any dependency flags with a given object. More...
 
void removeDependencyFlag (ccHObject *otherObject, DEPENDENCY_FLAGS flag)
 Removes a given dependency flag. More...
 
virtual bool addChild (ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
 Adds a child. More...
 
unsigned getChildrenNumber () const
 Returns the number of children. More...
 
unsigned int getChildCountRecursive () const
 Returns the total number of children under this object recursively. More...
 
ccHObjectgetChild (unsigned childPos) const
 Returns the ith child. More...
 
ccHObjectfind (unsigned uniqueID)
 Finds an entity in this object hierarchy. More...
 
unsigned filterChildren (Container &filteredChildren, bool recursive=false, CV_CLASS_ENUM filter=CV_TYPES::OBJECT, bool strict=false) const
 Collects the children corresponding to a certain pattern. More...
 
void detachChild (ccHObject *child)
 Detaches a specific child. More...
 
void detachAllChildren ()
 Removes a specific child. More...
 
void getTypeID_recursive (std::vector< removeInfo > &rmInfos, bool relative)
 
void getTypeID_recursive (std::vector< hideInfo > &hdInfos, bool relative)
 
void removeChild (ccHObject *child)
 
void removeChild (int pos)
 Removes a specific child given its index. More...
 
void removeAllChildren ()
 Removes all children. More...
 
int getChildIndex (const ccHObject *aChild) const
 Returns child index. More...
 
void swapChildren (unsigned firstChildIndex, unsigned secondChildIndex)
 Swaps two children. More...
 
int getIndex () const
 Returns index relatively to its parent or -1 if no parent. More...
 
void transferChild (ccHObject *child, ccHObject &newParent)
 Transfer a given child to another parent. More...
 
void transferChildren (ccHObject &newParent, bool forceFatherDependent=false)
 Transfer all children to another parent. More...
 
ccHObjectgetFirstChild () const
 Shortcut: returns first child. More...
 
ccHObjectgetLastChild () const
 Shortcut: returns last child. More...
 
bool isAncestorOf (const ccHObject *anObject) const
 Returns true if the current object is an ancestor of the specified one. More...
 
void removeFromRenderScreen (bool recursive=true)
 
void hideObject_recursive (bool recursive)
 
void hideBB (CC_DRAW_CONTEXT context)
 
void showBB (CC_DRAW_CONTEXT context)
 
void setRedrawFlagRecursive (bool redraw=false)
 
void setForceRedrawRecursive (bool redraw=false)
 
void setPointSizeRecursive (int pSize)
 
void setLineWidthRecursive (PointCoordinateType width)
 
virtual ccBBox getBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true)
 Returns the bounding-box of this entity and it's children. More...
 
virtual GlobalBoundingBox getGlobalBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true)
 Returns the global bounding-box of this entity and it's children. More...
 
virtual ccBBox getDisplayBB_recursive (bool relative)
 Returns the bounding-box of this entity and it's children WHEN DISPLAYED. More...
 
virtual ccBBox getOwnFitBB (ccGLMatrix &trans)
 Returns best-fit bounding-box (if available) More...
 
virtual void drawBB (CC_DRAW_CONTEXT &context, const ecvColor::Rgb &col)
 Draws the entity (and its children) bounding-box. More...
 
void draw (CC_DRAW_CONTEXT &context) override
 Draws entity and its children. More...
 
void updateNameIn3DRecursive ()
 
void setHideShowType (CC_DRAW_CONTEXT &context)
 
void setRemoveType (CC_DRAW_CONTEXT &context)
 
ENTITY_TYPE getEntityType () const
 
virtual void redrawDisplay (bool forceRedraw=true, bool only2D=false)
 Redraws associated display. More...
 
bool getAbsoluteGLTransformation (ccGLMatrix &trans) const
 
virtual bool isDisplayed () const
 Returns whether the object is actually displayed (visible) or not. More...
 
virtual bool isBranchEnabled () const
 Returns whether the object and all its ancestors are enabled. More...
 
virtual void redrawDisplay_recursive (bool p)
 
virtual void refreshDisplay_recursive (bool p)
 
virtual void setSelected_recursive (bool p)
 
virtual void toggleActivation_recursive ()
 
virtual void toggleVisibility_recursive ()
 
virtual void toggleColors_recursive ()
 
virtual void resetGLTransformationHistory_recursive ()
 
virtual void toggleNormals_recursive ()
 
virtual void toggleSF_recursive ()
 
virtual void toggleShowName_recursive ()
 
unsigned findMaxUniqueID_recursive () const
 Returns the max 'unique ID' of this entity and its siblings. More...
 
void applyGLTransformation_recursive (const ccGLMatrix *trans=nullptr)
 Applies the active OpenGL transformation to the entity (recursive) More...
 
bool isSerializable () const override
 Returns whether object is serializable of not. More...
 
bool toFile (QFile &out, short dataVersion) const override
 Saves data to binary stream. More...
 
bool fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
 Loads data from binary stream. More...
 
short minimumFileVersion () const override
 Returns the minimum file version required to save this instance. More...
 
bool fromFileNoChildren (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap)
 Custom version of ccSerializableObject::fromFile. More...
 
virtual bool isShareable () const
 Returns whether object is shareable or not. More...
 
virtual void setSelectionBehavior (SelectionBehavior mode)
 Sets selection behavior (when displayed) More...
 
virtual SelectionBehavior getSelectionBehavior () const
 Returns selection behavior. More...
 
virtual const ccGLMatrixgetGLTransformationHistory () const
 Returns the transformation 'history' matrix. More...
 
virtual void setGLTransformationHistory (const ccGLMatrix &mat)
 Sets the transformation 'history' matrix (handle with care!) More...
 
virtual void resetGLTransformationHistory ()
 Resets the transformation 'history' matrix. More...
 
bool pushDisplayState () override
 Pushes the current display state (overridden) More...
 
void popDisplayState (bool apply=true) override
 Pops the last pushed display state (overridden) More...
 
- Public Member Functions inherited from ccObject
 ccObject (QString name=QString())
 Default constructor. More...
 
 ccObject (const ccObject &object)
 Copy constructor. More...
 
virtual QString getName () const
 Returns object name. More...
 
virtual void setName (const QString &name)
 Sets object name. More...
 
virtual void setRemoveFlag (bool removeFlag)
 Sets removeFlag. More...
 
virtual bool getRemoveFlag ()
 Returns removeFlag. More...
 
virtual unsigned getUniqueID () const
 Returns object unique ID. More...
 
virtual void setUniqueID (unsigned ID)
 Changes unique ID. More...
 
virtual bool isEnabled () const
 Returns whether the object is enabled or not. More...
 
virtual void setEnabled (bool state)
 Sets the "enabled" property. More...
 
virtual void toggleActivation ()
 Toggles the "enabled" property. More...
 
virtual bool isLocked () const
 Returns whether the object is locked or not. More...
 
virtual void setLocked (bool state)
 Sets the "enabled" property. More...
 
bool isLeaf () const
 
bool isCustom () const
 
bool isHierarchy () const
 
bool isKindOf (CV_CLASS_ENUM type) const
 
bool isA (CV_CLASS_ENUM type) const
 
QVariant getMetaData (const QString &key) const
 Returns a given associated meta data. More...
 
bool removeMetaData (const QString &key)
 Removes a given associated meta-data. More...
 
void setMetaData (const QString &key, const QVariant &data)
 Sets a meta-data element. More...
 
void setMetaData (const QVariantMap &dataset, bool overwrite=false)
 Sets several meta-data elements at a time. More...
 
bool hasMetaData (const QString &key) const
 Returns whether a meta-data element with the given key exists or not. More...
 
const QVariantMap & metaData () const
 Returns meta-data map (const only) More...
 
void setBaseName (const QString &baseName)
 
QString getBaseName () const
 
void setFullPath (const QString &fullPaht)
 
QString getFullPath () const
 
- Public Member Functions inherited from ccSerializableObject
virtual ~ccSerializableObject ()=default
 Destructor. More...
 
- Public Member Functions inherited from ccDrawableObject
 ccDrawableObject ()
 Default constructor. More...
 
 ccDrawableObject (const ccDrawableObject &object)
 Copy constructor. More...
 
virtual ~ccDrawableObject ()=default
 
virtual bool isVisible () const
 Returns whether entity is visible or not. More...
 
virtual void setVisible (bool state)
 Sets entity visibility. More...
 
virtual void toggleVisibility ()
 Toggles visibility. More...
 
virtual bool isRedraw () const
 Returns whether entity is to be redraw. More...
 
virtual void setRedraw (bool state)
 Sets entity redraw mode. More...
 
virtual void setForceRedraw (bool state)
 Sets force redraw. More...
 
virtual void setFixedId (bool state)
 
virtual bool isFixedId ()
 
virtual bool isVisibilityLocked () const
 Returns whether visibility is locked or not. More...
 
virtual void lockVisibility (bool state)
 Locks/unlocks visibility. More...
 
virtual bool isSelected () const
 Returns whether entity is selected or not. More...
 
virtual void setSelected (bool state)
 Selects/Unselects entity. More...
 
virtual bool colorsShown () const
 Returns whether colors are shown or not. More...
 
virtual void showColors (bool state)
 Sets colors visibility. More...
 
virtual void toggleColors ()
 Toggles colors display state. More...
 
virtual bool normalsShown () const
 Returns whether normals are shown or not. More...
 
virtual void showNormals (bool state)
 Sets normals visibility. More...
 
virtual void toggleNormals ()
 Toggles normals display state. More...
 
virtual void showSF (bool state)
 Sets active scalarfield visibility. More...
 
virtual void toggleSF ()
 Toggles SF display state. More...
 
virtual bool sfShown () const
 Returns whether active scalar field is visible. More...
 
virtual void toggleMaterials ()
 Toggles material display state. More...
 
virtual void showNameIn3D (bool state)
 Sets whether name should be displayed in 3D. More...
 
virtual bool nameShownIn3D () const
 Returns whether name is displayed in 3D or not. More...
 
virtual void toggleShowName ()
 Toggles name in 3D display state. More...
 
virtual bool isColorOverridden () const
 
virtual const ecvColor::RgbgetTempColor () const
 Returns current temporary (unique) color. More...
 
virtual void setTempColor (const ecvColor::Rgb &col, bool autoActivate=true)
 Sets current temporary (unique) More...
 
virtual void enableTempColor (bool state)
 Set temporary color activation state. More...
 
virtual float getOpacity () const
 
virtual void setOpacity (float opacity)
 Set opacity activation state. More...
 
virtual void setGLTransformation (const ccGLMatrix &trans)
 Associates entity with a GL transformation (rotation + translation) More...
 
virtual void enableGLTransformation (bool state)
 Enables/disables associated GL transformation. More...
 
virtual bool isGLTransEnabled () const
 Returns whether a GL transformation is enabled or not. More...
 
virtual const ccGLMatrixgetGLTransformation () const
 Returns associated GL transformation. More...
 
virtual void resetGLTransformation ()
 Resets associated GL transformation. More...
 
virtual void rotateGL (const ccGLMatrix &rotMat)
 Multiplies (left) current GL transformation by a rotation matrix. More...
 
virtual void translateGL (const CCVector3 &trans)
 Translates current GL transformation by a rotation matrix. More...
 
virtual void removeAllClipPlanes ()
 Removes all clipping planes (if any) More...
 
virtual bool addClipPlanes (const ccClipPlane &plane)
 Registers a new clipping plane. More...
 
virtual void toggleClipPlanes (CC_DRAW_CONTEXT &context, bool enable)
 Enables or disables clipping planes (OpenGL) More...
 
virtual void applyDisplayState (const DisplayState &state)
 Applies a display state. 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...
 
- Public Member Functions inherited from cloudViewer::GenericCloud
 GenericCloud ()=default
 Default constructor. More...
 
virtual ~GenericCloud ()=default
 Default destructor. More...
 
virtual bool hasPoints () const
 

Static Public Member Functions

static ccPointCloudFrom (const cloudViewer::GenericIndexedCloud *cloud, const ccGenericPointCloud *sourceCloud=nullptr)
 Creates a new point cloud object from a GenericIndexedCloud. More...
 
static ccPointCloudFrom (cloudViewer::GenericCloud *cloud, const ccGenericPointCloud *sourceCloud=nullptr)
 Creates a new point cloud object from a GenericCloud. More...
 
static ccPointCloudFrom (const ccPointCloud *sourceCloud, const std::vector< size_t > &indices, bool invert=false)
 Function to select points from input ccPointCloud into output ccPointCloud. More...
 
static std::vector< Eigen::Matrix3d > EstimatePerPointCovariances (const ccPointCloud &input, const cloudViewer::geometry::KDTreeSearchParam &search_param=cloudViewer::geometry::KDTreeSearchParamKNN())
 Static function to compute the covariance matrix for each point of a point cloud. Doesn't change the input PointCloud, just outputs the covariance matrices. More...
 
static std::shared_ptr< ccPointCloudCreateFromDepthImage (const cloudViewer::geometry::Image &depth, const cloudViewer::camera::PinholeCameraIntrinsic &intrinsic, const Eigen::Matrix4d &extrinsic=Eigen::Matrix4d::Identity(), double depth_scale=1000.0, double depth_trunc=1000.0, int stride=1, bool project_valid_depth_only=true)
 Factory function to create a pointcloud from a depth image and a camera model. More...
 
static std::shared_ptr< ccPointCloudCreateFromRGBDImage (const cloudViewer::geometry::RGBDImage &image, const cloudViewer::camera::PinholeCameraIntrinsic &intrinsic, const Eigen::Matrix4d &extrinsic=Eigen::Matrix4d::Identity(), bool project_valid_depth_only=true)
 Factory function to create a pointcloud from an RGB-D image and a camera model. More...
 
- Static Public Member Functions inherited from ccHObject
static ccHObjectNew (CV_CLASS_ENUM objectType, const char *name=nullptr)
 Static factory. More...
 
static ccHObjectNew (const QString &pluginId, const QString &classId, const char *name=nullptr)
 Static factory (version to be used by external plugin factories) More...
 
static Eigen::Vector3d ComputeMinBound (const std::vector< Eigen::Vector3d > &points)
 Compute min bound of a list points. More...
 
static Eigen::Vector3d ComputeMaxBound (const std::vector< Eigen::Vector3d > &points)
 Compute max bound of a list points. More...
 
static Eigen::Vector3d ComputeCenter (const std::vector< Eigen::Vector3d > &points)
 Computer center of a list of points. More...
 
static void ResizeAndPaintUniformColor (std::vector< Eigen::Vector3d > &colors, std::size_t size, const Eigen::Vector3d &color)
 Resizes the colors vector and paints a uniform color. More...
 
static void TransformPoints (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points)
 Transforms all points with the transformation matrix. More...
 
static void TransformNormals (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals)
 Transforms the normals with the transformation matrix. More...
 
static void TransformCovariances (const Eigen::Matrix4d &transformation, std::vector< Eigen::Matrix3d > &covariances)
 Transforms all covariance matrices with the transformation. More...
 
static void TranslatePoints (const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative)
 Apply translation to the geometry coordinates. More...
 
static void ScalePoints (const double scale, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center)
 Scale the coordinates of all points by the scaling factor scale. More...
 
static void RotatePoints (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center)
 Rotate all points with the rotation matrix R. More...
 
static void RotateNormals (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &normals)
 Rotate all normals with the rotation matrix R. More...
 
static void RotateCovariances (const Eigen::Matrix3d &R, std::vector< Eigen::Matrix3d > &covariances)
 Rotate all covariance matrices with the rotation matrix R. More...
 
static Eigen::Matrix3d GetRotationMatrixFromXYZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XYZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYZX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YZX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZXY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZXY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromXZY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XZY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZYX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZYX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYXZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YXZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromAxisAngle (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from AxisAngle RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromQuaternion (const Eigen::Vector4d &rotation)
 Get Rotation Matrix from Quaternion. More...
 
static Eigen::Matrix3d GetRotationMatrixFromEulerAngle (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from Euler angle. More...
 
- Static Public Member Functions inherited from ccObject
static unsigned GetCurrentDBVersion ()
 Returns current database version. More...
 
static void SetUniqueIDGenerator (ccUniqueIDGenerator::Shared generator)
 Sets the unique ID generator. More...
 
static ccUniqueIDGenerator::Shared GetUniqueIDGenerator ()
 Returns the unique ID generator. More...
 
static unsigned GetNextUniqueID ()
 Returns a new unassigned unique ID. More...
 
static unsigned GetLastUniqueID ()
 Returns last assigned unique ID. More...
 
static CV_CLASS_ENUM ReadClassIDFromFile (QFile &in, short dataVersion)
 Helper: reads out class ID from a binary stream. More...
 
- Static Public Member Functions inherited from ccSerializableObject
static bool WriteError ()
 Sends a custom error message (write error) and returns 'false'. More...
 
static bool ReadError ()
 Sends a custom error message (read error) and returns 'false'. More...
 
static bool MemoryError ()
 Sends a custom error message (not enough memory) and returns 'false'. More...
 
static bool CorruptError ()
 Sends a custom error message (corrupted file) and returns 'false'. More...
 

Public Attributes

std::vector< Eigen::Matrix3d > covariances_
 Covariance Matrix for each point. More...
 

Protected Member Functions

void drawMeOnly (CC_DRAW_CONTEXT &context) override
 Draws the entity only (not its children) More...
 
void applyGLTransformation (const ccGLMatrix &trans) override
 Applies a GL transformation to the entity. More...
 
bool toFile_MeOnly (QFile &out, short dataVersion) const override
 Save own object data. More...
 
short minimumFileVersion_MeOnly () const override
 
bool fromFile_MeOnly (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
 Loads own object data. More...
 
void notifyGeometryUpdate () override
 
void swapPoints (unsigned firstIndex, unsigned secondIndex) override
 
virtual void removePoints (size_t index) override
 
void releaseVBOs ()
 Release VBOs. More...
 
- Protected Member Functions inherited from cloudViewer::PointCloudTpl< ccGenericPointCloud >
CCVector3point (unsigned index)
 Returns non const access to a given point. More...
 
const CCVector3point (unsigned index) const
 Returns const access to a given point. More...
 
- Protected Member Functions inherited from ccShiftedObject
bool saveShiftInfoToFile (QFile &out) const
 Serialization helper (output) More...
 
bool loadShiftInfoFromFile (QFile &in)
 Serialization helper (input) More...
 
- Protected Member Functions inherited from ccHObject
virtual void setParent (ccHObject *anObject)
 Sets parent object. More...
 
virtual void drawNameIn3D ()
 Draws the entity name in 3D. More...
 
virtual void onDeletionOf (const ccHObject *obj)
 This method is called when another object is deleted. More...
 
virtual void onUpdateOf (ccHObject *obj)
 This method is called when another object (geometry) is updated. More...
 
- Protected Member Functions inherited from ccObject
virtual bool getFlagState (CV_OBJECT_FLAG flag) const
 Returns flag state. More...
 
virtual void setFlagState (CV_OBJECT_FLAG flag, bool state)
 Sets flag state. More...
 
bool toFile (QFile &out, short dataVersion) const override
 Saves data to binary stream. More...
 
short minimumFileVersion () const override
 Returns the minimum file version required to save this instance. More...
 
bool fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
 Reimplemented from ccSerializableObject::fromFile. More...
 

Protected Attributes

ColorsTableTypem_rgbColors
 Colors. More...
 
NormsIndexesTableTypem_normals
 Normals (compressed) More...
 
bool m_sfColorScaleDisplayed
 
ccScalarFieldm_currentDisplayedScalarField
 Currently displayed scalar field. More...
 
int m_currentDisplayedScalarFieldIndex
 Currently displayed scalar field index. More...
 
std::vector< Grid::Sharedm_grids
 Associated grid structure. More...
 
bool m_visibilityCheckEnabled
 Whether visibility check is available or not (during comparison) More...
 
vboSet m_vboManager
 Set of VBOs attached to this cloud. More...
 
ccPointCloudLODm_lod
 L.O.D. structure. More...
 
FWFDescriptorSet m_fwfDescriptors
 General waveform descriptors. More...
 
std::vector< ccWaveformm_fwfWaveforms
 Per-point waveform accessors. More...
 
SharedFWFDataContainer m_fwfData
 Waveforms raw data storage. More...
 
- Protected Attributes inherited from cloudViewer::PointCloudTpl< ccGenericPointCloud >
std::vector< CCVector3m_points
 3D Points database More...
 
BoundingBox m_bbox
 Bounding-box. More...
 
unsigned m_currentPointIndex
 'Iterator' on the points db More...
 
std::vector< ScalarField * > m_scalarFields
 Associated scalar fields. More...
 
int m_currentInScalarFieldIndex
 Index of current scalar field used for input. More...
 
int m_currentOutScalarFieldIndex
 Index of current scalar field used for output. More...
 
- Protected Attributes inherited from ccGenericPointCloud
VisibilityTableType m_pointsVisibility
 Per-point visibility table. More...
 
unsigned char m_pointSize
 Point size (won't be applied if 0) More...
 
- Protected Attributes inherited from ccShiftedObject
CCVector3d m_globalShift
 Global shift (typically applied at loading time) More...
 
double m_globalScale
 Global scale (typically applied at loading time) More...
 
- Protected Attributes inherited from ccHObject
ccHObjectm_parent
 Parent. More...
 
Container m_children
 Children. More...
 
SelectionBehavior m_selectionBehavior
 Selection behavior. More...
 
std::map< ccHObject *, int > m_dependencies
 Dependencies map. More...
 
ccGLMatrix m_glTransHistory
 Cumulative GL transformation. More...
 
bool m_isDeleting
 Flag to safely handle dependencies when the object is being deleted. More...
 
- Protected Attributes inherited from ccObject
QString m_name
 Object name. More...
 
QString m_baseName
 
QString m_filePath
 
bool m_removeFlag
 
unsigned m_flags
 Object flags. More...
 
QVariantMap m_metaData
 Associated meta-data. More...
 
- Protected Attributes inherited from ccDrawableObject
bool m_fixedId
 
bool m_modelRedraw
 
bool m_forceRedraw
 
float m_opacity
 
bool m_visible
 Specifies whether the object is visible or not. More...
 
bool m_selected
 Specifies whether the object is selected or not. More...
 
bool m_lockedVisibility
 Specifies whether the visibility can be changed by user or not. More...
 
bool m_colorsDisplayed
 Specifies whether colors should be displayed. More...
 
bool m_normalsDisplayed
 Specifies whether normals should be displayed. More...
 
bool m_sfDisplayed
 Specifies whether scalar field should be displayed. More...
 
ecvColor::Rgb m_tempColor
 Temporary (unique) color. More...
 
bool m_colorIsOverridden
 Temporary (unique) color activation state. More...
 
ccGLMatrix m_glTrans
 Current GL transformation. More...
 
bool m_glTransEnabled
 Current GL transformation activation state. More...
 
bool m_showNameIn3D
 Whether name is displayed in 3D or not. More...
 
CCVector3d m_nameIn3DPos
 Last 2D position of the '3D' name. More...
 
ccClipPlaneSet m_clipPlanes
 Active clipping planes (used for display only) More...
 
std::vector< DisplayState::Sharedm_displayStateStack
 The stack of pushed display states. More...
 

Detailed Description

A 3D cloud and its associated features (color, normals, scalar fields, etc.)

A point cloud can have multiple features:

  • colors (RGB)
  • normals (compressed)
  • scalar fields
  • an octree strucutre
  • per-point visibility information (to hide/display subsets of points)
  • other children objects (meshes, calibrated pictures, etc.)

Definition at line 146 of file ecvPointCloud.h.

Member Typedef Documentation

◆ BaseClass

Base class (shortcut)

Definition at line 150 of file ecvPointCloud.h.

◆ FWFDataContainer

using ccPointCloud::FWFDataContainer = std::vector<uint8_t>

Waveform data container.

Definition at line 506 of file ecvPointCloud.h.

◆ FWFDescriptorSet

Waveform descriptors set.

Definition at line 503 of file ecvPointCloud.h.

◆ SharedFWFDataContainer

Definition at line 507 of file ecvPointCloud.h.

Member Enumeration Documentation

◆ CLONE_WARNINGS

Warnings for the partialClone method (bit flags)

Enumerator
WRN_OUT_OF_MEM_FOR_COLORS 
WRN_OUT_OF_MEM_FOR_NORMALS 
WRN_OUT_OF_MEM_FOR_SFS 
WRN_OUT_OF_MEM_FOR_FWF 

Definition at line 208 of file ecvPointCloud.h.

◆ RGB_FILTER_TYPES

RGB filter types.

Enumerator
NONE 
BILATERAL 
GAUSSIAN 
MEAN 
MEDIAN 

Definition at line 790 of file ecvPointCloud.h.

◆ UnrollMode

Enumerator
CYLINDER 
CONE 
STRAIGHTENED_CONE 
STRAIGHTENED_CONE2 

Definition at line 864 of file ecvPointCloud.h.

Constructor & Destructor Documentation

◆ ccPointCloud() [1/3]

ccPointCloud::ccPointCloud ( QString  name = QString())
throw (
)

Default constructor.

Creates an empty cloud without any feature. Each of them shoud be specifically instantiated/created (once the points have been added to this cloud, at least partially).

Parameters
namecloud name (optional)

◆ ccPointCloud() [2/3]

ccPointCloud::ccPointCloud ( const ccPointCloud cloud)

◆ ccPointCloud() [3/3]

ccPointCloud::ccPointCloud ( const std::vector< Eigen::Vector3d > &  points,
const std::string &  name = "cloud" 
)

◆ ~ccPointCloud()

ccPointCloud::~ccPointCloud ( )
override

Default destructor.

Member Function Documentation

◆ addColorRampInfo()

void ccPointCloud::addColorRampInfo ( CC_DRAW_CONTEXT context)

Adds associated SF color ramp info to current GL context.

◆ addEigenColor()

◆ addEigenColors()

void ccPointCloud::addEigenColors ( const std::vector< Eigen::Vector3d > &  colors)

◆ addEigenNorm()

void ccPointCloud::addEigenNorm ( const Eigen::Vector3d &  N)

◆ addEigenNorms()

void ccPointCloud::addEigenNorms ( const std::vector< Eigen::Vector3d > &  normals)

◆ addGreyColor()

void ccPointCloud::addGreyColor ( ColorCompType  g)
inline

Pushes a grey color on stack (shortcut)

Shortcut: color is converted to RGB(g, g, g)

Parameters
ggrey component

Definition at line 722 of file ecvPointCloud.h.

Referenced by SoiFilter::loadFile(), and cloudViewer::geometry::pybind_pointcloud().

◆ addGrid()

bool ccPointCloud::addGrid ( Grid::Shared  grid)
inline

Adds an associated grid.

Definition at line 449 of file ecvPointCloud.h.

◆ addNorm()

void ccPointCloud::addNorm ( const CCVector3 N)

◆ addNormAtIndex()

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.

Parameters
Nnormal vector to add (size: 3)
indexnormal index to modify

◆ addNormIndex()

void ccPointCloud::addNormIndex ( CompressedNormType  index)

Pushes a compressed normal vector.

Parameters
indexcompressed normal vector

◆ addNorms() [1/2]

void ccPointCloud::addNorms ( const std::vector< CCVector3 > &  Ns)

◆ addNorms() [2/2]

void ccPointCloud::addNorms ( const std::vector< CompressedNormType > &  idxes)

◆ addRGBColor() [1/2]

void ccPointCloud::addRGBColor ( ColorCompType  r,
ColorCompType  g,
ColorCompType  b 
)
inline

Pushes an RGB color on stack (shortcut)

Parameters
rred component
ggreen component
bblue component

Definition at line 714 of file ecvPointCloud.h.

◆ addRGBColor() [2/2]

◆ addRGBColors()

void ccPointCloud::addRGBColors ( const std::vector< ecvColor::Rgb > &  colors)

◆ addScalarField() [1/2]

int ccPointCloud::addScalarField ( ccScalarField sf)

Adds an existing scalar field to this cloud.

Warning: the cloud takes ownership of it!

Parameters
sfexisting scalar field
Returns
index of added scalar field (or -1 if an error occurred)

◆ addScalarField() [2/2]

int ccPointCloud::addScalarField ( const char *  uniqueName)
overridevirtual

Creates a new scalar field and registers it.

Warnings:

  • the name must be unique (the method will fail if a SF with the same name already exists)
  • this method DOES resize the scalar field to match the current cloud size
    Parameters
    uniqueNamescalar field name (must be unique)
    Returns
    index of this new scalar field (or -1 if an error occurred)

Reimplemented from cloudViewer::PointCloudTpl< ccGenericPointCloud >.

Referenced by LasCloudChunk::addLasFieldsToCloud(), ccScalarFieldArithmeticsDlg::Apply(), ccLibAlgorithms::ApplyCCLibAlgorithm(), ccTrace::buildCurvatureCost(), ccTrace::buildGradientCost(), masc::Classifier::classify(), qCanupoProcess::Classify(), qM3C2Process::Compute(), qVoxFallProcess::Compute(), ccComparisonDlg::computeApproxDistances(), ccComparisonDlg::computeDistances(), ccLibAlgorithms::ComputeGeomCharacteristic(), DistanceMapGenerationTool::ComputeRadialDist(), ccRasterizeTool::convertGridToCloud(), DistanceMapGenerationTool::ConvertMapToCloud(), ccEntityAction::convertNormalsTo(), ccCropTool::Crop(), qPCV::doAction(), qPoissonRecon::doAction(), ccCompass::estimateP21(), masc::Classifier::evaluate(), GrainsAsEllipsoids::exportResultsAsCloud(), qFacets::extractFacets(), TreeIso::Final_seg_pcd(), ccRasterizeTool::generateHillshade(), getMortarMaps(), ccRegistrationTools::ICP(), ccEntityAction::importToSF(), TreeIso::Init_seg_pcd(), TreeIso::Intermediate_seg_pcd(), LoadCloud(), LASFWFFilter::loadFile(), RDBFilter::loadFile(), LoadScan(), ccTrace::optimizePath(), masc::Feature::PrepareSF(), CommandExtractCCs::process(), CommandStatTest::process(), PCVCommand::Process(), cloudViewer::geometry::pybind_pointcloud(), ccEntityAction::rgbGaussianFilter(), ccEntityAction::sfAddIdField(), ccEntityAction::sfGaussianFilter(), and ccEntityAction::statisticalTest().

◆ append()

const ccPointCloud& ccPointCloud::append ( ccPointCloud cloud,
unsigned  pointCountBefore,
bool  ignoreChildren = false 
)

Appends a cloud to this one.

Same as the += operator with pointCountBefore == size()

Parameters
cloudcloud to be added
pointCountBeforethe number of points previously contained in this cloud
ignoreChildrenwhether to copy input cloud's children or not
Returns
the resulting point cloud

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ applyFilterToRGB()

bool ccPointCloud::applyFilterToRGB ( PointCoordinateType  sigma,
PointCoordinateType  sigmaSF,
RgbFilterOptions  filterParams,
cloudViewer::GenericProgressCallback progressCb = nullptr 
)

Applies a spatial Gaussian filter on RGB colors.

The "amplitude" of the Gaussian filter must be specified (sigma). As 99% of the Gaussian distribution is between -3*sigma and +3*sigma around the mean value, this filter will only look for neighbors within a sphere of radius 3*sigma. One can also use the filter as a Bilateral filter. In this case the weights are computed considering the difference of the neighbors SF values with the current point SF value (also following a Gaussian distribution). Warning: this method assumes the output scalar field is set.

Parameters
sigmafilter variance
sigmaSFif strictly positive, the variance for the Bilateral filter
filterParamsfilter options
progressCbthe client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback)
Returns
success

Referenced by ccEntityAction::rgbGaussianFilter().

◆ applyGLTransformation()

void ccPointCloud::applyGLTransformation ( const ccGLMatrix trans)
overrideprotectedvirtual

Applies a GL transformation to the entity.

this = rotMat*(this-rotCenter)+(rotCenter+trans)

Parameters
transa ccGLMatrix structure

Reimplemented from ccHObject.

◆ applyRigidTransformation()

virtual void ccPointCloud::applyRigidTransformation ( const ccGLMatrix trans)
overridevirtual

Applies a rigid transformation (rotation + translation)

Implements ccGenericPointCloud.

◆ clear()

◆ clearFWFData()

void ccPointCloud::clearFWFData ( )

Clears all associated FWF data.

◆ clearLOD()

void ccPointCloud::clearLOD ( )

Clears the LOD structure.

◆ clone()

ccGenericPointCloud* ccPointCloud::clone ( ccGenericPointCloud destCloud = nullptr,
bool  ignoreChildren = false 
)
overridevirtual

Clones this entity.

All the main features of the entity are cloned, except from the octree and the points visibility information.

Parameters
destClouddestination cloud can be provided here (must be of the exact same type as the cloned cloud!)
ignoreChildren[optional] whether to ignore the cloud's children or not (in which case they will be cloned as well)
Returns
a copy of this entity

Implements ccGenericPointCloud.

◆ cloneThis()

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.

Parameters
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)
Returns
a copy of this entity

Referenced by ComputeKmeansClustering(), cloudViewer::geometry::pybind_pointcloud(), and cloudViewer::geometry::pybind_trianglemesh().

◆ ClusterDBSCAN()

std::vector<int> ccPointCloud::ClusterDBSCAN ( double  eps,
size_t  min_points,
bool  print_progress = false 
) const

Cluster ccPointCloud using the DBSCAN algorithm Ester et al., "A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise", 1996.

Returns a list of point labels, -1 indicates noise according to the algorithm.

Parameters
epsDensity parameter that is used to find neighbouring points.
min_pointsMinimum number of points to form a cluster.
print_progressIf true the progress is visualized in the console.

Referenced by ccEntityAction::DBScanCluster(), and cloudViewer::geometry::pybind_pointcloud().

◆ colorize()

bool ccPointCloud::colorize ( float  r,
float  g,
float  b 
)

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.

Parameters
rred component
ggreen component
bblue component
Returns
success

Referenced by define_ccPointCloud(), cloudViewer::geometry::pybind_pointcloud(), and ccEntityAction::setColor().

◆ colorsHaveChanged()

void ccPointCloud::colorsHaveChanged ( )
inline

Notify a modification of color / scalar field display parameters or contents

Definition at line 276 of file ecvPointCloud.h.

Referenced by TreeIso::Final_seg_pcd(), TreeIso::Init_seg_pcd(), TreeIso::Intermediate_seg_pcd(), ccColorFromScalarDlg::onApply(), and cloudViewer::geometry::pybind_pointcloud().

◆ compressFWFData()

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

Referenced by LASFWFFilter::saveToFile().

◆ ComputeConvexHull()

std::tuple<std::shared_ptr<ccMesh>, std::vector<size_t> > ccPointCloud::ComputeConvexHull ( ) const

Function that computes the convex hull of the point cloud using qhull.

Referenced by ccEntityAction::ConvexHull(), and cloudViewer::geometry::pybind_pointcloud().

◆ computeCPSet()

QSharedPointer<cloudViewer::ReferenceCloud> ccPointCloud::computeCPSet ( ccGenericPointCloud otherCloud,
cloudViewer::GenericProgressCallback progressCb = nullptr,
unsigned char  octreeLevel = 0 
)

Computes 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)

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ computeFWFAmplitude()

bool ccPointCloud::computeFWFAmplitude ( double &  minVal,
double &  maxVal,
ecvProgressDialog pDlg = nullptr 
) const

Computes the maximum amplitude of all associated waveforms.

Referenced by ccWaveDialog::ccWaveDialog().

◆ computeGravityCenter()

CCVector3 ccPointCloud::computeGravityCenter ( )

Returns the cloud gravity center.

Returns
gravity center

Referenced by ccPointPairRegistrationDlg::callHornRegistration(), and cloudViewer::geometry::pybind_pointcloud().

◆ ComputeMahalanobisDistance()

std::vector<double> ccPointCloud::ComputeMahalanobisDistance ( ) const

Function to compute the Mahalanobis distance for points in an input point cloud.

See: https://en.wikipedia.org/wiki/Mahalanobis_distance

Referenced by convert(), and cloudViewer::geometry::pybind_pointcloud().

◆ ComputeNearestNeighborDistance()

std::vector<double> ccPointCloud::ComputeNearestNeighborDistance ( ) const

Function to compute the distance from a point to its nearest neighbor in the input point cloud

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ computeNormalsWithGrids()

bool ccPointCloud::computeNormalsWithGrids ( double  minTriangleAngle_deg = 1.0,
ecvProgressDialog pDlg = nullptr 
)

Compute the normals with the associated grid structure(s)

Can also orient the normals in the same run.

Referenced by define_ccPointCloud().

◆ computeNormalsWithOctree()

bool ccPointCloud::computeNormalsWithOctree ( CV_LOCAL_MODEL_TYPES  model,
ccNormalVectors::Orientation  preferredOrientation,
PointCoordinateType  defaultRadius,
ecvProgressDialog pDlg = nullptr 
)

Compute the normals by approximating the local surface around each point.

Referenced by define_ccPointCloud(), and CommandOctreeNormal::process().

◆ ComputePointCloudDistance()

std::vector<double> ccPointCloud::ComputePointCloudDistance ( const ccPointCloud target)

Function to compute the point to point distances between point clouds.

For each point in the source point cloud, compute the distance to the target point cloud.

Parameters
targetThe target point cloud.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ ComputeResolution()

double ccPointCloud::ComputeResolution ( ) const

◆ convertCurrentScalarFieldToColors()

bool ccPointCloud::convertCurrentScalarFieldToColors ( bool  mixWithExistingColor = false)

Converts current scalar field (values & display parameters) to RGB colors

Returns
success

Referenced by CommandSFConvertToRGB::process(), CommandVolume25D::process(), and cloudViewer::geometry::pybind_pointcloud().

◆ convertNormalToDipDirSFs()

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

Parameters
[out]dipSFdip values
[out]dipDirSFdip direction values
Returns
success

Referenced by ccEntityAction::convertNormalsTo(), and cloudViewer::geometry::pybind_pointcloud().

◆ convertNormalToRGB()

bool ccPointCloud::convertNormalToRGB ( )

Converts normals to RGB colors.

See ccNormalVectors::ConvertNormalToRGB

Returns
success

Referenced by ccEntityAction::convertNormalsTo(), and cloudViewer::geometry::pybind_pointcloud().

◆ convertRGBToGreyScale()

bool ccPointCloud::convertRGBToGreyScale ( )

Converts RGB to grey scale colors.

Returns
success

Referenced by cloudViewer::geometry::pybind_pointcloud(), and ccEntityAction::rgbToGreyScale().

◆ CreateFromDepthImage()

static std::shared_ptr<ccPointCloud> ccPointCloud::CreateFromDepthImage ( const cloudViewer::geometry::Image depth,
const cloudViewer::camera::PinholeCameraIntrinsic intrinsic,
const Eigen::Matrix4d &  extrinsic = Eigen::Matrix4d::Identity(),
double  depth_scale = 1000.0,
double  depth_trunc = 1000.0,
int  stride = 1,
bool  project_valid_depth_only = true 
)
static

Factory function to create a pointcloud from a depth image and a camera model.

Given depth value d at (u, v) image coordinate, the corresponding 3d point is: z = d / depth_scale
x = (u - cx) * z / fx
y = (v - cy) * z / fy

Parameters
depthThe input depth image can be either a float image, or a uint16_t image.
intrinsicIntrinsic parameters of the camera.
extrinsicExtrinsic parameters of the camera.
depth_scaleThe depth is scaled by 1 / depth_scale.
depth_truncTruncated at depth_trunc distance.
strideSampling factor to support coarse point cloud extraction.

\Return An empty pointcloud if the conversion fails. If

Parameters
project_valid_depth_onlyis true, return point cloud, which doesn't have nan point. If the value is false, return point cloud, which has a point for each pixel, whereas invalid depth results in NaN points.

Referenced by cloudViewer::pipelines::integration::ScalableTSDFVolume::Integrate(), main(), and cloudViewer::geometry::pybind_pointcloud().

◆ CreateFromRGBDImage()

static std::shared_ptr<ccPointCloud> ccPointCloud::CreateFromRGBDImage ( const cloudViewer::geometry::RGBDImage image,
const cloudViewer::camera::PinholeCameraIntrinsic intrinsic,
const Eigen::Matrix4d &  extrinsic = Eigen::Matrix4d::Identity(),
bool  project_valid_depth_only = true 
)
static

Factory function to create a pointcloud from an RGB-D image and a camera model.

Given depth value d at (u, v) image coordinate, the corresponding 3d point is: z = d / depth_scale
x = (u - cx) * z / fx
y = (v - cy) * z / fy

Parameters
imageThe input image.
intrinsicIntrinsic parameters of the camera.
extrinsicExtrinsic parameters of the camera.

\Return An empty pointcloud if the conversion fails. If

Parameters
project_valid_depth_onlyis true, return point cloud, which doesn't have nan point. If the value is false, return point cloud, which has a point for each pixel, whereas invalid depth results in NaN points.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ CreateFromVoxelGrid()

std::shared_ptr<ccPointCloud> ccPointCloud::CreateFromVoxelGrid ( const cloudViewer::geometry::VoxelGrid voxel_grid)

Function to create a PointCloud from a VoxelGrid.

It transforms the voxel centers to 3D points using the original point cloud coordinate (with respect to the center of the voxel grid).

Parameters
voxel_gridThe input VoxelGrid.

◆ createNewCloudFromVisibilitySelection()

ccGenericPointCloud* ccPointCloud::createNewCloudFromVisibilitySelection ( bool  removeSelectedPoints = false,
VisibilityTableType visTable = nullptr,
std::vector< int > *  newIndexesOfRemainingPoints = nullptr,
bool  silent = false,
cloudViewer::ReferenceCloud selection = nullptr 
)
overridevirtual
Warning
if removeSelectedPoints is true, any attached octree will be deleted, as well as the visibility table.

Implements ccGenericPointCloud.

Referenced by StereogramDialog::exportCurrentSelection().

◆ Crop() [1/2]

std::shared_ptr<ccPointCloud> ccPointCloud::Crop ( const ccBBox bbox) const

Function to crop ccPointCloud into output ccPointCloud.

All points with coordinates outside the bounding box bbox are clipped.

Parameters
bboxccBBox to crop points.

Referenced by convert(), cloudViewer::t::geometry::LegacyCropByAxisAlignedBox(), cloudViewer::t::geometry::LegacyCropByOrientedBox(), and cloudViewer::geometry::pybind_pointcloud().

◆ crop() [1/2]

cloudViewer::ReferenceCloud* ccPointCloud::crop ( const ccBBox box,
bool  inside = true 
)
overridevirtual

Crops the cloud inside (or outside) a bounding box.

Warning
Always returns a selection (potentially empty) if successful.
Parameters
boxcropping box
insidewhether selected points are inside or outside the box
Returns
points falling inside (or outside) as a selection

Implements ccGenericPointCloud.

Referenced by ccCropTool::Crop().

◆ Crop() [2/2]

std::shared_ptr<ccPointCloud> ccPointCloud::Crop ( const ecvOrientedBBox bbox) const

Function to crop ccPointCloud into output ccPointCloud.

All points with coordinates outside the bounding box bbox are clipped.

Parameters
bboxOrientedBoundingBox to crop points.

◆ crop() [2/2]

cloudViewer::ReferenceCloud* ccPointCloud::crop ( const ecvOrientedBBox bbox)
overridevirtual

Implements ccGenericPointCloud.

◆ crop2D()

cloudViewer::ReferenceCloud* ccPointCloud::crop2D ( const ccPolyline poly,
unsigned char  orthoDim,
bool  inside = true 
)

Crops the cloud inside (or outside) a 2D polyline.

Warning
Always returns a selection (potentially empty) if successful.
Parameters
polycroping polyline
orthoDimdimension orthogonal to the plane in which the segmentation should occur (X=0, Y=1, Z=2)
insidewhether selected points are inside or outside the polyline
Returns
points falling inside (or outside) as a selection

Referenced by define_ccPointCloud(), and cloudViewer::geometry::pybind_pointcloud().

◆ deleteAllScalarFields()

void ccPointCloud::deleteAllScalarFields ( )
overridevirtual

Deletes all scalar fields associated to this cloud.

Reimplemented from cloudViewer::PointCloudTpl< ccGenericPointCloud >.

Referenced by ccCropTool::Crop(), and cloudViewer::geometry::pybind_pointcloud().

◆ deleteScalarField()

◆ drawMeOnly()

void ccPointCloud::drawMeOnly ( CC_DRAW_CONTEXT context)
overrideprotectedvirtual

Draws the entity only (not its children)

Reimplemented from ccHObject.

Reimplemented in ccSymbolCloud, and ccSNECloud.

Referenced by ccSNECloud::drawMeOnly().

◆ enableVisibilityCheck()

void ccPointCloud::enableVisibilityCheck ( bool  state)
inline

Sets whether visibility check is enabled or not (e.g. during distances computation) See ccPointCloud::testVisibility.

Definition at line 618 of file ecvPointCloud.h.

Referenced by ccComparisonDlg::computeDistances().

◆ enhanceRGBWithIntensitySF()

bool ccPointCloud::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)

Referenced by ccEntityAction::enhanceRGBWithIntensities(), and cloudViewer::geometry::pybind_pointcloud().

◆ EstimateCovariances()

void ccPointCloud::EstimateCovariances ( const cloudViewer::geometry::KDTreeSearchParam search_param = cloudViewer::geometry::KDTreeSearchParamKNN())

Function to compute the covariance matrix for each point of a point cloud.

Parameters
search_paramThe KDTree search parameters for neighborhood search.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ EstimateNormals()

bool ccPointCloud::EstimateNormals ( const cloudViewer::geometry::KDTreeSearchParam search_param = cloudViewer::geometry::KDTreeSearchParamKNN(),
bool  fast_normal_computation = true 
)

Function to compute the normals of a point cloud.

Normals are oriented with respect to the input point cloud if normals exist.

Parameters
search_paramThe KDTree search parameters for neighborhood search.
fast_normal_computationIf true, the normal estiamtion uses a non-iterative method to extract the eigenvector from the covariance matrix. This is faster, but is not as numerical stable.

Referenced by convert(), and cloudViewer::geometry::pybind_pointcloud().

◆ EstimatePerPointCovariances()

static std::vector<Eigen::Matrix3d> ccPointCloud::EstimatePerPointCovariances ( const ccPointCloud input,
const cloudViewer::geometry::KDTreeSearchParam search_param = cloudViewer::geometry::KDTreeSearchParamKNN() 
)
static

Static function to compute the covariance matrix for each point of a point cloud. Doesn't change the input PointCloud, just outputs the covariance matrices.

Parameters
inputPointCloud to use for covariance computation
search_paramThe KDTree search parameters for neighborhood search.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ exportCoordToSF()

bool ccPointCloud::exportCoordToSF ( bool  exportDims[3])

Exports the specified coordinate dimension(s) to scalar field(s)

Referenced by ccEntityAction::exportCoordToSF(), CommandCoordToSF::process(), and cloudViewer::geometry::pybind_pointcloud().

◆ exportNormalToSF()

bool ccPointCloud::exportNormalToSF ( bool  exportDims[3])

Exports the specified normal dimension(s) to scalar field(s)

Referenced by ccEntityAction::exportNormalToSF().

◆ FarthestPointDownSample()

std::shared_ptr<ccPointCloud> ccPointCloud::FarthestPointDownSample ( const size_t  num_samples,
const size_t  start_index = 0 
) const

Function to downsample input pointcloud into output pointcloud with a set of points has farthest distance.

The sample is performed by selecting the farthest point from previous selected points iteratively, starting from start_index.

Parameters
num_samplesNumber of points to be sampled.
start_indexIndex to start downsampling from.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ filterPointsByScalarValue() [1/2]

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.

Parameters
minValminimum value
maxValmaximum value
outsidewhether to select the points inside or outside of the specified interval
Returns
resulting cloud (remaining points)

Referenced by ecvFilterByLabelDlg::apply(), and cloudViewer::geometry::pybind_pointcloud().

◆ filterPointsByScalarValue() [2/2]

ccPointCloud* ccPointCloud::filterPointsByScalarValue ( std::vector< ScalarType >  values,
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.

Parameters
valuesfilter scalar values
outsidewhether to select the points inside or outside of the specified interval
Returns
resulting cloud (remaining points)

◆ From() [1/3]

static ccPointCloud* ccPointCloud::From ( cloudViewer::GenericCloud cloud,
const ccGenericPointCloud sourceCloud = nullptr 
)
static

Creates a new point cloud object from a GenericCloud.

"GenericCloud" is a very simple and light interface from cloudViewer. It is meant to give access to points coordinates of any cloud (on the condition it implements the GenericCloud interface of course). See cloudViewer 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)

Parameters
clouda GenericCloud structure
sourceCloudcloud from which main parameters will be imported (optional)

◆ From() [2/3]

static ccPointCloud* ccPointCloud::From ( const ccPointCloud sourceCloud,
const std::vector< size_t > &  indices,
bool  invert = false 
)
static

Function to select points from input ccPointCloud into output ccPointCloud.

Points with indices in

Parameters
indicesare selected.
sourceCloud.
indicesIndices of points to be selected.
invertSet to True to invert the selection of indices.

◆ From() [3/3]

static ccPointCloud* ccPointCloud::From ( const cloudViewer::GenericIndexedCloud cloud,
const ccGenericPointCloud sourceCloud = nullptr 
)
static

Creates a new point cloud object from a GenericIndexedCloud.

"GenericIndexedCloud" is an extension of GenericCloud (from cloudViewer) which provides a const random accessor to points. See cloudViewer 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)

Parameters
clouda GenericIndexedCloud structure
sourceCloudcloud from which main parameters will be imported (optional)

Referenced by ccCropTool::Crop(), cloudViewer::geometry::pybind_pointcloud(), and ccEntityAction::RansacSegmentation().

◆ fromFile_MeOnly()

bool ccPointCloud::fromFile_MeOnly ( QFile &  in,
short  dataVersion,
int  flags,
LoadedIDMap oldToNewIDMap 
)
overrideprotectedvirtual

Loads own object data.

Called by 'fromFile' (recursive scheme) To be overloaded (but still called ;) by subclass.

Parameters
ininput file
dataVersionfile version
flagsdeserialization flags (see ccSerializableObject::DeserializationFlags)
oldToNewIDMapmap to link old IDs with new IDs

Reimplemented from ccGenericPointCloud.

◆ fwfData() [1/2]

SharedFWFDataContainer& ccPointCloud::fwfData ( )
inline

Gives access to the associated FWF data container.

Definition at line 525 of file ecvPointCloud.h.

Referenced by ccPropertiesTreeDelegate::fillWithPointCloud(), LasWaveformLoader::LasWaveformLoader(), LASFWFFilter::loadFile(), and LASFWFFilter::saveToFile().

◆ fwfData() [2/2]

const SharedFWFDataContainer& ccPointCloud::fwfData ( ) const
inline

Gives access to the associated FWF data container (const version)

Definition at line 527 of file ecvPointCloud.h.

◆ fwfDescriptors() [1/2]

FWFDescriptorSet& ccPointCloud::fwfDescriptors ( )
inline

◆ fwfDescriptors() [2/2]

const FWFDescriptorSet& ccPointCloud::fwfDescriptors ( ) const
inline

Gives access to the FWF descriptors (const version)

Definition at line 512 of file ecvPointCloud.h.

◆ GetAxisAlignedBoundingBox()

virtual ccBBox ccPointCloud::GetAxisAlignedBoundingBox ( ) const
overridevirtual

Returns an axis-aligned bounding box of the geometry.

Reimplemented from ccHObject.

Referenced by cloudViewer::visualization::rendering::PointCloudBuffersBuilder::ComputeAABB().

◆ GetCenter()

virtual Eigen::Vector3d ccPointCloud::GetCenter ( ) const
inlineoverridevirtual

Returns the center of the geometry coordinates.

Reimplemented from ccHObject.

Definition at line 970 of file ecvPointCloud.h.

References Vector3Tpl< PointCoordinateType >::fromArrayContainer().

◆ getClassID()

CV_CLASS_ENUM ccPointCloud::getClassID ( ) const
inlineoverridevirtual

Returns class ID.

Reimplemented from ccHObject.

Definition at line 167 of file ecvPointCloud.h.

References CV_TYPES::POINT_CLOUD.

◆ getCurrentDisplayedScalarField()

◆ getCurrentDisplayedScalarFieldIndex()

◆ getDrawingParameters()

void ccPointCloud::getDrawingParameters ( glDrawParams params) const
overridevirtual

Returns main OpenGL parameters for this entity.

These parameters are deduced from the visibility states of its different features (points, normals, etc.).

Parameters
paramsa glDrawParams structure

Reimplemented from ccDrawableObject.

Referenced by ccSymbolCloud::drawMeOnly().

◆ getEigenColor()

◆ getEigenColors()

std::vector<Eigen::Vector3d> ccPointCloud::getEigenColors ( ) const

◆ getEigenNormal()

◆ getEigenNormals()

std::vector<Eigen::Vector3d> ccPointCloud::getEigenNormals ( ) const

◆ GetMaxBound()

virtual Eigen::Vector3d ccPointCloud::GetMaxBound ( ) const
inlineoverridevirtual

Returns max bounds for geometry coordinates.

Reimplemented from ccHObject.

Definition at line 967 of file ecvPointCloud.h.

References Vector3Tpl< PointCoordinateType >::fromArrayContainer().

◆ GetMinBound()

virtual Eigen::Vector3d ccPointCloud::GetMinBound ( ) const
inlineoverridevirtual

Returns min bounds for geometry coordinates.

Reimplemented from ccHObject.

Definition at line 963 of file ecvPointCloud.h.

References Vector3Tpl< PointCoordinateType >::fromArrayContainer().

◆ getNormal()

const CCVector3* ccPointCloud::getNormal ( unsigned  index) const
overridevirtual

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

◆ getNorms() [1/2]

std::vector<CompressedNormType> ccPointCloud::getNorms ( ) const

◆ getNorms() [2/2]

void ccPointCloud::getNorms ( std::vector< CompressedNormType > &  idxes) const

◆ GetOrientedBoundingBox()

virtual ecvOrientedBBox ccPointCloud::GetOrientedBoundingBox ( ) const
overridevirtual

Reimplemented from ccHObject.

◆ getPointColor()

◆ getPointColorPtr()

ecvColor::Rgb& ccPointCloud::getPointColorPtr ( size_t  pointIndex)

◆ getPointColors()

const ColorsTableType& ccPointCloud::getPointColors ( ) const
inline

◆ getPointDisplayedDistance()

ScalarType ccPointCloud::getPointDisplayedDistance ( unsigned  pointIndex) const
overridevirtual

Returns scalar value associated to a given point.

The returned value is taken from the current displayed scalar field WARNING: scalar field must be enabled! (see ccDrawableObject::hasDisplayedScalarField)

Implements ccGenericPointCloud.

◆ getPointNormal()

const CCVector3& ccPointCloud::getPointNormal ( unsigned  pointIndex) const
overridevirtual

◆ getPointNormalIndex()

const CompressedNormType& ccPointCloud::getPointNormalIndex ( unsigned  pointIndex) const
overridevirtual

Returns compressed normal corresponding to a given point.

WARNING: normals array must be enabled! (see ccDrawableObject::hasNormals)

Implements ccGenericPointCloud.

Referenced by ccTrace::fitPlane().

◆ getPointNormalPtr()

CCVector3& ccPointCloud::getPointNormalPtr ( size_t  pointIndex) const

◆ getPointNormals()

std::vector<CCVector3> ccPointCloud::getPointNormals ( ) const

◆ getPointNormalsPtr()

std::vector<CCVector3*> ccPointCloud::getPointNormalsPtr ( ) const

◆ getPointScalarValueColor()

const ecvColor::Rgb* ccPointCloud::getPointScalarValueColor ( unsigned  pointIndex) const
overridevirtual

Returns color corresponding to a given point associated scalar value.

The returned value depends on the current scalar field display parameters. It may even be 0 if the value shouldn't be displayed. WARNING: scalar field must be enabled! (see ccDrawableObject::hasDisplayedScalarField)

Implements ccGenericPointCloud.

◆ getScalarValueColor()

const ecvColor::Rgb* ccPointCloud::getScalarValueColor ( ScalarType  d) const
overridevirtual

Returns color corresponding to a given scalar value.

The returned value depends on the current scalar field display parameters. It may even be 0 if the value shouldn't be displayed. WARNING: scalar field must be enabled! (see ccDrawableObject::hasDisplayedScalarField)

Implements ccGenericPointCloud.

◆ getUniqueIDForDisplay()

unsigned ccPointCloud::getUniqueIDForDisplay ( ) const
overridevirtual

Returns object unqiue ID used for display.

Reimplemented from ccHObject.

◆ grid() [1/2]

Grid::Shared& ccPointCloud::grid ( size_t  gridIndex)
inline

Returns an associated grid.

Definition at line 443 of file ecvPointCloud.h.

Referenced by ccPropertiesTreeDelegate::fillWithPointCloud().

◆ grid() [2/2]

const Grid::Shared& ccPointCloud::grid ( size_t  gridIndex) const
inline

Returns an associated grid (const verson)

Definition at line 445 of file ecvPointCloud.h.

◆ gridCount()

size_t ccPointCloud::gridCount ( ) const
inline

Returns the number of associated grids.

Definition at line 441 of file ecvPointCloud.h.

Referenced by ccEntityAction::computeNormals(), ccPropertiesTreeDelegate::fillWithPointCloud(), and ccDBRoot::getSelectedEntities().

◆ hasColors()

bool ccPointCloud::hasColors ( ) const
overridevirtual

Returns whether colors are enabled or not.

Reimplemented from ccDrawableObject.

Referenced by ccRasterizeTool::activeLayerChanged(), MeshWrapper< Real >::addColor(), LasCloudChunk::addLasFieldsToCloud(), ecvPoissonReconDlg::adjustParams(), ccCloudLayersHelper::ccCloudLayersHelper(), ccEntityAction::changeColorLevels(), masc::PointFeature::checkValidity(), GeneralFilters::compute(), cloudViewer::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::visualization::rendering::PointCloudBuffersBuilder::ConstructBuffers(), qPoissonRecon::doAction(), ccEntityAction::enhanceRGBWithIntensities(), cloudViewer::pipelines::integration::ScalableTSDFVolume::ExtractTriangleMesh(), cloudViewer::pipelines::integration::UniformTSDFVolume::ExtractTriangleMesh(), cloudViewer::t::geometry::PointCloud::FromLegacy(), ccDBRoot::gatherRecursiveInformation(), PointCloudWrapper< Real >::getColor(), ccTrace::getSegmentCost(), LasScalarFieldLoader::handleRGBValue(), LasSaveDialog::handleSelectedPointFormatChange(), LasCloudChunk::hasColors(), PointCloudWrapper< Real >::hasColors(), BasePclModule::hasSelectedRGB(), ColorScalarFieldWrapper::isValid(), LasSaver::LasSaver(), DRCFilter::loadFile(), LASFilter::loadFile(), ccColorFromScalarDlg::onApply(), MinimumCutSegmentation::openInputDialog(), RegionGrowingSegmentation::openInputDialog(), ccTrace::optimizeSegment(), cloudViewer::pipelines::registration::RegistrationColoredICP(), ccEntityAction::rgbGaussianFilter(), ccEntityAction::rgbToGreyScale(), LasSaver::saveNextPoint(), SaveScan(), PcdFilter::saveToFile(), LASFWFFilter::saveToFile(), LasDetails::SelectBestVersion(), cloudViewer::io::rpc::SetPointCloud(), ccEntityAction::sfFromColor(), ecvPoissonReconDlg::start(), cloudViewer::io::WritePointCloudToPLY(), cloudViewer::io::WritePointCloudToPTS(), and cloudViewer::io::WritePointCloudToXYZRGB().

◆ HasCovariances()

bool ccPointCloud::HasCovariances ( ) const
inline

Returns 'true' if the point cloud contains per-point covariance matrix.

Definition at line 988 of file ecvPointCloud.h.

Referenced by cloudViewer::pipelines::registration::TransformationEstimationForGeneralizedICP::ComputeTransformation(), and cloudViewer::geometry::pybind_pointcloud().

◆ hasDisplayedScalarField()

bool ccPointCloud::hasDisplayedScalarField ( ) const
overridevirtual

Returns whether an active scalar field is available or not.

Reimplemented from ccDrawableObject.

Referenced by LasCloudChunk::addLasFieldsToCloud(), ccTrace::getSegmentCost(), and ccEntityAction::rgbGaussianFilter().

◆ hasFWF()

bool ccPointCloud::hasFWF ( ) const

◆ hasNormals()

bool ccPointCloud::hasNormals ( ) const
overridevirtual

Returns whether normals are enabled or not.

Reimplemented from ccDrawableObject.

Referenced by MeshWrapper< Real >::addNormal(), cloudViewer::pipelines::registration::CorrespondenceCheckerBasedOnNormal::Check(), masc::PointFeature::checkValidity(), NormalEstimation::compute(), ProjectionFilter::compute(), GreedyTriangulation::compute(), MarchingCubeReconstruction::compute(), PoissonReconstruction::compute(), FastGlobalRegistrationFilter::compute(), qM3C2Process::Compute(), cloudViewer::pipelines::registration::TransformationEstimationPointToPlane::ComputeRMSE(), cloudViewer::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::pipelines::registration::TransformationEstimationPointToPlane::ComputeTransformation(), cloudViewer::visualization::rendering::PointCloudBuffersBuilder::ConstructBuffers(), convert(), ccEntityAction::convertNormalsTo(), qFacets::createFacets(), qPoissonRecon::doAction(), ccEntityAction::exportNormalToSF(), qFacets::extractFacets(), ccTrace::fitPlane(), cloudViewer::t::geometry::PointCloud::FromLegacy(), ccDBRoot::gatherRecursiveInformation(), PointCloudWrapper< Real >::getNormal(), qM3C2Dialog::getNormalsComputationMode(), FastGlobalRegistrationFilter::getParametersFromDialog(), ccTrace::getPointNormal(), PointCloudWrapper< Real >::hasNormals(), StereogramWidget::init(), ccEntityAction::invertNormals(), NormDipAndDipDirFieldWrapper::isValid(), DRCFilter::loadFile(), ccEntityAction::orientNormalsFM(), ccEntityAction::orientNormalsMST(), CommandOctreeNormal::process(), CommandInvertNormal::process(), CommandConvertNormalsToDipAndDipDir::process(), CommandConvertNormalsToSFs::process(), CommandOrientNormalsMST::process(), cloudViewer::visualization::MessageProcessor::ProcessMessage(), cloudViewer::pipelines::registration::RegistrationColoredICP(), cloudViewer::pipelines::registration::RegistrationICP(), masc::PointFeature::retrieveField(), SaveScan(), PcdFilter::saveToFile(), cloudViewer::io::rpc::SetPointCloud(), StereogramDialog::updateFacetsFilter(), qM3C2Dialog::updateNormalComboBox(), cloudViewer::io::WritePointCloudToPLY(), and cloudViewer::io::WritePointCloudToXYZN().

◆ hasScalarFields()

◆ hasSensor()

bool ccPointCloud::hasSensor ( ) const

Returns whether the mesh as an associated sensor or not.

Referenced by ccComparisonDlg::ccComparisonDlg(), ccEntityAction::computeNormals(), and cloudViewer::geometry::pybind_pointcloud().

◆ HiddenPointRemoval()

std::tuple<std::shared_ptr<ccMesh>, std::vector<size_t> > ccPointCloud::HiddenPointRemoval ( const Eigen::Vector3d &  camera_location,
const double  radius 
) const

This is an implementation of the Hidden Point Removal operator described in Katz et. al. 'Direct Visibility of Point Sets', 2007.

Additional information about the choice of radius for noisy point clouds can be found in Mehra et. al. 'Visibility of Noisy Point Cloud Data', 2010.

Parameters
camera_locationAll points not visible from that location will be removed.
radiusThe radius of the sperical projection.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ hidePointsByScalarValue() [1/2]

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.

Parameters
minValminimum value (below, points are hidden)
maxValmaximum value (above, points are hidden)

Referenced by ecvFilterByLabelDlg::apply(), and cloudViewer::geometry::pybind_pointcloud().

◆ hidePointsByScalarValue() [2/2]

void ccPointCloud::hidePointsByScalarValue ( std::vector< ScalarType >  values)

Hides points whose scalar values falls into an interval.

Values are taken from the current OUTPUT scalar field.

Parameters
valuesscalar values (equal, points are hidden)

◆ initLOD()

bool ccPointCloud::initLOD ( )

Intializes the LOD structure.

Returns
success

◆ interpolateColorsFrom()

bool ccPointCloud::interpolateColorsFrom ( ccGenericPointCloud cloud,
cloudViewer::GenericProgressCallback progressCb = nullptr,
unsigned char  octreeLevel = 0 
)

Interpolate colors from another cloud (nearest neighbor only)

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ invalidateBoundingBox()

void ccPointCloud::invalidateBoundingBox ( )
overridevirtual

◆ invertNormals()

void ccPointCloud::invertNormals ( )

◆ IsEmpty()

virtual bool ccPointCloud::IsEmpty ( ) const
inlineoverridevirtual

Reimplemented from ccHObject.

Definition at line 961 of file ecvPointCloud.h.

Referenced by cloudViewer::geometry::pybind_pointcloud(), and cloudViewer::io::WritePointCloudToPLY().

◆ minimumFileVersion_MeOnly()

short ccPointCloud::minimumFileVersion_MeOnly ( ) const
overrideprotectedvirtual

Returns the minimum file version required to save this instance's own data To be overloaded (but still called ;) by subclass. Used internally by minimumFileVersion() to compute the overall minimum.

Reimplemented from ccGenericPointCloud.

◆ NormalizeNormals()

ccPointCloud& ccPointCloud::NormalizeNormals ( )

Normalize point normals to length 1.`.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ normals()

NormsIndexesTableType* ccPointCloud::normals ( ) const
inline

Returns pointer on compressed normals indexes table.

Definition at line 917 of file ecvPointCloud.h.

Referenced by qM3C2Process::Compute().

◆ normalsAvailable()

bool ccPointCloud::normalsAvailable ( ) const
inlineoverridevirtual

Returns whether normals are available.

Reimplemented from cloudViewer::GenericIndexedCloud.

Definition at line 566 of file ecvPointCloud.h.

◆ normalsHaveChanged()

void ccPointCloud::normalsHaveChanged ( )
inline

Notify a modification of normals display parameters or contents.

Definition at line 280 of file ecvPointCloud.h.

Referenced by ccCompass::estimateStructureNormals(), and cloudViewer::geometry::pybind_pointcloud().

◆ notifyGeometryUpdate()

void ccPointCloud::notifyGeometryUpdate ( )
overrideprotectedvirtual

Notifies all dependent entities that the geometry of this entity has changed

Reimplemented from ccHObject.

◆ operator+()

ccPointCloud ccPointCloud::operator+ ( const ccPointCloud cloud) const
inline

Definition at line 252 of file ecvPointCloud.h.

◆ operator+=() [1/2]

const ccPointCloud& ccPointCloud::operator+= ( ccPointCloud )

◆ operator+=() [2/2]

const ccPointCloud& ccPointCloud::operator+= ( const ccPointCloud cloud)

◆ operator=()

ccPointCloud& ccPointCloud::operator= ( const ccPointCloud cloud)

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.

◆ OrientNormalsConsistentTangentPlane()

void ccPointCloud::OrientNormalsConsistentTangentPlane ( size_t  k)

Function to consistently orient estimated normals based on consistent tangent planes as described in Hoppe et al., "Surface Reconstruction from Unorganized Points", 1992.

Parameters
kk nearest neighbour for graph reconstruction for normal propagation.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ OrientNormalsToAlignWithDirection()

bool ccPointCloud::OrientNormalsToAlignWithDirection ( const Eigen::Vector3d &  orientation_reference = Eigen::Vector3d(0.0, 0.0, 1.0))

Function to orient the normals of a point cloud.

Parameters
orientation_referenceNormals are oriented with respect to orientation_reference.

Referenced by convert(), and cloudViewer::geometry::pybind_pointcloud().

◆ OrientNormalsTowardsCameraLocation()

bool ccPointCloud::OrientNormalsTowardsCameraLocation ( const Eigen::Vector3d &  camera_location = Eigen::Vector3d::Zero())

Function to orient the normals of a point cloud.

Parameters
camera_locationNormals are oriented with towards the camera_location.

Referenced by convert(), and cloudViewer::geometry::pybind_pointcloud().

◆ orientNormalsTowardViewPoint()

bool ccPointCloud::orientNormalsTowardViewPoint ( CCVector3 VP,
ecvProgressDialog pDlg = nullptr 
)

Normals are forced to point to O.

Referenced by define_ccPointCloud().

◆ orientNormalsWithFM()

bool ccPointCloud::orientNormalsWithFM ( unsigned char  level,
ecvProgressDialog pDlg = nullptr 
)

Orient normals with Fast Marching.

Referenced by define_ccPointCloud(), and ccEntityAction::orientNormalsFM().

◆ orientNormalsWithGrids()

bool ccPointCloud::orientNormalsWithGrids ( ecvProgressDialog pDlg = nullptr)

Orient the normals with the associated grid structure(s)

◆ orientNormalsWithMST()

bool ccPointCloud::orientNormalsWithMST ( unsigned  kNN = 6,
ecvProgressDialog pDlg = nullptr 
)

Orient the normals with a Minimum Spanning Tree.

Referenced by define_ccPointCloud(), ccEntityAction::orientNormalsMST(), and CommandOrientNormalsMST::process().

◆ PaintUniformColor()

ccPointCloud& ccPointCloud::PaintUniformColor ( const Eigen::Vector3d &  color)

Assigns each vertex in the ccMesh the same color.

Parameters
colorRGB colors of vertices.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ partialClone()

ccPointCloud* ccPointCloud::partialClone ( const cloudViewer::ReferenceCloud selection,
int *  warnings = nullptr,
bool  withChildEntities = true 
) 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.

Parameters
[in]selectiona ReferenceCloud structure (pointing to source)
[out]warnings[optional] to determine if warnings (CTOR_ERRORS) occurred during the duplication process
[in]withChildEntitieswhether child entities should be transferred as well (see ccHObjectCaster::CloneChildren)

Referenced by qFacets::createFacets(), ccCropTool::Crop(), qCSF::doAction(), qCanupoPlugin::doClassifyAction(), GrainsAsEllipsoids::fitEllipsoidToGrain(), G3Point::G3PointAction::getBorders(), getMortarMaps(), KNNRegions(), masc::CorePoints::prepare(), CommandSubsample::process(), CommandExtractCCs::process(), CommandSORFilter::process(), CommandCPS::process(), CommandCSF::process(), cloudViewer::geometry::pybind_pointcloud(), and GrainsAsEllipsoids::updateMeshAndLineSet().

◆ pointsHaveChanged()

void ccPointCloud::pointsHaveChanged ( )
inline

Notify a modification of points display parameters or contents.

Definition at line 284 of file ecvPointCloud.h.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ RandomDownSample()

std::shared_ptr<ccPointCloud> ccPointCloud::RandomDownSample ( double  sampling_ratio) const

Function to downsample input pointcloud into output pointcloud randomly.

The sample is performed by randomly selecting the index of the points in the pointcloud.

Parameters
sampling_ratioSampling ratio, the ratio of sample to total number of points in the pointcloud.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ refreshBB()

void ccPointCloud::refreshBB ( )
inlineoverridevirtual

Forces bounding-box update.

Implements ccGenericPointCloud.

Definition at line 603 of file ecvPointCloud.h.

Referenced by DistanceMapGenerationTool::ConvertCloudToConical(), and DistanceMapGenerationTool::ConvertCloudToCylindrical().

◆ releaseVBOs()

void ccPointCloud::releaseVBOs ( )
protected

Release VBOs.

◆ removeGrids()

void ccPointCloud::removeGrids ( )
inline

Remove all associated grids.

Definition at line 458 of file ecvPointCloud.h.

◆ RemoveNonFinitePoints()

ccPointCloud& ccPointCloud::RemoveNonFinitePoints ( bool  remove_nan = true,
bool  remove_infinite = true 
)

Remove all points fromt he point cloud that have a nan entry, or infinite entries.

Also removes the corresponding normals and color entries.

Parameters
remove_nanRemove NaN values from the ccPointCloud.
remove_infiniteRemove infinite values from the ccPointCloud.

Referenced by cloudViewer::geometry::pybind_pointcloud(), and cloudViewer::io::ReadPointCloud().

◆ removePoints()

virtual void ccPointCloud::removePoints ( size_t  index)
overrideprotectedvirtual

Implements ccGenericPointCloud.

◆ RemoveRadiusOutliers()

std::tuple<std::shared_ptr<ccPointCloud>, std::vector<size_t> > ccPointCloud::RemoveRadiusOutliers ( size_t  nb_points,
double  search_radius 
) const

Function to remove points that have less than nb_points in a sphere of a given radius.

Parameters
nb_pointsNumber of points within the radius.
search_radiusRadius of the sphere.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ RemoveStatisticalOutliers()

std::tuple<std::shared_ptr<ccPointCloud>, std::vector<size_t> > ccPointCloud::RemoveStatisticalOutliers ( size_t  nb_neighbors,
double  std_ratio 
) const

Function to remove points that are further away from their nb_neighbor neighbors in average.

Parameters
nb_neighborsNumber of neighbors around the target point.
std_ratioStandard deviation ratio.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ removeVisiblePoints()

bool ccPointCloud::removeVisiblePoints ( VisibilityTableType visTable = nullptr,
std::vector< int > *  newIndexes = nullptr 
)
overridevirtual

Removes all the 'visible' points (as defined by the visibility array)

Parameters
visTablevisibility table (optional, otherwise the cloud's default one will be used)
newIndexesoptional: stores the new indexes of the points (either an index >= 0 if kept, or -1 if not). Must be initially empty or have the same size as the original cloud.
Returns
success

Implements ccGenericPointCloud.

◆ reserve()

bool ccPointCloud::reserve ( unsigned  numberOfPoints)
overridevirtual

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.

Returns
true if ok, false if there's not enough memory

Reimplemented from cloudViewer::PointCloudTpl< ccGenericPointCloud >.

Reimplemented in ccSymbolCloud.

Referenced by ccPointPairRegistrationDlg::addAlignedPoint(), qCanupo2DViewDialog::addOrSelectPoint(), ccGraphicalSegmentationTool::addPointToPolyline(), ccPointPairRegistrationDlg::addReferencePoint(), ccTracePolylineTool::ccTracePolylineTool(), MeshWrapper< Real >::checkVertexCapacity(), qVoxFallProcess::Compute(), ccEntityAction::computeNormals(), ccTopologyRelation::constructGraphic(), DistanceMapGenerationTool::ConvertConicalMapToMesh(), DistanceMapGenerationTool::ConvertMapToCloud(), DistanceMapGenerationTool::ConvertProfileToMesh(), ccGraphicalSegmentationTool::doActionUseExistingPolyline(), ccCompass::estimateP21(), ccCompass::estimateStructureNormals(), ccPointListPickingDlg::exportToNewCloud(), ccPointListPickingDlg::exportToNewPolyline(), ccContourExtractor::ExtractConcaveHull2D(), ccContourExtractor::ExtractFlatContour(), FromFbxMesh(), ccRasterizeTool::generateContours(), GetConeProfile(), FastGlobalRegistrationFilter::getParametersFromDialog(), STEPFilter::importStepFile(), ProfileLoader::Load(), LoadCloud(), CSVMatrixFilter::loadFile(), SalomeHydroFilter::loadFile(), SinusxFilter::loadFile(), LASFWFFilter::loadFile(), RDBFilter::loadFile(), LoadScan(), ccTracePolylineTool::onItemPicked(), masc::ContextBasedFeature::prepare(), CommandCrop2D::process(), cloudViewer::geometry::pybind_pointcloud(), ccSymbolCloud::reserve(), qCanupo2DViewDialog::resetBoundary(), DistanceMapGenerationDlg::toggleOverlayGrid(), Cloth::toMesh(), qCanupoTools::TrainClassifier(), and GrainsAsEllipsoids::updateMeshAndLineSet().

◆ reserveTheFWFTable()

bool ccPointCloud::reserveTheFWFTable ( )

Reserves the FWF table.

◆ reserveTheNormsTable()

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

Returns
true if ok, false if there's not enough memory

Referenced by MeshWrapper< Real >::addNormal(), define_ccPointCloud(), ccCompass::estimateStructureNormals(), FromFbxMesh(), LoadCloud(), RDBFilter::loadFile(), LoadScan(), cloudViewer::visualization::MessageProcessor::ProcessMessage(), cloudViewer::geometry::pybind_pointcloud(), cloudViewer::io::ReadModelUsingAssimp(), cloudViewer::io::ReadPointCloudFromPLY(), and cloudViewer::t::geometry::PointCloud::ToLegacy().

◆ reserveThePointsTable()

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.

Parameters
_numberOfPointsnumber of points to reserve the memory for
Returns
true if ok, false if there's not enough memory

Referenced by contourPoly(), contourPoly2(), define_ccPointCloud(), ccMeasurementDevice::fitPlaneToPoints(), cloudViewer::t::geometry::FromLegacyPointCloud(), getDensity(), getMortarMaps(), SoiFilter::loadFile(), DistanceMapGenerationDlg::loadOverlaySymbols(), cloudViewer::visualization::MessageProcessor::ProcessMessage(), cloudViewer::geometry::pybind_pointcloud(), cloudViewer::io::ReadModelUsingAssimp(), cloudViewer::io::ReadTriangleMeshFromOBJ(), LasCloudChunk::reserveSize(), rotY(), and cloudViewer::t::geometry::PointCloud::ToLegacy().

◆ reserveTheRGBTable()

bool ccPointCloud::reserveTheRGBTable ( )

◆ resize()

◆ resizeTheFWFTable()

bool ccPointCloud::resizeTheFWFTable ( )

Resizes the FWF table.

◆ resizeTheNormsTable()

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 (effictively 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. WARNING: don't try to "add" any element on a resized array...

Returns
true if ok, false if there's not enough memory

Referenced by qM3C2Process::Compute(), define_ccPointCloud(), qHoughNormals::doAction(), cloudViewer::io::ReadTriangleMeshFromOBJ(), and cloudViewer::io::ReadTriangleMeshFromPLY().

◆ resizeTheRGBTable()

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). WARNING: don't try to "add" any element on a resized array...

Parameters
fillWithWhitewhether to fill new array elements with zeros (false) or white color (true)
Returns
true if ok, false if there's not enough memory

Referenced by ccCloudLayersHelper::ccCloudLayersHelper(), ccCropTool::Crop(), GrainsAsEllipsoids::exportResultsAsCloud(), ccColorFromScalarDlg::onApply(), cloudViewer::geometry::pybind_pointcloud(), cloudViewer::io::ReadPointCloudFromPLY(), cloudViewer::io::ReadPointCloudFromPTS(), cloudViewer::io::ReadTriangleMeshFromPLY(), cloudViewer::pipelines::color_map::SetGeometryColorAverage(), ccEntityAction::sfConvertToRandomRGB(), and GrainsAsEllipsoids::updateMeshAndLineSet().

◆ rgbColors()

ColorsTableType* ccPointCloud::rgbColors ( ) const
inline

Returns pointer on RGB colors table.

Definition at line 914 of file ecvPointCloud.h.

Referenced by ccCloudLayersHelper::ccCloudLayersHelper(), and ccCloudLayersHelper::~ccCloudLayersHelper().

◆ Rotate()

virtual ccPointCloud& ccPointCloud::Rotate ( const Eigen::Matrix3d &  R,
const Eigen::Vector3d &  center 
)
overridevirtual

Apply rotation to the geometry coordinates and normals. Given a rotation matrix $R$, and center $c$, a given point $p$ is transformed according to $R (p - c) + c$.

Parameters
RA 3x3 rotation matrix
centerRotation center that is used for the rotation.

Reimplemented from ccHObject.

◆ Scale()

virtual ccPointCloud& ccPointCloud::Scale ( const double  s,
const Eigen::Vector3d &  center 
)
overridevirtual

Apply scaling to the geometry coordinates. Given a scaling factor $s$, and center $c$, a given point $p$ is transformed according to $s (p - c) + c$.

Parameters
scaleThe scale parameter that is multiplied to the points/vertices of the geometry.
centerScale center that is used to resize the geometry.

Reimplemented from ccHObject.

◆ scale()

virtual void ccPointCloud::scale ( PointCoordinateType  fx,
PointCoordinateType  fy,
PointCoordinateType  fz,
CCVector3  center = CCVector3(0, 0, 0) 
)
overridevirtual

Multiplies all coordinates by constant factors (one per dimension)

WARNING: attached octree may be deleted.

Parameters
fxmultiplication factor along the X dimension
fymultiplication factor along the Y dimension
fzmultiplication factor along the Z dimension
centerscaling center (0,0,0) by default

Implements ccGenericPointCloud.

Referenced by getMortarMaps().

◆ SegmentPlane()

std::tuple<Eigen::Vector4d, std::vector<size_t> > ccPointCloud::SegmentPlane ( const double  distance_threshold = 0.01,
const int  ransac_n = 3,
const int  num_iterations = 100 
) const

Segment ccPointCloud plane using the RANSAC algorithm.

Parameters
distance_thresholdMax distance a point can be from the plane model, and still be considered an inlier.
ransac_nNumber of initial points to be considered inliers in each iteration.
num_iterationsNumber of iterations.
Returns
Returns the plane model ax + by + cz + d = 0 and the indices of the plane inliers.

Referenced by cloudViewer::geometry::pybind_pointcloud(), and ccEntityAction::RansacSegmentation().

◆ SelectByIndex()

std::shared_ptr<ccPointCloud> ccPointCloud::SelectByIndex ( const std::vector< size_t > &  indices,
bool  invert = false 
) const

Function to select points from input ccPointCloud into output ccPointCloud.

Points with indices in

Parameters
indicesare selected.
indicesIndices of points to be selected.
invertSet to True to invert the selection of indices.

Referenced by convert(), cloudViewer::t::geometry::LegacySelectByIndex(), and cloudViewer::geometry::pybind_pointcloud().

◆ setCoordFromSF()

bool ccPointCloud::setCoordFromSF ( bool  importDims[3],
cloudViewer::ScalarField sf,
PointCoordinateType  defaultValueForNaN 
)

Sets coordinate(s) from a scalar field.

Referenced by ccEntityAction::sfSetAsCoord().

◆ setCurrentDisplayedScalarField()

void ccPointCloud::setCurrentDisplayedScalarField ( int  index)

Sets the currently displayed scalar field.

Warning: this scalar field will automatically be set as the OUTPUT one!

Referenced by ccRasterizeTool::activeLayerChanged(), LasCloudChunk::addLasFieldsToCloud(), ccScalarFieldArithmeticsDlg::Apply(), ccComparisonDlg::applyAndExit(), ccLibAlgorithms::ApplyCCLibAlgorithm(), ccComparisonDlg::cancelAndExit(), ccColorFromScalarDlg::ccColorFromScalarDlg(), masc::Classifier::classify(), qCanupoProcess::Classify(), qM3C2Process::Compute(), qVoxFallProcess::Compute(), ccComparisonDlg::computeApproxDistances(), ccComparisonDlg::computeDistances(), ccLibAlgorithms::ComputeGeomCharacteristic(), DistanceMapGenerationTool::ComputeRadialDist(), ccVolumeCalcTool::convertGridToCloud(), ccVolumeCalcTool::ConvertGridToCloud(), ccRasterizeTool::convertGridToCloud(), DistanceMapGenerationTool::ConvertMapToCloud(), ccEntityAction::convertNormalsTo(), ccMeasurementDevice::createScalarFieldForCloud(), ccCropTool::Crop(), define_ccPointCloud(), qPCV::doAction(), qPoissonRecon::doAction(), ccCompass::estimateStructureNormals(), masc::Classifier::evaluate(), qFacets::extractFacets(), TreeIso::Final_seg_pcd(), ccRasterizeTool::generateHillshade(), getMortarMaps(), ccEntityAction::importToSF(), TreeIso::Init_seg_pcd(), TreeIso::Intermediate_seg_pcd(), ccEntityAction::interpolateSFs(), ccCloudLayersHelper::keepCurrentSFVisible(), LoadCloud(), LASFWFFilter::loadFile(), RDBFilter::loadFile(), LoadScan(), CommandSFConvertToRGB::process(), CommandStatTest::process(), CommandICP::process(), CommandRasterize::process(), PCVCommand::Process(), cloudViewer::geometry::pybind_pointcloud(), CommandRemoveSF::removeSF(), ccEntityAction::rgbGaussianFilter(), ccEntityAction::sfAddIdField(), ccEntityAction::sfGaussianFilter(), and ccEntityAction::statisticalTest().

◆ setEigenColor()

void ccPointCloud::setEigenColor ( size_t  index,
const Eigen::Vector3d &  color 
)

◆ setEigenColors()

void ccPointCloud::setEigenColors ( const std::vector< Eigen::Vector3d > &  colors)

◆ setEigenNormal()

void ccPointCloud::setEigenNormal ( size_t  index,
const Eigen::Vector3d &  normal 
)

◆ setEigenNormals()

void ccPointCloud::setEigenNormals ( const std::vector< Eigen::Vector3d > &  normals)

◆ setNormsTable()

void ccPointCloud::setNormsTable ( NormsIndexesTableType norms)

Sets the (compressed) normals table.

Referenced by qM3C2Process::Compute().

◆ setPointColor() [1/3]

◆ setPointColor() [2/3]

void ccPointCloud::setPointColor ( size_t  pointIndex,
const ecvColor::Rgba col 
)

◆ setPointColor() [3/3]

void ccPointCloud::setPointColor ( size_t  pointIndex,
const Eigen::Vector3d &  col 
)

◆ setPointNormal()

void ccPointCloud::setPointNormal ( size_t  pointIndex,
const CCVector3 N 
)

Sets a particular point normal (shortcut)

WARNING: normals must be enabled. Normal is automatically compressed before storage.

Referenced by ComputeM3C2DistForPoint(), define_ccPointCloud(), qHoughNormals::doAction(), ccCompass::estimateStructureNormals(), and cloudViewer::io::ReadTriangleMeshFromOBJ().

◆ setPointNormalIndex()

void ccPointCloud::setPointNormalIndex ( size_t  pointIndex,
CompressedNormType  norm 
)

Sets a particular point compressed normal.

WARNING: normals must be enabled.

Referenced by qM3C2Process::Compute().

◆ setPointNormals()

void ccPointCloud::setPointNormals ( const std::vector< CCVector3 > &  normals)

◆ setRGBColor() [1/2]

bool ccPointCloud::setRGBColor ( ColorCompType  r,
ColorCompType  g,
ColorCompType  b 
)
inline

Set a unique color for the whole cloud (shortcut)

Color array is automatically allocated if necessary.

Parameters
rred component
ggreen component
bblue component
Returns
success

Definition at line 778 of file ecvPointCloud.h.

Referenced by ccCloudLayersHelper::apply(), ExtractSIFT::compute(), GeneralFilters::compute(), ProjectionFilter::compute(), CorrespondenceMatching::compute(), TemplateAlignment::compute(), and ccEntityAction::setColor().

◆ setRGBColor() [2/2]

bool ccPointCloud::setRGBColor ( const ecvColor::Rgb col)

Set a unique color for the whole cloud.

Color array is automatically allocated if necessary.

Parameters
colRGB color (size: 3)
Returns
success

◆ setRGBColorByBanding()

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.

Parameters
dimbanding dimension (0:X, 1:Y, 2:Z)
freqbanding frequency
Returns
success

Referenced by CommandColorBanding::process(), cloudViewer::geometry::pybind_pointcloud(), and ccEntityAction::setColorGradient().

◆ setRGBColorByHeight()

bool ccPointCloud::setRGBColorByHeight ( unsigned char  heightDim,
ccColorScale::Shared  colorScale 
)

Assigns color to points proportionnaly to their 'height'.

Height is defined wrt to the specified dimension (heightDim). Color array is automatically allocated if necessary.

Parameters
heightDimramp dimension (0:X, 1:Y, 2:Z)
colorScalecolor scale to use
Returns
success

Referenced by ccEntityAction::setColorGradient().

◆ setRGBColorWithCurrentScalarField()

bool ccPointCloud::setRGBColorWithCurrentScalarField ( bool  mixWithExistingColor = false)

Sets RGB colors with current scalar field (values & parameters)

Returns
success

Referenced by cloudViewer::geometry::pybind_pointcloud(), and ccEntityAction::sfConvertToRGB().

◆ sfColorScaleShown()

bool ccPointCloud::sfColorScaleShown ( ) const

Returns whether color scale should be displayed or not.

Referenced by define_ccPointCloud(), ccPropertiesTreeDelegate::fillSFWithPointCloud(), and cloudViewer::geometry::pybind_pointcloud().

◆ showSFColorsScale()

void ccPointCloud::showSFColorsScale ( bool  state)

◆ shrinkToFit()

◆ swapPoints()

void ccPointCloud::swapPoints ( unsigned  firstIndex,
unsigned  secondIndex 
)
overrideprotectedvirtual
Warning
Doesn't handle scan grids!

Reimplemented from cloudViewer::PointCloudTpl< ccGenericPointCloud >.

◆ testVisibility()

unsigned char ccPointCloud::testVisibility ( const CCVector3 P) const
overridevirtual

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

◆ toFile_MeOnly()

bool ccPointCloud::toFile_MeOnly ( QFile &  out,
short  dataVersion 
) const
overrideprotectedvirtual

Save own object data.

Called by 'toFile' (recursive scheme) To be overloaded (but still called ;) by subclass.

Parameters
outoutput file
dataVersiontarget file version for compatibility control

Reimplemented from ccGenericPointCloud.

◆ Transform()

◆ Translate() [1/2]

ccPointCloud& ccPointCloud::Translate ( const CCVector3 T)
inline

Definition at line 979 of file ecvPointCloud.h.

References Vector3Tpl< double >::fromArray().

◆ Translate() [2/2]

virtual ccPointCloud& ccPointCloud::Translate ( const Eigen::Vector3d &  translation,
bool  relative = true 
)
overridevirtual

Apply translation to the geometry coordinates.

Parameters
translationA 3D vector to transform the geometry.
relativeIf true, the translation is directly applied to the geometry. Otherwise, the geometry center is moved to the translation.

Reimplemented from ccHObject.

Referenced by getMortarMaps().

◆ triangulateGrid()

ccMesh* ccPointCloud::triangulateGrid ( const Grid grid,
double  minTriangleAngle_deg = 0.0 
) const

Meshes a scan grid.

Warning
The mesh vertices will be this cloud instance!

◆ unalloactePoints()

void ccPointCloud::unalloactePoints ( )

Erases the cloud points.

Prefer ccPointCloud::clear by default.

Warning
DANGEROUS

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ unallocateColors()

◆ unallocateNorms()

◆ UniformDownSample()

std::shared_ptr<ccPointCloud> ccPointCloud::UniformDownSample ( size_t  every_k_points) const

Function to downsample input ccPointCloud into output ccPointCloud uniformly.

The sample is performed in the order of the points with the 0-th point always chosen, not at random.

Parameters
every_k_pointsSample rate, the selected point indices are [0, k, 2k].

Referenced by convert(), and cloudViewer::geometry::pybind_pointcloud().

◆ unroll()

ccPointCloud* ccPointCloud::unroll ( UnrollMode  mode,
UnrollBaseParams params,
bool  exportDeviationSF = false,
double  startAngle_deg = 0.0,
double  stopAngle_deg = 360.0,
cloudViewer::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 CCLib, apart that it can also handle the cloud normals.

Parameters
modeunrolling mode
paramsunrolling parameters (must match the unrolling mode)
exportDeviationSFto export the deviation fro the ideal cone as a scalar field
startAngle_degstart angle (in degrees) - 0 corresponds to +X (east)
stopAngle_degstop angle (in degrees)
progressCbfor progress notification
Returns
the unrolled point cloud

◆ VoxelDownSample()

std::shared_ptr<ccPointCloud> ccPointCloud::VoxelDownSample ( double  voxel_size)

Function to downsample input ccPointCloud into output ccPointCloud with a voxel.

Normals and colors are averaged if they exist.

Parameters
voxel_sizeDefines the resolution of the voxel grid, smaller value leads to denser output point cloud.

Referenced by convert(), cloudViewer::visualization::VisualizerWithEditing::KeyPressCallback(), cloudViewer::t::geometry::LegacyEstimateNormals(), cloudViewer::t::geometry::LegacyRemoveRadiusOutliers(), cloudViewer::t::geometry::LegacyRemoveStatisticalOutliers(), cloudViewer::pipelines::registration::LoadPointCloud(), and cloudViewer::geometry::pybind_pointcloud().

◆ VoxelDownSampleAndTrace()

std::tuple<std::shared_ptr<ccPointCloud>, Eigen::MatrixXi, std::vector<std::vector<int> > > ccPointCloud::VoxelDownSampleAndTrace ( double  voxel_size,
const Eigen::Vector3d &  min_bound,
const Eigen::Vector3d &  max_bound,
bool  approximate_class = false 
) const

Function to downsample using geometry.ccPointCloud.VoxelDownSample.

Also records point cloud index before downsampling.

Parameters
voxel_sizeVoxel size to downsample into.
min_boundMinimum coordinate of voxel boundaries
max_boundMaximum coordinate of voxel boundaries
approximate_classWhether to approximate.

Referenced by cloudViewer::geometry::pybind_pointcloud().

◆ waveformProxy()

ccWaveformProxy ccPointCloud::waveformProxy ( unsigned  index) const

Returns a proxy on a given waveform.

Referenced by ccWaveWidget::init(), ccWaveDialog::onExportWaveAsCSV(), and LASFWFFilter::saveToFile().

◆ waveforms() [1/2]

◆ waveforms() [2/2]

const std::vector<ccWaveform>& ccPointCloud::waveforms ( ) const
inline

Gives access to the associated FWF data (const version)

Definition at line 517 of file ecvPointCloud.h.

Member Data Documentation

◆ covariances_

◆ m_currentDisplayedScalarField

ccScalarField* ccPointCloud::m_currentDisplayedScalarField
protected

Currently displayed scalar field.

Definition at line 1348 of file ecvPointCloud.h.

Referenced by ccSNECloud::drawMeOnly().

◆ m_currentDisplayedScalarFieldIndex

int ccPointCloud::m_currentDisplayedScalarFieldIndex
protected

Currently displayed scalar field index.

Definition at line 1350 of file ecvPointCloud.h.

◆ m_fwfData

SharedFWFDataContainer ccPointCloud::m_fwfData
protected

Waveforms raw data storage.

Definition at line 1439 of file ecvPointCloud.h.

◆ m_fwfDescriptors

FWFDescriptorSet ccPointCloud::m_fwfDescriptors
protected

General waveform descriptors.

Definition at line 1433 of file ecvPointCloud.h.

◆ m_fwfWaveforms

std::vector<ccWaveform> ccPointCloud::m_fwfWaveforms
protected

Per-point waveform accessors.

Definition at line 1436 of file ecvPointCloud.h.

◆ m_grids

std::vector<Grid::Shared> ccPointCloud::m_grids
protected

Associated grid structure.

Definition at line 1353 of file ecvPointCloud.h.

◆ m_lod

ccPointCloudLOD* ccPointCloud::m_lod
protected

L.O.D. structure.

Definition at line 1429 of file ecvPointCloud.h.

◆ m_normals

NormsIndexesTableType* ccPointCloud::m_normals
protected

Normals (compressed)

Definition at line 1341 of file ecvPointCloud.h.

◆ m_rgbColors

ColorsTableType* ccPointCloud::m_rgbColors
protected

Colors.

Definition at line 1338 of file ecvPointCloud.h.

◆ m_sfColorScaleDisplayed

bool ccPointCloud::m_sfColorScaleDisplayed
protected

Specifies whether current scalar field color scale should be displayed or not

Definition at line 1345 of file ecvPointCloud.h.

◆ m_vboManager

vboSet ccPointCloud::m_vboManager
protected

Set of VBOs attached to this cloud.

Definition at line 1416 of file ecvPointCloud.h.

◆ m_visibilityCheckEnabled

bool ccPointCloud::m_visibilityCheckEnabled
protected

Whether visibility check is available or not (during comparison)

See ccPointCloud::testVisibility

Definition at line 1358 of file ecvPointCloud.h.


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