qCC_db  version 2.5.4 (Qt) - 19 Apr 2014
 All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ccPointCloud Class Reference

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

#include <ccPointCloud.h>

Inheritance diagram for ccPointCloud:
Inheritance graph
[legend]
Collaboration diagram for ccPointCloud:
Collaboration graph
[legend]

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 }
 Warnings for the partialClone method (bit flags)
 
- Public Types inherited from ccGenericPointCloud
typedef GenericChunkedArray
< 1, uchar > 
VisibilityTableType
 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 = 2, 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.
 
typedef std::vector< ccHObject * > Container
 standard ccHObject container (for children, etc.)
 
- Public Types inherited from ccSerializableObject
enum  DeserializationFlags { DF_POINT_COORDS_64_BITS = 1, DF_SCALAR_VAL_32_BITS = 2 }
 Deserialization flags (bit-field) More...
 

Public Member Functions

 ccPointCloud (QString name=QString()) throw ()
 Default constructor. More...
 
virtual ~ccPointCloud ()
 Default destructor.
 
virtual CC_CLASS_ENUM getClassID () const
 Returns class ID.
 
ccPointCloudpartialClone (const CCLib::ReferenceCloud *selection, int *warnings=0) const
 Creates a new point cloud object from a ReferenceCloud (selection) More...
 
ccPointCloudclone (const CCLib::GenericIndexedCloud *selection)
 Creates a new point cloud object from a GenericIndexedCloud. More...
 
virtual ccPointCloudcloneThis (ccPointCloud *destCloud=0, bool ignoreChildren=false)
 Clones this entity. More...
 
virtual ccGenericPointCloudclone (ccGenericPointCloud *destCloud=0, bool ignoreChildren=false)
 Clones this entity. More...
 
const ccPointCloudoperator+= (ccPointCloud *)
 Fuses another 3D entity with this one. More...
 
virtual void clear ()
 Clears the entity from all its points and features. More...
 
void unallocateColors ()
 Erases the cloud colors.
 
void unallocateNorms ()
 Erases the cloud normals.
 
bool reserveThePointsTable (unsigned _numberOfPoints)
 Reserves memory to store the points coordinates. More...
 
bool reserveTheRGBTable ()
 Reserves memory to store the RGB colors. More...
 
bool resizeTheRGBTable (bool fillWithWhite=false)
 Resizes the RGB colors array. More...
 
bool reserveTheNormsTable ()
 Reserves memory to store the compressed normals. More...
 
bool resizeTheNormsTable ()
 Resizes the compressed normals array. More...
 
virtual bool reserve (unsigned numberOfPoints)
 Reserves memory for all the active features. More...
 
virtual bool resize (unsigned numberOfPoints)
 Resizes all the active features arrays. More...
 
ccScalarFieldgetCurrentDisplayedScalarField () const
 Returns the currently displayed scalar (or 0 if none)
 
int getCurrentDisplayedScalarFieldIndex () const
 Returns the currently displayed scalar field index (or -1 if none)
 
virtual void setCurrentDisplayedScalarField (int index)
 Sets the currently displayed scalar field. More...
 
virtual void deleteScalarField (int index)
 
virtual void deleteAllScalarFields ()
 
bool sfColorScaleShown () const
 Returns whether color scale should be displayed or not.
 
void showSFColorsScale (bool state)
 Sets whether color scale should be displayed or not.
 
CCVector3 computeGravityCenter ()
 Returns the cloud gravity center. More...
 
virtual void getDrawingParameters (glDrawParams &params) const
 Returns main OpenGL paramters for this entity. More...
 
virtual unsigned getUniqueIDForDisplay () const
 Returns object unqiue ID used for display.
 
virtual bool hasColors () const
 Returns whether colors are enabled or not.
 
virtual bool hasNormals () const
 Returns whether normals are enabled or not.
 
virtual bool hasScalarFields () const
 Returns whether one or more scalar fields are instantiated. More...
 
virtual bool hasDisplayedScalarField () const
 Returns whether an active scalar field is available or not.
 
virtual const colorType * getPointScalarValueColor (unsigned pointIndex) const
 Returns color corresponding to a given point associated scalar value. More...
 
virtual const colorType * geScalarValueColor (ScalarType d) const
 Returns color corresponding to a given scalar value. More...
 
