Open CASCADE Technology  7.2.0
Public Member Functions | Protected Attributes

SelectMgr_BaseFrustum Class Reference

This class is an interface for different types of selecting frustums, defining different selection types, like point, box or polyline selection. It contains signatures of functions for detection of overlap by sensitive entity and initializes some data for building the selecting frustum. More...

#include <SelectMgr_BaseFrustum.hxx>

Inheritance diagram for SelectMgr_BaseFrustum:
Inheritance graph
[legend]

Public Member Functions

 SelectMgr_BaseFrustum ()
 Creates new selecting volume with pixel toletance set to 2, orthographic camera and empty frustum builder. More...
 
virtual ~SelectMgr_BaseFrustum ()
 
const Handle< Graphic3d_Camera > & Camera () const
 Return camera definition. More...
 
void SetCamera (const Handle< Graphic3d_Camera > &theCamera)
 Passes camera projection and orientation matrices to builder. More...
 
void SetCamera (const Graphic3d_Mat4d &theProjection, const Graphic3d_Mat4d &theWorldView, const Standard_Boolean theIsOrthographic, const Graphic3d_WorldViewProjState &theWVPState=Graphic3d_WorldViewProjState())
 Passes camera projection and orientation matrices to builder. More...
 
const Graphic3d_Mat4dProjectionMatrix () const
 
const Graphic3d_Mat4dWorldViewMatrix () const
 
const Graphic3d_WorldViewProjStateWorldViewProjState () const
 
void SetPixelTolerance (const Standard_Integer theTol)
 
void SetWindowSize (const Standard_Integer theWidth, const Standard_Integer theHeight)
 
void WindowSize (Standard_Integer &theWidth, Standard_Integer &theHeight) const
 
void SetViewport (const Standard_Real theX, const Standard_Real theY, const Standard_Real theWidth, const Standard_Real theHeight)
 Passes viewport parameters to builder. More...
 
void SetBuilder (const Handle< SelectMgr_FrustumBuilder > &theBuilder)
 Nullifies the builder created in the constructor and copies the pointer given. More...
 
virtual void Build (const gp_Pnt2d &)
 Builds volume according to the point and given pixel tolerance. More...
 
virtual void Build (const gp_Pnt2d &, const gp_Pnt2d &)
 Builds volume according to the selected rectangle. More...
 
virtual void Build (const gp_Pnt2d &, const gp_Pnt2d &, const gp_Pnt2d &)
 Builds volume according to the triangle given. More...
 
virtual void Build (const TColgp_Array1OfPnt2d &)
 Builds selecting volumes set according to polyline points. More...
 
virtual Handle< SelectMgr_BaseFrustumScaleAndTransform (const Standard_Integer, const gp_GTrsf &) const
 IMPORTANT: Scaling makes sense only for frustum built on a single point! Note that this method does not perform any checks on type of the frustum. Returns a copy of the frustum resized according to the scale factor given and transforms it using the matrix given. There are no default parameters, but in case if: More...
 
virtual Standard_Boolean Overlaps (const SelectMgr_Vec3 &theBoxMin, const SelectMgr_Vec3 &theBoxMax, Standard_Real &theDepth)
 SAT intersection test between defined volume and given axis-aligned box. More...
 
virtual Standard_Boolean Overlaps (const SelectMgr_Vec3 &theBoxMin, const SelectMgr_Vec3 &theBoxMax, Standard_Boolean *theInside=NULL)
 Returns true if selecting volume is overlapped by axis-aligned bounding box with minimum corner at point theMinPt and maximum at point theMaxPt. More...
 
virtual Standard_Boolean Overlaps (const gp_Pnt &thePnt, Standard_Real &theDepth)
 Intersection test between defined volume and given point. More...
 
virtual Standard_Boolean Overlaps (const gp_Pnt &thePnt)
 Intersection test between defined volume and given point Does not perform depth calculation, so this method is defined as helper function for inclusion test. Therefore, its implementation makes sense only for rectangular frustum with box selection mode activated. More...
 
virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt &theArrayOfPnts, Select3D_TypeOfSensitivity theSensType, Standard_Real &theDepth)
 SAT intersection test between defined volume and given ordered set of points, representing line segments. The test may be considered of interior part or boundary line defined by segments depending on given sensitivity type. More...
 
