mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-09 18:50:54 +03:00
0028061: Samples - Highlighting of any object with "Hidden On" option leads to crash in mfc Modeling
Graphic3d_Structure::Highlight() does not call UnHighlight() anymore.
This commit is contained in:
parent
eca0539260
commit
424392e0d8
@ -262,24 +262,6 @@ void Graphic3d_Structure::Highlight (const Handle(Graphic3d_HighlightStyle)& the
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Highlight on already Highlighted structure.
|
|
||||||
if (myCStructure->highlight)
|
|
||||||
{
|
|
||||||
Aspect_TypeOfUpdate anUpdateMode = myStructureManager->UpdateMode();
|
|
||||||
if (anUpdateMode == Aspect_TOU_WAIT)
|
|
||||||
{
|
|
||||||
UnHighlight();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// To avoid call of method : Update()
|
|
||||||
// Not useful and can be costly.
|
|
||||||
myStructureManager->SetUpdateMode (Aspect_TOU_WAIT);
|
|
||||||
UnHighlight();
|
|
||||||
myStructureManager->SetUpdateMode (anUpdateMode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SetDisplayPriority (Structure_MAX_PRIORITY - 1);
|
SetDisplayPriority (Structure_MAX_PRIORITY - 1);
|
||||||
|
|
||||||
myCStructure->GraphicHighlight (theStyle, this);
|
myCStructure->GraphicHighlight (theStyle, this);
|
||||||
|
@ -245,6 +245,14 @@ void OpenGl_Structure::highlightWithBndBox (const Handle(Graphic3d_Structure)& t
|
|||||||
void OpenGl_Structure::GraphicHighlight (const Handle(Graphic3d_HighlightStyle)& theStyle,
|
void OpenGl_Structure::GraphicHighlight (const Handle(Graphic3d_HighlightStyle)& theStyle,
|
||||||
const Handle(Graphic3d_Structure)& theStruct)
|
const Handle(Graphic3d_Structure)& theStruct)
|
||||||
{
|
{
|
||||||
|
if (!myHighlightStyle.IsNull()
|
||||||
|
&& myHighlightStyle->Method() == Aspect_TOHM_BOUNDBOX
|
||||||
|
&& theStyle->Method() != Aspect_TOHM_BOUNDBOX)
|
||||||
|
{
|
||||||
|
const Handle(OpenGl_Context)& aContext = GlDriver()->GetSharedContext();
|
||||||
|
clearHighlightBox (aContext);
|
||||||
|
}
|
||||||
|
|
||||||
myHighlightStyle = theStyle;
|
myHighlightStyle = theStyle;
|
||||||
|
|
||||||
highlight = 1;
|
highlight = 1;
|
||||||
|
19
tests/bugs/vis/bug28061
Normal file
19
tests/bugs/vis/bug28061
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
puts "==========="
|
||||||
|
puts "OCC28061 - Highlighting of any object with HLR option leads to crash"
|
||||||
|
puts "==========="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload MODELING VISUALIZATION
|
||||||
|
box b 1 2 3
|
||||||
|
|
||||||
|
vclear
|
||||||
|
vinit View1
|
||||||
|
vdisplay -dispMode 0 b
|
||||||
|
vsetwidth -noupdate b 4
|
||||||
|
vfit
|
||||||
|
vhlr on
|
||||||
|
|
||||||
|
vmoveto 250 250
|
||||||
|
if { [vreadpixel 321 150 rgb name] != "CYAN1" } { puts "Error: the box is not highlighted" }
|
||||||
|
|
||||||
|
vdump $imagedir/${casename}.png
|
Loading…
x
Reference in New Issue
Block a user