#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_SequenceOfInteger.hxx>
-IMPLEMENT_STANDARD_HANDLE (MeshVS_SensitivePolyhedron, Select3D_SensitiveEntity)
-IMPLEMENT_STANDARD_RTTIEXT(MeshVS_SensitivePolyhedron, Select3D_SensitiveEntity)
+
+IMPLEMENT_STANDARD_RTTIEXT(MeshVS_SensitivePolyhedron,Select3D_SensitiveEntity)
//================================================================
// Function : Constructor MeshVS_SensitivePolyhedron
Standard_Boolean MeshVS_SensitivePolyhedron::Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult)
{
- Standard_Real aDepthMin = RealLast();
- Standard_Real aDistToCOG = RealLast();
-
+ SelectBasics_PickResult aPickResult;
for (MeshVS_PolyhedronVertsIter aIter (myTopology); aIter.More(); aIter.Next())
{
- Standard_Real aDepth = RealLast();
- if (theMgr.Overlaps (aIter.Value(), Select3D_TOS_INTERIOR, aDepth))
+ if (theMgr.Overlaps (aIter.Value(), Select3D_TOS_INTERIOR, aPickResult))
{
- aDepthMin = Min (aDepth, aDepthMin);
+ thePickResult = SelectBasics_PickResult::Min (thePickResult, aPickResult);
}
}
+ if (!thePickResult.IsValid())
+ {
+ return Standard_False;
+ }
- aDistToCOG = aDepthMin == RealLast() ? RealLast() : theMgr.DistToGeometryCenter (myCenter);
- thePickResult = SelectBasics_PickResult (aDepthMin, aDistToCOG);
-
- return aDepthMin != RealLast();
+ thePickResult.SetDistToGeomCenter (theMgr.DistToGeometryCenter (CenterOfGeometry()));
+ return Standard_True;
}
//=======================================================================