ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
dl_attributes.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved.
3 **
4 ** This file is part of the dxflib project.
5 **
6 ** This file is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License as published by
8 ** the Free Software Foundation; either version 2 of the License, or
9 ** (at your option) any later version.
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 #include <vector>
30 
31 #include "dl_codes.h"
32 #include "dl_global.h"
33 
41 public:
46  : layer(""),
47  color(0),
48  color24(-1),
49  width(0),
50  linetype("BYLAYER"),
51  linetypeScale(1.0),
52  handle(-1),
53  inPaperSpace(false) {}
54 
66  DL_Attributes(const std::string& layer,
67  int color,
68  int width,
69  const std::string& linetype,
70  double linetypeScale)
71  : layer(layer),
72  color(color),
73  color24(-1),
74  width(width),
75  linetype(linetype),
76  linetypeScale(linetypeScale),
77  handle(-1),
78  inPaperSpace(false) {}
79 
92  DL_Attributes(const std::string& layer,
93  int color,
94  int color24,
95  int width,
96  const std::string& linetype,
97  int handle = -1)
98  : layer(layer),
99  color(color),
100  color24(color24),
101  width(width),
102  linetype(linetype),
103  linetypeScale(1.0),
104  handle(handle),
105  inPaperSpace(false) {}
106 
111  void setLayer(const std::string& layer) { this->layer = layer; }
112 
116  std::string getLayer() const { return layer; }
117 
123  void setColor(int color) { this->color = color; }
124 
130  void setColor24(int color) { this->color24 = color; }
131 
137  int getColor() const { return color; }
138 
144  int getColor24() const { return color24; }
145 
149  void setWidth(int width) { this->width = width; }
150 
154  int getWidth() const { return width; }
155 
160  void setLinetype(const std::string& linetype) { this->linetype = linetype; }
161 
165  void setLinetypeScale(double linetypeScale) {
166  this->linetypeScale = linetypeScale;
167  }
168 
169  double getLinetypeScale() const { return linetypeScale; }
170 
174  std::string getLinetype() const {
175  if (linetype.length() == 0) {
176  return "BYLAYER";
177  } else {
178  return linetype;
179  }
180  }
181 
182  void setHandle(int h) { handle = h; }
183 
184  int getHandle() const { return handle; }
185 
186  void setInPaperSpace(bool on) { inPaperSpace = on; }
187 
188  bool isInPaperSpace() const { return inPaperSpace; }
189 
190 private:
191  std::string layer;
192  int color;
193  int color24;
194  int width;
195  std::string linetype;
196  double linetypeScale;
197  int handle;
198 
199  // DXF code 67 (true: entity in paper space, false: entity in model space
200  // (default):
201  bool inPaperSpace;
202 };
203 
204 #endif
205 
206 // EOF
int width
math::float4 color
void setColor24(int color)
void setLayer(const std::string &layer)
std::string getLinetype() const
DL_Attributes(const std::string &layer, int color, int color24, int width, const std::string &linetype, int handle=-1)
Definition: dl_attributes.h:92
void setLinetype(const std::string &linetype)
bool isInPaperSpace() const
int getColor() const
int getWidth() const
void setInPaperSpace(bool on)
std::string getLayer() const
DL_Attributes(const std::string &layer, int color, int width, const std::string &linetype, double linetypeScale)
Definition: dl_attributes.h:66
void setLinetypeScale(double linetypeScale)
void setHandle(int h)
int getHandle() const
void setWidth(int width)
int getColor24() const
double getLinetypeScale() const
void setColor(int color)
#define DXFLIB_EXPORT
Definition: dl_global.h:12