virtual Standard_Boolean Overlaps (const gp_Pnt &thePnt1, const gp_Pnt &thePnt2, Standard_Real &theDepth)
 Checks if line segment overlaps selecting frustum. More...
 
virtual Standard_Boolean Overlaps (const gp_Pnt &thePt1, const gp_Pnt &thePt2, const gp_Pnt &thePt3, Select3D_TypeOfSensitivity theSensType, Standard_Real &theDepth)
 SAT intersection test between defined volume and given triangle. The test may be considered of interior part or boundary line defined by triangle vertices depending on given sensitivity type. More...
 
virtual Standard_Real DistToGeometryCenter (const gp_Pnt &theCOG)
 Measures distance between 3d projection of user-picked screen point and given point theCOG. More...
 
virtual gp_Pnt DetectedPoint (const Standard_Real theDepth) const
 
virtual Standard_Boolean IsClipped (const Graphic3d_SequenceOfHClipPlane &thePlanes, const Standard_Real theDepth)
 Checks if the point of sensitive in which selection was detected belongs to the region defined by clipping planes. More...
 
virtual void SetViewClipping (const Handle< Graphic3d_SequenceOfHClipPlane > &)
 Valid for point selection only! Computes depth range for global (defined for the whole view) clipping planes. More...
 
virtual Standard_Boolean SetViewClippingEnabled (const Standard_Boolean)
 Set if view clipping plane is enabled or not. More...
 
virtual void GetPlanes (NCollection_Vector< SelectMgr_Vec4 > &thePlaneEquations) const
 Stores plane equation coefficients (in the following form: Ax + By + Cz + D = 0) to the given vector. 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...
 

Protected Attributes

Standard_Integer myPixelTolerance
 Pixel tolerance. More...
 
Standard_Boolean myIsOrthographic
 Defines if current camera is orthographic. More...
 
Handle< SelectMgr_FrustumBuildermyBuilder
 A tool implementing methods for volume build. More...
 
Handle< Graphic3d_CameramyCamera
 camera definition More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. 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...
 

Detailed Description

This class is an interface for different types of selecting frustums, defining different selection types, like point, box or polyline selection. It contains signatures of functions for detection of overlap by sensitive entity and initializes some data for building the selecting frustum.

Constructor & Destructor Documentation

◆ SelectMgr_BaseFrustum()

SelectMgr_BaseFrustum::SelectMgr_BaseFrustum ( )

Creates new selecting volume with pixel toletance set to 2, orthographic camera and empty frustum builder.

◆ ~SelectMgr_BaseFrustum()

virtual SelectMgr_BaseFrustum::~SelectMgr_BaseFrustum ( )
inlinevirtual

Member Function Documentation

◆ Build() [1/4]

virtual void SelectMgr_BaseFrustum::Build ( const gp_Pnt2d )
inlinevirtual

Builds volume according to the point and given pixel tolerance.

Reimplemented in SelectMgr_RectangularFrustum.

◆ Build() [2/4]

virtual void SelectMgr_BaseFrustum::Build ( const gp_Pnt2d ,
const gp_Pnt2d  
)
inlinevirtual

Builds volume according to the selected rectangle.

Reimplemented in SelectMgr_RectangularFrustum.

◆ Build() [3/4]

virtual void SelectMgr_BaseFrustum::Build ( const gp_Pnt2d ,
const gp_Pnt2d ,
const gp_Pnt2d  
)
inlinevirtual

Builds volume according to the triangle given.

Reimplemented in SelectMgr_TriangularFrustum.

◆ Build() [4/4]

virtual void SelectMgr_BaseFrustum::Build ( const TColgp_Array1OfPnt2d )
inlinevirtual

Builds selecting volumes set according to polyline points.

Reimplemented in SelectMgr_TriangularFrustumSet.

◆ Camera()

const Handle< Graphic3d_Camera >& SelectMgr_BaseFrustum::Camera ( ) const
inline

Return camera definition.

◆ DetectedPoint()

virtual gp_Pnt SelectMgr_BaseFrustum::DetectedPoint ( const Standard_Real  theDepth) const
virtual

Reimplemented in SelectMgr_RectangularFrustum.

◆ DistToGeometryCenter()

virtual Standard_Real SelectMgr_BaseFrustum::DistToGeometryCenter ( const gp_Pnt theCOG)
virtual

