mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0026284: Visualization - eliminate recursion in SelectMgr_SelectionManager
Small correction of test case for issue CR26284
This commit is contained in:
parent
645ff3b1e7
commit
e11850fd23
@ -3489,6 +3489,42 @@ static Standard_Integer OCC26172 (Draw_Interpretor& theDI, Standard_Integer theA
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OCC26284
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Integer OCC26284 (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
|
||||
{
|
||||
if (theArgNb != 1)
|
||||
{
|
||||
std::cerr << "Error: wrong number of arguments! See usage:\n";
|
||||
theDI.PrintHelp (theArgVec[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(AIS_InteractiveContext) anAISContext = ViewerTest::GetAISContext();
|
||||
if (anAISContext.IsNull())
|
||||
{
|
||||
std::cerr << "Error: no active view. Please call vinit.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
BRepPrimAPI_MakeSphere aSphereBuilder (gp_Pnt (0.0, 0.0, 0.0), 1.0);
|
||||
Handle(AIS_Shape) aSphere = new AIS_Shape (aSphereBuilder.Shape());
|
||||
anAISContext->Display (aSphere);
|
||||
for (Standard_Integer aChildIdx = 0; aChildIdx < 5; ++aChildIdx)
|
||||
{
|
||||
BRepPrimAPI_MakeSphere aBuilder (gp_Pnt (1.0 + aChildIdx, 1.0 + aChildIdx, 1.0 + aChildIdx), 1.0);
|
||||
Handle(AIS_Shape) aChild = new AIS_Shape (aBuilder.Shape());
|
||||
aSphere->AddChild (aChild);
|
||||
anAISContext->Display (aChild);
|
||||
}
|
||||
|
||||
anAISContext->RecomputeSelectionOnly (aSphere);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
|
||||
@ -3698,5 +3734,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
|
||||
theCommands.Add ("xprojponf", "xprojponf p f", __FILE__, xprojponf, group);
|
||||
theCommands.Add ("OCC24923", "OCC24923", __FILE__, OCC24923, group);
|
||||
theCommands.Add ("OCC26139", "OCC26139 [-boxsize value] [-boxgrid value] [-compgrid value]", __FILE__, OCC26139, group);
|
||||
theCommands.Add ("OCC26284", "OCC26284", __FILE__, OCC26284, group);
|
||||
return;
|
||||
}
|
||||
|
@ -515,7 +515,7 @@ void SelectMgr_SelectionManager::ClearSelectionStructures (const Handle(SelectMg
|
||||
{
|
||||
for (PrsMgr_ListOfPresentableObjectsIter anChildrenIter (theObj->Children()); anChildrenIter.More(); anChildrenIter.Next())
|
||||
{
|
||||
ClearSelectionStructures (theObj, theMode, theSelector);
|
||||
ClearSelectionStructures (Handle(SelectMgr_SelectableObject)::DownCast (anChildrenIter.Value()), theMode, theSelector);
|
||||
}
|
||||
|
||||
if (!theObj->HasOwnPresentations())
|
||||
@ -575,7 +575,7 @@ void SelectMgr_SelectionManager::RestoreSelectionStructures (const Handle(Select
|
||||
{
|
||||
for (PrsMgr_ListOfPresentableObjectsIter anChildrenIter (theObj->Children()); anChildrenIter.More(); anChildrenIter.Next())
|
||||
{
|
||||
RestoreSelectionStructures (theObj, theMode, theSelector);
|
||||
RestoreSelectionStructures (Handle(SelectMgr_SelectableObject)::DownCast (anChildrenIter.Value()), theMode, theSelector);
|
||||
}
|
||||
|
||||
if (!theObj->HasOwnPresentations())
|
||||
@ -687,7 +687,6 @@ void SelectMgr_SelectionManager::RecomputeSelection (const Handle(SelectMgr_Sele
|
||||
for(theObject->Init(); theObject->More(); theObject->Next())
|
||||
{
|
||||
const Handle(SelectMgr_Selection)& aSelection = theObject->CurrentSelection();
|
||||
aSelection->UpdateStatus (SelectMgr_TOU_Full);
|
||||
Standard_Integer aSelMode = aSelection->Mode();
|
||||
|
||||
for (TColStd_MapIteratorOfMapOfTransient aSelectorIter (mySelectors); aSelectorIter.More(); aSelectorIter.Next())
|
||||
@ -695,23 +694,13 @@ void SelectMgr_SelectionManager::RecomputeSelection (const Handle(SelectMgr_Sele
|
||||
const Handle(SelectMgr_ViewerSelector)& aCurSelector = Handle(SelectMgr_ViewerSelector)::DownCast (aSelectorIter.Key());
|
||||
if (aCurSelector->Status (aSelection) == SelectMgr_SOS_Activated)
|
||||
{
|
||||
switch (aSelection->UpdateStatus())
|
||||
{
|
||||
case SelectMgr_TOU_Full:
|
||||
ClearSelectionStructures (theObject, aSelMode, aCurSelector);
|
||||
theObject->RecomputePrimitives(aSelMode);
|
||||
RestoreSelectionStructures (theObject, aSelMode, aCurSelector);
|
||||
case SelectMgr_TOU_Partial:
|
||||
theObject->UpdateTransformations (aSelection);
|
||||
aCurSelector->RebuildObjectsTree();
|
||||
aSelection->UpdateBVHStatus (SelectMgr_TBU_None);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
aSelection->UpdateStatus (SelectMgr_TOU_None);
|
||||
}
|
||||
}
|
||||
aSelection->UpdateStatus (SelectMgr_TOU_None);
|
||||
aSelection->UpdateBVHStatus (SelectMgr_TBU_None);
|
||||
}
|
||||
}
|
||||
|
||||
|
15
tests/bugs/vis/bug26284
Normal file
15
tests/bugs/vis/bug26284
Normal file
@ -0,0 +1,15 @@
|
||||
puts "========"
|
||||
puts "OCC26284"
|
||||
puts "========"
|
||||
puts ""
|
||||
##################################################################
|
||||
puts "Visualization - eliminate recursion in SelectMgr_SelectionManager"
|
||||
##################################################################
|
||||
|
||||
pload QAcommands VISUALIZATION
|
||||
|
||||
vinit
|
||||
OCC26284
|
||||
|
||||
vfit
|
||||
set only_screen 1
|
Loading…
x
Reference in New Issue
Block a user