diff --git a/bazaar/DXF/Entity.cpp b/bazaar/DXF/Entity.cpp index f3235cfe7..b9ef1beb9 100644 --- a/bazaar/DXF/Entity.cpp +++ b/bazaar/DXF/Entity.cpp @@ -62,3 +62,29 @@ double DXFEntity::R(double a) const { return entities->GetTransformationMatrix().R(a); } + +// sets color +DXFEntity &DXFEntity::SetColor(int c) +{ + color = c; + return *this; +} + +// sets layer +DXFEntity &DXFEntity::SetLayer(String const &l) +{ + layer = l; + return *this; +} + +// sets linetype +DXFEntity &DXFEntity::SetLineType(String const &l) +{ + // linetype MUST be there, so add if not + if(!GetDXF().tables.HasLineType(l)) + GetDXF().tables.AddLineType(l); + + lineType = l; + return *this; +} + diff --git a/bazaar/DXF/Entity.h b/bazaar/DXF/Entity.h index 05598c068..071b8ce69 100644 --- a/bazaar/DXF/Entity.h +++ b/bazaar/DXF/Entity.h @@ -61,15 +61,15 @@ class DXFEntity virtual ~DXFEntity() {} // gets/sets color - DXFEntity *SetColor(int c); + DXFEntity &SetColor(int c); int GetColor(void) const { return color; } // gets/sets layer - DXFEntity *SetLayer(String const &l); + DXFEntity &SetLayer(String const &l); String const &GetLayer(void) const { return layer; } // gets/sets linetype - DXFEntity *SetLineType(String const &l); + DXFEntity &SetLineType(String const &l); String const &GetLineType(void) const { return lineType; } // gets bounding box of element