1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0032337: Visualization - rename Overlaps() method in selection to more self-describable names

- renamed Overlaps and hasOverlap overloaded methods to self-describable names
This commit is contained in:
mkrylova 2021-05-12 16:39:17 +03:00 committed by bugmaster
parent df23a355c4
commit 03c9cc86c6
31 changed files with 626 additions and 549 deletions

View File

@ -254,10 +254,10 @@ Standard_Boolean MeshVS_CommonSensitiveEntity::overlapsElement (SelectBasics_Pic
} }
if (aNbNodes == 3) if (aNbNodes == 3)
{ {
return theMgr.Overlaps (gp_Pnt (aCoords (1), aCoords (2), aCoords (3)), return theMgr.OverlapsTriangle (gp_Pnt (aCoords (1), aCoords (2), aCoords (3)),
gp_Pnt (aCoords (4), aCoords (5), aCoords (6)), gp_Pnt (aCoords (4), aCoords (5), aCoords (6)),
gp_Pnt (aCoords (7), aCoords (8), aCoords (9)), gp_Pnt (aCoords (7), aCoords (8), aCoords (9)),
Select3D_TOS_INTERIOR, thePickResult); Select3D_TOS_INTERIOR, thePickResult);
} }
MeshVS_Buffer aFacePntsBuf (aNbNodes * 3 * sizeof (Standard_Real)); MeshVS_Buffer aFacePntsBuf (aNbNodes * 3 * sizeof (Standard_Real));
@ -268,12 +268,12 @@ Standard_Boolean MeshVS_CommonSensitiveEntity::overlapsElement (SelectBasics_Pic
aCoords (3 * aNodeIdx - 1), aCoords (3 * aNodeIdx - 1),
aCoords (3 * aNodeIdx))); aCoords (3 * aNodeIdx)));
} }
return theMgr.Overlaps (aFacePnts, Select3D_TOS_INTERIOR, thePickResult); return theMgr.OverlapsPolygon (aFacePnts, Select3D_TOS_INTERIOR, thePickResult);
} }
else if (mySelMethod == MeshVS_MSM_NODES) else if (mySelMethod == MeshVS_MSM_NODES)
{ {
const gp_Pnt aVert = getVertexByIndex (anItemIdx); const gp_Pnt aVert = getVertexByIndex (anItemIdx);
return theMgr.Overlaps (aVert, thePickResult); return theMgr.OverlapsPoint (aVert, thePickResult);
} }
return Standard_False; return Standard_False;
} }
@ -318,7 +318,7 @@ Standard_Boolean MeshVS_CommonSensitiveEntity::elementIsInside (SelectBasics_Sel
const gp_Pnt aPnt (aCoords (3 * aNodeIdx - 2), const gp_Pnt aPnt (aCoords (3 * aNodeIdx - 2),
aCoords (3 * aNodeIdx - 1), aCoords (3 * aNodeIdx - 1),
aCoords (3 * aNodeIdx)); aCoords (3 * aNodeIdx));
if (!theMgr.Overlaps (aPnt)) if (!theMgr.OverlapsPoint (aPnt))
{ {
return Standard_False; return Standard_False;
} }
@ -328,7 +328,7 @@ Standard_Boolean MeshVS_CommonSensitiveEntity::elementIsInside (SelectBasics_Sel
else if (mySelMethod == MeshVS_MSM_NODES) else if (mySelMethod == MeshVS_MSM_NODES)
{ {
const gp_Pnt aVert = getVertexByIndex (anItemIdx); const gp_Pnt aVert = getVertexByIndex (anItemIdx);
return theMgr.Overlaps (aVert); return theMgr.OverlapsPoint (aVert);
} }
return Standard_False; return Standard_False;
} }

View File

