From 77ded3f8a23aa66ad3c47b05d44c1c9e83154fac Mon Sep 17 00:00:00 2001 From: micio Date: Sun, 12 Aug 2012 13:06:00 +0000 Subject: [PATCH] Bazaar/DXF : added some missing setters to Entity class git-svn-id: svn://ultimatepp.org/upp/trunk@5277 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/DXF/Entity.cpp | 26 ++++++++++++++++++++++++++ bazaar/DXF/Entity.h | 6 +++--- 2 files changed, 29 insertions(+), 3 deletions(-) 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