Drawings SDK Developer Guide > Working with .dwg Files > Working with Entities > Working with Specific Entitites > Working with Point Clouds > Working with Point Cloud Definitions
Working 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 .pcg or .isd 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 OdDbPointCloudDef class and stored in a special point cloud dictionary named ACAD_POINTCLOUD_DICT.

Creating point cloud definition objects

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


OdDbPointCloudDefPtr pPointCloudDef = OdDbPointCloudDef::createObject();

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


static OdDbObjectId pointCloudDictionary(const OdDbDatabase&);

For creating the point cloud dictionary, the static OdDbPointCloudDef::createPointCloudDictionary() method is used:


static OdDbObjectId createPointCloudDictionary(OdDbDatabase&);

The method tries to get the ACAD_POINTCLOUD_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 pointCloudDictId = OdDbPointCloudDef::createPointCloudDictionary(db);

Working with point cloud definition properties

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

The following methods are used for setting or getting the source file name (of .pcg or .isd format) accordingly:

  • OdResult setSourceFileName(const OdString&);
  • OdString sourceFileName() const;

The type of the external file can be returned by the fileType() method.

The geometrical extents can be obtained or set using the getNativeCloudExtent() or setExtents() methods accordingly:


OdResult  getNativeCloudExtent(OdGeExtents3d &) const;
void setExtents(const OdGeExtents3d &);

The following methods return height, length, and width of the point cloud:

  • double defaultHeight() const;
  • double defaultLength() const;
  • double defaultWidth() const;

See Also

Working with Point Clouds

Working with Point Cloud Entities

Inserting a Point Cloud into a Drawing

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