/////////////////////////////////////////////////////////////////////////////// // 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 EX_H_HARDWARESECTIONS #define EX_H_HARDWARESECTIONS #include "TD_PackPush.h" #include "RxObject.h" #include "Ge/GeMatrix3d.h" #include "Ps/PlotStyles.h" #include "StaticRxObject.h" class OdGsView; /** \details This class provides ability to add new section planes, transform, remove, access existing section planes and customize the section geometry appearance. */ class OdHardwareSectionsInterface : public OdStaticRxObject { public: /** \details This structure represents a section definition (or section plane, in other words) used by the OdHardwareSectionsInterface object. */ struct SectionDef { /** Position of the section definition. */ OdGePoint3d m_position; /** Normal vector to the plane of section definition. */ OdGeVector3d m_normal; /** \details Default constructor for the SectionDef class. */ SectionDef() {} /** \details Constructor for the SectionDef class. Creates an instance with the specified position and normal vector of the plane. \param pos [in] Section position. \param norm [in] Normal to the section plane. */ SectionDef(const OdGePoint3d &pos, const OdGeVector3d &norm) : m_position(pos), m_normal(norm) {} /** \details Sets position of the the section definition. \param pos [in] Section position. */ void setPosition(const OdGePoint3d &pos) { m_position = pos; } /** \details Returns position of the the section definition. \returns Reference to an OdGePoint3d instance representing section position. */ const OdGePoint3d &position() const { return m_position; } /** \details Sets normal vector to the plane of section definition. \param norm [in] Normal to the section plane. */ void setNormal(const OdGeVector3d &norm) { m_normal = norm; } /** \details Returns normal vector to the plane of section definition. \returns Reference to an OdGeVector3d instance representing normal to the section plane. */ const OdGeVector3d &normal() const { return m_normal; } }; public: /** \details Default constructor for the OdHardwareSectionsInterface class. */ OdHardwareSectionsInterface() {} /** \details Adds a section plane for the specified view. \param pView [in] Pointer to a graphics view. \param secDef [in] Section definition to add. */ virtual void addSectionPlane(OdGsView *pView, const SectionDef &secDef) = 0; /** \details Removes a section plane from the specified view. \param pView [in] Pointer to a graphics view. \param nPlane [in] Index of a plane to remove. */ virtual void removeSectionPlane(OdGsView *pView, OdUInt32 nPlane) = 0; /** \details Update the plane object at the specified index in the array of cutting planes of a view. \param pView [in] Pointer to a graphics view. \param nPlane [in] Index of the plane. \param secDef [in] Section definition to replace. */ virtual void updateCuttingPlane(OdGsView* pView, OdUInt32 nPlane, const SectionDef& secDef) = 0; /** \details Returns a number of section planes of the specified view. \param pView [in] Pointer to a graphics view. \returns Number of section planes that are associated with the passed view. */ virtual OdUInt32 numSectionPlanes(const OdGsView *pView) const = 0; /** \details Retrieves a section plane of the specified view. \param pView [in] Pointer to a graphics view. \param nPlane [in] Index of the plane. \param secDef [out] Receives a section definition. */ virtual void getSectionPlane(const OdGsView *pView, OdUInt32 nPlane, SectionDef &secDef) const = 0; /** \details Clears all section planes of the specified view. \param pView [in] Pointer to a graphics view. */ virtual void clearSectionPlanes(OdGsView *pView) = 0; /** \details Transforms all section planes of the specified view. \param pView [in] Pointer to a graphics view. \param xForm [in] Transformation matrix. */ virtual void transformSectionPlanes(OdGsView *pView, const OdGeMatrix3d &xForm) = 0; /** \details Transforms a section plane of the specified view. \param pView [in] Pointer to a graphics view. \param nPlane [in] Index of the plane. \param xForm [in] Transformation matrix. */ virtual void transformSectionPlane(OdGsView* pView, OdUInt32 nPlane, const OdGeMatrix3d& xForm) = 0; /** \details Enables or disables sections filling in the specified view. \param pView [in] Pointer to a graphics view. \param bEnable [in] Flag that enables or disables the filling. */ virtual void setEnableSectionsFill(OdGsView *pView, bool bEnable) = 0; /** \details Checks whether sections filling is enabled in the specified view. \param pView [in] Pointer to a graphics view. \returns true if the sections filling is enabled, false otherwise. */ virtual bool isSectionsFillEnabled(const OdGsView *pView) const = 0; /** \details Sets the fill color of sections in the specified view. \param pView [in] Pointer to a graphics view. \param color [in] Fill color. */ virtual void setSectionsFillColor(OdGsView *pView, ODCOLORREF color) = 0; /** \details Returns the fill color of sections in the specified view. \param pView [in] Pointer to a graphics view. \returns Color value used for filling section. */ virtual ODCOLORREF sectionsFillColor(const OdGsView *pView) const = 0; /** \details Enables or disables sections fill patterns in the specified view. \param pView [in] Pointer to a graphics view. \param bEnable [in] Flag that enables or disables the fill patterns for sections. */ virtual void setEnableSectionsFillPattern(OdGsView *pView, bool bEnable) = 0; /** \details Checks whether sections fill patterns are enabled in the specified view. \param pView [in] Pointer to a graphics view. \returns true if the fill patterns are enabled, false otherwise. */ virtual bool isSectionsFillPatternEnabled(const OdGsView *pView) const = 0; /** \details Sets the fill pattern to use for sections in the specified view. \param pView [in] Pointer to a graphics view. \param pattern [in] Fill pattern for sections. */ virtual void setSectionsFillPattern(OdGsView *pView, OdPs::FillStyle pattern) = 0; /** \details Returns the fill pattern used for sections in the specified view. \param pView [in] Pointer to a graphics view. \returns A value from the OdPs::FillStyle enumeration that represents a fill pattern for sections. */ virtual OdPs::FillStyle sectionsFillPattern(const OdGsView *pView) const = 0; /** \details Sets the fill pattern color to use for sections in the specified view. \param pView [in] Pointer to a graphics view. \param pattern [in] Fill pattern color for sections. */ virtual void setSectionsFillPatternColor(OdGsView *pView, ODCOLORREF color) = 0; /** \details Returns the fill pattern color used for sections in the specified view. \param pView [in] Pointer to a graphics view. \returns Color value used for fill pattern in sections. */ virtual ODCOLORREF sectionsFillPatternColor(const OdGsView *pView) const = 0; }; /** \details This template class is a specialization of the OdSmartPtr class for OdHardwareSectionsInterface object pointers. */ typedef OdSmartPtr OdHardwareSectionsInterfacePtr; #include "TD_PackPop.h" #endif // EX_H_HARDWARESECTIONS