virtual ScalarType getPointDisplayedDistance (unsigned pointIndex) const
 Returns scalar value associated to a given point. More...
 
virtual const colorType * getPointColor (unsigned pointIndex) const
 Returns color corresponding to a given point. More...
 
virtual const normsType & getPointNormalIndex (unsigned pointIndex) const
 Returns compressed normal corresponding to a given point. More...
 
virtual const CCVector3 & getPointNormal (unsigned pointIndex) const
 Returns normal corresponding to a given point. More...
 
virtual ccGenericPointCloudcreateNewCloudFromVisibilitySelection (bool removeSelectedPoints=false)
 
virtual void applyRigidTransformation (const ccGLMatrix &trans)
 Applies a rigid transformation (rotation + translation)
 
virtual void refreshBB ()
 Forces bounding-box update.
 
bool interpolateColorsFrom (ccGenericPointCloud *cloud, CCLib::GenericProgressCallback *progressCb=NULL, unsigned char octreeLevel=7)
 Interpolate colors from another cloud.
 
void setPointColor (unsigned pointIndex, const colorType *col)
 Sets a particular point color. More...
 
void setPointNormalIndex (unsigned pointIndex, normsType norm)
 Sets a particular point compressed normal. More...
 
void setPointNormal (unsigned pointIndex, const CCVector3 &N)
 Sets a particular point normal (shortcut) More...
 
void addNormIndex (normsType index)
 Pushes a compressed normal vector. More...
 
void addNorm (const CCVector3 &N)
 Pushes a normal vector on stack (shortcut) More...
 
void addNormAtIndex (const PointCoordinateType *N, unsigned index)
 Adds a normal vector to the one at a specific index. More...
 
void setNormsTable (NormsIndexesTableType *norms)
 Sets the (compressed) normals table.
 
bool convertNormalToRGB ()
 Converts normals to RGB colors. More...
 
bool convertNormalToDipDirSFs (ccScalarField *dipSF, ccScalarField *dipDirSF)
 Converts normals to two scalar fields: 'dip' and 'dip direction'. More...
 
void addRGBColor (colorType r, colorType g, colorType b)
 Pushes an RGB color on stack. More...
 
void addRGBColor (const colorType *C)
 Pushes an RGB color on stack. More...
 
void addGreyColor (colorType g)
 Pushes a grey color on stack. 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, int freq)
 Assigns color to points by 'banding'. More...
 
bool setRGBColorWithCurrentScalarField (bool mixWithExistingColor=false)
 Sets RGB colors with current scalar field (values & parameters) More...
 
bool setRGBColor (colorType r, colorType g, colorType b)
 Set a unique color for the whole cloud (shortcut) More...
 
bool setRGBColor (const colorType *col)
 Set a unique color for the whole cloud. More...
 
void invertNormals ()
 Inverts normals (if any)
 
void translate (const CCVector3 &T)
 Translates cloud. More...
 
void multiply (PointCoordinateType fx, PointCoordinateType fy, PointCoordinateType fz)
 Multiplies all coordinates by a constant factor (per dimension) More...
 
ccPointCloudfilterPointsByScalarValue (ScalarType minVal, ScalarType maxVal)
 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 unrollOnCylinder (PointCoordinateType radius, CCVector3 *center=0, unsigned char dim=2, CCLib::GenericProgressCallback *progressCb=NULL)
 Unrolls the cloud and its normals on a cylinder. More...
 
void unrollOnCone (PointCoordinateType baseRadius, double alpha_deg, const CCVector3 &apex, unsigned char dim=2, CCLib::GenericProgressCallback *progressCb=NULL)
 Unrolls the cloud and its normals on a cone. More...
 
virtual void addColorRampInfo (CC_DRAW_CONTEXT &context)
 Adds associated SF color ramp info to current GL context.
 
virtual int addScalarField (const char *uniqueName)
 
int addScalarField (ccScalarField *sf)
 Adds an existing scalar field to this cloud. More...
 
ColorsTableTypergbColors () const
 Returns pointer on RGB colors table.
 
NormsIndexesTableTypenormals () const
 Returns pointer on compressed normals indexes table.
 
CCLib::ReferenceCloud * crop (const ccBBox &box, bool inside=true)
 Crops the cloud inside (or outside) a boundig box. More...
 
