Point cloud entities work together with point cloud definition objects to represent point clouds inside a drawing. The relationship between these two kinds of objects is very similar to the relationship between a block definition and block reference objects or between a raster image definition and raster image entity objects.
A point cloud entity is a selectable, drawable entity that places a point cloud in model or paper space inside the drawing. The point cloud entity is linked to exactly one point cloud definition object, and two or more entities can be linked to a single definition object.
Point cloud entities are represented by the OdDbPointCloudEx
class.
To create a point cloud entity, declare an object of OdDbPointCloudExPtr
class (which is the specialization of the OdSmartPtr class for OdDbPointCloudEx
pointers), and use the createObject()
method of the OdDbPointCloudEx
class that is the static pseudo-constructor. For example:
OdDbPointCloudExPtr pPointCloud = OdDbPointCloudEx::createObject();
An OdDbPointCloudEx
object cannot be used by itself; it must be linked to the specific point cloud definition object that contains all information about the external point cloud file. The following method sets the Object ID of the OdDbPointCloudDefEx
object associated with the entity:
void setPointCloudDefExId( const OdDbObjectId pointCloudDefExId );
For getting an Object ID of the associated point cloud, the pointCloudDefExId()
method is used. For example:
if(pPointCloud->pointCloudDefExId() == OdDb::kNull)
pPointCloud->setPointCloudDefExId(pointCloudDefExId);
Also for creating a point cloud entity, you can use the ::oddbCreatePointCloudExEntity()
function:
OdResult oddbCreatePointCloudExEntity(
OdDbBlockTableRecord* pBTR,
OdDbPointCloudExPtr& newPointCloud,
const OdString& sourceFile,
const OdGePoint3d& location,
double scale,
double rotation,
const OdGeVector3d& vAxis)
The method not only creates the OdDbPointCloudEx
entity, but also creates the OdDbPointCloudDefEx
if needed (or finds the existing proper one) and restores or creates new links to the OdDbPointCloudDefEx
object, applies specified attributes, and adds reactors.
Besides the general entity properties (color, layer, etc.), the OdDbPointCloudEx
class supports specific point cloud properties. There is a following set of methods to work with them.
Method | Brief Description |
void getNativeCloudExtent( OdGeExtents3d& extents ) const; |
Returns native cloud extents. |
unsigned int getVisiblePointCount( OdGeExtents3d extents ); |
NOT IMPLEMENTED |
unsigned int getLoadedVisiblePointCount( OdGeExtents3d extents ); |
NOT IMPLEMENTED |
unsigned int getDisplayedVisiblePointCount( OdGeExtents3d extents ); |
NOT IMPLEMENTED |
bool getActiveFileName( OdString& fileName ) const; |
Retrieves the currently active file name. |
bool setActiveFileName( const OdChar* strActiveFileName ); |
Sets an active file name. |
OdString getPointCloudName() const; |
Returns the name of the saved file. |
OdResult setPointCloudName( const OdString& name ); |
Sets the name of the saved file. |
StylizationType stylizationType() const; |
Returns the current stylization type. |
OdResult setStylizationType( StylizationType type ); |
Sets new stylization type. |
OdString getCurrentColorScheme() const; |
Retrieves the current color scheme if the current stylization type is one of the following:
|
OdResult setCurrentColorScheme( const OdString &guid ); |
Sets new color scheme if the current stylization type is one of the following:
|
OdString getColorSchemeForStylization( StylizationType type ) const; |
Gets color scheme by stylization type. |
OdResult setColorSchemeForStylization( const OdString &guid, StylizationType type ); |
Sets color scheme by stylization type. |
bool showIntensityAsGradient() const; |
Checks if the intensity is shown as gradient. |
void setShowIntensityAsGradient( bool bShowAsGradient ); |
Sets a flag whether to show intensity as gradient. |
OdInt32 minIntensity() const; |
Returns the current value of minimal intensity. |
OdInt32 maxIntensity() const; |
Returns the current value of maximal intensity. |
OdResult setMinMaxIntensity( OdInt32 min, OdInt32 max ); |
Sets minimal and maximal intensity. |
DisplayOptionOutOfRange intensityOutOfRangeBehavior() const; |
Returns the behaviour that will be executed when intensity is out of range. |
void setIntensityOutOfRangeBehavior( DisplayOptionOutOfRange displayOption ); |
Sets the behaviour that will be executed when intensity is out of range. |
bool showElevationAsGradient() const; |
Checks if the elevation is shown as gradient |
void setShowElevationAsGradient( bool bShowAsGradient ); |
Sets a flag whether to show elevation as gradient. |
double minElevation() const; |
Returns the current minimal elevation. |
double maxElevation() const; |
Returns the current maximal elevation. |
OdResult setMinMaxElevation( double min, double max ); |
Sets minimal and maximal elevation. |
bool elevationApplyToFixedRange() const; |
Checks if elevation is applied to a fixed range. |
void setElevationApplyToFixedRange( bool bFixedRange ); |
Sets a flag whether to apply elevation to a fixed range. |
DisplayOptionOutOfRange elevationOutOfRangeBehavior() const; |
Returns the behaviour that will be executed when elevation is out of range. |
void setElevationOutOfRangeBehavior( DisplayOptionOutOfRange displayOption ); |
Sets the behaviour that will be executed when elevation is out of range. |
As any OdDbEntity object, an OdDbPointCloudEx instance can be transformed by translating, rotating, scaling or by a combination of these operations.
You may use the following methods of OdDbPointCloudEx to work with an appropriate transformation:
Method | Brief Description |
double scale() const; |
Returns the current scaling multiplier. |
void setScale( double scale ); |
Sets a new scaling multiplier. |
double rotation() const; |
Returns the current rotation angle value. |
void setRotation( double newRotation ); |
Sets a new rotation angle value. |
OdGePoint3d location() const; |
Returns the 3d point, that the represents the translation values in the transformation matrix. |
void setLocation( OdGePoint3d newLocation ); |
Sets new translation values to the transformation matrix. |
OdDbPointCloudEx has a special set of methods to work with point cloud cropping.
Method | Brief Description |
OdDbPointCloudCropping* getConstPointCloudCropping( int index ); |
Returns the current point cloud cropping. |
OdDbPointCloudCropping const* getConstPointCloudCropping( int index ) const; |
Returns the current point cloud cropping. |
void addCroppingBoundary( OdDbPointCloudCropping const &boundary ); |
Adds a cropping boundary to the boundary array if it's valid. |
OdResult clearCropping(); |
Clears the cropping boundary array. |
OdResult removeLastCropping(); |
Removes the last cropping boundary from the array. |
OdUInt32 getCroppingCount() const; |
Returns the number of cropping boundaries set to the entity. |
bool getCroppingInvert() const; |
Returns a boolean value that determines if last cropping is inverted. |
OdResult setCroppingInvert( bool bInvert ); |
Sets a boolean value that determines wether last cropping should be inverted. |
OdResult setInCreatingCroppingMode( bool bCreating ); |
NOT IMPLEMENTED |
bool showCropping() const; |
Returns true only if this point cloud entity is displayed as cropped. |
OdResult setShowCropping( bool bShowCropping );; |
Set whether this point cloud entity is displayed as cropped. |
Current implementation of Drawings SDK supports cropping creation only, but it doesn’t support cropping visualization.
Work with Point Cloud Definitions
Insert a Point Cloud into a Drawing
Point Clouds Visualization and RCS/RCP File Formats
Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.
|