SelectBasics_PickResult()
: myObjPickedPnt (RealLast(), 0.0, 0.0),
myDepth (RealLast()),
- myDistToCenter (RealLast()) {}
+ myDistToCenter (RealLast()),
+ myIsDirectHit(Standard_False) {}
//! Constructor with initialization.
SelectBasics_PickResult (Standard_Real theDepth,
const gp_Pnt& theObjPickedPnt)
: myObjPickedPnt (theObjPickedPnt),
myDepth (theDepth),
- myDistToCenter (theDistToCenter) {}
+ myDistToCenter (theDistToCenter),
+ myIsDirectHit(Standard_False) {}
public:
myDepth = RealLast();
myObjPickedPnt = gp_Pnt (RealLast(), 0.0, 0.0);
myNormal.SetValues (0.0f, 0.0f, 0.0f);
+ myIsDirectHit = Standard_False;
}
//! Return depth along picking ray.
myNormal.SetValues ((float )theNormal.X(), (float )theNormal.Y(), (float )theNormal.Z());
}
+ //! Set boolean value for pick result direct hit (true) or indirect hit (false)
+ void SetDirectHit(Standard_Boolean theIsDirectHit) { myIsDirectHit = theIsDirectHit; }
+
+ //! Return value for direct hit test
+ Standard_Boolean IsDirectHit() const { return myIsDirectHit; }
+
private:
gp_Pnt myObjPickedPnt; //!< User-picked selection point onto object
NCollection_Vec3<float> myNormal; //!< surface normal
Standard_Real myDepth; //!< Depth to detected point
Standard_Real myDistToCenter; //!< Distance from 3d projection user-picked selection point to entity's geometry center
+ Standard_Boolean myIsDirectHit; //!< Checks if the detected point was obtained from a direct hit
};
#endif // _SelectBasics_PickResult_HeaderFile
aTc = (Abs (aTd) < gp::Resolution() ? 0.0 : aTn / aTd);
const gp_Pnt aClosestPnt = myNearPickedPnt.XYZ() + aV * aTc;
- Standard_Real aPenalty = Max(aC/anA, anA/aC);
- thePickResult.SetDepth (myNearPickedPnt.Distance (aClosestPnt) * myScale * aPenalty);
+ thePickResult.SetDepth (myNearPickedPnt.Distance (aClosestPnt) * myScale);
const gp_Vec aPickedVec = aClosestPnt.XYZ() - theSegPnt1.XYZ();
const gp_Vec aFigureVec = theSegPnt2.XYZ() - theSegPnt1.XYZ();
aDepth = aNearestPnt.Distance (myNearPickedPnt);
thePickResult.SetDepth (aDepth);
+ thePickResult.SetDirectHit(Standard_False);
return !theClipRange.IsClipped (thePickResult.Depth());
}
}
thePickResult.SetDepth (aDepth);
+ thePickResult.SetDirectHit(Standard_True);
return Standard_True;
}
thePickResult.SetDepth (Abs (aDepth) * myScale);
thePickResult.SetPickedPoint (thePnt);
+ thePickResult.SetDirectHit(Standard_True);
return !theClipRange.IsClipped (thePickResult.Depth());
}
return Standard_False;
segmentSegmentDistance (thePnt1, thePnt2, thePickResult);
+ thePickResult.SetDirectHit(Standard_True);
return !theClipRange.IsClipped (thePickResult.Depth());
}
aMatchingSegmentsNb++;
segmentSegmentDistance (aStartPnt, aEndPnt, aPickResult);
thePickResult = SelectBasics_PickResult::Min (thePickResult, aPickResult);
+ thePickResult.SetDirectHit(Standard_True);
}
}
thePickResult.SetDepth (myNearPickedPnt.Distance (aPtOnPlane) * myScale);
thePickResult.SetPickedPoint (aPtOnPlane);
thePickResult.SetSurfaceNormal (aTriangleNormal);
+ thePickResult.SetDirectHit(Standard_True);
return !theClipRange.IsClipped (thePickResult.Depth());
}
-
+
Standard_Real aMinDist = RealLast();
Standard_Integer aNearestEdgeIdx1 = -1;
for (Standard_Integer anEdgeIdx = 0; anEdgeIdx < 3; ++anEdgeIdx)
}
thePickResult.SetSurfaceNormal (aTriangleNormal);
segmentSegmentDistance (aPnts[aNearestEdgeIdx1], aPnts[aNearestEdgeIdx2], thePickResult);
+ thePickResult.SetDirectHit(Standard_False);
}
return !theClipRange.IsClipped (thePickResult.Depth());
thePickResult.SetSurfaceNormal (gp_Vec (aPntOnCylinder.X(), aPntOnCylinder.Y(), 0.0).Transformed (theTrsf));
}
thePickResult.SetPickedPoint (aPntOnCylinder.Transformed (theTrsf));
+ thePickResult.SetDirectHit(Standard_True);
return !theClipRange.IsClipped (thePickResult.Depth());
}
}
thePickResult.SetDepth (aTime * myScale);
+ thePickResult.SetDirectHit(Standard_True);
if (theClipRange.IsClipped (thePickResult.Depth()))
{
thePickResult.SetDepth (aTime * myScale);
}
thePickResult.SetDepth (aTimeEnter * myScale);
+ thePickResult.SetDirectHit(Standard_True);
if (theClipRange.IsClipped (thePickResult.Depth()))
{
thePickResult.SetDepth (aTimeLeave * myScale);