CCLib::ReferenceCloud * crop2D (const ccPolyline *poly, unsigned char orthoDim, bool inside=true)
 Crops the cloud inside (or outside) a 2D polyline. More...
 
- Public Member Functions inherited from ccGenericPointCloud
 ccGenericPointCloud (QString name=QString())
 Default constructor.
 
virtual ~ccGenericPointCloud ()
 Default destructor.
 
virtual ccOctreecomputeOctree (CCLib::GenericProgressCallback *progressCb=NULL)
 Computes the cloud octree. More...
 
virtual ccOctreegetOctree ()
 Returns associated octree.
 
virtual void deleteOctree ()
 Erases the octree.
 
virtual VisibilityTableTypegetTheVisibilityArray ()
 Returns associated visiblity array.
 
virtual CCLib::ReferenceCloud * getTheVisiblePoints () const
 Returns a ReferenceCloud equivalent to the visiblity array.
 
virtual bool isVisibilityTableInstantiated () const
 Returns whether the visiblity array is allocated or not.
 
virtual bool resetVisibilityArray ()
 Resets the associated visiblity array. More...
 
virtual void unallocateVisibilityArray ()
 Erases the points visibility information.
 
virtual uchar testVisibility (const CCVector3 &P)
 
virtual ccBBox getMyOwnBB ()
 Returns the entity bounding-box only. More...
 
void setGlobalShift (double x, double y, double z)
 Sets shift applied to original coordinates (information storage only) More...
 
void setGlobalShift (const CCVector3d &shift)
 Sets shift applied to original coordinates (information storage only) More...
 
const CCVector3d & getGlobalShift () const
 Returns the shift applied to original coordinates. More...
 
void setGlobalScale (double scale)
 Sets the scale applied to original coordinates (information storage only)
 
bool isShifted () const
 Returns whether the cloud is shifted or not.
 
double getGlobalScale () const
 Returns the scale applied to original coordinates. More...
 
template<typename T >
CCVector3d toGlobal3d (const Vector3Tpl< T > &Plocal) const
 Returns the point back-projected into the original coordinates system.
 
template<typename T >
CCVector3d toLocal3d (const Vector3Tpl< T > &Pglobal) const
 Returns the point projected into the local (shifted) coordinates system.
 
template<typename T >
CCVector3 toLocal3pc (const Vector3Tpl< T > &Pglobal) const
 Returns the point projected into the local (shifted) coordinates system.
 
virtual bool isSerializable () const
 Returns whether object is serializable of not.
 
void setPointSize (unsigned size=0)
 Sets point size. More...
 
unsigned char getPointSize () const
 Returns current point size. More...
 
- Public Member Functions inherited from ccHObject
 ccHObject (QString name=QString())
 Default constructor. More...
 
virtual ~ccHObject ()
 Default destructor.
 
virtual QIcon getIcon () const
 Returns the icon associated to this entity. More...
 
