Open CASCADE Technology  7.1.0.beta
Data Structures | Public Member Functions | Static Public Member Functions
Graphic3d_TransformPers Class Reference

Class for keeping and computing transformation persistence. Note that instance of this class can not define no transformation persistence Graphic3d_TMF_None - NULL handle should be used for this purpose. More...

#include <Graphic3d_TransformPers.hxx>

Inheritance diagram for Graphic3d_TransformPers:
Inheritance graph
[legend]

Public Member Functions

 Graphic3d_TransformPers (const Graphic3d_TransModeFlags theMode)
 Set transformation persistence. More...
 
 Graphic3d_TransformPers (const Graphic3d_TransModeFlags theMode, const gp_Pnt &thePnt)
 Set Zoom/Rotate transformation persistence with an anchor 3D point. Throws an exception if persistence mode is not Graphic3d_TMF_ZoomPers, Graphic3d_TMF_ZoomRotatePers or Graphic3d_TMF_RotatePers. More...
 
 Graphic3d_TransformPers (const Graphic3d_TransModeFlags theMode, const Aspect_TypeOfTriedronPosition theCorner, const Graphic3d_Vec2i &theOffset=Graphic3d_Vec2i(0, 0))
 Set 2d/trihedron transformation persistence with a corner and 2D offset. Throws an exception if persistence mode is not Graphic3d_TMF_TriedronPers or Graphic3d_TMF_2d. The offset is a positive displacement from the view corner in pixels. More...
 
Standard_Boolean IsZoomOrRotate () const
 Return true for Graphic3d_TMF_ZoomPers, Graphic3d_TMF_ZoomRotatePers or Graphic3d_TMF_RotatePers modes. More...
 
Standard_Boolean IsTrihedronOr2d () const
 Return true for Graphic3d_TMF_TriedronPers and Graphic3d_TMF_2d modes. More...
 
Graphic3d_TransModeFlags Mode () const
 Transformation persistence mode flags. More...
 
Graphic3d_TransModeFlags Flags () const
 Transformation persistence mode flags. More...
 
void SetPersistence (const Graphic3d_TransModeFlags theMode, const gp_Pnt &thePnt)
 Set Zoom/Rotate transformation persistence with an anchor 3D point. Throws an exception if persistence mode is not Graphic3d_TMF_ZoomPers, Graphic3d_TMF_ZoomRotatePers or Graphic3d_TMF_RotatePers. More...
 
void SetPersistence (const Graphic3d_TransModeFlags theMode, const Aspect_TypeOfTriedronPosition theCorner, const Graphic3d_Vec2i &theOffset)
 Set 2d/trihedron transformation persistence with a corner and 2D offset. Throws an exception if persistence mode is not Graphic3d_TMF_TriedronPers or Graphic3d_TMF_2d. More...
 
gp_Pnt AnchorPoint () const
 Return the anchor point for zoom/rotate transformation persistence. More...
 
void SetAnchorPoint (const gp_Pnt &thePnt)
 Set the anchor point for zoom/rotate transformation persistence. More...
 
Aspect_TypeOfTriedronPosition Corner2d () const
 Return the corner for 2d/trihedron transformation persistence. More...
 
void SetCorner2d (const Aspect_TypeOfTriedronPosition thePos)
 Set the corner for 2d/trihedron transformation persistence. More...
 
Graphic3d_Vec2i Offset2d () const
 Return the offset from the corner for 2d/trihedron transformation persistence. More...
 
void SetOffset2d (const Graphic3d_Vec2i &theOffset)
 Set the offset from the corner for 2d/trihedron transformation persistence. More...
 
template<class T >
void Apply (const Handle< Graphic3d_Camera > &theCamera, const NCollection_Mat4< T > &theProjection, const NCollection_Mat4< T > &theWorldView, const Standard_Integer theViewportWidth, const Standard_Integer theViewportHeight, Bnd_Box &theBoundingBox) const
 Apply transformation to bounding box of presentation. More...
 
template<class T >
void Apply (const Handle< Graphic3d_Camera > &theCamera, const NCollection_Mat4< T > &theProjection, const NCollection_Mat4< T > &theWorldView, const Standard_Integer theViewportWidth, const Standard_Integer theViewportHeight, BVH_Box< T, 3 > &theBoundingBox) const
 Apply transformation to bounding box of presentation. More...
 
