myEntities.Clear();
myBndBox.Clear();
myCenter = gp_Pnt (0.0, 0.0, 0.0);
- myEntities.Clear();
+ myBVHPrimIndexes.Clear();
}
//=======================================================================
return Select3D_SensitiveSet::Matches (theMgr, thePickResult);
}
- Standard_Real aDepth = RealLast();
- Standard_Real aDistToCOG = RealLast();
+ SelectBasics_PickResult aPickResult;
Standard_Boolean isFailed = Standard_False;
for (Select3D_IndexedMapOfEntity::Iterator anEntityIter (myEntities); anEntityIter.More(); anEntityIter.Next())
{
- SelectBasics_PickResult aMatchResult;
const Handle(Select3D_SensitiveEntity)& aChild = anEntityIter.Value();
- if (!aChild->Matches (theMgr, aMatchResult))
+ if (!aChild->Matches (theMgr, aPickResult))
{
if (toMatchAll)
{
}
else
{
- aDepth = Min (aMatchResult.Depth(), aDepth);
+ thePickResult = SelectBasics_PickResult::Min (thePickResult, aPickResult);
}
}
if (isFailed)
{
- thePickResult = SelectBasics_PickResult (RealLast(), RealLast());
return Standard_False;
}
- aDistToCOG = theMgr.DistToGeometryCenter (CenterOfGeometry());
- thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
+ thePickResult.SetDistToGeomCenter(distanceToCOG(theMgr));
return Standard_True;
}
// purpose : Checks whether the entity with index theIdx overlaps the
// current selecting volume
// =======================================================================
-Standard_Boolean Select3D_SensitiveGroup::overlapsElement (SelectBasics_SelectingVolumeManager& theMgr,
+Standard_Boolean Select3D_SensitiveGroup::overlapsElement (SelectBasics_PickResult& thePickResult,
+ SelectBasics_SelectingVolumeManager& theMgr,
Standard_Integer theElemIdx,
- Standard_Real& theMatchDepth)
+ Standard_Boolean )
{
- theMatchDepth = RealLast();
const Standard_Integer aSensitiveIdx = myBVHPrimIndexes.Value (theElemIdx);
- SelectBasics_PickResult aResult;
- if (myEntities.FindKey (aSensitiveIdx)->Matches (theMgr, aResult))
+ if (myEntities.FindKey (aSensitiveIdx)->Matches (theMgr, thePickResult))
{
- theMatchDepth = aResult.Depth();
return Standard_True;
}
// purpose :
// =======================================================================
Standard_Boolean Select3D_SensitiveGroup::elementIsInside (SelectBasics_SelectingVolumeManager& theMgr,
- const Standard_Integer theElemIdx)
+ Standard_Integer theElemIdx,
+ Standard_Boolean theIsFullInside)
{
- Standard_Real aDummy;
- return overlapsElement(theMgr, theElemIdx, aDummy);
+ SelectBasics_PickResult aDummy;
+ return overlapsElement (aDummy, theMgr, theElemIdx, theIsFullInside);
}
// =======================================================================