mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-06 10:36:12 +03:00
0031794: Visualization - Highlighting of AIS_Shape works incorrectly when AddChild() used
PrsMgr_PresentationManager::Display(), PrsMgr_PresentationManager::Color(), and SelectMgr_SelectionManager::Activate() now skip children in Erased state.
This commit is contained in:
parent
e70625d6b1
commit
19ed08fda6
@ -72,11 +72,15 @@ void PrsMgr_PresentationManager::Display (const Handle(PrsMgr_PresentableObject)
|
|||||||
if (thePrsObj->ToPropagateVisualState())
|
if (thePrsObj->ToPropagateVisualState())
|
||||||
{
|
{
|
||||||
for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
|
for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
|
||||||
|
{
|
||||||
|
const Handle(PrsMgr_PresentableObject)& aChild = anIter.Value();
|
||||||
|
if (aChild->DisplayStatus() != PrsMgr_DisplayStatus_Erased)
|
||||||
{
|
{
|
||||||
Display(anIter.Value(), theMode);
|
Display(anIter.Value(), theMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// function : Erase
|
// function : Erase
|
||||||
@ -156,10 +160,15 @@ void PrsMgr_PresentationManager::SetVisibility (const Handle(PrsMgr_PresentableO
|
|||||||
if (thePrsObj->ToPropagateVisualState())
|
if (thePrsObj->ToPropagateVisualState())
|
||||||
{
|
{
|
||||||
for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
|
for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
|
||||||
|
{
|
||||||
|
const Handle(PrsMgr_PresentableObject)& aChild = anIter.Value();
|
||||||
|
if (!theValue
|
||||||
|
|| aChild->DisplayStatus() != PrsMgr_DisplayStatus_Erased)
|
||||||
{
|
{
|
||||||
SetVisibility (anIter.Value(), theMode, theValue);
|
SetVisibility (anIter.Value(), theMode, theValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!thePrsObj->HasOwnPresentations())
|
if (!thePrsObj->HasOwnPresentations())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -616,7 +625,11 @@ void PrsMgr_PresentationManager::Color (const Handle(PrsMgr_PresentableObject)&
|
|||||||
{
|
{
|
||||||
for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
|
for (PrsMgr_ListOfPresentableObjectsIter anIter(thePrsObj->Children()); anIter.More(); anIter.Next())
|
||||||
{
|
{
|
||||||
Color(anIter.Value(), theStyle, theMode, NULL, theImmediateStructLayerId);
|
const Handle(PrsMgr_PresentableObject)& aChild = anIter.Value();
|
||||||
|
if (aChild->DisplayStatus() != PrsMgr_DisplayStatus_Erased)
|
||||||
|
{
|
||||||
|
Color (aChild, theStyle, theMode, NULL, theImmediateStructLayerId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!thePrsObj->HasOwnPresentations())
|
if (!thePrsObj->HasOwnPresentations())
|
||||||
|
@ -114,7 +114,11 @@ void SelectMgr_SelectionManager::Activate (const Handle(SelectMgr_SelectableObje
|
|||||||
|
|
||||||
for (PrsMgr_ListOfPresentableObjectsIter anChildIter (theObject->Children()); anChildIter.More(); anChildIter.Next())
|
for (PrsMgr_ListOfPresentableObjectsIter anChildIter (theObject->Children()); anChildIter.More(); anChildIter.Next())
|
||||||
{
|
{
|
||||||
Activate (Handle(SelectMgr_SelectableObject)::DownCast (anChildIter.Value()), theMode);
|
Handle(SelectMgr_SelectableObject) aChild = Handle(SelectMgr_SelectableObject)::DownCast (anChildIter.Value());
|
||||||
|
if (aChild->DisplayStatus() != PrsMgr_DisplayStatus_Erased)
|
||||||
|
{
|
||||||
|
Activate (aChild, theMode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!theObject->HasOwnPresentations())
|
if (!theObject->HasOwnPresentations())
|
||||||
return;
|
return;
|
||||||
|
22
tests/bugs/vis/bug31794
Normal file
22
tests/bugs/vis/bug31794
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "0031794: Visualization - Highlighting of AIS_Shape works incorrectly when AddChild() used"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload MODELING VISUALIZATION
|
||||||
|
vinit View1
|
||||||
|
box b 10 10 10
|
||||||
|
box p1 -100 -100 0 200 200 0 -preview
|
||||||
|
box p2 100 -100 0 200 200 0 -preview
|
||||||
|
vdisplay b -dispMode 1
|
||||||
|
vdisplay p1 p2 -dispMode 1 -highMode 1
|
||||||
|
vfit
|
||||||
|
vselmode b 0 0
|
||||||
|
verase p1
|
||||||
|
vchild b -add p1
|
||||||
|
vchild b -add p2
|
||||||
|
vselmode b 0 1
|
||||||
|
vmoveto 100 200
|
||||||
|
if {[vreadpixel 100 200 -rgb -name] != "BLACK"} { puts "Error" }
|
||||||
|
|
||||||
|
vdump ${imagedir}/${casename}.png
|
Loading…
x
Reference in New Issue
Block a user