Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

omglayer.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           omgserialisable.cpp  -  description
00003                              -------------------
00004     begin                : March 2006
00005     copyright            : (C) 2003 by Tim Sutton
00006     email                : tim@linfiniti.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include "omglayer.h"
00019 
00020 OmgLayer::OmgLayer() : OmgSerialisable()
00021 {
00022 
00023 }
00024 OmgLayer::~OmgLayer()
00025 {
00026 
00027 }
00028 
00029 OmgLayer::OmgLayer(const OmgLayer& theLayer)
00030 {
00031   mName=theLayer.name();
00032   mCategoricalFlag=theLayer.isCategorical();
00033   mType = theLayer.type();
00034 }
00035 
00036 OmgLayer& OmgLayer::operator=(const OmgLayer& theLayer)
00037 {
00038   if (this == &theLayer) return *this;   // Gracefully handle self assignment
00039 
00040   mName=theLayer.name();
00041   mCategoricalFlag=theLayer.isCategorical();
00042   mType=theLayer.type();  
00043   // Put the normal assignment duties here...
00044   return *this;
00045 }
00046 
00047 QString OmgLayer::name() const
00048 {
00049   return mName;
00050 }
00051 
00052 void OmgLayer::setName(QString theName)
00053 {
00054   mName=theName;
00055 }
00056 
00057 bool OmgLayer::isCategorical() const
00058 {
00059   return mCategoricalFlag;
00060 }
00061 
00062 void OmgLayer::setCategorical(bool theFlag)
00063 {
00064   mCategoricalFlag = theFlag;
00065 }
00066 
00067 OmgLayer::LayerType OmgLayer::type() const
00068 {
00069   return mType;
00070 }
00071 
00072 void OmgLayer::setType(OmgLayer::LayerType theType)
00073 {
00074   mType = theType;
00075 }
00076 
00077 QString OmgLayer::toXml() const 
00078 {
00079   QString myString = QString("      <Map Id=\"" 
00080       + mName.toLocal8Bit() 
00081       + "\" IsCategorical=\"" 
00082       + (mCategoricalFlag ? "1" : "0")  
00083       + "\"/>");
00084   return myString;
00085 }
00086 

Generated on Mon Apr 28 15:08:41 2008 for openModellerDesktop by  doxygen 1.4.1-20050210