@ -86,7 +86,7 @@ Standard_Boolean MeshVS_SensitivePolyhedron::Matches (SelectBasics_SelectingVolu
SelectBasics_PickResult aPickResult; SelectBasics_PickResult aPickResult;
for (MeshVS_PolyhedronVertsIter aIter (myTopology); aIter.More(); aIter.Next()) for (MeshVS_PolyhedronVertsIter aIter (myTopology); aIter.More(); aIter.Next())
{ {
if (theMgr.Overlaps (aIter.Value(), Select3D_TOS_INTERIOR, aPickResult)) if (theMgr.OverlapsPolygon (aIter.Value(), Select3D_TOS_INTERIOR, aPickResult))
{ {
thePickResult = SelectBasics_PickResult::Min (thePickResult, aPickResult); thePickResult = SelectBasics_PickResult::Min (thePickResult, aPickResult);
} }

View File

@ -70,12 +70,12 @@ Standard_Boolean MeshVS_SensitiveQuad::Matches (SelectBasics_SelectingVolumeMana
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline) if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
{ {
SelectBasics_PickResult aDummy; SelectBasics_PickResult aDummy;
return theMgr.Overlaps (myVertices[0], myVertices[1], myVertices[2], Select3D_TOS_INTERIOR, aDummy) return theMgr.OverlapsTriangle (myVertices[0], myVertices[1], myVertices[2], Select3D_TOS_INTERIOR, aDummy)
&& theMgr.Overlaps (myVertices[0], myVertices[2], myVertices[3], Select3D_TOS_INTERIOR, aDummy); && theMgr.OverlapsTriangle (myVertices[0], myVertices[2], myVertices[3], Select3D_TOS_INTERIOR, aDummy);
} }
for (Standard_Integer aPntIdx = 0; aPntIdx < 4; ++aPntIdx) for (Standard_Integer aPntIdx = 0; aPntIdx < 4; ++aPntIdx)
{ {
if (!theMgr.Overlaps (myVertices[aPntIdx])) if (!theMgr.OverlapsPoint (myVertices[aPntIdx]))
return Standard_False; return Standard_False;
} }
@ -84,8 +84,8 @@ Standard_Boolean MeshVS_SensitiveQuad::Matches (SelectBasics_SelectingVolumeMana
// check for overlap // check for overlap
SelectBasics_PickResult aPickResult1, aPickResult2; SelectBasics_PickResult aPickResult1, aPickResult2;
if (!theMgr.Overlaps (myVertices[0], myVertices[1], myVertices[2], Select3D_TOS_INTERIOR, aPickResult1) if (!theMgr.OverlapsTriangle (myVertices[0], myVertices[1], myVertices[2], Select3D_TOS_INTERIOR, aPickResult1)
&& !theMgr.Overlaps (myVertices[0], myVertices[2], myVertices[3], Select3D_TOS_INTERIOR, aPickResult2)) && !theMgr.OverlapsTriangle (myVertices[0], myVertices[2], myVertices[3], Select3D_TOS_INTERIOR, aPickResult2))
{ {
return Standard_False; return Standard_False;
} }

View File

@ -270,7 +270,7 @@ Standard_Boolean Select3D_InteriorSensitivePointSet::overlapsElement (SelectBasi
const Handle(Select3D_SensitivePoly)& aPolygon = myPlanarPolygons.Value (aPolygIdx); const Handle(Select3D_SensitivePoly)& aPolygon = myPlanarPolygons.Value (aPolygIdx);
Handle(TColgp_HArray1OfPnt) aPoints; Handle(TColgp_HArray1OfPnt) aPoints;
aPolygon->Points3D (aPoints); aPolygon->Points3D (aPoints);
return theMgr.Overlaps (aPoints, Select3D_TOS_INTERIOR, thePickResult); return theMgr.OverlapsPolygon (aPoints, Select3D_TOS_INTERIOR, thePickResult);
} }
// ======================================================================= // =======================================================================

View File

@ -89,10 +89,10 @@ Standard_Boolean Select3D_SensitiveBox::Matches (SelectBasics_SelectingVolumeMan
if (!theMgr.IsOverlapAllowed()) // check for inclusion if (!theMgr.IsOverlapAllowed()) // check for inclusion
{ {
Standard_Boolean isInside = Standard_True; Standard_Boolean isInside = Standard_True;
return theMgr.Overlaps (myBox.CornerMin(), myBox.CornerMax(), &isInside) && isInside; return theMgr.OverlapsBox (myBox.CornerMin(), myBox.CornerMax(), &isInside) && isInside;
} }
if (!theMgr.Overlaps (myBox.CornerMin(), myBox.CornerMax(), thePickResult)) // check for overlap if (!theMgr.OverlapsBox (myBox.CornerMin(), myBox.CornerMax(), thePickResult)) // check for overlap
{ {
return Standard_False; return Standard_False;
} }

View File

@ -228,11 +228,11 @@ Standard_Boolean Select3D_SensitiveCircle::Matches (SelectBasics_SelectingVolume
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline) if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
{ {
SelectBasics_PickResult aDummy; SelectBasics_PickResult aDummy;
return theMgr.Overlaps (anArrayOfPnt, mySensType, aDummy); return theMgr.OverlapsPolygon (anArrayOfPnt, mySensType, aDummy);
} }
for (Standard_Integer aPntIdx = anArrayOfPnt->Lower(); aPntIdx <= anArrayOfPnt->Upper(); ++aPntIdx) for (Standard_Integer aPntIdx = anArrayOfPnt->Lower(); aPntIdx <= anArrayOfPnt->Upper(); ++aPntIdx)
{ {
if (!theMgr.Overlaps (anArrayOfPnt->Value(aPntIdx))) if (!theMgr.OverlapsPoint (anArrayOfPnt->Value(aPntIdx)))
{ {
return Standard_False; return Standard_False;
} }
@ -240,7 +240,7 @@ Standard_Boolean Select3D_SensitiveCircle::Matches (SelectBasics_SelectingVolume
return Standard_True; return Standard_True;
} }
if (!theMgr.Overlaps (anArrayOfPnt, Select3D_TOS_INTERIOR, thePickResult)) if (!theMgr.OverlapsPolygon (anArrayOfPnt, Select3D_TOS_INTERIOR, thePickResult))
{ {
return Standard_False; return Standard_False;
} }

View File

@ -37,7 +37,7 @@ Select3D_SensitivePoint::Select3D_SensitivePoint (const Handle(SelectMgr_EntityO
Standard_Boolean Select3D_SensitivePoint::Matches (SelectBasics_SelectingVolumeManager& theMgr, Standard_Boolean Select3D_SensitivePoint::Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult) SelectBasics_PickResult& thePickResult)
{ {
if (!theMgr.Overlaps (myPoint, thePickResult)) if (!theMgr.OverlapsPoint (myPoint, thePickResult))
{ {
return Standard_False; return Standard_False;
} }

View File

@ -237,7 +237,7 @@ Standard_Boolean Select3D_SensitivePoly::overlapsElement (SelectBasics_PickResul
const Standard_Integer aSegmentIdx = mySegmentIndexes->Value (theElemIdx); const Standard_Integer aSegmentIdx = mySegmentIndexes->Value (theElemIdx);
gp_Pnt aPnt1 = myPolyg.Pnt3d (aSegmentIdx); gp_Pnt aPnt1 = myPolyg.Pnt3d (aSegmentIdx);
gp_Pnt aPnt2 = myPolyg.Pnt3d (aSegmentIdx + 1); gp_Pnt aPnt2 = myPolyg.Pnt3d (aSegmentIdx + 1);
return theMgr.Overlaps (aPnt1, aPnt2, thePickResult); return theMgr.OverlapsSegment (aPnt1, aPnt2, thePickResult);
} }
//================================================== //==================================================
@ -257,10 +257,10 @@ Standard_Boolean Select3D_SensitivePoly::elementIsInside (SelectBasics_Selecting
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline) if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
{ {
SelectBasics_PickResult aDummy; SelectBasics_PickResult aDummy;
return theMgr.Overlaps (myPolyg.Pnt3d (aSegmentIdx + 0), myPolyg.Pnt3d (aSegmentIdx + 1), aDummy); return theMgr.OverlapsSegment (myPolyg.Pnt3d (aSegmentIdx + 0), myPolyg.Pnt3d (aSegmentIdx + 1), aDummy);
} }
return theMgr.Overlaps (myPolyg.Pnt3d (aSegmentIdx + 0)) return theMgr.OverlapsPoint (myPolyg.Pnt3d (aSegmentIdx + 0))
&& theMgr.Overlaps (myPolyg.Pnt3d (aSegmentIdx + 1)); && theMgr.OverlapsPoint (myPolyg.Pnt3d (aSegmentIdx + 1));
} }
//================================================== //==================================================

View File

@ -988,7 +988,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::overlapsElement (SelectBasics
if (myToDetectNode if (myToDetectNode
|| myToDetectElem) || myToDetectElem)
{ {
if (theIsFullInside || theMgr.Overlaps (aPoint, aPickResult)) if (theIsFullInside || theMgr.OverlapsPoint (aPoint, aPickResult))
{ {
if (aPickResult.Depth() <= myMinDepthNode) if (aPickResult.Depth() <= myMinDepthNode)
{ {
@ -1037,7 +1037,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::overlapsElement (SelectBasics
if (myToDetectElem) if (myToDetectElem)
{ {
if (theIsFullInside || theMgr.Overlaps (aPnts[0], aPnts[1], aPnts[2], Select3D_TOS_INTERIOR, aPickResult)) if (theIsFullInside || theMgr.OverlapsTriangle (aPnts[0], aPnts[1], aPnts[2], Select3D_TOS_INTERIOR, aPickResult))
{ {
if (aPickResult.Depth() <= myMinDepthElem) if (aPickResult.Depth() <= myMinDepthElem)
{ {
@ -1056,7 +1056,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::overlapsElement (SelectBasics
{ {
for (int aNodeIter = 0; aNodeIter < 3; ++aNodeIter) for (int aNodeIter = 0; aNodeIter < 3; ++aNodeIter)
{ {
if (theIsFullInside || theMgr.Overlaps (aPnts[aNodeIter], aPickResult)) if (theIsFullInside || theMgr.OverlapsPoint (aPnts[aNodeIter], aPickResult))
{ {
if (aPickResult.Depth() <= myMinDepthNode) if (aPickResult.Depth() <= myMinDepthNode)
{ {
@ -1078,7 +1078,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::overlapsElement (SelectBasics
{ {
int aNode1 = aNodeIter == 0 ? 2 : (aNodeIter - 1); int aNode1 = aNodeIter == 0 ? 2 : (aNodeIter - 1);
int aNode2 = aNodeIter; int aNode2 = aNodeIter;
if (theIsFullInside || theMgr.Overlaps (aPnts[aNode1], aPnts[aNode2], aPickResult)) if (theIsFullInside || theMgr.OverlapsSegment (aPnts[aNode1], aPnts[aNode2], aPickResult))
{ {
if (aPickResult.Depth() <= myMinDepthEdge) if (aPickResult.Depth() <= myMinDepthEdge)
{ {
@ -1147,7 +1147,7 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::elementIsInside (SelectBasics
{ {
aPoint = vecToPnt (getPosVec2 (aPointIndex)); aPoint = vecToPnt (getPosVec2 (aPointIndex));
} }
if (!theIsFullInside && !theMgr.Overlaps (aPoint)) if (!theIsFullInside && !theMgr.OverlapsPoint (aPoint))
{ {
return Standard_False; return Standard_False;
} }
@ -1188,9 +1188,9 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::elementIsInside (SelectBasics
aPnts[2] = vecToPnt (getPosVec2 (aTriNodes[2])); aPnts[2] = vecToPnt (getPosVec2 (aTriNodes[2]));
} }
if (!theIsFullInside && ( !theMgr.Overlaps (aPnts[0]) if (!theIsFullInside && ( !theMgr.OverlapsPoint (aPnts[0])
|| !theMgr.Overlaps (aPnts[1]) || !theMgr.OverlapsPoint (aPnts[1])
|| !theMgr.Overlaps (aPnts[2]))) || !theMgr.OverlapsPoint (aPnts[2])))
{ {
return Standard_False; return Standard_False;
} }

View File

@ -47,12 +47,12 @@ Standard_Boolean Select3D_SensitiveSegment::Matches (SelectBasics_SelectingVolum
{ {
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline) if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
{ {
return theMgr.Overlaps (myStart, myEnd, thePickResult); return theMgr.OverlapsSegment (myStart, myEnd, thePickResult);
} }
return theMgr.Overlaps (myStart, thePickResult) && theMgr.Overlaps (myEnd, thePickResult); return theMgr.OverlapsPoint (myStart, thePickResult) && theMgr.OverlapsPoint (myEnd, thePickResult);
} }
if (!theMgr.Overlaps (myStart, myEnd, thePickResult)) // check for overlap if (!theMgr.OverlapsSegment (myStart, myEnd, thePickResult)) // check for overlap
{ {
return Standard_False; return Standard_False;
} }

View File

@ -141,9 +141,9 @@ Standard_Boolean Select3D_SensitiveSet::matches (SelectBasics_SelectingVolumeMan
const Select3D_BndBox3d& aGlobalBox = myContent.Box(); const Select3D_BndBox3d& aGlobalBox = myContent.Box();
Standard_Boolean isFullInside = Standard_True; Standard_Boolean isFullInside = Standard_True;
if (!theMgr.Overlaps(aGlobalBox.CornerMin(), if (!theMgr.OverlapsBox (aGlobalBox.CornerMin(),
aGlobalBox.CornerMax(), aGlobalBox.CornerMax(),
&isFullInside)) &isFullInside))
{ {
return Standard_False; return Standard_False;
} }
@ -177,13 +177,13 @@ Standard_Boolean Select3D_SensitiveSet::matches (SelectBasics_SelectingVolumeMan
Standard_Boolean toCheckLft = Standard_True, toCheckRgh = Standard_True; Standard_Boolean toCheckLft = Standard_True, toCheckRgh = Standard_True;
if (!aNode.IsFullInside) if (!aNode.IsFullInside)
{ {
toCheckLft = theMgr.Overlaps (aBVH->MinPoint (aLeft.Id), aBVH->MaxPoint (aLeft.Id), toCheckFullInside ? &aLeft.IsFullInside : NULL); toCheckLft = theMgr.OverlapsBox (aBVH->MinPoint (aLeft.Id), aBVH->MaxPoint (aLeft.Id), toCheckFullInside ? &aLeft.IsFullInside : NULL);
if (!toCheckLft) if (!toCheckLft)
{ {
aLeft.IsFullInside = Standard_False; aLeft.IsFullInside = Standard_False;
} }
toCheckRgh = theMgr.Overlaps (aBVH->MinPoint (aRight.Id), aBVH->MaxPoint (aRight.Id), toCheckFullInside ? &aRight.IsFullInside : NULL); toCheckRgh = theMgr.OverlapsBox (aBVH->MinPoint (aRight.Id), aBVH->MaxPoint (aRight.Id), toCheckFullInside ? &aRight.IsFullInside : NULL);
if (!toCheckRgh) if (!toCheckRgh)
{ {
aRight.IsFullInside = Standard_False; aRight.IsFullInside = Standard_False;

View File

@ -53,14 +53,14 @@ Standard_Boolean Select3D_SensitiveTriangle::Matches (SelectBasics_SelectingVolu
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline) if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
{ {
SelectBasics_PickResult aDummy; SelectBasics_PickResult aDummy;
return theMgr.Overlaps (myPoints[0], myPoints[1], myPoints[2], mySensType, aDummy); return theMgr.OverlapsTriangle (myPoints[0], myPoints[1], myPoints[2], mySensType, aDummy);
} }
return theMgr.Overlaps (myPoints[0]) return theMgr.OverlapsPoint (myPoints[0])
&& theMgr.Overlaps (myPoints[1]) && theMgr.OverlapsPoint (myPoints[1])
&& theMgr.Overlaps (myPoints[2]); && theMgr.OverlapsPoint (myPoints[2]);
} }
if (!theMgr.Overlaps (myPoints[0], myPoints[1], myPoints[2], mySensType, thePickResult)) if (!theMgr.OverlapsTriangle (myPoints[0], myPoints[1], myPoints[2], mySensType, thePickResult))
{ {
return Standard_False; return Standard_False;
} }

View File

@ -259,9 +259,9 @@ Standard_Boolean Select3D_SensitiveTriangulation::Matches (SelectBasics_Selectin
if (!theMgr.IsOverlapAllowed()) // check for inclusion if (!theMgr.IsOverlapAllowed()) // check for inclusion
{ {
bool isInside = true; bool isInside = true;
return theMgr.Overlaps (aBndBox.CornerMin(), aBndBox.CornerMax(), &isInside) && isInside; return theMgr.OverlapsBox (aBndBox.CornerMin(), aBndBox.CornerMax(), &isInside) && isInside;
} }
if (!theMgr.Overlaps (aBndBox.CornerMin(), aBndBox.CornerMax(), thePickResult)) // check for overlap if (!theMgr.OverlapsBox (aBndBox.CornerMin(), aBndBox.CornerMax(), thePickResult)) // check for overlap
{ {
return false; return false;
} }
@ -356,7 +356,7 @@ Standard_Boolean Select3D_SensitiveTriangulation::overlapsElement (SelectBasics_
myTriangul->Node (aSegmEndIdx) myTriangul->Node (aSegmEndIdx)
}; };
TColgp_Array1OfPnt anEdgePntsArr (anEdgePnts[0], 1, 2); TColgp_Array1OfPnt anEdgePntsArr (anEdgePnts[0], 1, 2);
Standard_Boolean isMatched = theMgr.Overlaps (anEdgePntsArr, Select3D_TOS_BOUNDARY, thePickResult); Standard_Boolean isMatched = theMgr.OverlapsPolygon (anEdgePntsArr, Select3D_TOS_BOUNDARY, thePickResult);
return isMatched; return isMatched;
} }
else else
@ -366,7 +366,7 @@ Standard_Boolean Select3D_SensitiveTriangulation::overlapsElement (SelectBasics_
const gp_Pnt aPnt1 = myTriangul->Node (aNode1); const gp_Pnt aPnt1 = myTriangul->Node (aNode1);
const gp_Pnt aPnt2 = myTriangul->Node (aNode2); const gp_Pnt aPnt2 = myTriangul->Node (aNode2);
const gp_Pnt aPnt3 = myTriangul->Node (aNode3); const gp_Pnt aPnt3 = myTriangul->Node (aNode3);
return theMgr.Overlaps (aPnt1, aPnt2, aPnt3, Select3D_TOS_INTERIOR, thePickResult); return theMgr.OverlapsTriangle (aPnt1, aPnt2, aPnt3, Select3D_TOS_INTERIOR, thePickResult);
} }
} }
@ -391,9 +391,9 @@ Standard_Boolean Select3D_SensitiveTriangulation::elementIsInside (SelectBasics_
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline) if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
{ {
SelectBasics_PickResult aDummy; SelectBasics_PickResult aDummy;
return theMgr.Overlaps (aSegmPnt1, aSegmPnt2, aDummy); return theMgr.OverlapsSegment (aSegmPnt1, aSegmPnt2, aDummy);
} }
return theMgr.Overlaps (aSegmPnt1) && theMgr.Overlaps (aSegmPnt2); return theMgr.OverlapsPoint (aSegmPnt1) && theMgr.OverlapsPoint (aSegmPnt2);
} }
else else
{ {
@ -406,11 +406,11 @@ Standard_Boolean Select3D_SensitiveTriangulation::elementIsInside (SelectBasics_
if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline) if (theMgr.GetActiveSelectionType() == SelectMgr_SelectionType_Polyline)
{ {
SelectBasics_PickResult aDummy; SelectBasics_PickResult aDummy;
return theMgr.Overlaps (aPnt1, aPnt2, aPnt3, mySensType, aDummy); return theMgr.OverlapsTriangle (aPnt1, aPnt2, aPnt3, mySensType, aDummy);
} }
return theMgr.Overlaps (aPnt1) return theMgr.OverlapsPoint (aPnt1)
&& theMgr.Overlaps (aPnt2) && theMgr.OverlapsPoint (aPnt2)
&& theMgr.Overlaps (aPnt3); && theMgr.OverlapsPoint (aPnt3);
} }
} }

View File

@ -40,50 +40,50 @@ public:
virtual Standard_Integer GetActiveSelectionType() const = 0; virtual Standard_Integer GetActiveSelectionType() const = 0;
//! Returns true if selecting volume is overlapped by box theBox //! Returns true if selecting volume is overlapped by box theBox
virtual Standard_Boolean Overlaps (const NCollection_Vec3<Standard_Real>& theBoxMin, virtual Standard_Boolean OverlapsBox (const NCollection_Vec3<Standard_Real>& theBoxMin,
const NCollection_Vec3<Standard_Real>& theBoxMax, const NCollection_Vec3<Standard_Real>& theBoxMax,
SelectBasics_PickResult& thePickResult) const = 0; SelectBasics_PickResult& thePickResult) const = 0;
//! Returns true if selecting volume is overlapped by axis-aligned bounding box with minimum //! Returns true if selecting volume is overlapped by axis-aligned bounding box with minimum
//! corner at point theMinPt and maximum at point theMaxPt //! corner at point theMinPt and maximum at point theMaxPt
virtual Standard_Boolean Overlaps (const NCollection_Vec3<Standard_Real>& theBoxMin, virtual Standard_Boolean OverlapsBox (const NCollection_Vec3<Standard_Real>& theBoxMin,
const NCollection_Vec3<Standard_Real>& theBoxMax, const NCollection_Vec3<Standard_Real>& theBoxMax,
Standard_Boolean* theInside = NULL) const = 0; Standard_Boolean* theInside = NULL) const = 0;
//! Returns true if selecting volume is overlapped by point thePnt //! Returns true if selecting volume is overlapped by point thePnt
virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt, virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
SelectBasics_PickResult& thePickResult) const = 0; SelectBasics_PickResult& thePickResult) const = 0;
//! Returns true if selecting volume is overlapped by point thePnt. //! Returns true if selecting volume is overlapped by point thePnt.
//! Does not perform depth calculation, so this method is defined as //! Does not perform depth calculation, so this method is defined as
//! helper function for inclusion test. //! helper function for inclusion test.
virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const = 0; virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const = 0;
//! Returns true if selecting volume is overlapped by planar convex polygon, which points //! Returns true if selecting volume is overlapped by planar convex polygon, which points
//! are stored in theArrayOfPts, taking into account sensitivity type theSensType //! are stored in theArrayOfPts, taking into account sensitivity type theSensType
virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts, virtual Standard_Boolean OverlapsPolygon (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Standard_Integer theSensType, Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const = 0; SelectBasics_PickResult& thePickResult) const = 0;
//! Returns true if selecting volume is overlapped by planar convex polygon, which points //! Returns true if selecting volume is overlapped by planar convex polygon, which points
//! are stored in theArrayOfPts, taking into account sensitivity type theSensType //! are stored in theArrayOfPts, taking into account sensitivity type theSensType
virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPts, virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPts,
Standard_Integer theSensType, Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const = 0; SelectBasics_PickResult& thePickResult) const = 0;
//! Returns true if selecting volume is overlapped by line segment with start point at thePt1 //! Returns true if selecting volume is overlapped by line segment with start point at thePt1
//! and end point at thePt2 //! and end point at thePt2
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1, virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePt1,
const gp_Pnt& thePt2, const gp_Pnt& thePt2,
SelectBasics_PickResult& thePickResult) const = 0; SelectBasics_PickResult& thePickResult) const = 0;
//! Returns true if selecting volume is overlapped by triangle with vertices thePt1, //! Returns true if selecting volume is overlapped by triangle with vertices thePt1,
//! thePt2 and thePt3, taking into account sensitivity type theSensType //! thePt2 and thePt3, taking into account sensitivity type theSensType
virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1, virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePt1,
const gp_Pnt& thePt2, const gp_Pnt& thePt2,
const gp_Pnt& thePt3, const gp_Pnt& thePt3,
Standard_Integer theSensType, Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const = 0; SelectBasics_PickResult& thePickResult) const = 0;
//! Calculates distance from 3d projection of user-defined selection point //! Calculates distance from 3d projection of user-defined selection point
//! to the given point theCOG //! to the given point theCOG

View File

@ -194,12 +194,12 @@ bool SelectMgr_AxisIntersector::rayPlaneIntersection (const gp_Vec& thePlane,
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_Boolean SelectMgr_AxisIntersector::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside) const Standard_Boolean* theInside) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization"); "Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
@ -218,13 +218,13 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const SelectMgr_Vec3& theB
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_Boolean SelectMgr_AxisIntersector::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization"); "Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
@ -250,12 +250,12 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const SelectMgr_Vec3& theB
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt, Standard_Boolean SelectMgr_AxisIntersector::OverlapsPoint (const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization"); "Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
@ -273,10 +273,10 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt,
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt) const Standard_Boolean SelectMgr_AxisIntersector::OverlapsPoint (const gp_Pnt& thePnt) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization"); "Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
@ -286,13 +286,13 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt) cons
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsSegment
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt1, Standard_Boolean SelectMgr_AxisIntersector::OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization"); "Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
@ -306,13 +306,13 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt1,
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsPolygon
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_Boolean SelectMgr_AxisIntersector::OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization"); "Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
@ -352,7 +352,7 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const TColgp_Array1OfPnt&
if (aPolyNorm.Magnitude() <= Precision::Confusion()) if (aPolyNorm.Magnitude() <= Precision::Confusion())
{ {
// treat degenerated polygon as point // treat degenerated polygon as point
return Overlaps (theArrayOfPnts.First(), theClipRange, thePickResult); return OverlapsPoint (theArrayOfPnts.First(), theClipRange, thePickResult);
} }
else if (!rayPlaneIntersection (aPolyNorm, theArrayOfPnts.First(), thePickResult)) else if (!rayPlaneIntersection (aPolyNorm, theArrayOfPnts.First(), thePickResult))
{ {
@ -364,15 +364,15 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const TColgp_Array1OfPnt&
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsTriangle
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt1, Standard_Boolean SelectMgr_AxisIntersector::OverlapsTriangle (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
"Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization"); "Error! SelectMgr_AxisIntersector::Overlaps() should be called after selection axis initialization");
@ -381,7 +381,7 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt1,
{ {
const gp_Pnt aPntsArrayBuf[4] = { thePnt1, thePnt2, thePnt3, thePnt1 }; const gp_Pnt aPntsArrayBuf[4] = { thePnt1, thePnt2, thePnt3, thePnt1 };
const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 4); const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 4);
return Overlaps (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult); return OverlapsPolygon (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult);
} }
else if (theSensType == Select3D_TOS_INTERIOR) else if (theSensType == Select3D_TOS_INTERIOR)
{ {
@ -394,10 +394,10 @@ Standard_Boolean SelectMgr_AxisIntersector::Overlaps (const gp_Pnt& thePnt1,
{ {
// consider degenerated triangle as point or segment // consider degenerated triangle as point or segment
return aTrEdges[0].SquareModulus() > gp::Resolution() return aTrEdges[0].SquareModulus() > gp::Resolution()
? Overlaps (thePnt1, thePnt2, theClipRange, thePickResult) ? OverlapsSegment (thePnt1, thePnt2, theClipRange, thePickResult)
: (aTrEdges[1].SquareModulus() > gp::Resolution() : (aTrEdges[1].SquareModulus() > gp::Resolution()
? Overlaps (thePnt2, thePnt3, theClipRange, thePickResult) ? OverlapsSegment (thePnt2, thePnt3, theClipRange, thePickResult)
: Overlaps (thePnt1, theClipRange, thePickResult)); : OverlapsPoint (thePnt1, theClipRange, thePickResult));
} }
const gp_Pnt aPnts[3] = {thePnt1, thePnt2, thePnt3}; const gp_Pnt aPnts[3] = {thePnt1, thePnt2, thePnt3};

View File

@ -49,48 +49,48 @@ public:
public: public:
//! Intersection test between defined axis and given axis-aligned box //! Intersection test between defined axis and given axis-aligned box
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Returns true if selecting axis intersects axis-aligned bounding box //! Returns true if selecting axis intersects axis-aligned bounding box
//! with minimum corner at point theMinPt and maximum at point theMaxPt //! with minimum corner at point theMinPt and maximum at point theMaxPt
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside) const Standard_OVERRIDE; Standard_Boolean* theInside) const Standard_OVERRIDE;
//! Intersection test between defined axis and given point //! Intersection test between defined axis and given point
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt, Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Intersection test between defined axis and given point //! Intersection test between defined axis and given point
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const Standard_OVERRIDE;
//! Intersection test between defined axis and given ordered set of points, //! Intersection test between defined axis and given ordered set of points,
//! representing line segments. The test may be considered of interior part or //! representing line segments. The test may be considered of interior part or
//! boundary line defined by segments depending on given sensitivity type //! boundary line defined by segments depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Checks if selecting axis intersects line segment //! Checks if selecting axis intersects line segment
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Intersection test between defined axis and given triangle. The test may //! Intersection test between defined axis and given triangle. The test may
//! be considered of interior part or boundary line defined by triangle vertices //! be considered of interior part or boundary line defined by triangle vertices
//! depending on given sensitivity type //! depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
public: public:

View File

@ -144,89 +144,89 @@ void SelectMgr_BaseFrustum::SetBuilder (const Handle(SelectMgr_FrustumBuilder)&
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : SAT intersection test between defined volume and // purpose : SAT intersection test between defined volume and
// given axis-aligned box // given axis-aligned box
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const SelectMgr_Vec3& /*theBoxMin*/, Standard_Boolean SelectMgr_BaseFrustum::OverlapsBox (const SelectMgr_Vec3& /*theBoxMin*/,
const SelectMgr_Vec3& /*theBoxMax*/, const SelectMgr_Vec3& /*theBoxMax*/,
const SelectMgr_ViewClipRange& /*theClipRange*/, const SelectMgr_ViewClipRange& /*theClipRange*/,
SelectBasics_PickResult& /*thePickResult*/) const SelectBasics_PickResult& /*thePickResult*/) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : Intersection test between defined volume and given point // purpose : Intersection test between defined volume and given point
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const SelectMgr_Vec3& /*theBoxMin*/, Standard_Boolean SelectMgr_BaseFrustum::OverlapsBox (const SelectMgr_Vec3& /*theBoxMin*/,
const SelectMgr_Vec3& /*theBoxMax*/, const SelectMgr_Vec3& /*theBoxMax*/,
Standard_Boolean* /*theInside*/) const Standard_Boolean* /*theInside*/) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : Intersection test between defined volume and given point // purpose : Intersection test between defined volume and given point
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePnt*/, Standard_Boolean SelectMgr_BaseFrustum::OverlapsPoint (const gp_Pnt& /*thePnt*/,
const SelectMgr_ViewClipRange& /*theClipRange*/, const SelectMgr_ViewClipRange& /*theClipRange*/,
SelectBasics_PickResult& ) const SelectBasics_PickResult& ) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : Intersection test between defined volume and given point // purpose : Intersection test between defined volume and given point
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePnt*/) const Standard_Boolean SelectMgr_BaseFrustum::OverlapsPoint (const gp_Pnt& /*thePnt*/) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsPolygon
// purpose : SAT intersection test between defined volume and given // purpose : SAT intersection test between defined volume and given
// ordered set of points, representing line segments. The test // ordered set of points, representing line segments. The test
// may be considered of interior part or boundary line defined // may be considered of interior part or boundary line defined
// by segments depending on given sensitivity type // by segments depending on given sensitivity type
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const TColgp_Array1OfPnt& /*theArrayOfPnts*/, Standard_Boolean SelectMgr_BaseFrustum::OverlapsPolygon (const TColgp_Array1OfPnt& /*theArrayOfPnts*/,
Select3D_TypeOfSensitivity /*theSensType*/, Select3D_TypeOfSensitivity /*theSensType*/,
const SelectMgr_ViewClipRange& /*theClipRange*/, const SelectMgr_ViewClipRange& /*theClipRange*/,
SelectBasics_PickResult& ) const SelectBasics_PickResult& ) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsTriangle
// purpose : SAT intersection test between defined volume and given // purpose : SAT intersection test between defined volume and given
// triangle. The test may be considered of interior part or // triangle. The test may be considered of interior part or
// boundary line defined by triangle vertices depending on // boundary line defined by triangle vertices depending on
// given sensitivity type // given sensitivity type
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePt1*/, Standard_Boolean SelectMgr_BaseFrustum::OverlapsTriangle (const gp_Pnt& /*thePt1*/,
const gp_Pnt& /*thePt2*/, const gp_Pnt& /*thePt2*/,
const gp_Pnt& /*thePt3*/, const gp_Pnt& /*thePt3*/,
Select3D_TypeOfSensitivity /*theSensType*/, Select3D_TypeOfSensitivity /*theSensType*/,
const SelectMgr_ViewClipRange& /*theClipRange*/, const SelectMgr_ViewClipRange& /*theClipRange*/,
SelectBasics_PickResult& ) const SelectBasics_PickResult& ) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsSegment
// purpose : Checks if line segment overlaps selecting volume // purpose : Checks if line segment overlaps selecting volume
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseFrustum::Overlaps (const gp_Pnt& /*thePnt1*/, Standard_Boolean SelectMgr_BaseFrustum::OverlapsSegment (const gp_Pnt& /*thePnt1*/,
const gp_Pnt& /*thePnt2*/, const gp_Pnt& /*thePnt2*/,
const SelectMgr_ViewClipRange& /*theClipRange*/, const SelectMgr_ViewClipRange& /*theClipRange*/,
SelectBasics_PickResult& ) const SelectBasics_PickResult& ) const
{ {
return Standard_False; return Standard_False;
} }

View File

@ -75,51 +75,51 @@ public:
//! SAT intersection test between defined volume and given axis-aligned box //! SAT intersection test between defined volume and given axis-aligned box
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Returns true if selecting volume is overlapped by axis-aligned bounding box //! Returns true if selecting volume is overlapped by axis-aligned bounding box
//! with minimum corner at point theMinPt and maximum at point theMaxPt //! with minimum corner at point theMinPt and maximum at point theMaxPt
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside = NULL) const Standard_OVERRIDE; Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
//! Intersection test between defined volume and given point //! Intersection test between defined volume and given point
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt, Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Intersection test between defined volume and given point //! Intersection test between defined volume and given point
//! Does not perform depth calculation, so this method is defined as //! Does not perform depth calculation, so this method is defined as
//! helper function for inclusion test. Therefore, its implementation //! helper function for inclusion test. Therefore, its implementation
//! makes sense only for rectangular frustum with box selection mode activated. //! makes sense only for rectangular frustum with box selection mode activated.
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const Standard_OVERRIDE;
//! SAT intersection test between defined volume and given ordered set of points, //! SAT intersection test between defined volume and given ordered set of points,
//! representing line segments. The test may be considered of interior part or //! representing line segments. The test may be considered of interior part or
//! boundary line defined by segments depending on given sensitivity type //! boundary line defined by segments depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Checks if line segment overlaps selecting frustum //! Checks if line segment overlaps selecting frustum
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! SAT intersection test between defined volume and given triangle. The test may //! SAT intersection test between defined volume and given triangle. The test may
//! be considered of interior part or boundary line defined by triangle vertices //! be considered of interior part or boundary line defined by triangle vertices
//! depending on given sensitivity type //! depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1, Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePt1,
const gp_Pnt& thePt2, const gp_Pnt& thePt2,
const gp_Pnt& thePt3, const gp_Pnt& thePt3,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Dumps the content of me into the stream //! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@ -165,83 +165,83 @@ const gp_Pnt2d& SelectMgr_BaseIntersector::GetMousePosition() const
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const SelectMgr_Vec3&, Standard_Boolean SelectMgr_BaseIntersector::OverlapsBox (const SelectMgr_Vec3&,
const SelectMgr_Vec3&, const SelectMgr_Vec3&,
const SelectMgr_ViewClipRange&, const SelectMgr_ViewClipRange&,
SelectBasics_PickResult&) const SelectBasics_PickResult&) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const SelectMgr_Vec3&, Standard_Boolean SelectMgr_BaseIntersector::OverlapsBox (const SelectMgr_Vec3&,
const SelectMgr_Vec3&, const SelectMgr_Vec3&,
Standard_Boolean*) const Standard_Boolean*) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const gp_Pnt&, Standard_Boolean SelectMgr_BaseIntersector::OverlapsPoint (const gp_Pnt&,
const SelectMgr_ViewClipRange&, const SelectMgr_ViewClipRange&,
SelectBasics_PickResult&) const SelectBasics_PickResult&) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const gp_Pnt& thePnt) const Standard_Boolean SelectMgr_BaseIntersector::OverlapsPoint (const gp_Pnt& thePnt) const
{ {
(void )thePnt; (void )thePnt;
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsPolygon
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const TColgp_Array1OfPnt&, Standard_Boolean SelectMgr_BaseIntersector::OverlapsPolygon (const TColgp_Array1OfPnt&,
Select3D_TypeOfSensitivity, Select3D_TypeOfSensitivity,
const SelectMgr_ViewClipRange&, const SelectMgr_ViewClipRange&,
SelectBasics_PickResult&) const SelectBasics_PickResult&) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsTriangle
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const gp_Pnt&, Standard_Boolean SelectMgr_BaseIntersector::OverlapsTriangle (const gp_Pnt&,
const gp_Pnt&, const gp_Pnt&,
const gp_Pnt&, const gp_Pnt&,
Select3D_TypeOfSensitivity, Select3D_TypeOfSensitivity,
const SelectMgr_ViewClipRange&, const SelectMgr_ViewClipRange&,
SelectBasics_PickResult&) const SelectBasics_PickResult&) const
{ {
return Standard_False; return Standard_False;
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsSegment
// purpose : // purpose :
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_BaseIntersector::Overlaps (const gp_Pnt&, Standard_Boolean SelectMgr_BaseIntersector::OverlapsSegment (const gp_Pnt&,
const gp_Pnt&, const gp_Pnt&,
const SelectMgr_ViewClipRange&, const SelectMgr_ViewClipRange&,
SelectBasics_PickResult&) const SelectBasics_PickResult&) const
{ {
return Standard_False; return Standard_False;
} }

View File

@ -150,51 +150,51 @@ public:
public: public:
//! SAT intersection test between defined volume and given axis-aligned box //! SAT intersection test between defined volume and given axis-aligned box
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const; SelectBasics_PickResult& thePickResult) const;
//! Returns true if selecting volume is overlapped by axis-aligned bounding box //! Returns true if selecting volume is overlapped by axis-aligned bounding box
//! with minimum corner at point theMinPt and maximum at point theMaxPt //! with minimum corner at point theMinPt and maximum at point theMaxPt
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside = NULL) const; Standard_Boolean* theInside = NULL) const;
//! Intersection test between defined volume and given point //! Intersection test between defined volume and given point
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt, Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const; SelectBasics_PickResult& thePickResult) const;
//! Intersection test between defined volume and given point //! Intersection test between defined volume and given point
//! Does not perform depth calculation, so this method is defined as //! Does not perform depth calculation, so this method is defined as
//! helper function for inclusion test. Therefore, its implementation //! helper function for inclusion test. Therefore, its implementation
//! makes sense only for rectangular frustum with box selection mode activated. //! makes sense only for rectangular frustum with box selection mode activated.
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const; Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const;
//! SAT intersection test between defined volume and given ordered set of points, //! SAT intersection test between defined volume and given ordered set of points,
//! representing line segments. The test may be considered of interior part or //! representing line segments. The test may be considered of interior part or
//! boundary line defined by segments depending on given sensitivity type //! boundary line defined by segments depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const; SelectBasics_PickResult& thePickResult) const;
//! Checks if line segment overlaps selecting frustum //! Checks if line segment overlaps selecting frustum
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const; SelectBasics_PickResult& thePickResult) const;
//! SAT intersection test between defined volume and given triangle. The test may //! SAT intersection test between defined volume and given triangle. The test may
//! be considered of interior part or boundary line defined by triangle vertices //! be considered of interior part or boundary line defined by triangle vertices
//! depending on given sensitivity type //! depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePt1, Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePt1,
const gp_Pnt& thePt2, const gp_Pnt& thePt2,
const gp_Pnt& thePt3, const gp_Pnt& thePt3,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const; SelectBasics_PickResult& thePickResult) const;
public: public:

View File

@ -67,26 +67,26 @@ protected:
//! Returns true if selecting volume is overlapped by axis-aligned bounding box //! Returns true if selecting volume is overlapped by axis-aligned bounding box
//! with minimum corner at point theMinPt and maximum at point theMaxPt //! with minimum corner at point theMinPt and maximum at point theMaxPt
Standard_Boolean hasOverlap (const SelectMgr_Vec3& theBoxMin, Standard_Boolean hasBoxOverlap (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside = NULL) const; Standard_Boolean* theInside = NULL) const;
//! SAT intersection test between defined volume and given point //! SAT intersection test between defined volume and given point
Standard_Boolean hasOverlap (const gp_Pnt& thePnt) const; Standard_Boolean hasPointOverlap (const gp_Pnt& thePnt) const;
//! SAT intersection test between defined volume and given segment //! SAT intersection test between defined volume and given segment
Standard_Boolean hasOverlap (const gp_Pnt& thePnt1, Standard_Boolean hasSegmentOverlap (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2) const; const gp_Pnt& thePnt2) const;
//! SAT intersection test between frustum given and planar convex polygon represented as ordered point set //! SAT intersection test between frustum given and planar convex polygon represented as ordered point set
Standard_Boolean hasOverlap (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_Boolean hasPolygonOverlap (const TColgp_Array1OfPnt& theArrayOfPnts,
gp_Vec& theNormal) const; gp_Vec& theNormal) const;
//! SAT intersection test between defined volume and given triangle //! SAT intersection test between defined volume and given triangle
Standard_Boolean hasOverlap (const gp_Pnt& thePnt1, Standard_Boolean hasTriangleOverlap (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
gp_Vec& theNormal) const; gp_Vec& theNormal) const;
private: private:

View File

@ -122,15 +122,15 @@ Standard_Boolean SelectMgr_Frustum<N>::isSeparated (const gp_Pnt& thePnt1,
} }
// ======================================================================= // =======================================================================
// function : hasOverlap // function : hasBoxOverlap
// purpose : Returns true if selecting volume is overlapped by // purpose : Returns true if selecting volume is overlapped by
// axis-aligned bounding box with minimum corner at point // axis-aligned bounding box with minimum corner at point
// theMinPnt and maximum at point theMaxPnt // theMinPnt and maximum at point theMaxPnt
// ======================================================================= // =======================================================================
template <int N> template <int N>
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const SelectMgr_Vec3& theMinPnt, Standard_Boolean SelectMgr_Frustum<N>::hasBoxOverlap (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt, const SelectMgr_Vec3& theMaxPnt,
Standard_Boolean* theInside) const Standard_Boolean* theInside) const
{ {
for (Standard_Integer anAxis = 0; anAxis < 3; ++anAxis) for (Standard_Integer anAxis = 0; anAxis < 3; ++anAxis)
{ {
@ -200,11 +200,11 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const SelectMgr_Vec3& theMinP
} }
// ======================================================================= // =======================================================================
// function : hasOverlap // function : hasPointOverlap
// purpose : SAT intersection test between defined volume and given point // purpose : SAT intersection test between defined volume and given point
// ======================================================================= // =======================================================================
template <int N> template <int N>
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt) const Standard_Boolean SelectMgr_Frustum<N>::hasPointOverlap (const gp_Pnt& thePnt) const
{ {
const Standard_Integer anIncFactor = (myIsOrthographic && N == 4) ? 2 : 1; const Standard_Integer anIncFactor = (myIsOrthographic && N == 4) ? 2 : 1;
@ -223,12 +223,12 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt) const
} }
// ======================================================================= // =======================================================================
// function : hasOverlap // function : hasSegmentOverlap
// purpose : SAT intersection test between defined volume and given segment // purpose : SAT intersection test between defined volume and given segment
// ======================================================================= // =======================================================================
template <int N> template <int N>
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& theStartPnt, Standard_Boolean SelectMgr_Frustum<N>::hasSegmentOverlap (const gp_Pnt& theStartPnt,
const gp_Pnt& theEndPnt) const const gp_Pnt& theEndPnt) const
{ {
const gp_XYZ& aDir = theEndPnt.XYZ() - theStartPnt.XYZ(); const gp_XYZ& aDir = theEndPnt.XYZ() - theStartPnt.XYZ();
if (aDir.Modulus() < Precision::Confusion()) if (aDir.Modulus() < Precision::Confusion())
@ -304,13 +304,13 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& theStartPnt,
} }
// ======================================================================= // =======================================================================
// function : hasOverlap // function : hasPolygonOverlap
// purpose : SAT intersection test between frustum given and planar convex // purpose : SAT intersection test between frustum given and planar convex
// polygon represented as ordered point set // polygon represented as ordered point set
// ======================================================================= // =======================================================================
template <int N> template <int N>
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_Boolean SelectMgr_Frustum<N>::hasPolygonOverlap (const TColgp_Array1OfPnt& theArrayOfPnts,
gp_Vec& theNormal) const gp_Vec& theNormal) const
{ {
Standard_Integer aStartIdx = theArrayOfPnts.Lower(); Standard_Integer aStartIdx = theArrayOfPnts.Lower();
Standard_Integer anEndIdx = theArrayOfPnts.Upper(); Standard_Integer anEndIdx = theArrayOfPnts.Upper();
@ -400,14 +400,14 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const TColgp_Array1OfPnt& the
} }
// ======================================================================= // =======================================================================
// function : hasOverlap // function : hasTriangleOverlap
// purpose : SAT intersection test between defined volume and given triangle // purpose : SAT intersection test between defined volume and given triangle
// ======================================================================= // =======================================================================
template <int N> template <int N>
Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt1, Standard_Boolean SelectMgr_Frustum<N>::hasTriangleOverlap (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
gp_Vec& theNormal) const gp_Vec& theNormal) const
{ {
const gp_XYZ aTrEdges[3] = { thePnt2.XYZ() - thePnt1.XYZ(), const gp_XYZ aTrEdges[3] = { thePnt2.XYZ() - thePnt1.XYZ(),
thePnt3.XYZ() - thePnt2.XYZ(), thePnt3.XYZ() - thePnt2.XYZ(),

View File

@ -457,35 +457,35 @@ Standard_Boolean SelectMgr_RectangularFrustum::IsScalable() const
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : Returns true if selecting volume is overlapped by // purpose : Returns true if selecting volume is overlapped by
// axis-aligned bounding box with minimum corner at point // axis-aligned bounding box with minimum corner at point
// theMinPnt and maximum at point theMaxPnt // theMinPnt and maximum at point theMaxPnt
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_Boolean SelectMgr_RectangularFrustum::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside) const Standard_Boolean* theInside) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
return hasOverlap (theBoxMin, theBoxMax, theInside); return hasBoxOverlap (theBoxMin, theBoxMax, theInside);
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : SAT intersection test between defined volume and // purpose : SAT intersection test between defined volume and
// given axis-aligned box // given axis-aligned box
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_Boolean SelectMgr_RectangularFrustum::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
if (!hasOverlap (theBoxMin, theBoxMax)) if (!hasBoxOverlap (theBoxMin, theBoxMax))
return Standard_False; return Standard_False;
Standard_Real aDepth = 0.0; Standard_Real aDepth = 0.0;
@ -518,17 +518,17 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& t
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : Intersection test between defined volume and given point // purpose : Intersection test between defined volume and given point
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt, Standard_Boolean SelectMgr_RectangularFrustum::OverlapsPoint (const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
if (!hasOverlap (thePnt)) if (!hasPointOverlap (thePnt))
return Standard_False; return Standard_False;
gp_XYZ aV = thePnt.XYZ() - myNearPickedPnt.XYZ(); gp_XYZ aV = thePnt.XYZ() - myNearPickedPnt.XYZ();
@ -541,30 +541,30 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt,
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : Intersection test between defined volume and given point // purpose : Intersection test between defined volume and given point
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt) const Standard_Boolean SelectMgr_RectangularFrustum::OverlapsPoint (const gp_Pnt& thePnt) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
return hasOverlap (thePnt); return hasPointOverlap (thePnt);
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsSegment
// purpose : Checks if line segment overlaps selecting frustum // purpose : Checks if line segment overlaps selecting frustum
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1, Standard_Boolean SelectMgr_RectangularFrustum::OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
if (!hasOverlap (thePnt1, thePnt2)) if (!hasSegmentOverlap (thePnt1, thePnt2))
return Standard_False; return Standard_False;
segmentSegmentDistance (thePnt1, thePnt2, thePickResult); segmentSegmentDistance (thePnt1, thePnt2, thePickResult);
@ -573,16 +573,16 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsPolygon
// purpose : SAT intersection test between defined volume and given // purpose : SAT intersection test between defined volume and given
// ordered set of points, representing line segments. The test // ordered set of points, representing line segments. The test
// may be considered of interior part or boundary line defined // may be considered of interior part or boundary line defined
// by segments depending on given sensitivity type // by segments depending on given sensitivity type
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_Boolean SelectMgr_RectangularFrustum::OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
@ -598,7 +598,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPn
{ {
const gp_Pnt& aStartPnt = theArrayOfPnts.Value (aPntIter); const gp_Pnt& aStartPnt = theArrayOfPnts.Value (aPntIter);
const gp_Pnt& aEndPnt = theArrayOfPnts.Value (aPntIter == anUpper ? aLower : (aPntIter + 1)); const gp_Pnt& aEndPnt = theArrayOfPnts.Value (aPntIter == anUpper ? aLower : (aPntIter + 1));
if (hasOverlap (aStartPnt, aEndPnt)) if (hasSegmentOverlap (aStartPnt, aEndPnt))
{ {
aMatchingSegmentsNb++; aMatchingSegmentsNb++;
segmentSegmentDistance (aStartPnt, aEndPnt, aPickResult); segmentSegmentDistance (aStartPnt, aEndPnt, aPickResult);
@ -612,7 +612,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPn
else if (theSensType == Select3D_TOS_INTERIOR) else if (theSensType == Select3D_TOS_INTERIOR)
{ {
gp_Vec aPolyNorm (gp_XYZ (RealLast(), RealLast(), RealLast())); gp_Vec aPolyNorm (gp_XYZ (RealLast(), RealLast(), RealLast()));
if (!hasOverlap (theArrayOfPnts, aPolyNorm)) if (!hasPolygonOverlap (theArrayOfPnts, aPolyNorm))
{ {
return Standard_False; return Standard_False;
} }
@ -620,7 +620,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPn
if (aPolyNorm.Magnitude() <= Precision::Confusion()) if (aPolyNorm.Magnitude() <= Precision::Confusion())
{ {
// treat degenerated polygon as point // treat degenerated polygon as point
return Overlaps (theArrayOfPnts.First(), theClipRange, thePickResult); return OverlapsPoint (theArrayOfPnts.First(), theClipRange, thePickResult);
} }
else if (!segmentPlaneIntersection (aPolyNorm, theArrayOfPnts.First(), thePickResult)) else if (!segmentPlaneIntersection (aPolyNorm, theArrayOfPnts.First(), thePickResult))
{ {
@ -632,18 +632,18 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPn
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsTriangle
// purpose : SAT intersection test between defined volume and given // purpose : SAT intersection test between defined volume and given
// triangle. The test may be considered of interior part or // triangle. The test may be considered of interior part or
// boundary line defined by triangle vertices depending on // boundary line defined by triangle vertices depending on
// given sensitivity type // given sensitivity type
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1, Standard_Boolean SelectMgr_RectangularFrustum::OverlapsTriangle (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
@ -652,12 +652,12 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
{ {
const gp_Pnt aPntsArrayBuf[4] = { thePnt1, thePnt2, thePnt3, thePnt1 }; const gp_Pnt aPntsArrayBuf[4] = { thePnt1, thePnt2, thePnt3, thePnt1 };
const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 4); const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 4);
return Overlaps (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult); return OverlapsPolygon (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult);
} }
else if (theSensType == Select3D_TOS_INTERIOR) else if (theSensType == Select3D_TOS_INTERIOR)
{ {
gp_Vec aTriangleNormal (gp_XYZ (RealLast(), RealLast(), RealLast())); gp_Vec aTriangleNormal (gp_XYZ (RealLast(), RealLast(), RealLast()));
if (!hasOverlap (thePnt1, thePnt2, thePnt3, aTriangleNormal)) if (!hasTriangleOverlap (thePnt1, thePnt2, thePnt3, aTriangleNormal))
{ {
return Standard_False; return Standard_False;
} }
@ -669,10 +669,10 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
{ {
// consider degenerated triangle as point or segment // consider degenerated triangle as point or segment
return aTrEdges[0].SquareModulus() > gp::Resolution() return aTrEdges[0].SquareModulus() > gp::Resolution()
? Overlaps (thePnt1, thePnt2, theClipRange, thePickResult) ? OverlapsSegment (thePnt1, thePnt2, theClipRange, thePickResult)
: (aTrEdges[1].SquareModulus() > gp::Resolution() : (aTrEdges[1].SquareModulus() > gp::Resolution()
? Overlaps (thePnt2, thePnt3, theClipRange, thePickResult) ? OverlapsSegment (thePnt2, thePnt3, theClipRange, thePickResult)
: Overlaps (thePnt1, theClipRange, thePickResult)); : OverlapsPoint (thePnt1, theClipRange, thePickResult));
} }
const gp_Pnt aPnts[3] = {thePnt1, thePnt2, thePnt3}; const gp_Pnt aPnts[3] = {thePnt1, thePnt2, thePnt3};

View File

@ -90,48 +90,48 @@ public:
// SAT Tests for different objects // SAT Tests for different objects
//! SAT intersection test between defined volume and given axis-aligned box //! SAT intersection test between defined volume and given axis-aligned box
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Returns true if selecting volume is overlapped by axis-aligned bounding box //! Returns true if selecting volume is overlapped by axis-aligned bounding box
//! with minimum corner at point theMinPt and maximum at point theMaxPt //! with minimum corner at point theMinPt and maximum at point theMaxPt
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside) const Standard_OVERRIDE; Standard_Boolean* theInside) const Standard_OVERRIDE;
//! Intersection test between defined volume and given point //! Intersection test between defined volume and given point
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt, Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Intersection test between defined volume and given point //! Intersection test between defined volume and given point
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const Standard_OVERRIDE;
//! SAT intersection test between defined volume and given ordered set of points, //! SAT intersection test between defined volume and given ordered set of points,
//! representing line segments. The test may be considered of interior part or //! representing line segments. The test may be considered of interior part or
//! boundary line defined by segments depending on given sensitivity type //! boundary line defined by segments depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Checks if line segment overlaps selecting frustum //! Checks if line segment overlaps selecting frustum
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! SAT intersection test between defined volume and given triangle. The test may //! SAT intersection test between defined volume and given triangle. The test may
//! be considered of interior part or boundary line defined by triangle vertices //! be considered of interior part or boundary line defined by triangle vertices
//! depending on given sensitivity type //! depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Measures distance between 3d projection of user-picked //! Measures distance between 3d projection of user-picked
//! screen point and given point theCOG. //! screen point and given point theCOG.

View File

@ -329,143 +329,143 @@ void SelectMgr_SelectingVolumeManager::BuildSelectingVolume (const TColgp_Array1
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : SAT intersection test between defined volume and // purpose : SAT intersection test between defined volume and
// given axis-aligned box // given axis-aligned box
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
if (myActiveSelectingVolume.IsNull()) if (myActiveSelectingVolume.IsNull())
{ {
return Standard_False; return Standard_False;
} }
return myActiveSelectingVolume->Overlaps (theBoxMin, theBoxMax, myViewClipRange, thePickResult); return myActiveSelectingVolume->OverlapsBox (theBoxMin, theBoxMax, myViewClipRange, thePickResult);
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : Intersection test between defined volume and given point // purpose : Intersection test between defined volume and given point
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside) const Standard_Boolean* theInside) const
{ {
if (myActiveSelectingVolume.IsNull()) if (myActiveSelectingVolume.IsNull())
{ {
return Standard_False; return Standard_False;
} }
return myActiveSelectingVolume->Overlaps (theBoxMin, theBoxMax, theInside); return myActiveSelectingVolume->OverlapsBox (theBoxMin, theBoxMax, theInside);
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : Intersection test between defined volume and given point // purpose : Intersection test between defined volume and given point
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePnt, Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsPoint (const gp_Pnt& thePnt,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
if (myActiveSelectingVolume.IsNull()) if (myActiveSelectingVolume.IsNull())
{ {
return Standard_False; return Standard_False;
} }
return myActiveSelectingVolume->Overlaps (thePnt, myViewClipRange, thePickResult); return myActiveSelectingVolume->OverlapsPoint (thePnt, myViewClipRange, thePickResult);
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : Intersection test between defined volume and given point // purpose : Intersection test between defined volume and given point
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePnt) const Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsPoint (const gp_Pnt& thePnt) const
{ {
if (myActiveSelectingVolume.IsNull()) if (myActiveSelectingVolume.IsNull())
{ {
return Standard_False; return Standard_False;
} }
return myActiveSelectingVolume->Overlaps (thePnt); return myActiveSelectingVolume->OverlapsPoint (thePnt);
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsPolygon
// purpose : SAT intersection test between defined volume and given // purpose : SAT intersection test between defined volume and given
// ordered set of points, representing line segments. The test // ordered set of points, representing line segments. The test
// may be considered of interior part or boundary line defined // may be considered of interior part or boundary line defined
// by segments depending on given sensitivity type // by segments depending on given sensitivity type
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts, Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsPolygon (const Handle(TColgp_HArray1OfPnt)& theArrayOfPnts,
Standard_Integer theSensType, Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
if (myActiveSelectingVolume.IsNull()) if (myActiveSelectingVolume.IsNull())
{ {
return Standard_False; return Standard_False;
} }
return myActiveSelectingVolume->Overlaps (theArrayOfPnts->Array1(), (Select3D_TypeOfSensitivity)theSensType, return myActiveSelectingVolume->OverlapsPolygon (theArrayOfPnts->Array1(), (Select3D_TypeOfSensitivity)theSensType,
myViewClipRange, thePickResult); myViewClipRange, thePickResult);
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsPolygon
// purpose : SAT intersection test between defined volume and given // purpose : SAT intersection test between defined volume and given
// ordered set of points, representing line segments. The test // ordered set of points, representing line segments. The test
// may be considered of interior part or boundary line defined // may be considered of interior part or boundary line defined
// by segments depending on given sensitivity type // by segments depending on given sensitivity type
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
Standard_Integer theSensType, Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
if (myActiveSelectingVolume.IsNull()) if (myActiveSelectingVolume.IsNull())
{ {
return Standard_False; return Standard_False;
} }
return myActiveSelectingVolume->Overlaps (theArrayOfPnts, (Select3D_TypeOfSensitivity)theSensType, return myActiveSelectingVolume->OverlapsPolygon (theArrayOfPnts, (Select3D_TypeOfSensitivity)theSensType,
myViewClipRange, thePickResult); myViewClipRange, thePickResult);
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsSegment
// purpose : Checks if line segment overlaps selecting volume // purpose : Checks if line segment overlaps selecting volume
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePt1, Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsSegment (const gp_Pnt& thePt1,
const gp_Pnt& thePt2, const gp_Pnt& thePt2,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
if (myActiveSelectingVolume.IsNull()) if (myActiveSelectingVolume.IsNull())
{ {
return Standard_False; return Standard_False;
} }
return myActiveSelectingVolume->Overlaps (thePt1, thePt2, myViewClipRange, thePickResult); return myActiveSelectingVolume->OverlapsSegment (thePt1, thePt2, myViewClipRange, thePickResult);
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsTriangle
// purpose : SAT intersection test between defined volume and given // purpose : SAT intersection test between defined volume and given
// triangle. The test may be considered of interior part or // triangle. The test may be considered of interior part or
// boundary line defined by triangle vertices depending on // boundary line defined by triangle vertices depending on
// given sensitivity type // given sensitivity type
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_SelectingVolumeManager::Overlaps (const gp_Pnt& thePt1, Standard_Boolean SelectMgr_SelectingVolumeManager::OverlapsTriangle (const gp_Pnt& thePt1,
const gp_Pnt& thePt2, const gp_Pnt& thePt2,
const gp_Pnt& thePt3, const gp_Pnt& thePt3,
Standard_Integer theSensType, Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
if (myActiveSelectingVolume.IsNull()) if (myActiveSelectingVolume.IsNull())
{ {
return Standard_False; return Standard_False;
} }
return myActiveSelectingVolume->Overlaps (thePt1, thePt2, thePt3, (Select3D_TypeOfSensitivity)theSensType, return myActiveSelectingVolume->OverlapsTriangle (thePt1, thePt2, thePt3, (Select3D_TypeOfSensitivity)theSensType,
myViewClipRange, thePickResult); myViewClipRange, thePickResult);
} }
//======================================================================= //=======================================================================

View File

@ -130,51 +130,50 @@ public:
//! SAT intersection test between defined volume and given axis-aligned box //! SAT intersection test between defined volume and given axis-aligned box
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Returns true if selecting volume is overlapped by axis-aligned bounding box //! Returns true if selecting volume is overlapped by axis-aligned bounding box
//! with minimum corner at point theMinPt and maximum at point theMaxPt //! with minimum corner at point theMinPt and maximum at point theMaxPt
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax, const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside = NULL) const Standard_OVERRIDE; Standard_Boolean* theInside = NULL) const Standard_OVERRIDE;
//! Intersection test between defined volume and given point //! Intersection test between defined volume and given point
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt, Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Intersection test between defined volume and given point //! Intersection test between defined volume and given point
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt) const Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt) const Standard_OVERRIDE;
//! SAT intersection test between defined volume and given ordered set of points, //! SAT intersection test between defined volume and given ordered set of points,
//! representing line segments. The test may be considered of interior part or //! representing line segments. The test may be considered of interior part or
//! boundary line defined by segments depending on given sensitivity type //! boundary line defined by segments depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts, Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Standard_Integer theSensType, Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! SAT intersection test between defined volume and given ordered set of points, //! SAT intersection test between defined volume and given ordered set of points,
//! representing line segments. The test may be considered of interior part or //! representing line segments. The test may be considered of interior part or
//! boundary line defined by segments depending on given sensitivity type //! boundary line defined by segments depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPts, Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPts,
Standard_Integer theSensType, Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Checks if line segment overlaps selecting frustum //! Checks if line segment overlaps selecting frustum
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! SAT intersection test between defined volume and given triangle. The test may //! SAT intersection test between defined volume and given triangle. The test may
//! be considered of interior part or boundary line defined by triangle vertices //! be considered of interior part or boundary line defined by triangle vertices
//! depending on given sensitivity type //! depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
Standard_Integer theSensType, Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Measures distance between 3d projection of user-picked //! Measures distance between 3d projection of user-picked
//! screen point and given point theCOG //! screen point and given point theCOG
@ -271,6 +270,84 @@ public:
Standard_DEPRECATED("Deprecated method - InitPolylineSelectingVolume() and Build() should be used instead") Standard_DEPRECATED("Deprecated method - InitPolylineSelectingVolume() and Build() should be used instead")
Standard_EXPORT void BuildSelectingVolume (const TColgp_Array1OfPnt2d& thePoints); Standard_EXPORT void BuildSelectingVolume (const TColgp_Array1OfPnt2d& thePoints);
//! SAT intersection test between defined volume and given axis-aligned box
Standard_DEPRECATED ("Deprecated method - OverlapsBox() should be used instead")
Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax,
SelectBasics_PickResult& thePickResult) const
{
return OverlapsBox (theBoxMin, theBoxMax, thePickResult);
}
//! Returns true if selecting volume is overlapped by axis-aligned bounding box
//! with minimum corner at point theMinPt and maximum at point theMaxPt
Standard_DEPRECATED ("Deprecated method - OverlapsBox() should be used instead")
Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside = NULL) const
{
return OverlapsBox (theBoxMin, theBoxMax, theInside);
}
//! Intersection test between defined volume and given point
Standard_DEPRECATED ("Deprecated method - OverlapsPoint() should be used instead")
Standard_Boolean Overlaps (const gp_Pnt& thePnt,
SelectBasics_PickResult& thePickResult) const
{
return OverlapsPoint (thePnt, thePickResult);
}
//! Intersection test between defined volume and given point
Standard_DEPRECATED ("Deprecated method - OverlapsPoint() should be used instead")
Standard_Boolean Overlaps (const gp_Pnt& thePnt) const
{
return OverlapsPoint (thePnt);
}
//! 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
Standard_DEPRECATED ("Deprecated method - OverlapsPolygon() should be used instead")
Standard_Boolean Overlaps (const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const
{
return OverlapsPolygon (theArrayOfPts, theSensType, thePickResult);
}
//! 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
Standard_DEPRECATED ("Deprecated method - OverlapsPolygon() should be used instead")
Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPts,
Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const
{
return OverlapsPolygon (theArrayOfPts, theSensType, thePickResult);
}
//! Checks if line segment overlaps selecting frustum
Standard_DEPRECATED ("Deprecated method - OverlapsSegment() should be used instead")
Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
SelectBasics_PickResult& thePickResult) const
{
return OverlapsSegment (thePnt1, thePnt2, thePickResult);
}
//! 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
Standard_DEPRECATED ("Deprecated method - OverlapsTriangle() should be used instead")
Standard_Boolean Overlaps (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3,
Standard_Integer theSensType,
SelectBasics_PickResult& thePickResult) const
{
return OverlapsTriangle (thePnt1, thePnt2, thePnt3, theSensType, thePickResult);
}
private: private:
Handle(SelectMgr_BaseIntersector) myActiveSelectingVolume; Handle(SelectMgr_BaseIntersector) myActiveSelectingVolume;
Handle(Graphic3d_SequenceOfHClipPlane) myViewClipPlanes; //!< view clipping planes Handle(Graphic3d_SequenceOfHClipPlane) myViewClipPlanes; //!< view clipping planes

View File

@ -177,53 +177,53 @@ Handle(SelectMgr_BaseIntersector) SelectMgr_TriangularFrustum::ScaleAndTransform
} }
//======================================================================= //=======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : SAT intersection test between defined volume and // purpose : SAT intersection test between defined volume and
// given axis-aligned box // given axis-aligned box
//======================================================================= //=======================================================================
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const SelectMgr_Vec3& theMinPt, Standard_Boolean SelectMgr_TriangularFrustum::OverlapsBox (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt, const SelectMgr_Vec3& theMaxPt,
const SelectMgr_ViewClipRange& /*theClipRange*/, const SelectMgr_ViewClipRange& /*theClipRange*/,
SelectBasics_PickResult& /*thePickResult*/) const SelectBasics_PickResult& /*thePickResult*/) const
{ {
return hasOverlap (theMinPt, theMaxPt); return hasBoxOverlap (theMinPt, theMaxPt);
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : Returns true if selecting volume is overlapped by // purpose : Returns true if selecting volume is overlapped by
// axis-aligned bounding box with minimum corner at point // axis-aligned bounding box with minimum corner at point
// theMinPt and maximum at point theMaxPt // theMinPt and maximum at point theMaxPt
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const SelectMgr_Vec3& theMinPt, Standard_Boolean SelectMgr_TriangularFrustum::OverlapsBox (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt, const SelectMgr_Vec3& theMaxPt,
Standard_Boolean* /*theInside*/) const Standard_Boolean* /*theInside*/) const
{ {
return hasOverlap (theMinPt, theMaxPt, NULL); return hasBoxOverlap (theMinPt, theMaxPt, NULL);
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : Intersection test between defined volume and given point // purpose : Intersection test between defined volume and given point
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt, Standard_Boolean SelectMgr_TriangularFrustum::OverlapsPoint (const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& /*theClipRange*/, const SelectMgr_ViewClipRange& /*theClipRange*/,
SelectBasics_PickResult& /*thePickResult*/) const SelectBasics_PickResult& /*thePickResult*/) const
{ {
return hasOverlap (thePnt); return hasPointOverlap (thePnt);
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsPolygon
// purpose : SAT intersection test between defined volume and given // purpose : SAT intersection test between defined volume and given
// ordered set of points, representing line segments. The test // ordered set of points, representing line segments. The test
// may be considered of interior part or boundary line defined // may be considered of interior part or boundary line defined
// by segments depending on given sensitivity type // by segments depending on given sensitivity type
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_Boolean SelectMgr_TriangularFrustum::OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& /*theClipRange*/, const SelectMgr_ViewClipRange& /*theClipRange*/,
SelectBasics_PickResult& /*thePickResult*/) const SelectBasics_PickResult& /*thePickResult*/) const
{ {
if (theSensType == Select3D_TOS_BOUNDARY) if (theSensType == Select3D_TOS_BOUNDARY)
{ {
@ -233,7 +233,7 @@ Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const TColgp_Array1OfPnt
{ {
const gp_Pnt& aStartPt = theArrayOfPnts.Value (aPtIdx); const gp_Pnt& aStartPt = theArrayOfPnts.Value (aPtIdx);
const gp_Pnt& aEndPt = theArrayOfPnts.Value (aPtIdx == anUpper ? aLower : (aPtIdx + 1)); const gp_Pnt& aEndPt = theArrayOfPnts.Value (aPtIdx == anUpper ? aLower : (aPtIdx + 1));
if (!hasOverlap (aStartPt, aEndPt)) if (!hasSegmentOverlap (aStartPt, aEndPt))
{ {
return Standard_False; return Standard_False;
} }
@ -242,48 +242,48 @@ Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const TColgp_Array1OfPnt
else if (theSensType == Select3D_TOS_INTERIOR) else if (theSensType == Select3D_TOS_INTERIOR)
{ {
gp_Vec aNorm (gp_XYZ (RealLast(), RealLast(), RealLast())); gp_Vec aNorm (gp_XYZ (RealLast(), RealLast(), RealLast()));
return hasOverlap (theArrayOfPnts, aNorm); return hasPolygonOverlap (theArrayOfPnts, aNorm);
} }
return Standard_False; return Standard_False;
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsSegment
// purpose : Checks if line segment overlaps selecting frustum // purpose : Checks if line segment overlaps selecting frustum
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt1, Standard_Boolean SelectMgr_TriangularFrustum::OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const SelectMgr_ViewClipRange& /*theClipRange*/, const SelectMgr_ViewClipRange& /*theClipRange*/,
SelectBasics_PickResult& /*thePickResult*/) const SelectBasics_PickResult& /*thePickResult*/) const
{ {
return hasOverlap (thePnt1, thePnt2); return hasSegmentOverlap (thePnt1, thePnt2);
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsTriangle
// purpose : SAT intersection test between defined volume and given // purpose : SAT intersection test between defined volume and given
// triangle. The test may be considered of interior part or // triangle. The test may be considered of interior part or
// boundary line defined by triangle vertices depending on // boundary line defined by triangle vertices depending on
// given sensitivity type // given sensitivity type
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustum::Overlaps (const gp_Pnt& thePnt1, Standard_Boolean SelectMgr_TriangularFrustum::OverlapsTriangle (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
if (theSensType == Select3D_TOS_BOUNDARY) if (theSensType == Select3D_TOS_BOUNDARY)
{ {
const gp_Pnt aPntsArrayBuf[3] = { thePnt1, thePnt2, thePnt3 }; const gp_Pnt aPntsArrayBuf[3] = { thePnt1, thePnt2, thePnt3 };
const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 3); const TColgp_Array1OfPnt aPntsArray (aPntsArrayBuf[0], 1, 3);
return Overlaps (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult); return OverlapsPolygon (aPntsArray, Select3D_TOS_BOUNDARY, theClipRange, thePickResult);
} }
else if (theSensType == Select3D_TOS_INTERIOR) else if (theSensType == Select3D_TOS_INTERIOR)
{ {
gp_Vec aNorm (gp_XYZ (RealLast(), RealLast(), RealLast())); gp_Vec aNorm (gp_XYZ (RealLast(), RealLast(), RealLast()));
return hasOverlap (thePnt1, thePnt2, thePnt3, aNorm); return hasTriangleOverlap (thePnt1, thePnt2, thePnt3, aNorm);
} }
return Standard_True; return Standard_True;

View File

@ -60,45 +60,45 @@ public:
// SAT Tests for different objects // SAT Tests for different objects
//! SAT intersection test between defined volume and given axis-aligned box //! SAT intersection test between defined volume and given axis-aligned box
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt, const SelectMgr_Vec3& theMaxPnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Returns true if selecting volume is overlapped by axis-aligned bounding box //! Returns true if selecting volume is overlapped by axis-aligned bounding box
//! with minimum corner at point theMinPt and maximum at point theMaxPt //! with minimum corner at point theMinPt and maximum at point theMaxPt
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPt, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theMinPt,
const SelectMgr_Vec3& theMaxPt, const SelectMgr_Vec3& theMaxPt,
Standard_Boolean* theInside) const Standard_OVERRIDE; Standard_Boolean* theInside) const Standard_OVERRIDE;
//! Intersection test between defined volume and given point //! Intersection test between defined volume and given point
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt, Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! SAT intersection test between defined volume and given ordered set of points, //! SAT intersection test between defined volume and given ordered set of points,
//! representing line segments. The test may be considered of interior part or //! representing line segments. The test may be considered of interior part or
//! boundary line defined by segments depending on given sensitivity type //! boundary line defined by segments depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Checks if line segment overlaps selecting frustum //! Checks if line segment overlaps selecting frustum
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! SAT intersection test between defined volume and given triangle. The test may //! SAT intersection test between defined volume and given triangle. The test may
//! be considered of interior part or boundary line defined by triangle vertices //! be considered of interior part or boundary line defined by triangle vertices
//! depending on given sensitivity type //! depending on given sensitivity type
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Nullifies the handle to corresponding builder instance to prevent memory leaks //! Nullifies the handle to corresponding builder instance to prevent memory leaks
Standard_EXPORT void Clear(); Standard_EXPORT void Clear();

View File

@ -171,20 +171,20 @@ Handle(SelectMgr_BaseIntersector) SelectMgr_TriangularFrustumSet::ScaleAndTransf
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr_Vec3& theMinPnt, Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsBox (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt, const SelectMgr_Vec3& theMaxPnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next()) for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{ {
if (anIter.Value()->Overlaps (theMinPnt, theMaxPnt, theClipRange, thePickResult)) if (anIter.Value()->OverlapsBox (theMinPnt, theMaxPnt, theClipRange, thePickResult))
return Standard_True; return Standard_True;
} }
@ -192,19 +192,19 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr_Vec3&
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsBox
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr_Vec3& theMinPnt, Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsBox (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt, const SelectMgr_Vec3& theMaxPnt,
Standard_Boolean* theInside) const Standard_Boolean* theInside) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next()) for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{ {
if (anIter.Value()->Overlaps (theMinPnt, theMaxPnt, NULL)) if (anIter.Value()->OverlapsBox (theMinPnt, theMaxPnt, NULL))
{ {
if (myToAllowOverlap || theInside == NULL) if (myToAllowOverlap || theInside == NULL)
{ {
@ -243,19 +243,19 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const SelectMgr_Vec3&
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsPoint
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt, Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsPoint (const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next()) for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{ {
if (anIter.Value()->Overlaps (thePnt, theClipRange, thePickResult)) if (anIter.Value()->OverlapsPoint (thePnt, theClipRange, thePickResult))
return Standard_True; return Standard_True;
} }
@ -263,20 +263,20 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt,
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsPolygon
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const TColgp_Array1OfPnt& theArrayOfPts, Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPts,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next()) for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{ {
if (anIter.Value()->Overlaps (theArrayOfPts, theSensType, theClipRange, thePickResult)) if (anIter.Value()->OverlapsPolygon (theArrayOfPts, theSensType, theClipRange, thePickResult))
{ {
if (myToAllowOverlap) if (myToAllowOverlap)
{ {
@ -302,20 +302,20 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const TColgp_Array1Of
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsSegment
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt1, Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next()) for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{ {
if (anIter.Value()->Overlaps (thePnt1, thePnt2, theClipRange, thePickResult)) if (anIter.Value()->OverlapsSegment (thePnt1, thePnt2, theClipRange, thePickResult))
{ {
if (myToAllowOverlap) if (myToAllowOverlap)
{ {
@ -336,22 +336,22 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt1
} }
// ======================================================================= // =======================================================================
// function : Overlaps // function : OverlapsTriangle
// purpose : // purpose :
// ======================================================================= // =======================================================================
Standard_Boolean SelectMgr_TriangularFrustumSet::Overlaps (const gp_Pnt& thePnt1, Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsTriangle (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const SelectBasics_PickResult& thePickResult) const
{ {
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline, Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Polyline,
"Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization"); "Error! SelectMgr_TriangularFrustumSet::Overlaps() should be called after selection frustum initialization");
for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next()) for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
{ {
if (anIter.Value()->Overlaps (thePnt1, thePnt2, thePnt3, theSensType, theClipRange, thePickResult)) if (anIter.Value()->OverlapsTriangle (thePnt1, thePnt2, thePnt3, theSensType, theClipRange, thePickResult))
{ {
if (myToAllowOverlap) if (myToAllowOverlap)
{ {

View File

@ -58,35 +58,35 @@ public:
const gp_GTrsf& theTrsf, const gp_GTrsf& theTrsf,
const Handle(SelectMgr_FrustumBuilder)& theBuilder) const Standard_OVERRIDE; const Handle(SelectMgr_FrustumBuilder)& theBuilder) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt, const SelectMgr_Vec3& theMaxPnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt, Standard_EXPORT virtual Standard_Boolean OverlapsBox (const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt, const SelectMgr_Vec3& theMaxPnt,
Standard_Boolean* theInside) const Standard_OVERRIDE; Standard_Boolean* theInside) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt, Standard_EXPORT virtual Standard_Boolean OverlapsPoint (const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const TColgp_Array1OfPnt& theArrayOfPnts, Standard_EXPORT virtual Standard_Boolean OverlapsPolygon (const TColgp_Array1OfPnt& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsSegment (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Overlaps (const gp_Pnt& thePnt1, Standard_EXPORT virtual Standard_Boolean OverlapsTriangle (const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2, const gp_Pnt& thePnt2,
const gp_Pnt& thePnt3, const gp_Pnt& thePnt3,
Select3D_TypeOfSensitivity theSensType, Select3D_TypeOfSensitivity theSensType,
const SelectMgr_ViewClipRange& theClipRange, const SelectMgr_ViewClipRange& theClipRange,
SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE; SelectBasics_PickResult& thePickResult) const Standard_OVERRIDE;
//! Calculates the point on a view ray that was detected during the run of selection algo by given depth //! Calculates the point on a view ray that was detected during the run of selection algo by given depth
Standard_EXPORT virtual gp_Pnt DetectedPoint (const Standard_Real theDepth) const Standard_OVERRIDE; Standard_EXPORT virtual gp_Pnt DetectedPoint (const Standard_Real theDepth) const Standard_OVERRIDE;

View File

@ -405,8 +405,8 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
SelectMgr_SelectingVolumeManager aMgr = aInversedTrsf.Form() != gp_Identity SelectMgr_SelectingVolumeManager aMgr = aInversedTrsf.Form() != gp_Identity
? theMgr.ScaleAndTransform (1, aInversedTrsf, NULL) ? theMgr.ScaleAndTransform (1, aInversedTrsf, NULL)
: theMgr; : theMgr;
if (!aMgr.Overlaps (aSensitivesTree->MinPoint (0), if (!aMgr.OverlapsBox (aSensitivesTree->MinPoint (0),
aSensitivesTree->MaxPoint (0))) aSensitivesTree->MaxPoint (0)))
{ {
return; return;
} }
@ -487,10 +487,10 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
{ {
const Standard_Integer aLeftChildIdx = aSensitivesTree->Child<0> (aNode); const Standard_Integer aLeftChildIdx = aSensitivesTree->Child<0> (aNode);
const Standard_Integer aRightChildIdx = aSensitivesTree->Child<1> (aNode); const Standard_Integer aRightChildIdx = aSensitivesTree->Child<1> (aNode);
const Standard_Boolean isLeftChildIn = aMgr.Overlaps (aSensitivesTree->MinPoint (aLeftChildIdx), const Standard_Boolean isLeftChildIn = aMgr.OverlapsBox (aSensitivesTree->MinPoint (aLeftChildIdx),
aSensitivesTree->MaxPoint (aLeftChildIdx)); aSensitivesTree->MaxPoint (aLeftChildIdx));
const Standard_Boolean isRightChildIn = aMgr.Overlaps (aSensitivesTree->MinPoint (aRightChildIdx), const Standard_Boolean isRightChildIn = aMgr.OverlapsBox (aSensitivesTree->MinPoint (aRightChildIdx),
aSensitivesTree->MaxPoint (aRightChildIdx)); aSensitivesTree->MaxPoint (aRightChildIdx));
if (isLeftChildIn if (isLeftChildIn
&& isRightChildIn) && isRightChildIn)
{ {
@ -680,7 +680,7 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
const opencascade::handle<BVH_Tree<Standard_Real, 3> >& aBVHTree = mySelectableObjects.BVH (aBVHSubset); const opencascade::handle<BVH_Tree<Standard_Real, 3> >& aBVHTree = mySelectableObjects.BVH (aBVHSubset);
Standard_Integer aNode = 0; Standard_Integer aNode = 0;
if (!aMgr.Overlaps (aBVHTree->MinPoint (0), aBVHTree->MaxPoint (0))) if (!aMgr.OverlapsBox (aBVHTree->MinPoint (0), aBVHTree->MaxPoint (0)))
{ {
continue; continue;
} }
@ -694,9 +694,9 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
const Standard_Integer aLeftChildIdx = aBVHTree->Child<0> (aNode); const Standard_Integer aLeftChildIdx = aBVHTree->Child<0> (aNode);
const Standard_Integer aRightChildIdx = aBVHTree->Child<1> (aNode); const Standard_Integer aRightChildIdx = aBVHTree->Child<1> (aNode);
const Standard_Boolean isLeftChildIn = const Standard_Boolean isLeftChildIn =
aMgr.Overlaps (aBVHTree->MinPoint (aLeftChildIdx), aBVHTree->MaxPoint (aLeftChildIdx)); aMgr.OverlapsBox (aBVHTree->MinPoint (aLeftChildIdx), aBVHTree->MaxPoint (aLeftChildIdx));
const Standard_Boolean isRightChildIn = const Standard_Boolean isRightChildIn =
aMgr.Overlaps (aBVHTree->MinPoint (aRightChildIdx), aBVHTree->MaxPoint (aRightChildIdx)); aMgr.OverlapsBox (aBVHTree->MinPoint (aRightChildIdx), aBVHTree->MaxPoint (aRightChildIdx));
if (isLeftChildIn if (isLeftChildIn
&& isRightChildIn) && isRightChildIn)
{ {