/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef POINTCLOUD2VISUALIZE_H #define POINTCLOUD2VISUALIZE_H #include "TD_PackPush.h" #include "RxDispatchImpl.h" #include "TvVisualizeFiler.h" #include "RcsFileServices/OdPointCloudConverter.h" class OdTvFilerTimer; namespace PointCloud2Visualize { /** \details This class implements the properties of the rcs loader */ class OdTvVisualizePointCloudFilerProperties : public OdRxDispatchImpl<> { public: OdTvVisualizePointCloudFilerProperties(); virtual ~OdTvVisualizePointCloudFilerProperties(); ODRX_DECLARE_DYNAMIC_PROPERTY_MAP(OdTvVisualizePointCloudFilerProperties); static OdRxDictionaryPtr createObject(); void setDefaultColor(ODCOLORREF defColor) { m_defaultColor = defColor; } ODCOLORREF getDefaultColor() const { return m_defaultColor; } void setPointSize(OdUInt8 pointSize) { m_iPointSize = pointSize; } OdUInt8 getPointSize() const { return m_iPointSize; } void setAppendTransform(const OdTvMatrix& transform) { m_appendTransform = transform; } const OdTvMatrix& getAppendTransform() const { return m_appendTransform; } void setImportAsRcsPointCloud(bool bSet) { m_bImportAsRcsPointCloud = bSet; } bool getImportAsRcsPointCloud() const { return m_bImportAsRcsPointCloud; } void setUseSpatialTreeForSelection(bool bSet) { m_bUseSpatialTreeForSelection = bSet; } bool getUseSpatialTreeForSelection() const { return m_bUseSpatialTreeForSelection; } void setSeparator(const OdString& separator); const OdString& getSeparator() const; void setXYZIndexes(const OdUInt32Array& indexes) { m_xyzIndexes = indexes; } const OdUInt32Array& getXYZIndexes() const { return m_xyzIndexes; } void setRGBIndexes(const OdUInt32Array& indexes) { m_rgbIndexes = indexes; } const OdUInt32Array& getRGBIndexes() const { return m_rgbIndexes; } void setRGBIndexesAsIntPtr(OdIntPtr pIndexes); OdIntPtr getRGBIndexesAsIntPtr() const; void setIntensityIndex(OdUInt32 intensityIndex) { m_intensityIndex = intensityIndex; } OdUInt32 getIntensityIndex() const { return m_intensityIndex; } void setSkipLinesCount(OdUInt32 lines) { m_skipLines = lines; } OdUInt32 getSkipLinesCount() const { return m_skipLines; } void setDefaultUnits(OdTv::Units units) { m_defaultUnits = units; } OdTv::Units getDefaultUnits() const { return m_defaultUnits; } void setColorRange(OdPointCloudDataSource::ColorRange colorRange) { m_colorRange = colorRange; } OdPointCloudDataSource::ColorRange getColorRange() const { return m_colorRange; } void setNeedCDATree(bool bSet) { m_bNeedCDATree = bSet; } bool getNeedCDATree() const { return m_bNeedCDATree; } void setNeedCollectPropertiesInCDA(bool bSet) { m_bNeedCollectPropertiesInCDA = bSet; } bool getNeedCollectPropertiesInCDA() const { return m_bNeedCollectPropertiesInCDA; } private: friend class _AppendTransform_PropDesc; friend class _XYZIndexes_PropDesc; friend class _RGBIndexes_PropDesc; friend class _DefaultUnits_PropDesc; friend class _ColorRange_PropDesc; void setAppendTransformAsIntPtr(OdIntPtr pTransform); OdIntPtr getAppendTransformAsIntPtr() const; void setXYZIndexesAsIntPtr(OdIntPtr pIndexes); OdIntPtr getXYZIndexesAsIntPtr() const; void setDefaultUnitsAsUInt8(OdUInt8 units) { m_defaultUnits = static_cast(units); } OdUInt8 getDefaultUnitsAsUInt8() const { return m_defaultUnits; } void setColorRangeAsInt8(OdInt8 colorRange) { m_colorRange = static_cast(colorRange); } OdInt8 getColorRangeAsInt8() const { return m_colorRange; } protected: ODCOLORREF m_defaultColor; // default color which is set to the entity OdUInt8 m_iPointSize; // Point size bool m_bImportAsRcsPointCloud; // Import as rcs point cloud bool m_bUseSpatialTreeForSelection; // Use spatial tree for selection OdTvMatrix m_appendTransform; // Transform for the append OdString m_separator; // Separator symbol OdUInt32Array m_xyzIndexes; // Indexes of XYZ columns OdUInt32Array m_rgbIndexes; // Indexes of RGB columns OdUInt32 m_intensityIndex; // Index of intensity column OdUInt32 m_skipLines; // Number of skipped lines in xyz files OdTv::Units m_defaultUnits; // Default units OdPointCloudDataSource::ColorRange m_colorRange; // Color range bool m_bNeedCDATree; // Need build CDA tree bool m_bNeedCollectPropertiesInCDA; // Need collect native properties in CDA nodes }; typedef OdSmartPtr OdTvVisualizePointCloudPropertiesPtr; } class OdTvVisualizePointCloudFiler : public OdTvVisualizeFiler { public: OdTvVisualizePointCloudFiler(); virtual OdTvDatabaseId loadFrom(const OdString& filePath, OdTvFilerTimeProfiling* pProfileRes = NULL, OdTvResult* rc = NULL) const; // Inherited via OdTvVisualizeFiler virtual OdRxDictionaryPtr properties(); virtual OdTvDatabaseId loadFrom(OdStreamBuf* pBuffer, OdTvFilerTimeProfiling* pProfileRes = NULL, OdTvResult* rc = NULL) const; virtual OdTvDatabaseId loadFrom(OdDbBaseDatabase* pDatabase, OdTvFilerTimeProfiling* pProfileRes = NULL, OdTvResult* rc = NULL) const; virtual OdTvDatabaseId generate(OdTvFilerTimeProfiling* pProfileRes = NULL) const; virtual OdTvModelId appendFrom(const OdTvDatabaseId& databaseId, const OdString& filePath, OdTvFilerTimeProfiling* pProfileRes = NULL, OdTvResult* rc = NULL) const; virtual OdTvModelId appendFrom(const OdTvDatabaseId& databaseId, OdStreamBuf* pBuffer, OdTvFilerTimeProfiling* pProfileRes = NULL, OdTvResult* rc = NULL) const; virtual OdTvModelId appendFrom(const OdTvDatabaseId& databaseId, OdDbBaseDatabase* pDatabase, OdTvFilerTimeProfiling* pProfileRes = NULL, OdTvResult* rc = NULL) const; protected: void createCommonDataAccessTree(const OdTvDatabaseId& tvDbId, const OdString& strTreeName) const; private: OdPointCloudDataSourcePtr createPointCloudDataSource(const OdString& filePath, OdTvResult* rc = NULL) const; bool appendPointCloud(OdTvModelPtr pTvModel, const OdString& filePath, OdPointCloudDataSourcePtr pDataSource, OdTvFilerTimer& timing, OdTvResult* rc = NULL, OdGeExtents3d* pointCloudExtents = NULL) const; PointCloud2Visualize::OdTvVisualizePointCloudPropertiesPtr m_properties; }; class OdTvVisualizePointCloudFilerModule : public OdTvVisualizeFilerModule { public: virtual OdTvVisualizeFilerPtr getVisualizeFiler() const; void initApp(); void uninitApp(); }; #include "TD_PackPop.h" #endif // POINTCLOUD2VISUALIZE_H