/////////////////////////////////////////////////////////////////////////////// // 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 __NWCLIPPLANESET_H__ #define __NWCLIPPLANESET_H__ #include "NwExport.h" #include "NwClipPlaneSetMode.h" #include "NwClipPlane.h" #include "Ge/GeQuaternion.h" class OdGsView; /** \details This class represents a set of clipping plane objects of a view. */ class NWDBEXPORT OdNwClipPlaneSet : public OdNwObject { //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdNwClipPlaneSet); //DOM-IGNORE-END public: /** \details Default constructor. Creates a new object of the OdNwClipPlaneSet class. */ OdNwClipPlaneSet(); public: /** \details Destructor. Frees allocated resources. */ virtual ~OdNwClipPlaneSet(); public: /** \details Returns the clipping planes type mode. \returns Clipping planes type mode as an NwClipPlaneSetMode::Enum value. \remarks The type must be one of the following: Name Value Description NwClipPlaneSetMode::CL_PLANES 0x00 Plane mode. NwClipPlaneSetMode::CL_BOX 0x01 Box mode.
*/ NwClipPlaneSetMode::Enum getMode() const; /** \details Returns the transformation matrix of the clipping planes. \returns Transformation matrix of the clipping planes as an OdGeMatrix3d object. \remarks The transformation matrix is required for the CL_BOX mode. Matrix values are expressed in model units. */ OdGeMatrix3d getTransform() const; /** \details Gets the planes of the view for the current clipping plane mode. \param planes [out] OdArray of OdGePlane objects with planes of the view. \returns eOk if the planes are retrieved successfully, or an appropriate error code otherwise. \remarks The planes contain resulting geometry data for rendering. For the CL_PLANE mode the clipping plane with the default mode corresponds to default OdGePlane objects. */ OdResult getPlanesForActiveMode(OdArray& planes); /** \details Gets the clipping plane of the view by index. \param clipPlane [out] OdNwClipPlane object with the selected clipping plane. \param idx [in] Clipping plane index. \returns eOk if the clipping plane is retrieved successfully, or an appropriate error code otherwise. \remarks The planes are required for the CL_PLANE mode. For the CL_BOX mode clipping plane objects have the default mode. */ OdResult getClipPlaneByIndex(OdNwClipPlane& clipPlane, OdUInt32 idx); /** \details Gets the clipping plane of the view by index. \param idx [in] Clipping plane index. \param pRes [out] pointer to OdResult object for getting error code. \returns OdSharedPtr with OdNwClipPlane object if the clipping plane is retrieved successfully, or an empty pointer otherwise. \remarks The planes are required for the CL_PLANE mode. For the CL_BOX mode clipping plane objects have the default mode. The method is deprecated since release 25.9 and will be removed soon. Use the OdResult getClipPlaneByIndex(OdNwClipPlane& clipPlane, OdUInt32 idx) method instead. */ OdNwClipPlanePtr getClipPlaneByIndex(OdUInt32 idx, OdResult* pRes = NULL); /** \details Returns a boolean value of the linked status of clipping planes. \returns True if clipping planes are linked, or false if not. \remarks Linked clipping planes means that clipping planes move together. */ bool isLinked() const; /** \details Returns an index of the current clipping plane. \returns Index of the current clipping plane. */ OdUInt32 getCurrentPlaneIndex() const; /** \details Returns a boolean value of the enabled section status of the view. \return True if clipping planes are enabled, or false if not. */ bool isEnabled() const; /** \details Returns the bounding box of the clip plane set. \returns OdGeExtents3d object with the bounding box. */ OdGeExtents3d getBox() const; /** \details Gets the rotation of the clip plane set. \returns Rotation of the clip plane set as an OdGeQuaternion value. */ OdGeQuaternion getRotation() const; /** \details Applies clipping plane parameters as GPU sections for OdGsView. \param pGsView [in] pointer to OdGsView class object with view to which is need to apply sections. \returns eOk if the clipping plane's applying is successfully, or an appropriate error code otherwise. \remarks GPU section applying work only for devices with 'HardwareSections' property, for example 'WinGLES2.txv' module support this feature. */ OdResult applyAsHardwareSections(OdGsView* pGsView) const; /** \details Sets clip plane set in box mode with new extents values. \param box [in] Constant reference to OdGeExtents3d object with new border for box clipplane set. \param rot [in] OdGeQuaternion object with rotation transform for cliplane box, by default there is no rotation for new clipplane box. \returns eOk if the clipping plane's setup is successfully, or an appropriate error code otherwise. */ OdResult setupBox(const OdGeExtents3d& box, const OdGeQuaternion& rot = OdGeQuaternion()); /** \details Sets plane data for one of 6 clip planes. \param plane [in] Constant reference to OdGePlane object with new clip plane. \param idx [in] index of plane for set. \returns eOk if the clipping plane's setup is successfully, or an appropriate error code otherwise. */ OdResult setupPlaneData(const OdGePlane& plane, OdUInt32 idx); /** \details Sets plane enabling for one of 6 clip planes. \param isEnable [in] flag set in true if plan should be enable. \param idx [in] index of plane for set. \returns eOk if the clipping plane's setup is successfully, or an appropriate error code otherwise. */ OdResult setEnablePlaneData(bool isEnable, OdUInt32 idx); /** \details Sets the enabled section status of the view. \param bIsEnabled [in] boolean value for is section in enabled/disable status. */ void setEnabled(bool bIsEnabled); }; /** \details This template class is a specialization of the OdSmartPtr class for OdNwClipPlaneSet object pointers. */ typedef OdSmartPtr OdNwClipPlaneSetPtr; #endif //__NWCLIPPLANESET_H__