ccHObjectgetParent () const
 Returns parent object. 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 (const 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...
 
ccHObjectgetChild (unsigned childPos) const
 Returns the ith child. More...
 
ccHObjectfind (int uniqueID)
 Finds an entity in this object hierarchy. More...
 
unsigned filterChildren (Container &filteredChildren, bool recursive=false, CC_CLASS_ENUM filter=CC_TYPES::OBJECT) const
 Collects the children corresponding to a certain pattern. More...
 
void detachChild (ccHObject *child)
 Detaches a specific child. More...
 
void detatchAllChildren ()
 Removes a specific child. More...
 
void removeChild (ccHObject *child)
 
void removeChild (int pos)
 Removes a specific child given its index. More...
 
void removeAllChildren ()
 Removes all children.
 
int getChildIndex (const ccHObject *aChild) const
 Returns child index.
 
void swapChildren (unsigned firstChildIndex, unsigned secondChildIndex)
 Swaps two children.
 
int getIndex () const
 Returns index relatively to its parent or -1 if no parent.
 
void transferChild (ccHObject *child, ccHObject &newParent)
 Transfer a given child to another parent.
 
void transferChildren (ccHObject &newParent, bool forceFatherDependent=false)
 Transfer all children to another parent.
 
ccHObjectgetFirstChild () const
 Shortcut: returns first child.
 
ccHObjectgetLastChild () const
 Shortcut: returns last child.
 
bool isAncestorOf (const ccHObject *anObject) const
 Returns true if the current object is an ancestor of the specified one.
 
virtual ccBBox getBB (bool relative=true, bool withGLfeatures=false, const ccGenericGLDisplay *window=NULL)
 Returns bounding-box. More...
 
virtual void draw (CC_DRAW_CONTEXT &context)
 Draws entity and its children.
 
virtual bool isDisplayed () const
 Returns whether the object is actually displayed (visible) or not.
 
virtual bool isBranchEnabled () const
 Returns whether the object and all its ancestors are enabled.
 
 ccHObject_recursive_call1 (setSelected, bool, setSelected_recursive)
 
 ccHObject_recursive_call1 (setDisplay, ccGenericGLDisplay *, setDisplay_recursive)
 
 ccHObject_recursive_call1 (removeFromDisplay, ccGenericGLDisplay *, removeFromDisplay_recursive)
 
 ccHObject_recursive_call0 (prepareDisplayForRefresh, prepareDisplayForRefresh_recursive)
 
 ccHObject_recursive_call0 (refreshDisplay, refreshDisplay_recursive)
 
 ccHObject_recursive_call0 (toggleVisibility, toggleVisibility_recursive)
 
 ccHObject_recursive_call0 (toggleColors, toggleColors_recursive)
 
 ccHObject_recursive_call0 (toggleNormals, toggleNormals_recursive)
 
 ccHObject_recursive_call0 (toggleSF, toggleSF_recursive)
 
 ccHObject_recursive_call0 (toggleShowName, toggleShowName_recursive)
 
 ccHObject_recursive_call0 (toggleMaterials, toggleMaterials_recursive)
 
void applyGLTransformation_recursive (ccGLMatrix *trans=0)
 Applies the active OpenGL transformation to the entity (recursive) More...
 
virtual CCVector3 getBBCenter ()
 Returns the bounding-box center. More...
 
void notifyGeometryUpdate ()
 Notifies all dependent entities that the geometry of this entity has changed.
 
virtual ccBBox getDisplayBB ()
 Returns the entity GL display bounding-box. More...
 
virtual bool toFile (QFile &out) const
 Saves data to binay stream. More...
 
virtual bool fromFile (QFile &in, short dataVersion, int flags)
 Reimplemented from ccSerializableObject::fromFile. More...
 
virtual bool isShareable () const
 Returns whether object is shareable or not. More...
 
void setSelectionBehavior (SelectionBehavior mode)
 Sets selection behavior (when displayed) More...
 
SelectionBehavior getSelectionBehavior () const
 Returns selection behavior.
 
- Public Member Functions inherited from ccObject
 ccObject (QString name=QString())
 Default constructor. More...
 
virtual QString getName () const
 Returns object name.
 
virtual void setName (const QString &name)
 Sets object name.
 
virtual unsigned getUniqueID () const
 Returns object unique ID.
 
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 bool isLocked () const
 Returns whether the object is locked or not. More...
 
virtual void setLocked (bool state)
 Sets the "enabled" property. More...
 
bool isGroup () const
 
bool isLeaf () const
 
bool isCustom () const
 
bool isHierarchy () const
 
bool isKindOf (CC_CLASS_ENUM type) const
 
bool isA (CC_CLASS_ENUM type) const
 
QVariant getMetaData (QString key) const
 Returns a given associated meta data. More...
 
bool removeMetaData (QString key)
 Removes a given associated meta data. More...
 
void setMetaData (QString key, QVariant data)
 Sets a meta data element. More...
 
bool hasMetaData (QString key)
 Says if a metadata with the given key exists or not. More...
 
const QVariantMap & metaData () const
 Returns meta-data map (const only)
 
- Public Member Functions inherited from ccSerializableObject
virtual ~ccSerializableObject ()
 Desctructor.
 
- Public Member Functions inherited from ccDrawableObject
 ccDrawableObject ()
 Default constructor.
 
virtual bool isVisible () const
 Returns whether entity is visible or not.
 
virtual void setVisible (bool state)
 Sets entity visibility.
 
virtual void toggleVisibility ()
 Toggles visibility.
 
virtual bool isVisiblityLocked () const
 Returns whether visibilty is locked or not.
 
virtual void lockVisibility (bool state)
 Locks/unlocks visibilty. More...
 
virtual bool isSelected () const
 Returns whether entity is selected or not.
 
virtual void setSelected (bool state)
 Selects/unselects entity.
 
virtual ccBBox getFitBB (ccGLMatrix &trans)
 Returns best-fit bounding-box (if available) More...
 
virtual void drawBB (const colorType col[])
 Draws absolute (axis aligned) bounding-box.
 
virtual bool colorsShown () const
 Returns whether colors are shown or not.
 
virtual void showColors (bool state)
 Sets colors visibility.
 
virtual void toggleColors ()
 Toggles colors display state.
 
virtual bool normalsShown () const
 Returns whether normals are shown or not.
 
virtual void showNormals (bool state)
 Sets normals visibility.
 
virtual void toggleNormals ()
 Toggles normals display state.
 
virtual void showSF (bool state)
 Sets active scalarfield visibility.
 
virtual void toggleSF ()
 Toggles SF display state.
 
virtual bool sfShown () const
 Returns whether active scalar field is visible.
 
virtual void toggleMaterials ()
 Toggles material display state.
 
virtual void showNameIn3D (bool state)
 Sets whether name should be displayed in 3D.
 
virtual bool nameShownIn3D () const
 Returns whether name is displayed in 3D or not.
 
virtual void toggleShowName ()
 Toggles name in 3D display state.
 
virtual bool isColorOverriden () const
 Returns whether colors are currently overriden by a temporary (unique) color. More...
 
virtual const colorType * getTempColor () const
 Returns current temporary (unique) color.
 
virtual void setTempColor (const colorType *col, bool autoActivate=true)
 Sets current temporary (unique) More...
 
virtual void enableTempColor (bool state)
 Set temporary color activation state.
 
virtual void removeFromDisplay (const ccGenericGLDisplay *win)
 Unlinks entity from a GL display (only if it belongs to it of course)
 
virtual void setDisplay (ccGenericGLDisplay *win)
 Sets associated GL display.
 
virtual ccGenericGLDisplaygetDisplay () const
 Returns associated GL display.
 
virtual void redrawDisplay ()
 Redraws associated GL display.
 
virtual void prepareDisplayForRefresh ()
 Sets associated GL display 'refreshable' before global refresh. More...
 
virtual void refreshDisplay ()
 Refreshes associated GL display. 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.
 
virtual const ccGLMatrixgetGLTransformation () const
 Retuns associated GL transformation. More...
 
virtual void resetGLTransformation ()
 Resets associated GL transformation. More...
 
virtual void rotateGL (const ccGLMatrix &rotMat)
 Mutliplies (left) current GL transformation by a rotation matrix. More...
 
virtual void translateGL (const CCVector3 &trans)
 Translates current GL transformation by a rotation matrix. More...
 

Static Public Member Functions

static ccPointCloudFrom (const CCLib::GenericIndexedCloud *cloud)
 Creates a new point cloud object from a GenericIndexedCloud. More...
 
static ccPointCloudFrom (CCLib::GenericCloud *cloud)
 Creates a new point cloud object from a GenericCloud. More...
 
- Static Public Member Functions inherited from ccHObject
static ccHObjectNew (CC_CLASS_ENUM objectType, const char *name=0)
 Static factory. More...
 
- Static Public Member Functions inherited from ccObject
static unsigned GetCurrentDBVersion ()
 Returns current database version.
 
static void ResetUniqueIDCounter ()
 Resets the object's unique ID counter. More...
 
static unsigned GetNextUniqueID ()
 Returns a new unassigned unique ID. More...
 
static unsigned GetLastUniqueID ()
 Returns last assigned unique ID. More...
 
static CC_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...
 

Protected Member Functions

const ccPointCloudappend (ccPointCloud *cloud, unsigned pointCountBefore, bool ignoreChildren=false)
 Appends a cloud to this one.
 
virtual void drawMeOnly (CC_DRAW_CONTEXT &context)
 Draws the entity only (not its children)
 
virtual void applyGLTransformation (const ccGLMatrix &trans)
 Applies a GL transformation to the entity. More...
 
virtual bool toFile_MeOnly (QFile &out) const
 Save own object data. More...
 
virtual bool fromFile_MeOnly (QFile &in, short dataVersion, int flags)
 Loads own object data. More...
 
virtual void swapPoints (unsigned firstIndex, unsigned secondIndex)
 
- Protected Member Functions inherited from ccHObject
virtual void setParent (ccHObject *anObject)
 Sets parent object.
 
virtual void drawNameIn3D (CC_DRAW_CONTEXT &context)
 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 (CC_OBJECT_FLAG flag) const
 Returns flag state.
 
virtual void setFlagState (CC_OBJECT_FLAG flag, bool state)
 Sets flag state. More...
 

Protected Attributes

ColorsTableTypem_rgbColors
 Colors.
 
NormsIndexesTableTypem_normals
 Normals (compressed)
 
bool m_sfColorScaleDisplayed
 Specifies whether current scalar field color scale should be displayed or not.
 
ccScalarFieldm_currentDisplayedScalarField
 Currently displayed scalar field.
 
int m_currentDisplayedScalarFieldIndex
 Currently displayed scalar field index.
 
- Protected Attributes inherited from ccGenericPointCloud
VisibilityTableTypem_pointsVisibility
 Per-point visibility table. More...
 
CCVector3d m_globalShift
 Global shift (typically applied at loading time)
 
double m_globalScale
 Global scale (typically applied at loading time)
 
unsigned char m_pointSize
 Point size (won't be applied if 0)
 
- Protected Attributes inherited from ccHObject
ccHObjectm_parent
 Object's parent.
 
Container m_children
 Object's children.
 
SelectionBehavior m_selectionBehavior
 Selection behavior.
 
std::map< ccHObject *, int > m_dependencies
 Dependencies map. More...
 
- Protected Attributes inherited from ccObject
QString m_name
 Object name.
 
unsigned m_flags
 Object flags.
 
QVariantMap m_metaData
 Associated meta-data.
 
- Protected Attributes inherited from ccDrawableObject
bool m_visible
 Specifies whether the object is visible or not. More...
 
bool m_selected
 Specifies whether the object is selected or not.
 
bool m_lockedVisibility
 Specifies whether the visibility can be changed by user or not.
 
bool m_colorsDisplayed
 Specifies whether colors should be displayed.
 
bool m_normalsDisplayed
 Specifies whether normals should be displayed.
 
bool m_sfDisplayed
 Specifies whether scalar field should be displayed.
 
colorType m_tempColor [3]
 Temporary (unique) color.
 
bool m_colorIsOverriden
 Temporary (unique) color activation state.
 
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.
 
ccGenericGLDisplaym_currentDisplay
 Currently associated GL display.
 

Additional Inherited Members

- Static Protected Member Functions inherited from ccObject
static void UpdateLastUniqueID (unsigned lastID)
 Sets last assigned unique ID. More...
 

Detailed Description

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

A point cloud can have multiple features:

Constructor & Destructor Documentation

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)

Member Function Documentation

void ccPointCloud::addGreyColor ( colorType  g)

Pushes a grey color on stack.

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

Parameters
ggrey component
void ccPointCloud::addNorm ( const CCVector3 &  N)

Pushes a normal vector on stack (shortcut)

Parameters
Nnormal vector
void ccPointCloud::addNormAtIndex ( const PointCoordinateType *  N,
unsigned  index 
)

Adds a normal vector to the one at a specific index.

The resulting sum is automatically normalized and compressed.

Parameters
Nnormal vector to add (size: 3)
indexnormal index to modify
void ccPointCloud::addNormIndex ( normsType  index)

Pushes a compressed normal vector.

Parameters
indexcompressed normal vector
void ccPointCloud::addRGBColor ( colorType  r,
colorType  g,
colorType  b 
)

Pushes an RGB color on stack.

Parameters
rred component
ggreen component
bblue component
void ccPointCloud::addRGBColor ( const colorType *  C)

Pushes an RGB color on stack.

Parameters
CRGB color (size: 3)
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)
void ccPointCloud::applyGLTransformation ( const ccGLMatrix trans)
protectedvirtual

