Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
Graphic3d_Flipper Class Reference

CPU-side analogue of OpenGl_Flipper used by the selection pipeline. Describes a reference coordinate system used at draw time to mirror group contents so that they remain upright relative to the camera. The same logic is used here to compute the flipping matrix applied to bounding boxes and sensitive frustums, so that selection matches the rendered geometry. More...

#include <Graphic3d_Flipper.hxx>

Inheritance diagram for Graphic3d_Flipper:
Inheritance graph
[legend]

Public Member Functions

 Graphic3d_Flipper (const gp_Ax2 &theRefPlane)
 Constructor.
 
gp_Ax2 RefPlane () const
 Return reference plane used for flipping.
 
void SetRefPlane (const gp_Ax2 &theValue)
 Set reference plane used for flipping.
 
template<class T >
void Apply (const NCollection_Mat4< T > &theWorldView, Bnd_Box &theBoundingBox) const
 Apply flipping transformation to a Bnd_Box of presentation.
 
template<class T >
void Apply (const NCollection_Mat4< T > &theWorldView, BVH_Box< T, 3 > &theBoundingBox) const
 Apply flipping transformation to a BVH_Box of presentation.
 
template<class T >
NCollection_Mat4< T > Compute (const NCollection_Mat4< T > &theWorldView) const
 Compute the flipping transformation matrix. The returned matrix can be composed with the model-world transformation of an object to reproduce the render-time flip. Note: each branch of the flip is a 180 degree rotation (self-inverse), so the returned matrix is its own inverse.
 
virtual void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (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_TransientThis () 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

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_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

CPU-side analogue of OpenGl_Flipper used by the selection pipeline. Describes a reference coordinate system used at draw time to mirror group contents so that they remain upright relative to the camera. The same logic is used here to compute the flipping matrix applied to bounding boxes and sensitive frustums, so that selection matches the rendered geometry.

Constructor & Destructor Documentation

◆ Graphic3d_Flipper()

Graphic3d_Flipper::Graphic3d_Flipper ( const gp_Ax2 & theRefPlane)
inline

Constructor.

Member Function Documentation

◆ Apply() [1/2]

template<class T >
void Graphic3d_Flipper::Apply ( const NCollection_Mat4< T > & theWorldView,
Bnd_Box & theBoundingBox ) const

Apply flipping transformation to a Bnd_Box of presentation.

Parameters
theWorldView[in] the world view transformation matrix
theBoundingBox[in,out] the bounding box to transform

◆ Apply() [2/2]

template<class T >
void Graphic3d_Flipper::Apply ( const NCollection_Mat4< T > & theWorldView,
BVH_Box< T, 3 > & theBoundingBox ) const

Apply flipping transformation to a BVH_Box of presentation.

Parameters
theWorldView[in] the world view transformation matrix
theBoundingBox[in,out] the bounding box to transform

◆ Compute()

template<class T >
NCollection_Mat4< T > Graphic3d_Flipper::Compute ( const NCollection_Mat4< T > & theWorldView) const

Compute the flipping transformation matrix. The returned matrix can be composed with the model-world transformation of an object to reproduce the render-time flip. Note: each branch of the flip is a 180 degree rotation (self-inverse), so the returned matrix is its own inverse.

Parameters
theWorldView[in] the composed World-View * ModelWorld matrix that the caller would use at draw time. To agree with OpenGl_Flipper::Render() the caller must include the owning object's Transformation() and, when available, the flipping group's own Transformation(). Passing the bare WorldView matrix is only correct for objects/groups with identity transformations. TODO: group-level Graphic3d_Group::Transformation() is not folded in by the selection pipeline yet (the sensitive entity does not carry a reference to its host group). This only affects consumers that give the flipping group its own gp_Trsf - uncommon in stock OCCT.

◆ DumpJson()

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

Dumps the content of me into the stream.

◆ RefPlane()

gp_Ax2 Graphic3d_Flipper::RefPlane ( ) const
inline

Return reference plane used for flipping.

◆ SetRefPlane()

void Graphic3d_Flipper::SetRefPlane ( const gp_Ax2 & theValue)
inline

Set reference plane used for flipping.


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