/////////////////////////////////////////////////////////////////////////////// // 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 __TNW_MODEL_H__ #define __TNW_MODEL_H__ #include "NwObject.h" #include "NwExport.h" #include "NwModelType.h" #define STL_USING_LIST #include "OdaSTL.h" #include "NwModelUnits.h" #include "NwModelOverrideFlags.h" class OdGeMatrix3d; class OdNwDataProperty; class OdNwPublishAttribute; /** \details This template class is a specialization of the OdSmartPtr class for OdNwDataProperty object pointers. */ typedef OdSmartPtr OdNwDataPropertyPtr; /** \details This template class is a specialization of the OdSmartPtr class for OdNwPublishAttribute object pointers. */ typedef OdSmartPtr OdNwPublishAttributePtr; /** \details This class represents a model in the database. */ class NWDBEXPORT OdNwModel : public OdNwObject { //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdNwModel); //DOM-IGNORE-END protected: /** \details Default constructor. Creates a new object of the OdNwModel class. */ OdNwModel(OdNwObjectImpl* pImpl); public: /** \details Virtual destructor. Frees allocated resources. */ virtual ~OdNwModel(); public: /** \details Receives the filename of the model. \returns The filename of the model. */ virtual OdString getFileName() const = 0; /** \details Receives the path of the model. \returns The path of the model. */ virtual OdString getPath() const = 0; /** \details Receives the name of the original source file from which this model was first converted. \returns Name of the original source file, or an empty string if the filename is unknown. */ virtual OdString getSourceFileName() const = 0; /** \details Indicates whether the model has override data. \param overrideFlags [in] The override flags for check. \returns The true value if the model has override data, or false otherwise. \remarks bit values for flags must be one of the following: Name Value Description NwModelOverrideFlags::kNotSet 0x00 model has no override data NwModelOverrideFlags::kUnitOverride 0x01 model reference has override units NwModelOverrideFlags::kTransformOverride 0x02 model reference has override transformation NwModelOverrideFlags::kOrientationOverride 0x04 model reference has override orientation vectors NwModelOverrideFlags::kFullOverride 0x07 model reference has all type of overrides
*/ virtual bool hasOverride(OdUInt32 overrideFlags = NwModelOverrideFlags::kFullOverride) const = 0; /** \details Receives a transformation matrix applied to the model. \returns Transformation matrix as an OdGeMatrix3d object. \remarks If the hasOverride method returns true with NwModelOverrideFlags::kTransformOverride then this matrix is overriden transformation over model. */ virtual OdGeMatrix3d getTransform() const = 0; /** \details Receives the type of the loaded model. \returns The type of the loaded model as one of the enumerated items from the NwModelType::Enum. \remarks The returned type can be one of the following: Name Value Description NwModelType::undefined 0 Original model is undefined. NwModelType::dwg_model 1 Original model is from a .dwg file. NwModelType::dgn_model 2 Original model is a DGN model. NwModelType::revit_model 3 Original model is an Autodesk(R) Revit(R) model. NwModelType::nw_model 4 Original model is an Autodesk Navisworks(R) model. NwModelType::nw_13_model 5 Original model is an Autodesk Navisworks(R) model. NwModelType::ifc_model 6 Original model is a IFC model. NwModelType::nw_exportrevit 7 Original model is an Autodesk Navisworks(R) model.
*/ virtual NwModelType::Enum getType() const = 0; /** \details Receives the plugin name with which this model was created. \returns Name of the plugin name with which this model was created. */ virtual OdString getPluginName() const = 0; /** \details Gets the measuring units set for this model. \returns One of the enumerated items from the NwModelUnits::Enum enumerated type. \remarks Returned value can be one of the following: Name Value Description NwModelUnits::UNITS_METERS 0x00 SI meter. NwModelUnits::UNITS_CENTIMETERS 0x01 1 100th of an SI meter. NwModelUnits::UNITS_MILLIMETERS 0x02 1 1000th of an SI meter. NwModelUnits::UNITS_FEET 0x03 1 3rd of a yard. NwModelUnits::UNITS_INCHES 0x04 1 12th of a foot, 2.54 SI centimeters. NwModelUnits::UNITS_YARDS 0x05 Imperial yard, 0.9144 SI meters. NwModelUnits::UNITS_KILOMETERS 0x06 1000 SI meters NwModelUnits::UNITS_MILES 0x07 1760 yards NwModelUnits::UNITS_MICROMETERS 0x08 1 1,000,000th of an SI meter, micron NwModelUnits::UNITS_MILS 0x09 1 1,000th of an inch NwModelUnits::UNITS_MICROINCHES 0x0A 1 1,000,000th of an inch
If the hasOverride methods returns true with NwModelOverrideFlags::kUnitOverride then this units is overriden over model. */ virtual NwModelUnits::Enum getUnits() const = 0; /** \details Gets the property list of the model's plugin options. \param lProperties [out] The std::list with smart pointers to properties as values. \returns The eOk values if the properties are retrieved successfully, or an appropriate error code otherwise. \remarks The method is deprecated. */ virtual OdResult getProperties(std::list& lProperties) const = 0; /** \details Receives the globally unique identifier assigned to this model. \returns Model's globally unique identifier as an OdGUID object. */ virtual OdGUID getGuId() const = 0; /** \details Receives the original GUID that the model was created with. \returns The original GUID that the model was created with as an OdGUID object. \remarks If the model is appended to a sheet several times, each model instance has the same source GUID but different GUIDs. */ virtual OdGUID getSourceGuId() const = 0; /** \details Receives an object ID of the root model item. \returns Object ID of an OdNwModelItem object with the root model item of the model. \remarks For NWD and NWC files the method returns object ID of model item. For NWF file the method returns an OdNwObjectId from external embedded database, if Xref model has NWD or NWC type in the same directory with NWF file. Returns empty OdNwObjectId otherwise. */ virtual OdNwObjectId getRootItem() const = 0; /** \details Indicates whether the model is hidden. \returns The true value if the model is hidden, otherwise false. \remarks The method returns a value corresponding to the current viewpoint. */ virtual bool isHidden() const = 0; /** \details Indicates whether the model is required. \returns The true value if the model is required, otherwise false. \remarks The method returns a value corresponding to the current viewpoint. */ virtual bool isRequired() const = 0; public: /** \details Sets the path to the model. \param path [in] String with the model path to set. \returns The eOk value if the path is set successfully, or an appropriate error code otherwise. */ virtual OdResult setSourcePath(const OdString& path) = 0; /** \details Sets the transformation matrix for the model. \param trMtrx [in] Transformation matrix to set. */ virtual void setTransform(const OdGeMatrix3d& trMtrx) = 0; /** \details Sets the measuring units for this model. \param units [in] Measuring units to set. \remarks Units must be one of the following: Name Value Description NwModelUnits::UNITS_METERS 0x00 SI meter. NwModelUnits::UNITS_CENTIMETERS 0x01 1 100th of an SI meter. NwModelUnits::UNITS_MILLIMETERS 0x02 1 1000th of an SI meter. NwModelUnits::UNITS_FEET 0x03 1 3rd of a yard. NwModelUnits::UNITS_INCHES 0x04 1 12th of a foot, 2.54 SI centimeters. NwModelUnits::UNITS_YARDS 0x05 Imperial yard, 0.9144 SI meters. NwModelUnits::UNITS_KILOMETERS 0x06 1000 SI meters NwModelUnits::UNITS_MILES 0x07 1760 yards NwModelUnits::UNITS_MICROMETERS 0x08 1 1,000,000th of an SI meter, micron NwModelUnits::UNITS_MILS 0x09 1 1,000th of an inch NwModelUnits::UNITS_MICROINCHES 0x0A 1 1,000,000th of an inch
*/ virtual void setUnits(NwModelUnits::Enum units) = 0; /** \details Returns the pointer to instance of attribute with publish data. \returns Smart pointer to the OdNwPublishAttribute object, or an empty smart pointer if the object does not exist. */ virtual OdNwPublishAttributePtr getPublishAttribute() const = 0; }; /** \details This template class is a specialization of the OdSmartPtr class for OdNwModel object pointers. */ typedef OdSmartPtr OdNwModelPtr; #endif //__TNW_MODEL_H__