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
.
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);
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:
The following methods return height, length, and width of the point cloud:
double defaultHeight() const;
double defaultLength() const;
double defaultWidth() const;
Work with Legacy Point Cloud Entities
Insert a legacy Point Cloud into a Drawing
Legacy Point Clouds Visualization and PCG File Format
Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.
|