Drawings SDK Developer Guide > Working with Point Clouds > Working with Point Clouds with Drawings SDK > Working with Point Clouds > Working with Point Cloud Definitions
Work with Point Cloud Definitions

Point cloud definition objects define a point cloud object inside the database and contain information about the linked point cloud file of RCS or RCP format.

Like block definition and raster image definition objects, a point cloud definition isn't an entity; it cannot be displayed in the drawing but it's considered a sample that can be inserted in the drawing one or more times by creating point cloud entities which refer to the definition object.

Point cloud definition objects are represented by the OdDbPointCloudDefEx class and stored in a special point cloud dictionary named ACAD_POINTCLOUD_EX_DICT.

Creating Point Cloud Definition Objects

To create a point cloud definition, declare an object of the OdDbPointCloudDefExPtr class (which is the specialization of the OdSmartPtr class for OdDbPointCloudDefEx pointers) and use the createObject() method of the OdDbPointCloudDefEx class that is the static pseudo-constructor. For example:

OdDbPointCloudDefExPtr pPointCloudDef = OdDbPointCloudDefEx::createObject();

Since an OdDbPointCloudDefEx instance is created, it must be added to the point cloud dictionary. The ACAD_POINTCLOUD_EX_DICT dictionary can be obtained using the OdDbPointCloudDefEx::createPointCloudExDictionary() method:

static OdDbObjectId pointCloudExDictionary(const OdDbDatabase *pDb);

For creating the point cloud dictionary, the following static method is used:

static OdDbObjectId createPointCloudExDictionary(OdDbDatabase *pDb);

The method tries to get the ACAD_POINTCLOUD_EX_DICT dictionary in the specified database and creates a new one if it is not already present. For example, to create the point cloud dictionary in the OdDbDatabase instance:

OdDbObjectId pointCloudDicId = OdDbPointCloudDefEx::createPointCloudExDictionary(pDb);

Working with Point Cloud Definition Properties

The OdDbPointCloudDefEx class contains a set of methods for working with point cloud definition properties: filename of the source point cloud file, extents, etc.

Method Brief Description
OdString sourceFileName() const; Returns the name of the external file containing the point cloud extension data (.rcp or .rcs) for this OdDbPointCloudDefEx object (as it is stored in a file).
OdResult setSourceFileName(const OdString& sPathName); Sets the name of the external file containing the point cloud extension data (.rcp or .rcs) for this OdDbPointCloudDefEx object (as it is stored in a file).
const OdChar * activeFileName() const; Returns the path name of the actual point cloud file being currently used for this OdDbPointCloudDefEx object.
OdResult setActiveFileName( const OdChar * pPathName); Sets the path name of the actual point cloud file being currently used for this OdDbPointCloudDefEx object.
const OdChar * fileType() const; Returns the type of the source file containing the point cloud data for this OdDbPointCloudDefEx object (as it is stored in file).
bool isLoaded() const; Returns true if and only if the point cloud file for this OdDbPointCloudDefEx object is loaded.
int entityCount(bool *pbLocked) const; Returns the number of OdDbPointCloudEx entities in the current drawing that are dependent upon this OdDbPointCloudDefEx object.
OdUInt64 totalPointsCount() const; Returns the total number of points of this OdDbPointCloudDefEx object.
double defaultHeight() const; Returns the default height of this OdDbPointCloudDefEx object.
double defaultLength() const; Returns the default length of this OdDbPointCloudDefEx object.
double defaultWidth() const; Returns the default width of this OdDbPointCloudDefEx object.
OdResult extents(OdGeExtents3d &exts) const; Calculates the extents of this OdDbPointCloudDefEx object.
OdUInt32 totalRegionsCount() const; Returns the total number of regions for this OdDbPointCloudDefEx object.
OdUInt32 totalScansCount() const; Returns the total number of scans for this OdDbPointCloudDefEx object.
OdString coordinateSystemName() const; Gets the coordinate system name of the point cloud.
OdString getRcsFilePath(const OdString &guid) const; Gets the path of a specified .rcs file.
void getAllRcsFilePaths(OdStringArray &list) const; Gets the list of paths for all .rcs files.
PropState hasProperty(Property prop) const; Checks whether a specified property is present in scans of a point cloud. The result will show whether this property is present in all scans, some of the scans, or none of the scans.

See Also

Work with Point Clouds

Work with Point Cloud Entities

Insert a Point Cloud into a Drawing

Point Clouds Visualization and RCS/RCP File Formats

Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.