- unnecessary re-initialization of pick result was removed from Select3D_SensitiveCircle;
- test case for issue #27477
thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
return Standard_False;
}
+ else
+ {
+ thePickResult = SelectBasics_PickResult (aDepth, theMgr.DistToGeometryCenter (myCenter3D));
+ }
}
-
- aDistToCOG = theMgr.DistToGeometryCenter (myCenter3D);
- thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
return Standard_True;
}
{
return myCenter3D;
}
+
+//=======================================================================
+// function : distanceToCOG
+// purpose :
+//=======================================================================
+Standard_Real Select3D_SensitiveCircle::distanceToCOG (SelectBasics_SelectingVolumeManager& theMgr)
+{
+ return theMgr.DistToGeometryCenter (myCenter3D);
+}
DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveCircle,Select3D_SensitivePoly)
+protected:
+
+ //! Calculates distance from the 3d projection of used-picked screen point
+ //! to center of the geometry
+ virtual Standard_Real distanceToCOG (SelectBasics_SelectingVolumeManager& theMgr) Standard_OVERRIDE;
+
private:
//! Computes myCenter3D as the barycenter of points from mypolyg3d
--- /dev/null
+puts "============"
+puts "OCC27477"
+puts "============"
+puts ""
+####################################################################################
+# Visualization - Select3D_SensitiveCircle always return infinite depth value in boundary mode
+####################################################################################
+
+proc check_output {theInfo} {
+ set aSize [llength $theInfo]
+ 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"]} {
+ return 1
+ } else {
+ return $aDepth
+ }
+ }
+ }
+
+ return 0
+}
+
+pload VISUALIZATION
+
+vinit View1
+vpoint radP1 0 0 0
+vpoint radP2 50 50 0
+vpoint radP3 100 0 0
+vcircle circle radP1 radP2 radP3 0
+vfit
+
+vmoveto 177 285
+set anOut [split [vstate -entities] "\n"]
+set anInfo [split [lindex $anOut 1] " "]
+set aResult [check_output $anInfo]
+if {$aResult == 1} {
+ puts "OK"
+ } else {
+ puts "ERROR: the depth value is incorrect: should be +17.569, but is equal to:"
+ puts $aResult
+ }
+
+set only_screen 1