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:
@@ -236,7 +236,7 @@ Standard_Boolean IGESCAFControl_Writer::WriteAttributes (const TDF_LabelSequence
|
||||
TDF_Label L = labels.Value(i);
|
||||
|
||||
// collect color settings
|
||||
XCAFPrs_DataMapOfShapeStyle settings;
|
||||
XCAFPrs_IndexedDataMapOfShapeStyle settings;
|
||||
TopLoc_Location loc;
|
||||
XCAFPrs::CollectStyleSettings ( L, loc, settings );
|
||||
if ( settings.Extent() <=0 ) continue;
|
||||
@@ -262,7 +262,7 @@ Standard_Boolean IGESCAFControl_Writer::WriteAttributes (const TDF_LabelSequence
|
||||
//=======================================================================
|
||||
|
||||
void IGESCAFControl_Writer::MakeColors (const TopoDS_Shape &S,
|
||||
const XCAFPrs_DataMapOfShapeStyle &settings,
|
||||
const XCAFPrs_IndexedDataMapOfShapeStyle &settings,
|
||||
XCAFPrs_DataMapOfStyleTransient &colors,
|
||||
TopTools_MapOfShape &Map,
|
||||
const XCAFPrs_Style &inherit)
|
||||
@@ -272,8 +272,8 @@ void IGESCAFControl_Writer::MakeColors (const TopoDS_Shape &S,
|
||||
|
||||
// check if shape has its own style (or inherits from ancestor)
|
||||
XCAFPrs_Style style = inherit;
|
||||
if ( settings.IsBound(S) ) {
|
||||
XCAFPrs_Style own = settings.Find(S);
|
||||
if ( settings.Contains(S) ) {
|
||||
XCAFPrs_Style own = settings.FindFromKey(S);
|
||||
if ( own.IsSetColorCurv() ) style.SetColorCurv ( own.GetColorCurv() );
|
||||
if ( own.IsSetColorSurf() ) style.SetColorSurf ( own.GetColorSurf() );
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#include <IGESControl_Writer.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <TDF_LabelSequence.hxx>
|
||||
#include <XCAFPrs_DataMapOfShapeStyle.hxx>
|
||||
#include <XCAFPrs_IndexedDataMapOfShapeStyle.hxx>
|
||||
#include <XCAFPrs_DataMapOfStyleTransient.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
class XSControl_WorkSession;
|
||||
@@ -125,7 +125,7 @@ private:
|
||||
|
||||
//! Recursively iterates on subshapes and assigns colors
|
||||
//! to faces and edges (if set)
|
||||
Standard_EXPORT void MakeColors (const TopoDS_Shape& S, const XCAFPrs_DataMapOfShapeStyle& settings, XCAFPrs_DataMapOfStyleTransient& colors, TopTools_MapOfShape& Map, const XCAFPrs_Style& inherit);
|
||||
Standard_EXPORT void MakeColors (const TopoDS_Shape& S, const XCAFPrs_IndexedDataMapOfShapeStyle& settings, XCAFPrs_DataMapOfStyleTransient& colors, TopTools_MapOfShape& Map, const XCAFPrs_Style& inherit);
|
||||
|
||||
|
||||
Standard_Boolean myColorMode;
|
||||
|
Reference in New Issue
Block a user