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:
@@ -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 :
|
||||
|
Reference in New Issue
Block a user