| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/dxflib/dl_attributes.h
Go to the documentation of this file.

    00001 /****************************************************************************
    00002 ** $Id: dl_attributes.h 8171 2009-12-11 12:31:36Z fredbed $
    00003 **
    00004 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
    00005 **
    00006 ** This file is part of the dxflib project.
    00007 **
    00008 ** This file may be distributed and/or modified under the terms of the
    00009 ** GNU General Public License version 2 as published by the Free Software
    00010 ** Foundation and appearing in the file LICENSE.GPL included in the
    00011 ** packaging of this file.
    00012 **
    00013 ** Licensees holding valid dxflib Professional Edition licenses may use
    00014 ** this file in accordance with the dxflib Commercial License
    00015 ** Agreement provided with the Software.
    00016 **
    00017 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
    00018 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    00019 **
    00020 ** See http://www.ribbonsoft.com for further details.
    00021 **
    00022 ** Contact info@ribbonsoft.com if any conditions of this licensing are
    00023 ** not clear to you.
    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 // EOF

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines