QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
dl_attributes.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2011 RibbonSoft. All rights reserved.
3 **
4 ** This file is part of the dxflib project.
5 **
6 ** This file may be distributed and/or modified under the terms of the
7 ** GNU General Public License version 2 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.GPL included in the
9 ** packaging of this file.
10 **
11 ** Licensees holding valid dxflib Professional Edition licenses may use
12 ** this file in accordance with the dxflib Commercial License
13 ** Agreement provided with the Software.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** See http://www.ribbonsoft.com for further details.
19 **
20 ** Contact info@ribbonsoft.com if any conditions of this licensing are
21 ** not clear to you.
22 **
23 **********************************************************************/
24 
25 #ifndef DL_ATTRIBUTES_H
26 #define DL_ATTRIBUTES_H
27 
28 #include <string>
29 using std::string;
30 
31 #include "dl_codes.h"
32 
40 
41 public:
42 
47  setLayer("");
48  setColor(0);
49  setColor24(-1);
50  setWidth(0);
51  setLineType("BYLAYER");
52  }
53 
54 
55 
67  DL_Attributes(const string& layer,
68  int color, int width,
69  const string& lineType) {
70  setLayer(layer);
71  setColor(color);
72  setColor24(-1);
73  setWidth(width);
74  setLineType(lineType);
75  }
76 
77 
90  DL_Attributes(const string& layer,
91  int color, int color24, int width,
92  const string& lineType) {
93  setLayer(layer);
94  setColor(color);
95  setColor24(color24);
96  setWidth(width);
97  setLineType(lineType);
98  }
99 
100 
101 
106  void setLayer(const string& layer) {
107  this->layer = layer;
108  }
109 
110 
111 
115  string getLayer() const {
116  return layer;
117  }
118 
119 
120 
126  void setColor(int color) {
127  this->color = color;
128  }
129 
130 
131 
137  void setColor24(int color) {
138  this->color24 = color;
139  }
140 
141 
142 
148  int getColor() const {
149  return color;
150  }
151 
152 
153 
159  int getColor24() const {
160  return color24;
161  }
162 
163 
164 
168  void setWidth(int width) {
169  this->width = width;
170  }
171 
172 
173 
177  int getWidth() const {
178  return width;
179  }
180 
181 
182 
187  void setLineType(const string& lineType) {
188  this->lineType = lineType;
189  }
190 
191 
192 
196  string getLineType() const {
197  if (lineType.length()==0) {
198  return "BYLAYER";
199  } else {
200  return lineType;
201  }
202  }
203 
204 
205 
210  setLayer(attrib.layer);
211  setColor(attrib.color);
212  setColor24(attrib.color24);
213  setWidth(attrib.width);
214  setLineType(attrib.lineType);
215 
216  return *this;
217  }
218 
219 private:
220  string layer;
221  int color;
222  int color24;
223  int width;
224  string lineType;
225 };
226 
227 #endif
228 
229 // EOF