Measures distance between 3d projection of user-picked screen point and given point theCOG.

Reimplemented in SelectMgr_RectangularFrustum.

◆ GetPlanes()

virtual void SelectMgr_BaseFrustum::GetPlanes ( NCollection_Vector< SelectMgr_Vec4 > &  thePlaneEquations) const
inlinevirtual

Stores plane equation coefficients (in the following form: Ax + By + Cz + D = 0) to the given vector.

Reimplemented in SelectMgr_RectangularFrustum, SelectMgr_TriangularFrustum, and SelectMgr_TriangularFrustumSet.

◆ IsClipped()

virtual Standard_Boolean SelectMgr_BaseFrustum::IsClipped ( const Graphic3d_SequenceOfHClipPlane thePlanes,
const Standard_Real  theDepth 
)
virtual

Checks if the point of sensitive in which selection was detected belongs to the region defined by clipping planes.

Reimplemented in SelectMgr_RectangularFrustum.

◆ Overlaps() [1/7]

virtual Standard_Boolean SelectMgr_BaseFrustum::Overlaps ( const SelectMgr_Vec3 theBoxMin,
const SelectMgr_Vec3 theBoxMax,
Standard_Real theDepth 
)
virtual

SAT intersection test between defined volume and given axis-aligned box.

Reimplemented in SelectMgr_RectangularFrustum, SelectMgr_TriangularFrustumSet, and SelectMgr_TriangularFrustum.

◆ Overlaps() [2/7]

virtual Standard_Boolean SelectMgr_BaseFrustum::Overlaps ( const SelectMgr_Vec3 theBoxMin,
const SelectMgr_Vec3 theBoxMax,
Standard_Boolean theInside = NULL 
)
virtual

Returns true if selecting volume is overlapped by axis-aligned bounding box with minimum corner at point theMinPt and maximum at point theMaxPt.

Reimplemented in SelectMgr_RectangularFrustum, SelectMgr_TriangularFrustumSet, and SelectMgr_TriangularFrustum.

◆ Overlaps() [3/7]

virtual Standard_Boolean SelectMgr_BaseFrustum::Overlaps ( const gp_Pnt thePnt,
Standard_Real theDepth 
)
virtual

Intersection test between defined volume and given point.

Reimplemented in SelectMgr_RectangularFrustum, SelectMgr_TriangularFrustumSet, and SelectMgr_TriangularFrustum.

◆ Overlaps() [4/7]

virtual Standard_Boolean SelectMgr_BaseFrustum::Overlaps ( const gp_Pnt thePnt)
virtual

Intersection test between defined volume and given point Does not perform depth calculation, so this method is defined as helper function for inclusion test. Therefore, its implementation makes sense only for rectangular frustum with box selection mode activated.

Reimplemented in SelectMgr_RectangularFrustum.

◆ Overlaps() [5/7]

virtual Standard_Boolean SelectMgr_BaseFrustum::Overlaps ( const TColgp_Array1OfPnt theArrayOfPnts,
Select3D_TypeOfSensitivity  theSensType,
Standard_Real theDepth 
)
virtual

SAT intersection test between defined volume and given ordered set of points, representing line segments. The test may be considered of interior part or boundary line defined by segments depending on given sensitivity type.

Reimplemented in SelectMgr_RectangularFrustum, SelectMgr_TriangularFrustum, and SelectMgr_TriangularFrustumSet.

◆ Overlaps() [6/7]

virtual Standard_Boolean SelectMgr_BaseFrustum::Overlaps ( const gp_Pnt thePnt1,
const gp_Pnt thePnt2,
Standard_Real theDepth 
)
virtual

Checks if line segment overlaps selecting frustum.

Reimplemented in SelectMgr_RectangularFrustum, SelectMgr_TriangularFrustum, and SelectMgr_TriangularFrustumSet.

◆ Overlaps() [7/7]

virtual Standard_Boolean SelectMgr_BaseFrustum::Overlaps ( const gp_Pnt thePt1,
const gp_Pnt thePt2,
const gp_Pnt thePt3,
Select3D_TypeOfSensitivity  theSensType,
Standard_Real theDepth 
)
virtual

SAT intersection test between defined volume and given triangle. The test may be considered of interior part or boundary line defined by triangle vertices depending on given sensitivity type.

