Open CASCADE Technology  7.4.1.dev
Public Member Functions
SelectMgr_SelectingVolumeManager Class Reference

This class is used to switch between active selecting volumes depending on selection type chosen by the user. More...

#include <SelectMgr_SelectingVolumeManager.hxx>

Inheritance diagram for SelectMgr_SelectingVolumeManager:
Inheritance graph
[legend]

Public Member Functions

 SelectMgr_SelectingVolumeManager (Standard_Boolean theToAllocateFrustums=Standard_True)
 Creates instances of all available selecting volume types. More...
 
virtual ~SelectMgr_SelectingVolumeManager ()
 
virtual SelectMgr_SelectingVolumeManager ScaleAndTransform (const Standard_Integer theScaleFactor, const gp_GTrsf &theTrsf, const Handle< SelectMgr_FrustumBuilder > &theBuilder=NULL) 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. More...
 
virtual Standard_Integer GetActiveSelectionType () const override
 
void SetActiveSelectionType (const SelectionType &theType)
 
const Handle< Graphic3d_Camera > & Camera () const
 Returns current camera definition. More...
 
void SetCamera (const Handle< Graphic3d_Camera > theCamera)
 Updates camera projection and orientation matrices in all selecting volumes. More...
 
void SetCamera (const Graphic3d_Mat4d &theProjection, const Graphic3d_Mat4d &theWorldView, const Standard_Boolean theIsOrthographic, const Graphic3d_WorldViewProjState &theWVPState=Graphic3d_WorldViewProjState())
 Updates camera projection and orientation matrices in all selecting volumes. More...
 
const Graphic3d_Mat4dProjectionMatrix () const
 
const Graphic3d_Mat4dWorldViewMatrix () const
 
void WindowSize (Standard_Integer &theWidth, Standard_Integer &theHeight) const
 
const Graphic3d_WorldViewProjStateWorldViewProjState () const
 
void SetViewport (const Standard_Real theX, const Standard_Real theY, const Standard_Real theWidth, const Standard_Real theHeight)
 Updates viewport in all selecting volumes. More...
 
void SetPixelTolerance (const Standard_Integer theTolerance)
 Updates pixel tolerance in all selecting volumes. More...
 
void SetWindowSize (const Standard_Integer theWidth, const Standard_Integer theHeight)
 Updates window size in all selecting volumes. More...
 
void BuildSelectingVolume (const gp_Pnt2d &thePoint)
 Builds rectangular selecting frustum for point selection. More...
 
void BuildSelectingVolume (const gp_Pnt2d &theMinPt, const gp_Pnt2d &theMaxPt)
 Builds rectangular selecting frustum for box selection. More...
 
void BuildSelectingVolume (const TColgp_Array1OfPnt2d &thePoints)
 Builds set of triangular selecting frustums for polyline selection. More...
 
virtual Standard_Boolean Overlaps (const SelectMgr_Vec3 &theBoxMin, const SelectMgr_Vec3 &theBoxMax, SelectBasics_PickResult &thePickResult) const override
 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) const override
 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, SelectBasics_PickResult &thePickResult) const override
 Intersection test between defined volume and given point. More...
 
virtual Standard_Boolean Overlaps (const gp_Pnt &thePnt) const override
 Intersection test between defined volume and given point. More...
 
virtual Standard_Boolean Overlaps (const Handle< TColgp_HArray1OfPnt > &theArrayOfPts, Standard_Integer theSensType, SelectBasics_PickResult &thePickResult) const override
 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 TColgp_Array1OfPnt &theArrayOfPts, Standard_Integer theSensType, SelectBasics_PickResult &thePickResult) const override
 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, SelectBasics_PickResult &thePickResult) const override
 Checks if line segment overlaps selecting frustum. More...
 
virtual Standard_Boolean Overlaps (const gp_Pnt &thePnt1, const gp_Pnt &thePnt2, const gp_Pnt &thePnt3, Standard_Integer theSensType, SelectBasics_PickResult &thePickResult) const override
 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) const override
 Measures distance between 3d projection of user-picked screen point and given point theCOG. More...
 
virtual gp_Pnt DetectedPoint (const Standard_Real theDepth) const override
 Calculates the point on a view ray that was detected during the run of selection algo by given depth. Throws exception if active selection type is not Point. More...
 
virtual void AllowOverlapDetection (const Standard_Boolean theIsToAllow)
 If theIsToAllow is false, only fully included sensitives will be detected, otherwise the algorithm will mark both included and overlapped entities as matched. More...
 