Applies a GL transformation to the entity.

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

Parameters
transa ccGLMatrix structure

Reimplemented from ccHObject.

void ccPointCloud::clear ( )
virtual

Clears the entity from all its points and features.

Display parameters are also reseted to their default values.

Reimplemented from ccGenericPointCloud.

ccPointCloud* ccPointCloud::clone ( const CCLib::GenericIndexedCloud *  selection)

Creates a new point cloud object from a GenericIndexedCloud.

Should be prefered to the equivalent constructor.

Parameters
selectiona GenericIndexedCloud structure
ccGenericPointCloud * ccPointCloud::clone ( ccGenericPointCloud destCloud = 0,
bool  ignoreChildren = false 
)
virtual

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.

ccPointCloud * ccPointCloud::cloneThis ( ccPointCloud destCloud = 0,
bool  ignoreChildren = false 
)
virtual

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
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
CCVector3 ccPointCloud::computeGravityCenter ( )

Returns the cloud gravity center.

Returns
gravity center
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
bool ccPointCloud::convertNormalToRGB ( )

Converts normals to RGB colors.

See ccNormalVectors::ConvertNormalToRGB

Returns
success
virtual ccGenericPointCloud* ccPointCloud::createNewCloudFromVisibilitySelection ( bool  removeSelectedPoints = false)
virtual

