Do not use myMainSel->OnePicked() in AIS_InteractiveContext::MoveTo().
Test-case for issue #25340
// filling of myAISDetectedSeq sequence storing information about detected AIS objects
// (the objects must be AIS_Shapes)
const Standard_Integer aDetectedNb = myMainSel->NbPicked();
+ Standard_Integer aNewDetected = 0;
for (Standard_Integer aDetIter = 1; aDetIter <= aDetectedNb; ++aDetIter)
{
Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aDetIter);
continue;
}
+ if (aNewDetected < 1)
+ {
+ aNewDetected = aDetIter;
+ }
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
if (!anObj.IsNull())
{
}
}
- myMainSel->Init();
- if (myMainSel->More())
+ if (aNewDetected >= 1)
{
// does nothing if previously detected object is equal to the current one
- if (myMainSel->OnePicked()->Selectable() == myLastPicked)
+ Handle(SelectMgr_EntityOwner) aNewPickedOwner = myMainSel->Picked (aNewDetected);
+ if (aNewPickedOwner->Selectable() == myLastPicked)
{
return myLastPicked->State() == 1
? AIS_SOD_Selected
}
// initialize myLastPicked field with currently detected object
- myLastPicked = Handle(AIS_InteractiveObject)::DownCast (myMainSel->OnePicked()->Selectable());
+ myLastPicked = Handle(AIS_InteractiveObject)::DownCast (aNewPickedOwner->Selectable());
myLastinMain = myLastPicked;
// highlight detected object if it is not selected or myToHilightSelected flag is true
return 0;
}
+#include <AIS_TypeFilter.hxx>
+static Standard_Integer OCC25340 (Draw_Interpretor& /*theDI*/,
+ Standard_Integer /*theArgNb*/,
+ const char** /*theArgVec*/)
+{
+ Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
+ if (aCtx.IsNull())
+ {
+ std::cerr << "Error: No opened viewer!\n";
+ return 1;
+ }
+ Handle(AIS_TypeFilter) aFilter = new AIS_TypeFilter (AIS_KOI_Shape);
+ aCtx->AddFilter (aFilter);
+ return 0;
+}
+
/*****************************************************************************/
#include <GeomAPI_IntSS.hxx>
theCommands.Add ("OCC25202", "OCC25202 res shape numF1 face1 numF2 face2", __FILE__, OCC25202, group);
theCommands.Add ("OCC7570", "OCC7570 shape", __FILE__, OCC7570, group);
theCommands.Add ("OCC25100", "OCC25100 shape", __FILE__, OCC25100, group);
+ theCommands.Add ("OCC25340", "OCC25340", __FILE__, OCC25340, group);
return;
}
--- /dev/null
+puts "========"
+puts "OCC25340"
+puts "========"
+puts ""
+#############################################################################################
+# Visualization, AIS_InteractiveContext - properly apply selection filters at Neutral point
+#############################################################################################
+
+pload QAcommands
+
+vinit
+
+box b 1 2 3
+vdisplay b
+vfit
+vtrihedron t
+set color_1 [vreadpixel 87 25]
+
+OCC25340
+vselect 87 25
+set color_2 [vreadpixel 87 25]
+
+if {$color_2 != $color_1} {
+ puts "ERROR: OCC25340 is reproduced"
+ puts " initial color of trihedron is: $color_1"
+ puts " final color of trihedron is: $color_2"
+}
+
+if {$color_2 != "0.43137255311012268 0.48235294222831726 0.54509806632995605 1"} {
+ puts "ERROR: OCC25340 is reproduced"
+ puts " additional investigation is needed"
+ puts " expected color is: 0.43137255311012268 0.48235294222831726 0.54509806632995605 1"
+ puts " current color is: $_color_2"
+}
+
+set only_screen 1