virtual Standard_Boolean IsOverlapAllowed () const override
 
const Handle< Graphic3d_SequenceOfHClipPlane > & ViewClipping () const
 Return view clipping planes. More...
 
const Handle< Graphic3d_SequenceOfHClipPlane > & ObjectClipping () const
 Return object clipping planes. More...
 
void SetViewClipping (const Handle< Graphic3d_SequenceOfHClipPlane > &theViewPlanes, const Handle< Graphic3d_SequenceOfHClipPlane > &theObjPlanes, const SelectMgr_SelectingVolumeManager *theWorldSelMgr)
 Valid for point selection only! Computes depth range for clipping planes. More...
 
void SetViewClipping (const SelectMgr_SelectingVolumeManager &theOther)
 Copy clipping planes from another volume manager. More...
 
const SelectMgr_ViewClipRangeViewClipRanges () const
 Return clipping range. More...
 
void SetViewClipRanges (const SelectMgr_ViewClipRange &theRange)
 Set clipping range. More...
 
const gp_PntGetVertices () const
 A set of helper functions that return rectangular selecting frustum data. More...
 
virtual gp_Pnt GetNearPickedPnt () const override
 Valid only for point and rectangular selection. Returns projection of 2d mouse picked point or projection of center of 2d rectangle (for point and rectangular selection correspondingly) onto near view frustum plane. More...
 
virtual gp_Pnt GetFarPickedPnt () const override
 Valid only for point and rectangular selection. Returns projection of 2d mouse picked point or projection of center of 2d rectangle (for point and rectangular selection correspondingly) onto far view frustum plane. More...
 
virtual gp_Pnt2d GetMousePosition () const override
 Return mouse coordinates for Point selection mode. More...
 
Handle< SelectMgr_BaseFrustumActiveVolume () const
 Returns active selecting volume that was built during last run of OCCT selection mechanism. More...
 
virtual void GetPlanes (NCollection_Vector< SelectMgr_Vec4 > &thePlaneEquations) const override
 Stores plane equation coefficients (in the following form: Ax + By + Cz + D = 0) to the given vector. More...
 
void DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const override
 Dumps the content of me into the stream. More...
 
- Public Member Functions inherited from SelectBasics_SelectingVolumeManager
 SelectBasics_SelectingVolumeManager ()
 
virtual ~SelectBasics_SelectingVolumeManager ()
 
virtual Standard_Boolean Overlaps (const NCollection_Vec3< Standard_Real > &theBoxMin, const NCollection_Vec3< Standard_Real > &theBoxMax, SelectBasics_PickResult &thePickResult) const =0
 Returns true if selecting volume is overlapped by box theBox. More...
 
virtual Standard_Boolean Overlaps (const NCollection_Vec3< Standard_Real > &theBoxMin, const NCollection_Vec3< Standard_Real > &theBoxMax, Standard_Boolean *theInside=NULL) const =0
 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 void GetPlanes (NCollection_Vector< NCollection_Vec4< Standard_Real > > &thePlaneEquations) const =0
 Stores plane equation coefficients (in the following form: Ax + By + Cz + D = 0) to the given vector. More...
 

Additional Inherited Members

- Public Types inherited from SelectBasics_SelectingVolumeManager
enum  SelectionType { Point, Box, Polyline, Unknown }
 Available selection types. More...
 
- Protected Attributes inherited from SelectBasics_SelectingVolumeManager
SelectionType myActiveSelectionType
 Active selection type: point, box or polyline. More...
 

Detailed Description

This class is used to switch between active selecting volumes depending on selection type chosen by the user.

Constructor & Destructor Documentation

◆ SelectMgr_SelectingVolumeManager()

SelectMgr_SelectingVolumeManager::SelectMgr_SelectingVolumeManager ( Standard_Boolean  theToAllocateFrustums = Standard_True)

Creates instances of all available selecting volume types.

◆ ~SelectMgr_SelectingVolumeManager()

virtual SelectMgr_SelectingVolumeManager::~SelectMgr_SelectingVolumeManager ( )
inlinevirtual

Member Function Documentation

◆ ActiveVolume()

Handle< SelectMgr_BaseFrustum > SelectMgr_SelectingVolumeManager::ActiveVolume ( ) const
inline

Returns active selecting volume that was built during last run of OCCT selection mechanism.

◆ AllowOverlapDetection()

