//! class.
class OpenGl_Clipping
{
-public:
-
- //! Enumerates supported equation coordinate spaces.
- enum EquationCoords
- {
- EquationCoords_View,
- EquationCoords_World
- };
-
public: //! @name general methods
//! Default constructor.
return myPlanes;
}
- //! @return kind of equation coordinate space used for the clip plane.
- inline EquationCoords GetEquationSpace (const Handle(Graphic3d_ClipPlane)& thePlane) const
- {
- return myPlaneStates.Find (thePlane).CoordSpace;
- }
-
//! Check whether the clipping plane has been set and enabled for the current context state.
//! @param thePlane [in] the plane to check.
//! @return True if plane is enabled.
//! Otherwise the method just redirects to addLazy().
//!
//! @param theGlCtx [in] context to access the matrices
- //! @param theCoordSpace [in] the equation definition space
//! @param thePlanes [in/out] the list of planes to be added
//! The list then provides information on which planes were really added to clipping state.
//! This list then can be used to fall back to previous state.
Standard_EXPORT void add (const Handle(OpenGl_Context)& theGlCtx,
- const EquationCoords& theCoordSpace,
Graphic3d_SequenceOfHClipPlane& thePlanes);
//! Add planes to the context clipping at the specified system of coordinates.
//! @param thePlanes [in/out] the list of planes to be added.
//! The list then provides information on which planes were really added to clipping state.
//! This list then can be used to fall back to previous state.
- //! @param theCoordSpace [in] the equation definition space.
Standard_EXPORT void addLazy (const Handle(OpenGl_Context)& theGlCtx,
- const EquationCoords& theCoordSpace,
Graphic3d_SequenceOfHClipPlane& thePlanes);
//! Remove the passed set of clipping planes from the context state.
public: //! @name Short-cuts
- //! Add planes to the context clipping at the view system of coordinates.
- //! If the number of the passed planes exceeds capabilities of OpenGl, the last planes
- //! are simply ignored.
- //! @param theGlCtx [in] context to access the matrices
- //! @param thePlanes [in/out] the list of planes to be added
- //! The list then provides information on which planes were really added to clipping state.
- //! This list then can be used to fall back to previous state.
- inline void AddView (const Handle(OpenGl_Context)& theGlCtx,
- Graphic3d_SequenceOfHClipPlane& thePlanes)
- {
- add (theGlCtx, EquationCoords_View, thePlanes);
- }
-
//! Add planes to the context clipping at the world system of coordinates.
//! If the number of the passed planes exceeds capabilities of OpenGl, the last planes
//! are simply ignored.
inline void AddWorld (const Handle(OpenGl_Context)& theGlCtx,
Graphic3d_SequenceOfHClipPlane& thePlanes)
{
- add (theGlCtx, EquationCoords_World, thePlanes);
+ add (theGlCtx, thePlanes);
}
//! Remove all of the planes from context state.
// declare default constructor
// to allow compilation of template collections
PlaneProps() {}
- PlaneProps (const EquationCoords theCoords,
- const Standard_Integer theID,
+ PlaneProps (const Standard_Integer theID,
const Standard_Boolean theIsEnabled)
{
- CoordSpace = theCoords;
ContextID = theID;
IsEnabled = theIsEnabled;
}
- EquationCoords CoordSpace;
Standard_Integer ContextID;
Standard_Boolean IsEnabled;
};