Reimplemented in SelectMgr_RectangularFrustum, SelectMgr_TriangularFrustum, and SelectMgr_TriangularFrustumSet.

◆ ProjectionMatrix()

const Graphic3d_Mat4d& SelectMgr_BaseFrustum::ProjectionMatrix ( ) const
Returns
current camera projection transformation common for all selecting volumes

◆ ScaleAndTransform()

virtual Handle< SelectMgr_BaseFrustum > SelectMgr_BaseFrustum::ScaleAndTransform ( const Standard_Integer  ,
const gp_GTrsf  
) const
inlinevirtual

IMPORTANT: Scaling makes sense only for frustum built on a single point! Note that this method does not perform any checks on type of the frustum. Returns a copy of the frustum resized according to the scale factor given and transforms it using the matrix given. There are no default parameters, but in case if:

  • transformation only is needed: must be initialized as any negative value;
  • scale only is needed: must be set to gp_Identity.

Reimplemented in SelectMgr_RectangularFrustum, SelectMgr_TriangularFrustumSet, and SelectMgr_TriangularFrustum.

◆ SetBuilder()

void SelectMgr_BaseFrustum::SetBuilder ( const Handle< SelectMgr_FrustumBuilder > &  theBuilder)

Nullifies the builder created in the constructor and copies the pointer given.

◆ SetCamera() [1/2]

void SelectMgr_BaseFrustum::SetCamera ( const Handle< Graphic3d_Camera > &  theCamera)

Passes camera projection and orientation matrices to builder.

◆ SetCamera() [2/2]

void SelectMgr_BaseFrustum::SetCamera ( const Graphic3d_Mat4d theProjection,
const Graphic3d_Mat4d theWorldView,
const Standard_Boolean  theIsOrthographic,
const Graphic3d_WorldViewProjState theWVPState = Graphic3d_WorldViewProjState() 
)

Passes camera projection and orientation matrices to builder.

◆ SetPixelTolerance()

void SelectMgr_BaseFrustum::SetPixelTolerance ( const Standard_Integer  theTol)

◆ SetViewClipping()

virtual void SelectMgr_BaseFrustum::SetViewClipping ( const Handle< Graphic3d_SequenceOfHClipPlane > &  )
inlinevirtual

Valid for point selection only! Computes depth range for global (defined for the whole view) clipping planes.

Reimplemented in SelectMgr_RectangularFrustum.

◆ SetViewClippingEnabled()

virtual Standard_Boolean SelectMgr_BaseFrustum::SetViewClippingEnabled ( const Standard_Boolean  )
inlinevirtual

Set if view clipping plane is enabled or not.

Returns
previous value of the flag

Reimplemented in SelectMgr_RectangularFrustum.

◆ SetViewport()

void SelectMgr_BaseFrustum::SetViewport ( const Standard_Real  theX,
const Standard_Real  theY,
const Standard_Real  theWidth,
const Standard_Real  theHeight 
)

Passes viewport parameters to builder.

◆ SetWindowSize()

void SelectMgr_BaseFrustum::SetWindowSize ( const Standard_Integer  theWidth,
const Standard_Integer  theHeight 
)

◆ WindowSize()

void SelectMgr_BaseFrustum::WindowSize ( Standard_Integer theWidth,
Standard_Integer theHeight 
) const

◆ WorldViewMatrix()

const Graphic3d_Mat4d& SelectMgr_BaseFrustum::WorldViewMatrix ( ) const
Returns
current camera world view transformation common for all selecting volumes

◆ WorldViewProjState()

const Graphic3d_WorldViewProjState& SelectMgr_BaseFrustum::WorldViewProjState ( ) const
Returns
current camera world view projection transformation state

Field Documentation

◆ myBuilder

Handle< SelectMgr_FrustumBuilder > SelectMgr_BaseFrustum::myBuilder
protected

A tool implementing methods for volume build.

◆ myCamera

Handle< Graphic3d_Camera > SelectMgr_BaseFrustum::myCamera
protected

camera definition

◆ myIsOrthographic

Standard_Boolean SelectMgr_BaseFrustum::myIsOrthographic
protected

Defines if current camera is orthographic.

◆ myPixelTolerance

Standard_Integer SelectMgr_BaseFrustum::myPixelTolerance
protected

Pixel tolerance.


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