virtual void SelectMgr_SelectingVolumeManager::AllowOverlapDetection ( const Standard_Boolean  theIsToAllow)
virtual

If theIsToAllow is false, only fully included sensitives will be detected, otherwise the algorithm will mark both included and overlapped entities as matched.

◆ BuildSelectingVolume() [1/3]

void SelectMgr_SelectingVolumeManager::BuildSelectingVolume ( const gp_Pnt2d thePoint)

Builds rectangular selecting frustum for point selection.

◆ BuildSelectingVolume() [2/3]

void SelectMgr_SelectingVolumeManager::BuildSelectingVolume ( const gp_Pnt2d theMinPt,
const gp_Pnt2d theMaxPt 
)

Builds rectangular selecting frustum for box selection.

◆ BuildSelectingVolume() [3/3]

void SelectMgr_SelectingVolumeManager::BuildSelectingVolume ( const TColgp_Array1OfPnt2d thePoints)

Builds set of triangular selecting frustums for polyline selection.

◆ Camera()

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

Returns current camera definition.

◆ DetectedPoint()

virtual gp_Pnt SelectMgr_SelectingVolumeManager::DetectedPoint ( const Standard_Real  theDepth) const
overridevirtual

Calculates the point on a view ray that was detected during the run of selection algo by given depth. Throws exception if active selection type is not Point.

Implements SelectBasics_SelectingVolumeManager.

◆ DistToGeometryCenter()

virtual Standard_Real SelectMgr_SelectingVolumeManager::DistToGeometryCenter ( const gp_Pnt theCOG) const
overridevirtual

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

Implements SelectBasics_SelectingVolumeManager.

◆ DumpJson()

void SelectMgr_SelectingVolumeManager::DumpJson ( Standard_OStream theOStream,
Standard_Integer  theDepth = -1 
) const
overridevirtual

Dumps the content of me into the stream.

Reimplemented from SelectBasics_SelectingVolumeManager.

◆ GetActiveSelectionType()

virtual Standard_Integer SelectMgr_SelectingVolumeManager::GetActiveSelectionType ( ) const
overridevirtual

◆ GetFarPickedPnt()

virtual gp_Pnt SelectMgr_SelectingVolumeManager::GetFarPickedPnt ( ) const
overridevirtual

Valid only for point and rectangular selection. Returns projection of 2d mouse picked point or projection of center of 2d rectangle (for point and rectangular selection correspondingly) onto far view frustum plane.

Implements SelectBasics_SelectingVolumeManager.

◆ GetMousePosition()

virtual gp_Pnt2d SelectMgr_SelectingVolumeManager::GetMousePosition ( ) const
inlineoverridevirtual

Return mouse coordinates for Point selection mode.

Implements SelectBasics_SelectingVolumeManager.

◆ GetNearPickedPnt()

virtual gp_Pnt SelectMgr_SelectingVolumeManager::GetNearPickedPnt ( ) const
overridevirtual

Valid only for point and rectangular selection. Returns projection of 2d mouse picked point or projection of center of 2d rectangle (for point and rectangular selection correspondingly) onto near view frustum plane.

Implements SelectBasics_SelectingVolumeManager.

◆ GetPlanes()

virtual void SelectMgr_SelectingVolumeManager::GetPlanes ( NCollection_Vector< SelectMgr_Vec4 > &  thePlaneEquations) const
inlineoverridevirtual

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

◆ GetVertices()

const gp_Pnt* SelectMgr_SelectingVolumeManager::GetVertices ( ) const

A set of helper functions that return rectangular selecting frustum data.

◆ IsOverlapAllowed()

virtual Standard_Boolean SelectMgr_SelectingVolumeManager::IsOverlapAllowed ( ) const
overridevirtual

◆ ObjectClipping()

const Handle< Graphic3d_SequenceOfHClipPlane >& SelectMgr_SelectingVolumeManager::ObjectClipping ( ) const
inline

Return object clipping planes.

◆ Overlaps() [1/8]

virtual Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps ( const SelectMgr_Vec3 theBoxMin,
const SelectMgr_Vec3 theBoxMax,
SelectBasics_PickResult thePickResult 
) const
overridevirtual

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

◆ Overlaps() [2/8]

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

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

◆ Overlaps() [3/8]

virtual Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps ( const gp_Pnt thePnt,
SelectBasics_PickResult thePickResult 
) const
overridevirtual

Intersection test between defined volume and given point.

Implements SelectBasics_SelectingVolumeManager.

