All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EnumScaleType.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file EnumScaleType.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "EnumScaleType.h"
30 
32  m_noneType(0),
33  m_alternatingScaleBarType(0),
34  m_doubleAlternatingScaleBarType(0),
35  m_hollowScaleBarType(0)
36 {
37  init();
38 }
39 
41 {
42  if(m_noneType)
43  {
44  delete m_noneType;
45  m_noneType = 0;
46  }
47  if(m_alternatingScaleBarType)
48  {
49  delete m_alternatingScaleBarType;
50  m_alternatingScaleBarType = 0;
51  }
52  if(m_doubleAlternatingScaleBarType)
53  {
54  delete m_doubleAlternatingScaleBarType;
55  m_doubleAlternatingScaleBarType = 0;
56  }
57  if(m_hollowScaleBarType)
58  {
59  delete m_hollowScaleBarType;
60  m_hollowScaleBarType = 0;
61  }
62 }
64 {
65  m_noneType = new EnumType(0, "NoneScale", this);
66  m_noneType->setLabel("None Scale");
67  m_enums.push_back(m_noneType);
68 
69  m_alternatingScaleBarType = new EnumType(1, "AlternantingScaleBar", this);
70  m_alternatingScaleBarType->setLabel("Alternanting Scale Bar");
71  m_enums.push_back(m_alternatingScaleBarType);
72 
73  m_doubleAlternatingScaleBarType = new EnumType(2, "DoubleAlternantingScaleBar", this);
74  m_doubleAlternatingScaleBarType->setLabel("Double Alternanting Scale Bar");
75  m_enums.push_back(m_doubleAlternatingScaleBarType);
76 
77  m_hollowScaleBarType = new EnumType(3, "HollowScaleBar", this);
78  m_hollowScaleBarType->setLabel("Hollow Scale Bar");
79  m_enums.push_back(m_hollowScaleBarType);
80 }
81 
83 {
84  return m_noneType;
85 }
86 
88 {
89  return m_alternatingScaleBarType;
90 }
91 
93 {
94  return m_doubleAlternatingScaleBarType;
95 }
96 
98 {
99  return m_hollowScaleBarType;
100 }
101 
virtual EnumType * getAlternatingScaleBarType() const
Returns value that represents alternating scale bar type belonging to enumeration.
virtual EnumType * getNoneType() const
Returns value that represents none type belonging to enumeration.
virtual EnumType * getDoubleAlternatingScaleBarType() const
Returns value that represents double alternating scale bar type belonging to enumeration.
EnumScaleType()
Constructor.
virtual void init()
Reimplemented from AbstractEnum.
virtual EnumType * getHollowScaleBarType() const
Returns value that represents hollow scale bar type belonging to enumeration.
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
Definition: EnumType.h:48
virtual ~EnumScaleType()
Destructor.