mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0032365: Visualization - refactoring of viewer selector
Add SelectMgr_BaseIntersector class as base intersector that can have any geometry not only frustum. Remove cached static array of selecting volumes from selecting volume manager. Keep only one the latest active selection volume. Change initialization interface of active volume frustum inside of selecting volume manager: Init*SelectingVolume(), set required parameters, BuildSelectingVolume(). Mark existing BuildSelectingVolume() methods as deprecated. Use SelectMgr_SelectionType instead of SelectBasics_SelectingVolumeManager::SelectionType (the last one is marked as deprecated). Add interface GetViewRayDirection() to selecting volume manager to get view ray direction (instead of computation it as vector from near to far point). Add interface IsScalableActiveVolume() to selecting volume manager to check possibility of scaling of current active selecting volume.
This commit is contained in:
@@ -225,7 +225,7 @@ Standard_Boolean Select3D_SensitiveCircle::Matches (SelectBasics_SelectingVolume
|
||||
Points3D (anArrayOfPnt);
|
||||
if (!theMgr.IsOverlapAllowed())
|
||||
{
|
||||
if (theMgr.GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Polyline)
|
||||
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
|
||||
{
|
||||
SelectBasics_PickResult aDummy;
|
||||
return theMgr.Overlaps (anArrayOfPnt, mySensType, aDummy);
|
||||
|
@@ -193,9 +193,9 @@ Handle(Select3D_SensitiveEntity) Select3D_SensitiveGroup::GetConnected()
|
||||
Standard_Boolean Select3D_SensitiveGroup::Matches (SelectBasics_SelectingVolumeManager& theMgr,
|
||||
SelectBasics_PickResult& thePickResult)
|
||||
{
|
||||
const Standard_Boolean toMatchAll = theMgr.GetActiveSelectionType() != SelectBasics_SelectingVolumeManager::Point
|
||||
const Standard_Boolean toMatchAll = theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point
|
||||
&& myMustMatchAll;
|
||||
const Standard_Boolean toCheckAll = theMgr.GetActiveSelectionType() != SelectBasics_SelectingVolumeManager::Point
|
||||
const Standard_Boolean toCheckAll = theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point
|
||||
&& myToCheckOverlapAll;
|
||||
if (!toMatchAll && !toCheckAll)
|
||||
{
|
||||
|
@@ -254,7 +254,7 @@ Standard_Boolean Select3D_SensitivePoly::elementIsInside (SelectBasics_Selecting
|
||||
}
|
||||
|
||||
const Standard_Integer aSegmentIdx = mySegmentIndexes->Value (theElemIdx);
|
||||
if (theMgr.GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Polyline)
|
||||
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
|
||||
{
|
||||
SelectBasics_PickResult aDummy;
|
||||
return theMgr.Overlaps (myPolyg.Pnt3d (aSegmentIdx + 0), myPolyg.Pnt3d (aSegmentIdx + 1), aDummy);
|
||||
|
@@ -891,7 +891,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::Matches (SelectBasics_Selecti
|
||||
myDetectedEdgeNode2 = -1;
|
||||
const bool toDetectRange = !myDetectedElemMap.IsNull() || !myDetectedNodeMap.IsNull();
|
||||
if (myGroups.IsNull()
|
||||
|| theMgr.GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Point
|
||||
|| theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Point
|
||||
|| !toDetectRange)
|
||||
{
|
||||
if (!matches (theMgr, thePickResult, toDetectRange))
|
||||
@@ -995,7 +995,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::overlapsElement (SelectBasics
|
||||
myDetectedElem = myDetectedNode = aPointIndex;
|
||||
myMinDepthElem = myMinDepthNode = aPickResult.Depth();
|
||||
}
|
||||
if (theMgr.GetActiveSelectionType() != SelectBasics_SelectingVolumeManager::Point)
|
||||
if (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point)
|
||||
{
|
||||
if (!myDetectedElemMap.IsNull())
|
||||
{
|
||||
@@ -1046,7 +1046,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::overlapsElement (SelectBasics
|
||||
}
|
||||
aResult = Standard_True;
|
||||
if (!myDetectedElemMap.IsNull()
|
||||
&& theMgr.GetActiveSelectionType() != SelectBasics_SelectingVolumeManager::Point)
|
||||
&& theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point)
|
||||
{
|
||||
myDetectedElemMap->ChangeMap().Add(aTriIndex);
|
||||
}
|
||||
@@ -1064,7 +1064,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::overlapsElement (SelectBasics
|
||||
myMinDepthNode = aPickResult.Depth();
|
||||
}
|
||||
if (!myDetectedNodeMap.IsNull()
|
||||
&& theMgr.GetActiveSelectionType() != SelectBasics_SelectingVolumeManager::Point)
|
||||
&& theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point)
|
||||
{
|
||||
myDetectedNodeMap->ChangeMap().Add (aTriNodes[aNodeIter]);
|
||||
}
|
||||
@@ -1152,7 +1152,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::elementIsInside (SelectBasics
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
if (theMgr.GetActiveSelectionType() != SelectBasics_SelectingVolumeManager::Point)
|
||||
if (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point)
|
||||
{
|
||||
if (!myDetectedElemMap.IsNull())
|
||||
{
|
||||
@@ -1195,7 +1195,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::elementIsInside (SelectBasics
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
if (theMgr.GetActiveSelectionType() != SelectBasics_SelectingVolumeManager::Point)
|
||||
if (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point)
|
||||
{
|
||||
if (!myDetectedElemMap.IsNull())
|
||||
{
|
||||
|
@@ -45,7 +45,7 @@ Standard_Boolean Select3D_SensitiveSegment::Matches (SelectBasics_SelectingVolum
|
||||
{
|
||||
if (!theMgr.IsOverlapAllowed()) // check for inclusion
|
||||
{
|
||||
if (theMgr.GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Polyline)
|
||||
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
|
||||
{
|
||||
return theMgr.Overlaps (myStart, myEnd, thePickResult);
|
||||
}
|
||||
|
@@ -150,7 +150,7 @@ Standard_Boolean Select3D_SensitiveSet::matches (SelectBasics_SelectingVolumeMan
|
||||
|
||||
Standard_Integer aMatchesNb = -1;
|
||||
|
||||
const bool toCheckFullInside = (theMgr.GetActiveSelectionType() != SelectBasics_SelectingVolumeManager::Point);
|
||||
const bool toCheckFullInside = (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point);
|
||||
if (toCheckFullInside && isFullInside)
|
||||
{
|
||||
Standard_Integer aSize = myContent.Size();
|
||||
|
@@ -50,7 +50,7 @@ Standard_Boolean Select3D_SensitiveTriangle::Matches (SelectBasics_SelectingVolu
|
||||
{
|
||||
if (!theMgr.IsOverlapAllowed())
|
||||
{
|
||||
if (theMgr.GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Polyline)
|
||||
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
|
||||
{
|
||||
SelectBasics_PickResult aDummy;
|
||||
return theMgr.Overlaps (myPoints[0], myPoints[1], myPoints[2], mySensType, aDummy);
|
||||
|
@@ -388,7 +388,7 @@ Standard_Boolean Select3D_SensitiveTriangulation::elementIsInside (SelectBasics_
|
||||
{
|
||||
const gp_Pnt aSegmPnt1 = myTriangul->Node (myFreeEdges->Value (aPrimitiveIdx * 2 + 1));
|
||||
const gp_Pnt aSegmPnt2 = myTriangul->Node (myFreeEdges->Value (aPrimitiveIdx * 2 + 2));
|
||||
if (theMgr.GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Polyline)
|
||||
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
|
||||
{
|
||||
SelectBasics_PickResult aDummy;
|
||||
return theMgr.Overlaps (aSegmPnt1, aSegmPnt2, aDummy);
|
||||
@@ -403,7 +403,7 @@ Standard_Boolean Select3D_SensitiveTriangulation::elementIsInside (SelectBasics_
|
||||
const gp_Pnt aPnt1 = myTriangul->Node (aNode1);
|
||||
const gp_Pnt aPnt2 = myTriangul->Node (aNode2);
|
||||
const gp_Pnt aPnt3 = myTriangul->Node (aNode3);
|
||||
if (theMgr.GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Polyline)
|
||||
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
|
||||
{
|
||||
SelectBasics_PickResult aDummy;
|
||||
return theMgr.Overlaps (aPnt1, aPnt2, aPnt3, mySensType, aDummy);
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include <SelectMgr_SelectingVolumeManager.hxx>
|
||||
#include <Select3D_SensitiveSet.hxx>
|
||||
|
||||
class Poly_Triangle;
|
||||
class Poly_Triangulation;
|
||||
|
||||
//! A framework to define selection of a sensitive entity made of a set of triangles.
|
||||
|
Reference in New Issue
Block a user