gp_Pnt SelectMgr_SelectingVolumeManager::DetectedPoint (const Standard_Real theDepth) const
{
if (myActiveSelectionType != Point)
- return gp_Pnt (RealLast(), RealLast(), RealLast());
+ {
+ Standard_ProgramError::Raise ("SelectMgr_SelectingVolumeManager::DetectedPoint() should be called only for Point selection type");
+ }
return mySelectingVolumes[Frustum]->DetectedPoint (theDepth);
}
//! screen point and given point theCOG
Standard_EXPORT virtual Standard_Real DistToGeometryCenter (const gp_Pnt& theCOG) Standard_OVERRIDE;
- //! Calculates the point on a view ray that was detected during the run of selection algo by given depth. Is valid for point
- //! selection only
+ //! Calculates the point on a view ray that was detected during the run of selection algo by given depth.
+ //! Throws exception if active selection type is not Point.
Standard_EXPORT virtual gp_Pnt DetectedPoint (const Standard_Real theDepth) const Standard_OVERRIDE;
//! Checks if the point of sensitive in which selection was detected belongs
const gp_GTrsf& theInversedTrsf,
SelectMgr_SelectingVolumeManager& theMgr)
{
+ if (theMgr.GetActiveSelectionType() != SelectMgr_SelectingVolumeManager::Point)
+ {
+ return;
+ }
+
theCriterion.Point = theMgr.DetectedPoint (theCriterion.Depth);
gp_GTrsf anInvTrsf = theInversedTrsf;
if (theCriterion.Entity->HasInitLocation())
aName.LeftJustify (20, ' ');
char anInfoStr[512];
Sprintf (anInfoStr,
- " Depth: %+.3f Distance: %+.3f Point: %+.3f %+.3f %+.3f",
+ " Depth: %g Distance: %g Point: %g %g %g",
aPickData.Depth,
aPickData.MinDist,
aPickData.Point.X(), aPickData.Point.Y(), aPickData.Point.Z());
if { [vreadpixel 132 300 rgb name] != "GRAY66" } { puts "Error selecting trihedron persistence object" }
vselect 50 380 400 50
+vstate -entities
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
for {set i 0} {$i < $aSize} {incr i} {
if {[string equal [lindex $theInfo $i] "Depth:"]} {
set aDepth [lindex $theInfo [expr $i + 1]]
- if {[string equal $aDepth "+17.569"]} {
+ if {[string equal $aDepth "17.5691"]} {
return 1
} else {
return $aDepth
if {$aResult == 1} {
puts "OK"
} else {
- puts "ERROR: the depth value is incorrect: should be +17.569, but is equal to:"
+ puts "ERROR: the depth value is incorrect: should be 17.5691, but is equal to:"
puts $aResult
}