All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ScaleModel.h
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 ScaleModel.h
22 
23  \brief Class that represents a "Model" part of Scale MVC component.
24  Its coordinate system is the same of scene (millimeters).
25  This is also son of ItemModelObservable, so it can become observable, and son of AbstractVisitor, so it can become visitor.
26  It is must visit the map, via te::layout::Visitable*, to get the scale value.
27 
28  \ingroup layout
29 */
30 
31 #ifndef __TERRALIB_LAYOUT_INTERNAL_SCALE_MODEL_H
32 #define __TERRALIB_LAYOUT_INTERNAL_SCALE_MODEL_H
33 
34 // TerraLib
35 #include "../core/pattern/mvc/ItemModelObservable.h"
36 #include "../core/ContextItem.h"
37 #include "../core/pattern/derivativevisitor/AbstractVisitor.h"
38 #include "../../maptools/Canvas.h"
39 #include "../core/Utils.h"
40 #include "../core/Config.h"
41 #include "../core/enum/EnumScaleType.h"
42 #include "../core/enum/EnumType.h"
43 #include "../core/property/Property.h"
44 
45 // STL
46 #include <string>
47 #include <vector>
48 
49 namespace te
50 {
51  namespace layout
52  {
53  /*!
54  \brief Class that represents a "Model" part of Scale MVC component.
55  Its coordinate system is the same of scene (millimeters).
56  This is also son of ItemModelObservable, so it can become observable, and son of AbstractVisitor, so it can become visitor.
57  It is must visit the map, via te::layout::Visitable*, to get the scale value.
58 
59  \ingroup layout
60 
61  \sa te::layout::ItemModelObservable , te::layout::AbstractVisitor
62  */
64  {
65  public:
66 
67  /*!
68  \brief Constructor
69  */
70  ScaleModel();
71 
72  /*!
73  \brief Destructor
74  */
75  virtual ~ScaleModel();
76 
77  virtual Properties* getProperties() const;
78 
79  virtual void updateProperties(te::layout::Properties* properties);
80 
81  virtual void setScaleGapX(double x);
82 
83  virtual double getScaleGapX();
84 
85  virtual void setScaleGapY(double y);
86 
87  virtual double getScaleGapY();
88 
89  virtual double getMapScale();
90 
91  virtual EnumScaleType* getEnumScaleType();
92 
93  virtual EnumType* getCurrentScaleType();
94 
95  protected:
96 
97  virtual void visitDependent(ContextItem context);
98 
99  virtual Property scaleProperty() const;
100 
101  std::string m_mapName;
102  double m_mapScale;
103  double m_scaleGapX;
104  double m_scaleGapY;
107  };
108  }
109 }
110 
111 #endif
std::string m_mapName
Definition: ScaleModel.h:101
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Definition: ContextItem.h:49
Abstract class to represent a visitor. All classes representing a visitor must inherit from this clas...
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
Abstract class to represent an observable. "Model" part of MVC component. All classes representing th...
The Properties class represents a persistent set of properties. The Properties can be saved to a file...
Definition: Properties.h:52
Class to represent a scale type enumeration. Ex.: hollow scale bar, etc.
Definition: EnumScaleType.h:48
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
Definition: EnumType.h:48
EnumScaleType * m_enumScaleType
Definition: ScaleModel.h:105
A property acts like a attribute member of a object and stores the state of this attribute. A set of properties stores the state of an object. Any data type, not included in the convertValue method in the class te::layout::Variant, it will be by default "std::string" value.
Definition: Property.h:47
EnumType * m_currentScaleType
Definition: ScaleModel.h:106
Class that represents a "Model" part of Scale MVC component. Its coordinate system is the same of sce...
Definition: ScaleModel.h:63