mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0025381: Visualization - XCAFPrs_AISObject ignores visibility flag for sub-shapes
Test case for issue CR25381
This commit is contained in:
@@ -312,7 +312,19 @@ void AIS_ColoredShape::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
|
|||||||
{
|
{
|
||||||
const TopoDS_Shape& aShapeKey = aMapIter.Key(); // key shape with detailed color or a base shape
|
const TopoDS_Shape& aShapeKey = aMapIter.Key(); // key shape with detailed color or a base shape
|
||||||
const TopoDS_Compound& aShapeDraw = aMapIter.Value(); // compound of subshapes with <aShType> type
|
const TopoDS_Compound& aShapeDraw = aMapIter.Value(); // compound of subshapes with <aShType> type
|
||||||
Handle(AIS_Drawer) aDrawer = !myShapeColors.Find (aShapeKey, aCustomDrawer) ? myDrawer : aCustomDrawer;
|
Handle(AIS_Drawer) aDrawer;
|
||||||
|
if (myShapeColors.Find (aShapeKey, aCustomDrawer))
|
||||||
|
{
|
||||||
|
aDrawer = aCustomDrawer;
|
||||||
|
if (aCustomDrawer->IsHidden())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aDrawer = myDrawer;
|
||||||
|
}
|
||||||
|
|
||||||
// Draw each kind of subshapes and personal-colored shapes in a separate group
|
// Draw each kind of subshapes and personal-colored shapes in a separate group
|
||||||
// since it's necessary to set transparency/material for all subshapes
|
// since it's necessary to set transparency/material for all subshapes
|
||||||
|
@@ -30,12 +30,15 @@ class AIS_ColoredDrawer : public AIS_Drawer
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
AIS_ColoredDrawer (const Handle(AIS_Drawer)& theLink)
|
AIS_ColoredDrawer (const Handle(AIS_Drawer)& theLink)
|
||||||
: myHasOwnColor (Standard_False),
|
: myIsHidden (Standard_False),
|
||||||
|
myHasOwnColor (Standard_False),
|
||||||
myHasOwnWidth (Standard_False)
|
myHasOwnWidth (Standard_False)
|
||||||
{
|
{
|
||||||
Link (theLink);
|
Link (theLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Standard_Boolean IsHidden() const { return myIsHidden; }
|
||||||
|
void SetHidden (const Standard_Boolean theToHide) { myIsHidden = theToHide; }
|
||||||
Standard_Boolean HasOwnColor() const { return myHasOwnColor; }
|
Standard_Boolean HasOwnColor() const { return myHasOwnColor; }
|
||||||
void UnsetOwnColor() { myHasOwnColor = Standard_False; }
|
void UnsetOwnColor() { myHasOwnColor = Standard_False; }
|
||||||
void SetOwnColor (const Quantity_Color& /*theColor*/) { myHasOwnColor = Standard_True; }
|
void SetOwnColor (const Quantity_Color& /*theColor*/) { myHasOwnColor = Standard_True; }
|
||||||
@@ -45,6 +48,7 @@ public:
|
|||||||
|
|
||||||
public: //! @name list of overridden properties
|
public: //! @name list of overridden properties
|
||||||
|
|
||||||
|
Standard_Boolean myIsHidden;
|
||||||
Standard_Boolean myHasOwnColor;
|
Standard_Boolean myHasOwnColor;
|
||||||
Standard_Boolean myHasOwnWidth;
|
Standard_Boolean myHasOwnWidth;
|
||||||
|
|
||||||
|
@@ -155,6 +155,7 @@ void XCAFPrs_AISObject::Compute (const Handle(PrsMgr_PresentationManager3d)& the
|
|||||||
{
|
{
|
||||||
Handle(AIS_ColoredDrawer) aDrawer = CustomAspects (anIter.Key());
|
Handle(AIS_ColoredDrawer) aDrawer = CustomAspects (anIter.Key());
|
||||||
const XCAFPrs_Style& aStyle = anIter.Value();
|
const XCAFPrs_Style& aStyle = anIter.Value();
|
||||||
|
aDrawer->SetHidden (!aStyle.IsVisible());
|
||||||
|
|
||||||
aColorCurv = aStyle.IsSetColorCurv() ? aStyle.GetColorCurv() : aDefStyle.GetColorCurv();
|
aColorCurv = aStyle.IsSetColorCurv() ? aStyle.GetColorCurv() : aDefStyle.GetColorCurv();
|
||||||
aColorSurf = aStyle.IsSetColorSurf() ? aStyle.GetColorSurf() : aDefStyle.GetColorSurf();
|
aColorSurf = aStyle.IsSetColorSurf() ? aStyle.GetColorSurf() : aDefStyle.GetColorSurf();
|
||||||
|
23
tests/bugs/xde/bug25381
Normal file
23
tests/bugs/xde/bug25381
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR25381"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
######################################################
|
||||||
|
# Visualization - XCAFPrs_AISObject ignores visibility flag for sub-shapes
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
pload QAcommands
|
||||||
|
|
||||||
|
ReadStep D [locate_data_file bug25381_test_assembly_invisible.step]
|
||||||
|
XShow D
|
||||||
|
vfit
|
||||||
|
|
||||||
|
decho off
|
||||||
|
if { [catch { QAGetPixelColor 198 172 1 1 1 }] != 0 } {
|
||||||
|
decho on
|
||||||
|
puts "OK : XCAFPrs_AISObject get visibility flag for sub-shapes"
|
||||||
|
} else {
|
||||||
|
puts "Error : XCAFPrs_AISObject ignores visibility flag for sub-shapes"
|
||||||
|
}
|
||||||
|
|
||||||
|
set only_screen 1
|
Reference in New Issue
Block a user