Drawings SDK Developer Guide > Working with Point Clouds > Working with Point Clouds with Drawings SDK > Working with Legacy Point Clouds > Legacy Point Clouds Visualization and PCG File Format
Legacy Point Clouds Visualization and PCG File Format

Drawings SDK does not provide support for reading and rendering .isd files and provides a partial support for reading and rendering .pcg files.

However, Drawings SDK provides a hook for client implementation using third-party engines and libraries. This hook is represented by special set of interfaces declared in the Drawing\Include\DbPointCloudObj\DbPointCloudHostPE.h header file.

The header contains a declaration of the following interfaces:

  • OdDbPointCloudItem – abstraction of point cloud source file to provide access to point cloud data for point cloud definition of type OdDbPointCloudDef.
  • OdDbPointCloudHostPE – protocol extension to load point cloud data from .pcg files.

You can find an sample implementation of the interfaces mentioned above in the Drawing/Examples/ExPointCloudHost example. You can provide your own module implementing these interfaces.

Partial support for .pcg files implemented in the following files:

  • Drawing/Examples/ExPointCloudHost/ExPointCloudHostPE.h
  • Drawing/Examples/ExPointCloudHost/ExPointCloudHostPE.cpp

Main method of the protocol extension implementation for .pcg is a following:

OdResult ExPointCloudHostPE::load(const OdString& filename, OdDbPointCloudItemPtr& pItem);

These method contains a partial support to read point cloud data from .pcg files. It is meant to be called from while rendering the point cloud entities of type OdDbPointCloud.

The method loads all points from a .pcg file into memory. Right after loading is performed all points are stored within object of type ExPointCloudItem that implements OdDbPointCloudItem interface.

Visualization of these points would be performed while the following methods of ExPointCloudItem works:

    
bool ExPointCloudItem::worldDrawPoints(const OdDbPointCloud* pEnt, OdGiWorldDraw* pWd) const
{
  drawPoints(pWd->geometry());
  return true;
}

void ExPointCloudItem::drawPoints(OdGiGeometry& geom) const
{
  OdInt32 nCount = (OdInt32)m_points.size();
  const OdGePoint3d* pPt = m_points.getPtr();
  geom.polypoint(nCount, pPt);
}
    

Method ExPointCloudItem::worldDrawPoints() is meant to be called from the subWorldDraw() method of the OdDbPointCloud entity.

See Also

Work with Legacy Point Clouds

Work with Legacy Point Cloud Definitions

Work with Legacy Point Cloud Entities

Insert a legacy Point Cloud into a Drawing

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