1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0028188: Improving layer color storage mechanism for DXF Import/Export

Attribute ColorByLayer was added for shapes that should be colored by the color of their layer or, if it's absent, by the parent component's layer color.

Fixing inconsistency of iterating through the map of Styles

Improving ColorByLayer mechanism

Fix for Map/IndexedMad differences.

Renaming according to convention of naming collection typedefs
This commit is contained in:
anv
2016-12-29 11:48:16 +03:00
committed by kgv
parent 7fbc3bc5a4
commit 08b183fe0b
14 changed files with 182 additions and 55 deletions

View File

@@ -558,6 +558,35 @@ void XCAFDoc_ColorTool::SetVisibility (const TDF_Label& L,
else L.ForgetAttribute( XCAFDoc::InvisibleGUID() );
}
//=======================================================================
//function : IsColorByLayer
//purpose :
//=======================================================================
Standard_Boolean XCAFDoc_ColorTool::IsColorByLayer (const TDF_Label& L) const
{
Handle(TDataStd_UAttribute) aUAttr;
return L.FindAttribute(XCAFDoc::ColorByLayerGUID(), aUAttr);
}
//=======================================================================
//function : SetColorByLayer
//purpose :
//=======================================================================
void XCAFDoc_ColorTool::SetColorByLayer (const TDF_Label& L,
const Standard_Boolean isColorByLayer)
{
Handle(TDataStd_UAttribute) aUAttr;
if ( isColorByLayer ) {
Handle(XCAFDoc_GraphNode) aSHUO;
if (ShapeTool()->IsShape(L) || ShapeTool()->GetSHUO( L, aSHUO ) )
if (!L.FindAttribute(XCAFDoc::ColorByLayerGUID(), aUAttr))
aUAttr->Set( L, XCAFDoc::ColorByLayerGUID() );
}
else L.ForgetAttribute( XCAFDoc::ColorByLayerGUID() );
}
//=======================================================================
//function : SetInstanceColor
//purpose :