1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027611: Visualization - provide an interface to access selection frustum center points from SelectBasics level

- getters for rectangular frustum center points were added to SelectBasics_SelectingVolumeManager
This commit is contained in:
vpa
2016-06-16 14:38:19 +03:00
committed by bugmaster
parent d7b1999736
commit 21a8e27535
5 changed files with 36 additions and 10 deletions

View File

@@ -4140,8 +4140,8 @@ static Standard_Integer OCC26195 (Draw_Interpretor& theDI, Standard_Integer theA
aMgr->BuildSelectingVolume (aPxPnt1);
}
const gp_Pnt* aVerts = aMgr->GetVertices();
gp_Pnt aNearPnt = aMgr->GetNearPnt();
gp_Pnt aFarPnt = aMgr->GetFarPnt();
gp_Pnt aNearPnt = aMgr->GetNearPickedPnt();
gp_Pnt aFarPnt = aMgr->GetFarPickedPnt();
BRepBuilderAPI_MakePolygon aWireBldrs[4];
aWireBldrs[0].Add (gp_Pnt (aVerts[0].X(), aVerts[0].Y(), aVerts[0].Z()));

View File

@@ -96,6 +96,18 @@ public:
virtual Standard_Boolean IsOverlapAllowed() const = 0;
//! 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
virtual gp_Pnt GetNearPickedPnt() const = 0;
//! 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
virtual gp_Pnt GetFarPickedPnt() const = 0;
protected:
SelectionType myActiveSelectionType; //!< Active selection type: point, box or polyline
};

View File

@@ -114,9 +114,15 @@ public:
//! A set of helper functions that return rectangular selecting frustum data
inline const gp_Pnt* GetVertices() const { return myVertices; }
inline gp_Pnt GetNearPnt() const { return myNearPickedPnt; }
//! 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
inline const gp_Pnt& GetNearPnt() const { return myNearPickedPnt; }
inline gp_Pnt GetFarPnt() const { return myFarPickedPnt; }
//! 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
inline const gp_Pnt& GetFarPnt() const { return myFarPickedPnt; }
protected:
Standard_EXPORT void segmentSegmentDistance (const gp_Pnt& theSegPnt1,

View File

@@ -430,10 +430,10 @@ const gp_Pnt* SelectMgr_SelectingVolumeManager::GetVertices() const
}
//=======================================================================
// function : GetNearPnt
// function : GetNearPickedPnt
// purpose :
//=======================================================================
gp_Pnt SelectMgr_SelectingVolumeManager::GetNearPnt() const
gp_Pnt SelectMgr_SelectingVolumeManager::GetNearPickedPnt() const
{
if (myActiveSelectionType == Polyline)
return gp_Pnt();
@@ -444,10 +444,10 @@ gp_Pnt SelectMgr_SelectingVolumeManager::GetNearPnt() const
}
//=======================================================================
// function : GetFarPnt
// function : GetFarPickedPnt
// purpose :
//=======================================================================
gp_Pnt SelectMgr_SelectingVolumeManager::GetFarPnt() const
gp_Pnt SelectMgr_SelectingVolumeManager::GetFarPickedPnt() const
{
if (myActiveSelectionType == Polyline)
return gp_Pnt();

View File

@@ -171,9 +171,17 @@ public:
//! A set of helper functions that return rectangular selecting frustum data
Standard_EXPORT const gp_Pnt* GetVertices() const;
Standard_EXPORT gp_Pnt GetNearPnt() const;
//! 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
Standard_EXPORT virtual gp_Pnt GetNearPickedPnt() const Standard_OVERRIDE;
Standard_EXPORT gp_Pnt GetFarPnt() const;
//! 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
Standard_EXPORT virtual gp_Pnt GetFarPickedPnt() const Standard_OVERRIDE;
private:
enum { Frustum, FrustumSet, VolumeTypesNb }; //!< Defines the amount of available selecting volumes