◆ Overlaps() [4/8]

virtual Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps ( const gp_Pnt thePnt) const
overridevirtual

Intersection test between defined volume and given point.

Implements SelectBasics_SelectingVolumeManager.

◆ Overlaps() [5/8]

virtual Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps ( const Handle< TColgp_HArray1OfPnt > &  theArrayOfPts,
Standard_Integer  theSensType,
SelectBasics_PickResult thePickResult 
) const
overridevirtual

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.

Implements SelectBasics_SelectingVolumeManager.

◆ Overlaps() [6/8]

virtual Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps ( const TColgp_Array1OfPnt theArrayOfPts,
Standard_Integer  theSensType,
SelectBasics_PickResult thePickResult 
) const
overridevirtual

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.

Implements SelectBasics_SelectingVolumeManager.

◆ Overlaps() [7/8]

virtual Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps ( const gp_Pnt thePnt1,
const gp_Pnt thePnt2,
SelectBasics_PickResult thePickResult 
) const
overridevirtual

Checks if line segment overlaps selecting frustum.

Implements SelectBasics_SelectingVolumeManager.

◆ Overlaps() [8/8]

virtual Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps ( const gp_Pnt thePnt1,
const gp_Pnt thePnt2,
const gp_Pnt thePnt3,
Standard_Integer  theSensType,
SelectBasics_PickResult thePickResult 
) const
overridevirtual

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.

Implements SelectBasics_SelectingVolumeManager.

◆ ProjectionMatrix()

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

◆ ScaleAndTransform()

virtual SelectMgr_SelectingVolumeManager SelectMgr_SelectingVolumeManager::ScaleAndTransform ( const Standard_Integer  theScaleFactor,
const gp_GTrsf theTrsf,
const Handle< SelectMgr_FrustumBuilder > &  theBuilder = NULL 
) const
virtual

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. Builder is an optional argument that represents corresponding settings for re-constructing transformed frustum from scratch. Can be null if reconstruction is not expected furthermore.

◆ SetActiveSelectionType()

void SelectMgr_SelectingVolumeManager::SetActiveSelectionType ( const SelectionType theType)

◆ SetCamera() [1/2]

void SelectMgr_SelectingVolumeManager::SetCamera ( const Handle< Graphic3d_Camera theCamera)

Updates camera projection and orientation matrices in all selecting volumes.

◆ SetCamera() [2/2]

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

Updates camera projection and orientation matrices in all selecting volumes.

◆ SetPixelTolerance()

void SelectMgr_SelectingVolumeManager::SetPixelTolerance ( const Standard_Integer  theTolerance)

Updates pixel tolerance in all selecting volumes.

◆ SetViewClipping() [1/2]

void SelectMgr_SelectingVolumeManager::SetViewClipping ( const Handle< Graphic3d_SequenceOfHClipPlane > &  theViewPlanes,
const Handle< Graphic3d_SequenceOfHClipPlane > &  theObjPlanes,
const SelectMgr_SelectingVolumeManager theWorldSelMgr 
)

Valid for point selection only! Computes depth range for clipping planes.

Parameters
theViewPlanes[in] global view planes
theObjPlanes[in] object planes
theWorldSelMgr[in] selection volume in world space for computing clipping plane ranges

◆ SetViewClipping() [2/2]

void SelectMgr_SelectingVolumeManager::SetViewClipping ( const SelectMgr_SelectingVolumeManager theOther)

Copy clipping planes from another volume manager.

◆ SetViewClipRanges()

void SelectMgr_SelectingVolumeManager::SetViewClipRanges ( const SelectMgr_ViewClipRange theRange)
inline

Set clipping range.

◆ SetViewport()

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

Updates viewport in all selecting volumes.

◆ SetWindowSize()

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

Updates window size in all selecting volumes.

◆ ViewClipping()

const Handle< Graphic3d_SequenceOfHClipPlane >& SelectMgr_SelectingVolumeManager::ViewClipping ( ) const
inline

Return view clipping planes.

◆ ViewClipRanges()

const SelectMgr_ViewClipRange& SelectMgr_SelectingVolumeManager::ViewClipRanges ( ) const
inline

Return clipping range.

◆ WindowSize()

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

◆ WorldViewMatrix()

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

◆ WorldViewProjState()

const Graphic3d_WorldViewProjState& SelectMgr_SelectingVolumeManager::WorldViewProjState ( ) const
Returns
current camera world view projection transformation state common for all selecting volumes

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