00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef DL_ATTRIBUTES_H
00028 #define DL_ATTRIBUTES_H
00029
00030 #include <string>
00031 using std::string;
00032
00033 #include "dl_codes.h"
00034
00041 class DL_Attributes {
00042
00043 public:
00044
00048 DL_Attributes() {
00049 setLayer("");
00050 setColor(0);
00051 setWidth(0);
00052 setLineType("BYLAYER");
00053 }
00054
00055
00056
00068 DL_Attributes(const string& layer,
00069 int color, int width,
00070 const string& lineType) {
00071 setLayer(layer);
00072 setColor(color);
00073 setWidth(width);
00074 setLineType(lineType);
00075 }
00076
00077
00078
00083 void setLayer(const string& layer) {
00084 this->layer = layer;
00085 }
00086
00087
00088
00092 string getLayer() const {
00093 return layer;
00094 }
00095
00096
00097
00103 void setColor(int color) {
00104 this->color = color;
00105 }
00106
00107
00108
00114 int getColor() const {
00115 return color;
00116 }
00117
00118
00119
00123 void setWidth(int width) {
00124 this->width = width;
00125 }
00126
00127
00128
00132 int getWidth() const {
00133 return width;
00134 }
00135
00136
00137
00142 void setLineType(const string& lineType) {
00143 this->lineType = lineType;
00144 }
00145
00146
00147
00151 string getLineType() const {
00152 if (lineType.length()==0) {
00153 return "BYLAYER";
00154 } else {
00155 return lineType;
00156 }
00157 }
00158
00159
00160
00164 DL_Attributes operator = (const DL_Attributes& attrib) {
00165 setLayer(attrib.layer);
00166 setColor(attrib.color);
00167 setWidth(attrib.width);
00168 setLineType(attrib.lineType);
00169
00170 return *this;
00171 }
00172
00173 private:
00174 string layer;
00175 int color;
00176 int width;
00177 string lineType;
00178 };
00179
00180 #endif
00181
00182