WARNING: if removeSelectedPoints is true, any attached octree will be deleted.

Implements ccGenericPointCloud.

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

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

Warning
Always returns a selection (potentially empty) if successful.
Parameters
boxcroping box
insidewhether selected points are inside or outside the box
Returns
points falling inside (or outside) as a selection
CCLib::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
ccPointCloud* ccPointCloud::filterPointsByScalarValue ( ScalarType  minVal,
ScalarType  maxVal 
)

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 (below, points are excluded)
maxValmaximum value (above, points are excluded)
Returns
resulting cloud (remaining points)
ccPointCloud * ccPointCloud::From ( const CCLib::GenericIndexedCloud *  cloud)
static

Creates a new point cloud object from a GenericIndexedCloud.

"GenericIndexedCloud" is an extension of GenericCloud (from CCLib) which provides a const random accessor to points. See CClib documentation for more information about GenericIndexedCloud. As the GenericIndexedCloud interface is very simple, only points are imported. Note: throws an 'int' exception in case of error (see CTOR_ERRORS)

Parameters
clouda GenericIndexedCloud structure
ccPointCloud * ccPointCloud::From ( CCLib::GenericCloud *  cloud)
static

Creates a new point cloud object from a GenericCloud.

"GenericCloud" is a very simple and light interface from CCLib. It is meant to give access to points coordinates of any cloud (on the condition it implements the GenericCloud interface of course). See CClib documentation for more information about GenericClouds. As the GenericCloud interface is very simple, only points are imported. Note: throws an 'int' exception in case of error (see CTOR_ERRORS)

