Open CASCADE Technology  7.2.0

OpenGl_Clipping Class Reference

This class contains logics related to tracking and modification of clipping plane state for particular OpenGl context. It contains information about enabled clipping planes and provides method to change clippings in context. The methods should be executed within OpenGl context associated with instance of this class. More...

#include <OpenGl_Clipping.hxx>

Public Member Functions

general methods
 OpenGl_Clipping ()
 Default constructor. More...
 
void Init (const Standard_Integer theMaxPlanes)
 Initialize. More...
 
void Reset (const Handle< OpenGl_Context > &theGlCtx, const Handle< Graphic3d_SequenceOfHClipPlane > &thePlanes)
 Setup list of global (for entire view) clipping planes and clears local plane list if it was not released before. More...
 
void SetLocalPlanes (const Handle< OpenGl_Context > &theGlCtx, const Handle< Graphic3d_SequenceOfHClipPlane > &thePlanes)
 Setup list of local (for current object) clipping planes. More...
 
Standard_Boolean IsClippingOn () const
 
Standard_Boolean IsCappingOn () const
 
Standard_Boolean IsClippingOrCappingOn () const
 
Standard_Integer NbClippingOrCappingOn () const
 
advanced method for disabling defined planes
Standard_Boolean HasDisabled () const
 Return true if some clipping planes have been temporarily disabled. More...
 
Standard_Boolean SetEnabled (const Handle< OpenGl_Context > &theGlCtx, const OpenGl_ClippingIterator &thePlane, const Standard_Boolean theIsEnabled)
 Disable plane temporarily. More...
 
void DisableGlobal (const Handle< OpenGl_Context > &theGlCtx)
 Temporarily disable all planes from the global (view) list, keep only local (object) list. More...
 
void RestoreDisabled (const Handle< OpenGl_Context > &theGlCtx)
 Restore all temporarily disabled planes. Does NOT affect constantly disabled planes Graphic3d_ClipPlane::IsOn(). More...
 
void DisableAllExcept (const Handle< OpenGl_Context > &theGlCtx, const OpenGl_ClippingIterator &thePlane)
 Temporarily disable all planes except specified one. Does not affect already disabled planes. More...
 
void EnableAllExcept (const Handle< OpenGl_Context > &theGlCtx, const OpenGl_ClippingIterator &thePlane)
 Enable back planes disabled by ::DisableAllExcept(). Keeps only specified plane enabled. More...
 

clipping state modification commands

void add (const Handle< OpenGl_Context > &theGlCtx, const Handle< Graphic3d_SequenceOfHClipPlane > &thePlanes, const Standard_Integer theStartIndex)
 Add planes to the context clipping at the specified system of coordinates. This methods loads appropriate transformation matrix from workspace to to transform equation coordinates. The planes become enabled in the context. If the number of the passed planes exceeds capabilities of OpenGl, the last planes are simply ignored. More...
 
void remove (const Handle< OpenGl_Context > &theGlCtx, const Handle< Graphic3d_SequenceOfHClipPlane > &thePlanes, const Standard_Integer theStartIndex)
 Remove the passed set of clipping planes from the context state. More...
 

Detailed Description

This class contains logics related to tracking and modification of clipping plane state for particular OpenGl context. It contains information about enabled clipping planes and provides method to change clippings in context. The methods should be executed within OpenGl context associated with instance of this class.

Constructor & Destructor Documentation

◆ OpenGl_Clipping()

OpenGl_Clipping::OpenGl_Clipping ( )

Default constructor.

Member Function Documentation

◆ add()

void OpenGl_Clipping::add ( const Handle< OpenGl_Context > &  theGlCtx,
const Handle< Graphic3d_SequenceOfHClipPlane > &  thePlanes,
const Standard_Integer  theStartIndex 
)
protected

Add planes to the context clipping at the specified system of coordinates. This methods loads appropriate transformation matrix from workspace to to transform equation coordinates. The planes become enabled in the context. If the number of the passed planes exceeds capabilities of OpenGl, the last planes are simply ignored.

Within FFP, method also temporarily resets ModelView matrix before calling glClipPlane(). Otherwise the method just redirects to addLazy().

Parameters
theGlCtx[in] context to access the matrices
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.

◆ DisableAllExcept()

void OpenGl_Clipping::DisableAllExcept ( const Handle< OpenGl_Context > &  theGlCtx,
const OpenGl_ClippingIterator thePlane 
)

Temporarily disable all planes except specified one. Does not affect already disabled planes.

◆ DisableGlobal()

void OpenGl_Clipping::DisableGlobal ( const Handle< OpenGl_Context > &  theGlCtx)

Temporarily disable all planes from the global (view) list, keep only local (object) list.

◆ EnableAllExcept()

void OpenGl_Clipping::EnableAllExcept ( const Handle< OpenGl_Context > &  theGlCtx,
const OpenGl_ClippingIterator thePlane 
)

Enable back planes disabled by ::DisableAllExcept(). Keeps only specified plane enabled.

◆ HasDisabled()

Standard_Boolean OpenGl_Clipping::HasDisabled ( ) const
inline

Return true if some clipping planes have been temporarily disabled.

◆ Init()

void OpenGl_Clipping::Init ( const Standard_Integer  theMaxPlanes)

Initialize.

Parameters
theMaxPlanes[in] number of clipping planes supported by OpenGl context.

◆ IsCappingOn()

Standard_Boolean OpenGl_Clipping::IsCappingOn ( ) const
inline
Returns
true if there are enabled capping planes

◆ IsClippingOn()

Standard_Boolean OpenGl_Clipping::IsClippingOn ( ) const
inline
Returns
true if there are enabled clipping planes (NOT capping)

◆ IsClippingOrCappingOn()

Standard_Boolean OpenGl_Clipping::IsClippingOrCappingOn ( ) const
inline
Returns
true if there are enabled clipping or capping planes

◆ NbClippingOrCappingOn()

Standard_Integer OpenGl_Clipping::NbClippingOrCappingOn ( ) const
inline
Returns
number of enabled clipping + capping planes

◆ remove()

void OpenGl_Clipping::remove ( const Handle< OpenGl_Context > &  theGlCtx,
const Handle< Graphic3d_SequenceOfHClipPlane > &  thePlanes,
const Standard_Integer  theStartIndex 
)
protected

Remove the passed set of clipping planes from the context state.

Parameters
thePlanes[in] the planes to remove from list.

◆ Reset()

void OpenGl_Clipping::Reset ( const Handle< OpenGl_Context > &  theGlCtx,
const Handle< Graphic3d_SequenceOfHClipPlane > &  thePlanes 
)

Setup list of global (for entire view) clipping planes and clears local plane list if it was not released before.

◆ RestoreDisabled()

void OpenGl_Clipping::RestoreDisabled ( const Handle< OpenGl_Context > &  theGlCtx)

Restore all temporarily disabled planes. Does NOT affect constantly disabled planes Graphic3d_ClipPlane::IsOn().

◆ SetEnabled()

Standard_Boolean OpenGl_Clipping::SetEnabled ( const Handle< OpenGl_Context > &  theGlCtx,
const OpenGl_ClippingIterator thePlane,
const Standard_Boolean  theIsEnabled 
)

Disable plane temporarily.

◆ SetLocalPlanes()

void OpenGl_Clipping::SetLocalPlanes ( const Handle< OpenGl_Context > &  theGlCtx,
const Handle< Graphic3d_SequenceOfHClipPlane > &  thePlanes 
)

Setup list of local (for current object) clipping planes.


The documentation for this class was generated from the following file: