OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    Graphic3d_ClipPlane Class Reference

    Container for properties describing either a Clipping halfspace (single Clipping Plane), or a chain of Clipping Planes defining logical AND (conjunction) operation. The plane equation is specified in "world" coordinate system. More...

    #include <Graphic3d_ClipPlane.hxx>

    Inheritance diagram for Graphic3d_ClipPlane:

    Public Types

    typedef NCollection_Vec4< double > Equation
     Type defining XYZW (ABCD) plane equation - left for compatibility with old code using Graphic3d_ClipPlane::Equation type.
    typedef void base_type
     Returns a type descriptor about this object.

    Public Member Functions

     Graphic3d_ClipPlane ()
     Default constructor. Initializes clip plane container with the following properties:
     Graphic3d_ClipPlane (const Graphic3d_ClipPlane &theOther)
     Copy constructor.
     Graphic3d_ClipPlane (const NCollection_Vec4< double > &theEquation)
     Construct clip plane for the passed equation. By default the plane is on, capping is turned off.
     Graphic3d_ClipPlane (const gp_Pln &thePlane)
     Construct clip plane from the passed geometrical definition. By default the plane is on, capping is turned off.
    void SetEquation (const gp_Pln &thePlane)
     Set plane equation by its geometrical definition. The equation is specified in "world" coordinate system.
    void SetEquation (const NCollection_Vec4< double > &theEquation)
     Set 4-component equation vector for clipping plane. The equation is specified in "world" coordinate system.
    const NCollection_Vec4< double > & GetEquation () const
     Get 4-component equation vector for clipping plane.
    const NCollection_Vec4< double > & ReversedEquation () const
     Get 4-component equation vector for clipping plane.
    bool IsOn () const
     Check that the clipping plane is turned on.
    void SetOn (const bool theIsOn)
     Change state of the clipping plane.
    void SetCapping (const bool theIsOn)
     Change state of capping surface rendering.
    bool IsCapping () const
     Check state of capping surface rendering.
    const gp_Pln & ToPlane () const
     Get geometrical definition.
    virtual occ::handle< Graphic3d_ClipPlane > Clone () const
     Clone plane. Virtual method to simplify copying procedure if plane class is redefined at application level to add specific fields to it e.g. id, name, etc.
    bool IsChain () const
     Return TRUE if this item defines a conjunction (logical AND) between a set of Planes. Graphic3d_ClipPlane item defines either a Clipping halfspace (single Clipping Plane) or a Clipping volume defined by a logical AND (conjunction) operation between a set of Planes defined as a Chain (so that the volume cuts a space only in case if check fails for ALL Planes in the Chain).
    occ::handle< Graphic3d_ClipPlane > ChainPreviousPlane () const
     Return the previous plane in a Chain of Planes defining logical AND operation, or NULL if there is no Chain or it is a first element in Chain. When clipping is defined by a Chain of Planes, it cuts a space only in case if check fails for all Planes in Chain.
    const occ::handle< Graphic3d_ClipPlane > & ChainNextPlane () const
     Return the next plane in a Chain of Planes defining logical AND operation, or NULL if there is no chain or it is a last element in chain.
    int NbChainNextPlanes () const
     Return the number of chains in forward direction (including this item, so it is always >= 1). For a head of Chain - returns the length of entire Chain.
    void SetChainNextPlane (const occ::handle< Graphic3d_ClipPlane > &thePlane)
     Set the next plane in a Chain of Planes. This operation also updates relationship between chains (Previous/Next items), so that the previously set Next plane is cut off.
    Quantity_Color CappingColor () const
     Return color for rendering capping surface.
    void SetCappingColor (const Quantity_Color &theColor)
     Set color for rendering capping surface.
    void SetCappingMaterial (const Graphic3d_MaterialAspect &theMat)
     Set material for rendering capping surface.
    const Graphic3d_MaterialAspect & CappingMaterial () const
    void SetCappingTexture (const occ::handle< Graphic3d_TextureMap > &theTexture)
     Set texture to be applied on capping surface.
    occ::handle< Graphic3d_TextureMap > CappingTexture () const
    void SetCappingHatch (const Aspect_HatchStyle theStyle)
     Set hatch style (stipple) and turn hatching on.
    Aspect_HatchStyle CappingHatch () const
    void SetCappingCustomHatch (const occ::handle< Graphic3d_HatchStyle > &theStyle)
     Set custom hatch style (stipple) and turn hatching on.
    const occ::handle< Graphic3d_HatchStyle > & CappingCustomHatch () const
    void SetCappingHatchOn ()
     Turn on hatching.
    void SetCappingHatchOff ()
     Turn off hatching.
    bool IsHatchOn () const
    const TCollection_AsciiString & GetId () const
     This ID is used for managing associated resources in graphical driver. The clip plane can be assigned within a range of IO which can be displayed in separate OpenGl contexts. For each of the context an associated OpenGl resource for graphical aspects should be created and kept. The resources are stored in graphical driver for each of individual groups of shared context under the clip plane identifier.
    const occ::handle< Graphic3d_AspectFillArea3d > & CappingAspect () const
     Return capping aspect.
    void SetCappingAspect (const occ::handle< Graphic3d_AspectFillArea3d > &theAspect)
     Assign capping aspect.
    bool ToUseObjectMaterial () const
     Flag indicating whether material for capping plane should be taken from object. Default value: FALSE (use dedicated capping plane material).
    void SetUseObjectMaterial (bool theToUse)
     Set flag for controlling the source of capping plane material.
    bool ToUseObjectTexture () const
     Flag indicating whether texture for capping plane should be taken from object. Default value: FALSE.
    void SetUseObjectTexture (bool theToUse)
     Set flag for controlling the source of capping plane texture.
    bool ToUseObjectShader () const
     Flag indicating whether shader program for capping plane should be taken from object. Default value: FALSE.
    void SetUseObjectShader (bool theToUse)
     Set flag for controlling the source of capping plane shader program.
    bool ToUseObjectProperties () const
     Return true if some fill area aspect properties should be taken from object.
    Graphic3d_ClipState ProbePoint (const NCollection_Vec4< double > &thePoint) const
     Check if the given point is outside / inside / on section.
    Graphic3d_ClipState ProbeBox (const Graphic3d_BndBox3d &theBox) const
     Check if the given bounding box is fully outside / fully inside.
    bool ProbeBoxTouch (const Graphic3d_BndBox3d &theBox) const
     Check if the given bounding box is In and touch the clipping planes.
    Graphic3d_ClipState ProbePointHalfspace (const NCollection_Vec4< double > &thePoint) const
     Check if the given point is outside of the half-space (e.g. should be discarded by clipping plane).
    Graphic3d_ClipState ProbeBoxHalfspace (const Graphic3d_BndBox3d &theBox) const
     Check if the given bounding box is fully outside / fully inside the half-space.
    bool IsPointOutHalfspace (const NCollection_Vec4< double > &thePoint) const
     Check if the given point is outside of the half-space (e.g. should be discarded by clipping plane).
    bool IsBoxFullOutHalfspace (const Graphic3d_BndBox3d &theBox) const
     Check if the given bounding box is fully outside of the half-space (e.g. should be discarded by clipping plane).
    Graphic3d_ClipState ProbeBoxMaxPointHalfspace (const Graphic3d_BndBox3d &theBox) const
     Check if the given bounding box is fully outside of the half-space (e.g. should be discarded by clipping plane).
    bool IsBoxFullInHalfspace (const Graphic3d_BndBox3d &theBox) const
     Check if the given bounding box is fully inside (or touches from inside) the half-space (e.g. NOT discarded by clipping plane).
    virtual void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
     Dumps the content of me into the stream.
    unsigned int MCountEquation () const
    unsigned int MCountAspect () const
    Public Member Functions inherited from Standard_Transient
     Standard_Transient ()
     Empty constructor.
     Standard_Transient (const Standard_Transient &)
     Copy constructor – does nothing.
    Standard_Transient & operator= (const Standard_Transient &)
     Assignment operator, needed to avoid copying reference counter.
    virtual ~Standard_Transient ()=default
     Destructor must be virtual.
    virtual const opencascade::handle< Standard_Type > & DynamicType () const
     Returns a type descriptor about this object.
    bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
     Returns a true value if this is an instance of Type.
    bool IsInstance (const char *const theTypeName) const
     Returns a true value if this is an instance of TypeName.
    bool IsKind (const opencascade::handle< Standard_Type > &theType) const
     Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
    bool IsKind (const char *const theTypeName) const
     Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
    Standard_Transient * This () const
     Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
    int GetRefCount () const noexcept
     Get the reference counter of this object.
    void IncrementRefCounter () noexcept
     Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
    int DecrementRefCounter () noexcept
     Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
    virtual void Delete () const
     Memory deallocator for transient classes.

    Additional Inherited Members

    static constexpr const char * get_type_name ()
     Returns a type descriptor about this object.
    static const opencascade::handle< Standard_Type > & get_type_descriptor ()
     Returns type descriptor of Standard_Transient class.

    Detailed Description

    Container for properties describing either a Clipping halfspace (single Clipping Plane), or a chain of Clipping Planes defining logical AND (conjunction) operation. The plane equation is specified in "world" coordinate system.

    Member Typedef Documentation

    ◆ Equation

    Type defining XYZW (ABCD) plane equation - left for compatibility with old code using Graphic3d_ClipPlane::Equation type.

    Constructor & Destructor Documentation

    ◆ Graphic3d_ClipPlane() [1/4]

    Graphic3d_ClipPlane::Graphic3d_ClipPlane ( )

    Default constructor. Initializes clip plane container with the following properties:

    • Equation (0.0, 0.0, 1.0, 0)
    • IsOn (True),
    • IsCapping (False),
    • Material (Graphic3d_NameOfMaterial_DEFAULT),
    • Texture (NULL),
    • HatchStyle (Aspect_HS_HORIZONTAL),
    • IsHatchOn (False)

    ◆ Graphic3d_ClipPlane() [2/4]

    Graphic3d_ClipPlane::Graphic3d_ClipPlane ( const Graphic3d_ClipPlane & theOther)

    Copy constructor.

    Parameters
    [in]theOtherthe copied plane.

    ◆ Graphic3d_ClipPlane() [3/4]

    Graphic3d_ClipPlane::Graphic3d_ClipPlane ( const NCollection_Vec4< double > & theEquation)

    Construct clip plane for the passed equation. By default the plane is on, capping is turned off.

    Parameters
    [in]theEquationthe plane equation.

    ◆ Graphic3d_ClipPlane() [4/4]

    Graphic3d_ClipPlane::Graphic3d_ClipPlane ( const gp_Pln & thePlane)

    Construct clip plane from the passed geometrical definition. By default the plane is on, capping is turned off.

    Parameters
    [in]thePlanethe plane.

    Member Function Documentation

    ◆ CappingAspect()

    const occ::handle< Graphic3d_AspectFillArea3d > & Graphic3d_ClipPlane::CappingAspect ( ) const
    inline

    Return capping aspect.

    Returns
    capping surface rendering aspect.

    ◆ CappingColor()

    Quantity_Color Graphic3d_ClipPlane::CappingColor ( ) const
    inline

    Return color for rendering capping surface.

    ◆ CappingCustomHatch()

    const occ::handle< Graphic3d_HatchStyle > & Graphic3d_ClipPlane::CappingCustomHatch ( ) const
    inline
    Returns
    hatching style.

    ◆ CappingHatch()

    Aspect_HatchStyle Graphic3d_ClipPlane::CappingHatch ( ) const
    inline
    Returns
    hatching style.

    ◆ CappingMaterial()

    const Graphic3d_MaterialAspect & Graphic3d_ClipPlane::CappingMaterial ( ) const
    inline
    Returns
    capping material.

    ◆ CappingTexture()

    occ::handle< Graphic3d_TextureMap > Graphic3d_ClipPlane::CappingTexture ( ) const
    inline
    Returns
    capping texture map.

    ◆ ChainNextPlane()

    const occ::handle< Graphic3d_ClipPlane > & Graphic3d_ClipPlane::ChainNextPlane ( ) const
    inline

    Return the next plane in a Chain of Planes defining logical AND operation, or NULL if there is no chain or it is a last element in chain.

    ◆ ChainPreviousPlane()

    occ::handle< Graphic3d_ClipPlane > Graphic3d_ClipPlane::ChainPreviousPlane ( ) const
    inline

    Return the previous plane in a Chain of Planes defining logical AND operation, or NULL if there is no Chain or it is a first element in Chain. When clipping is defined by a Chain of Planes, it cuts a space only in case if check fails for all Planes in Chain.

    ◆ Clone()

    virtual occ::handle< Graphic3d_ClipPlane > Graphic3d_ClipPlane::Clone ( ) const
    virtual

    Clone plane. Virtual method to simplify copying procedure if plane class is redefined at application level to add specific fields to it e.g. id, name, etc.

    Returns
    new instance of clipping plane with same properties and attributes.

    ◆ DumpJson()

    virtual void Graphic3d_ClipPlane::DumpJson ( Standard_OStream & theOStream,
    int theDepth = -1 ) const
    virtual

    Dumps the content of me into the stream.

    ◆ GetEquation()

    const NCollection_Vec4< double > & Graphic3d_ClipPlane::GetEquation ( ) const
    inline

    Get 4-component equation vector for clipping plane.

    Returns
    clipping plane equation vector.

    ◆ GetId()

    const TCollection_AsciiString & Graphic3d_ClipPlane::GetId ( ) const
    inline

    This ID is used for managing associated resources in graphical driver. The clip plane can be assigned within a range of IO which can be displayed in separate OpenGl contexts. For each of the context an associated OpenGl resource for graphical aspects should be created and kept. The resources are stored in graphical driver for each of individual groups of shared context under the clip plane identifier.

    Returns
    clip plane resource identifier string.

    ◆ IsBoxFullInHalfspace()

    bool Graphic3d_ClipPlane::IsBoxFullInHalfspace ( const Graphic3d_BndBox3d & theBox) const
    inline

    Check if the given bounding box is fully inside (or touches from inside) the half-space (e.g. NOT discarded by clipping plane).

    ◆ IsBoxFullOutHalfspace()

    bool Graphic3d_ClipPlane::IsBoxFullOutHalfspace ( const Graphic3d_BndBox3d & theBox) const
    inline

    Check if the given bounding box is fully outside of the half-space (e.g. should be discarded by clipping plane).

    ◆ IsCapping()

    bool Graphic3d_ClipPlane::IsCapping ( ) const
    inline

    Check state of capping surface rendering.

    Returns
    true (turned on) or false depending on the state.

    ◆ IsChain()

    bool Graphic3d_ClipPlane::IsChain ( ) const
    inline

    Return TRUE if this item defines a conjunction (logical AND) between a set of Planes. Graphic3d_ClipPlane item defines either a Clipping halfspace (single Clipping Plane) or a Clipping volume defined by a logical AND (conjunction) operation between a set of Planes defined as a Chain (so that the volume cuts a space only in case if check fails for ALL Planes in the Chain).

    Note that Graphic3d_ClipPlane item cannot:

    • Define a Chain with logical OR (disjunction) operation; this should be done through Graphic3d_SequenceOfHClipPlane.
    • Define nested Chains.
    • Disable Chain items; only entire Chain can be disabled (by disabled a head of Chain).

    The head of a Chain defines all visual properties of the Chain, so that Graphic3d_ClipPlane of next items in a Chain merely defines only geometrical definition of the plane.

    ◆ IsHatchOn()

    bool Graphic3d_ClipPlane::IsHatchOn ( ) const
    inline
    Returns
    True if hatching mask is turned on.

    ◆ IsOn()

    bool Graphic3d_ClipPlane::IsOn ( ) const
    inline

    Check that the clipping plane is turned on.

    Returns
    boolean flag indicating whether the plane is in on or off state.

    ◆ IsPointOutHalfspace()

    bool Graphic3d_ClipPlane::IsPointOutHalfspace ( const NCollection_Vec4< double > & thePoint) const
    inline

    Check if the given point is outside of the half-space (e.g. should be discarded by clipping plane).

    ◆ MCountAspect()

    unsigned int Graphic3d_ClipPlane::MCountAspect ( ) const
    inline
    Returns
    modification counter for aspect.

    ◆ MCountEquation()

    unsigned int Graphic3d_ClipPlane::MCountEquation ( ) const
    inline
    Returns
    modification counter for equation.

    ◆ NbChainNextPlanes()

    int Graphic3d_ClipPlane::NbChainNextPlanes ( ) const
    inline

    Return the number of chains in forward direction (including this item, so it is always >= 1). For a head of Chain - returns the length of entire Chain.

    ◆ ProbeBox()

    Graphic3d_ClipState Graphic3d_ClipPlane::ProbeBox ( const Graphic3d_BndBox3d & theBox) const
    inline

    Check if the given bounding box is fully outside / fully inside.

    ◆ ProbeBoxHalfspace()

    Graphic3d_ClipState Graphic3d_ClipPlane::ProbeBoxHalfspace ( const Graphic3d_BndBox3d & theBox) const
    inline

    Check if the given bounding box is fully outside / fully inside the half-space.

    ◆ ProbeBoxMaxPointHalfspace()

    Graphic3d_ClipState Graphic3d_ClipPlane::ProbeBoxMaxPointHalfspace ( const Graphic3d_BndBox3d & theBox) const
    inline

    Check if the given bounding box is fully outside of the half-space (e.g. should be discarded by clipping plane).

    ◆ ProbeBoxTouch()

    bool Graphic3d_ClipPlane::ProbeBoxTouch ( const Graphic3d_BndBox3d & theBox) const
    inline

    Check if the given bounding box is In and touch the clipping planes.

    ◆ ProbePoint()

    Graphic3d_ClipState Graphic3d_ClipPlane::ProbePoint ( const NCollection_Vec4< double > & thePoint) const
    inline

    Check if the given point is outside / inside / on section.

    ◆ ProbePointHalfspace()

    Graphic3d_ClipState Graphic3d_ClipPlane::ProbePointHalfspace ( const NCollection_Vec4< double > & thePoint) const
    inline

    Check if the given point is outside of the half-space (e.g. should be discarded by clipping plane).

    ◆ ReversedEquation()

    const NCollection_Vec4< double > & Graphic3d_ClipPlane::ReversedEquation ( ) const
    inline

    Get 4-component equation vector for clipping plane.

    Returns
    clipping plane equation vector.

    ◆ SetCapping()

    void Graphic3d_ClipPlane::SetCapping ( const bool theIsOn)

    Change state of capping surface rendering.

    Parameters
    [in]theIsOnthe flag specifying whether the graphic driver should perform rendering of capping surface produced by this plane. The graphic driver produces this surface for convex graphics by means of stencil-test and multi-pass rendering.

    ◆ SetCappingAspect()

    void Graphic3d_ClipPlane::SetCappingAspect ( const occ::handle< Graphic3d_AspectFillArea3d > & theAspect)

    Assign capping aspect.

    ◆ SetCappingColor()

    void Graphic3d_ClipPlane::SetCappingColor ( const Quantity_Color & theColor)

    Set color for rendering capping surface.

    ◆ SetCappingCustomHatch()

    void Graphic3d_ClipPlane::SetCappingCustomHatch ( const occ::handle< Graphic3d_HatchStyle > & theStyle)

    Set custom hatch style (stipple) and turn hatching on.

    Parameters
    [in]theStylethe hatch pattern.

    ◆ SetCappingHatch()

    void Graphic3d_ClipPlane::SetCappingHatch ( const Aspect_HatchStyle theStyle)

    Set hatch style (stipple) and turn hatching on.

    Parameters
    [in]theStylethe hatch style.

    ◆ SetCappingHatchOff()

    void Graphic3d_ClipPlane::SetCappingHatchOff ( )

    Turn off hatching.

    ◆ SetCappingHatchOn()

    void Graphic3d_ClipPlane::SetCappingHatchOn ( )

    Turn on hatching.

    ◆ SetCappingMaterial()

    void Graphic3d_ClipPlane::SetCappingMaterial ( const Graphic3d_MaterialAspect & theMat)

    Set material for rendering capping surface.

    Parameters
    [in]theMatthe material.

    ◆ SetCappingTexture()

    void Graphic3d_ClipPlane::SetCappingTexture ( const occ::handle< Graphic3d_TextureMap > & theTexture)

    Set texture to be applied on capping surface.

    Parameters
    [in]theTexturethe texture.

    ◆ SetChainNextPlane()

    void Graphic3d_ClipPlane::SetChainNextPlane ( const occ::handle< Graphic3d_ClipPlane > & thePlane)

    Set the next plane in a Chain of Planes. This operation also updates relationship between chains (Previous/Next items), so that the previously set Next plane is cut off.

    ◆ SetEquation() [1/2]

    void Graphic3d_ClipPlane::SetEquation ( const gp_Pln & thePlane)

    Set plane equation by its geometrical definition. The equation is specified in "world" coordinate system.

    Parameters
    [in]thePlanethe plane.

    ◆ SetEquation() [2/2]

    void Graphic3d_ClipPlane::SetEquation ( const NCollection_Vec4< double > & theEquation)

    Set 4-component equation vector for clipping plane. The equation is specified in "world" coordinate system.

    Parameters
    [in]theEquationthe XYZW (or "ABCD") equation vector.

    ◆ SetOn()

    void Graphic3d_ClipPlane::SetOn ( const bool theIsOn)

    Change state of the clipping plane.

    Parameters
    [in]theIsOnthe flag specifying whether the graphic driver clipping by this plane should be turned on or off.

    ◆ SetUseObjectMaterial()

    void Graphic3d_ClipPlane::SetUseObjectMaterial ( bool theToUse)
    inline

    Set flag for controlling the source of capping plane material.

    ◆ SetUseObjectShader()

    void Graphic3d_ClipPlane::SetUseObjectShader ( bool theToUse)
    inline

    Set flag for controlling the source of capping plane shader program.

    ◆ SetUseObjectTexture()

    void Graphic3d_ClipPlane::SetUseObjectTexture ( bool theToUse)
    inline

    Set flag for controlling the source of capping plane texture.

    ◆ ToPlane()

    const gp_Pln & Graphic3d_ClipPlane::ToPlane ( ) const
    inline

    Get geometrical definition.

    Returns
    geometrical definition of clipping plane

    ◆ ToUseObjectMaterial()

    bool Graphic3d_ClipPlane::ToUseObjectMaterial ( ) const
    inline

    Flag indicating whether material for capping plane should be taken from object. Default value: FALSE (use dedicated capping plane material).

    ◆ ToUseObjectProperties()

    bool Graphic3d_ClipPlane::ToUseObjectProperties ( ) const
    inline

    Return true if some fill area aspect properties should be taken from object.

    ◆ ToUseObjectShader()

    bool Graphic3d_ClipPlane::ToUseObjectShader ( ) const
    inline

    Flag indicating whether shader program for capping plane should be taken from object. Default value: FALSE.

    ◆ ToUseObjectTexture()

    bool Graphic3d_ClipPlane::ToUseObjectTexture ( ) const
    inline

    Flag indicating whether texture for capping plane should be taken from object. Default value: FALSE.


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