Parameters
clouda GenericCloud structure
virtual bool ccPointCloud::fromFile_MeOnly ( QFile &  in,
short  dataVersion,
int  flags 
)
protectedvirtual

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)

Reimplemented from ccGenericPointCloud.

const colorType * ccPointCloud::geScalarValueColor ( ScalarType  d) const
virtual

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.

void ccPointCloud::getDrawingParameters ( glDrawParams params) const
virtual

Returns main OpenGL paramters for this entity.

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

Parameters
paramsa glDrawParams structure

Reimplemented from ccDrawableObject.

const colorType * ccPointCloud::getPointColor ( unsigned  pointIndex) const
virtual

Returns color corresponding to a given point.

WARNING: color array must be enabled! (see ccDrawableObject::hasDisplayedScalarField)

Implements ccGenericPointCloud.

ScalarType ccPointCloud::getPointDisplayedDistance ( unsigned  pointIndex) const
virtual

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.

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

Returns normal corresponding to a given point.

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

Implements ccGenericPointCloud.

const normsType & ccPointCloud::getPointNormalIndex ( unsigned  pointIndex) const
virtual

Returns compressed normal corresponding to a given point.

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

Implements ccGenericPointCloud.

const colorType * ccPointCloud::getPointScalarValueColor ( unsigned  pointIndex) const
virtual

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.

bool ccPointCloud::hasScalarFields ( ) const
virtual

Returns whether one or more scalar fields are instantiated.

WARNING: doesn't mean a scalar field is currently displayed (see ccDrawableObject::hasDisplayedScalarField).

Reimplemented from ccDrawableObject.

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)
void ccPointCloud::multiply ( PointCoordinateType  fx,
PointCoordinateType  fy,
PointCoordinateType  fz 
)

Multiplies all coordinates by a constant factor (per dimension)

WARNING: any attached octree will be deleted.

Parameters
fxmultipliation factor along the X dimension
fymultipliation factor along the Y dimension
fzmultipliation factor along the Z dimension
const ccPointCloud & ccPointCloud::operator+= ( ccPointCloud addedCloud)

Fuses another 3D entity with this one.

All the main features of the given entity are added, except from the octree and the points visibility information. Those features are deleted on this cloud.

ccPointCloud * ccPointCloud::partialClone ( const CCLib::ReferenceCloud *  selection,
int *  warnings = 0 
) 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
selectiona ReferenceCloud structure (pointing to source)
[out]warnings[optional] to determine if warnings (CTOR_ERRORS) occurred during the duplication process
bool ccPointCloud::reserve ( unsigned  numberOfPoints)
virtual

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
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 colors as the number of points in the cloud (effictively stored or reserved).

Returns
true if ok, false if there's not enough memory
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. It 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
bool ccPointCloud::reserveTheRGBTable ( )

Reserves memory to store the RGB colors.

Before adding colors to the cloud (with addRGBColor()) be sure to reserve the necessary amount of memory with this method. This method reserves memory for as many colors as the number of points in the cloud (effictively stored or reserved).

Returns
true if ok, false if there's not enough memory
bool ccPointCloud::resize ( unsigned  numberOfPoints)
virtual

Resizes all the active features arrays.

This method is meant to be called after having increased the cloud population (if the final number of insterted point is lower than the reserved size). Otherwise, it fills all new elements with blank values.

Returns
true if ok, false if there's not enough memory
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
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 (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 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
void ccPointCloud::setCurrentDisplayedScalarField ( int  index)
virtual

Sets the currently displayed scalar field.

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

void ccPointCloud::setPointColor ( unsigned  pointIndex,
const colorType *  col 
)

Sets a particular point color.

WARNING: colors must be enabled.

void ccPointCloud::setPointNormal ( unsigned  pointIndex,
const CCVector3 &  N 
)

Sets a particular point normal (shortcut)

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

void ccPointCloud::setPointNormalIndex ( unsigned  pointIndex,
normsType  norm 
)

Sets a particular point compressed normal.

WARNING: normals must be enabled.

bool ccPointCloud::setRGBColor ( colorType  r,
colorType  g,
colorType  b 
)

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
bool ccPointCloud::setRGBColor ( const colorType *  col)

Set a unique color for the whole cloud.

Color array is automatically allocated if necessary.

Parameters
colRGB color (size: 3)
Returns
success
bool ccPointCloud::setRGBColorByBanding ( unsigned char  dim,
int  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
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
bool ccPointCloud::setRGBColorWithCurrentScalarField ( bool  mixWithExistingColor = false)

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

Returns
success
virtual bool ccPointCloud::toFile_MeOnly ( QFile &  out) const
protectedvirtual

Save own object data.

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

Reimplemented from ccGenericPointCloud.

void ccPointCloud::translate ( const CCVector3 &  T)

Translates cloud.

Parameters
Ttranslation vector
void ccPointCloud::unrollOnCone ( PointCoordinateType  baseRadius,
double  alpha_deg,
const CCVector3 &  apex,
unsigned char  dim = 2,
CCLib::GenericProgressCallback *  progressCb = NULL 
)

Unrolls the cloud and its normals on a cone.

This method is redundant with the "developCloudOnCone" method of CCLib, appart that it can also handle the cloud normals.

Parameters
baseRadiusunrolling cone base radius
alpha_degcone angle (between 0 and 180 degrees)
apexcone apex
dimdimension along which the cone axis is aligned (X=0, Y=1, Z=2)
progressCbthe client application can get some notification of the process progress through this callback mechanism
void ccPointCloud::unrollOnCylinder ( PointCoordinateType  radius,
CCVector3 *  center = 0,
unsigned char  dim = 2,
CCLib::GenericProgressCallback *  progressCb = NULL 
)

Unrolls the cloud and its normals on a cylinder.

This method is redundant with the "developCloudOnCylinder" method of CCLib, appart that it can also handle the cloud normals.

Parameters
radiusunrolling cylinder radius
centera point belonging to the cylinder axis (automatically computed if not specified)
dimdimension along which the cylinder axis is aligned (X=0, Y=1, Z=2)
progressCbthe client application can get some notification of the process progress through this callback mechanism

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