template<class T >
NCollection_Mat4< T > Compute (const Handle< Graphic3d_Camera > &theCamera, const NCollection_Mat4< T > &theProjection, const NCollection_Mat4< T > &theWorldView, const Standard_Integer theViewportWidth, const Standard_Integer theViewportHeight) const
 Compute transformation. Computed matrix can be applied to model world transformation of an object to implement effect of transformation persistence. More...
 
template<class T >
void Apply (const Handle< Graphic3d_Camera > &theCamera, const NCollection_Mat4< T > &theProjection, NCollection_Mat4< T > &theWorldView, const Standard_Integer theViewportWidth, const Standard_Integer theViewportHeight) const
 Apply transformation persistence on specified matrices. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean 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. More...
 
Standard_Boolean IsKind (const Standard_CString 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. More...
 
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. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Static Public Member Functions

static Standard_Boolean IsZoomOrRotate (Graphic3d_TransModeFlags theMode)
 Return true if specified mode is zoom/rotate transformation persistence. More...
 
static Standard_Boolean IsTrihedronOr2d (Graphic3d_TransModeFlags theMode)
 Return true if specified mode is 2d/trihedron transformation persistence. More...
 
static Handle< Graphic3d_TransformPersFromDeprecatedParams (Graphic3d_TransModeFlags theFlag, const gp_Pnt &thePoint)
 Create Graphic3d_TransformPers instance from deprecated parameters set decoding 2D corner + offset parameters from 3D point. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 

Detailed Description

Class for keeping and computing transformation persistence. Note that instance of this class can not define no transformation persistence Graphic3d_TMF_None - NULL handle should be used for this purpose.

Constructor & Destructor Documentation

Graphic3d_TransformPers::Graphic3d_TransformPers ( const Graphic3d_TransModeFlags  theMode)
inline

Set transformation persistence.

Graphic3d_TransformPers::Graphic3d_TransformPers ( const Graphic3d_TransModeFlags  theMode,
const gp_Pnt thePnt 
)
inline

Set Zoom/Rotate transformation persistence with an anchor 3D point. Throws an exception if persistence mode is not Graphic3d_TMF_ZoomPers, Graphic3d_TMF_ZoomRotatePers or Graphic3d_TMF_RotatePers.

Graphic3d_TransformPers::Graphic3d_TransformPers ( const Graphic3d_TransModeFlags  theMode,
const Aspect_TypeOfTriedronPosition  theCorner,
const Graphic3d_Vec2i theOffset = Graphic3d_Vec2i (0, 0) 
)
inline

Set 2d/trihedron transformation persistence with a corner and 2D offset. Throws an exception if persistence mode is not Graphic3d_TMF_TriedronPers or Graphic3d_TMF_2d. The offset is a positive displacement from the view corner in pixels.

Member Function Documentation

gp_Pnt Graphic3d_TransformPers::AnchorPoint ( ) const
inline

Return the anchor point for zoom/rotate transformation persistence.

template<class T >
void Graphic3d_TransformPers::Apply ( const Handle< Graphic3d_Camera > &  theCamera,
const NCollection_Mat4< T > &  theProjection,
const NCollection_Mat4< T > &  theWorldView,
const Standard_Integer  theViewportWidth,
const Standard_Integer  theViewportHeight,
Bnd_Box theBoundingBox 
) const

Apply transformation to bounding box of presentation.

Parameters
theCamera[in] camera definition
theProjection[in] the projection transformation matrix.
theWorldView[in] the world view transformation matrix.
theViewportWidth[in] the width of viewport (for 2d persistence).
theViewportHeight[in] the height of viewport (for 2d persistence).
theBoundingBox[in/out] the bounding box to transform.
template<class T >
void Graphic3d_TransformPers::Apply ( const Handle< Graphic3d_Camera > &  theCamera,
const NCollection_Mat4< T > &  theProjection,
const NCollection_Mat4< T > &  theWorldView,
const Standard_Integer  theViewportWidth,
const Standard_Integer  theViewportHeight,
BVH_Box< T, 3 > &  theBoundingBox 
) const

Apply transformation to bounding box of presentation.

Parameters
theCamera[in] camera definition
theProjection[in] the projection transformation matrix.
theWorldView[in] the world view transformation matrix.
theViewportWidth[in] the width of viewport (for 2d persistence).
theViewportHeight[in] the height of viewport (for 2d persistence).
theBoundingBox[in/out] the bounding box to transform.
template<class T >
void Graphic3d_TransformPers::Apply ( const Handle< Graphic3d_Camera > &  theCamera,
const NCollection_Mat4< T > &  theProjection,
NCollection_Mat4< T > &  theWorldView,
const Standard_Integer  theViewportWidth,
const Standard_Integer  theViewportHeight 
) const

Apply transformation persistence on specified matrices.

Parameters
theCameracamera definition
theProjectionprojection matrix to modify
theWorldViewworld-view matrix to modify
theViewportWidthviewport width
theViewportHeightviewport height
template<class T >
NCollection_Mat4< T > Graphic3d_TransformPers::Compute ( const Handle< Graphic3d_Camera > &  theCamera,
const NCollection_Mat4< T > &  theProjection,
const NCollection_Mat4< T > &  theWorldView,
const Standard_Integer  theViewportWidth,
const Standard_Integer  theViewportHeight 
) const

Compute transformation. Computed matrix can be applied to model world transformation of an object to implement effect of transformation persistence.

Parameters
theCamera[in] camera definition
theProjection[in] the projection transformation matrix.
theWorldView[in] the world view transformation matrix.
theViewportWidth[in] the width of viewport (for 2d persistence).
theViewportHeight[in] the height of viewport (for 2d persistence).
Returns
transformation matrix to be applied to model world transformation of an object.
Aspect_TypeOfTriedronPosition Graphic3d_TransformPers::Corner2d ( ) const
inline

Return the corner for 2d/trihedron transformation persistence.

Graphic3d_TransModeFlags Graphic3d_TransformPers::Flags ( ) const
inline

Transformation persistence mode flags.

static Handle< Graphic3d_TransformPers > Graphic3d_TransformPers::FromDeprecatedParams ( Graphic3d_TransModeFlags  theFlag,
const gp_Pnt thePoint 
)
static

Create Graphic3d_TransformPers instance from deprecated parameters set decoding 2D corner + offset parameters from 3D point.

static Standard_Boolean Graphic3d_TransformPers::IsTrihedronOr2d ( Graphic3d_TransModeFlags  theMode)
inlinestatic

Return true if specified mode is 2d/trihedron transformation persistence.

Standard_Boolean Graphic3d_TransformPers::IsTrihedronOr2d ( ) const
inline

Return true for Graphic3d_TMF_TriedronPers and Graphic3d_TMF_2d modes.

static Standard_Boolean Graphic3d_TransformPers::IsZoomOrRotate ( Graphic3d_TransModeFlags  theMode)
inlinestatic

Return true if specified mode is zoom/rotate transformation persistence.

Standard_Boolean Graphic3d_TransformPers::IsZoomOrRotate ( ) const
inline

Return true for Graphic3d_TMF_ZoomPers, Graphic3d_TMF_ZoomRotatePers or Graphic3d_TMF_RotatePers modes.

Graphic3d_TransModeFlags Graphic3d_TransformPers::Mode ( ) const
inline

Transformation persistence mode flags.

Graphic3d_Vec2i Graphic3d_TransformPers::Offset2d ( ) const
inline

Return the offset from the corner for 2d/trihedron transformation persistence.

void Graphic3d_TransformPers::SetAnchorPoint ( const gp_Pnt thePnt)
inline

Set the anchor point for zoom/rotate transformation persistence.

void Graphic3d_TransformPers::SetCorner2d ( const Aspect_TypeOfTriedronPosition  thePos)
inline

Set the corner for 2d/trihedron transformation persistence.

void Graphic3d_TransformPers::SetOffset2d ( const Graphic3d_Vec2i theOffset)
inline

Set the offset from the corner for 2d/trihedron transformation persistence.

void Graphic3d_TransformPers::SetPersistence ( const Graphic3d_TransModeFlags  theMode,
const gp_Pnt thePnt 
)
inline

Set Zoom/Rotate transformation persistence with an anchor 3D point. Throws an exception if persistence mode is not Graphic3d_TMF_ZoomPers, Graphic3d_TMF_ZoomRotatePers or Graphic3d_TMF_RotatePers.

void Graphic3d_TransformPers::SetPersistence ( const Graphic3d_TransModeFlags  theMode,
const Aspect_TypeOfTriedronPosition  theCorner,
const Graphic3d_Vec2i theOffset 
)
inline

Set 2d/trihedron transformation persistence with a corner and 2D offset. Throws an exception if persistence mode is not Graphic3d_TMF_TriedronPers or Graphic3d_TMF_2d.

Field Documentation

PersParams2d Graphic3d_TransformPers::Params2d
PersParams3d Graphic3d_TransformPers::Params3d

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