All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GridMapModel.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 GridMapModel.h
22 
23  \brief Class that represents a "Model" part of GridMap MVC component.
24  Its coordinate system is the same of scene (millimeters).
25  This is also son of ItemModelObservable, so it can become observable.
26 
27  \ingroup layout
28 */
29 
30 #ifndef __TERRALIB_LAYOUT_INTERNAL_GRIDMAP_MODEL_H
31 #define __TERRALIB_LAYOUT_INTERNAL_GRIDMAP_MODEL_H
32 
33 // TerraLib
34 #include "../core/property/Properties.h"
35 #include "../../maptools/Canvas.h"
36 #include "../../maptools/Enums.h"
37 #include "../core/property/Property.h"
38 #include "../../geometry/Envelope.h"
39 #include "../core/Utils.h"
40 #include "../../geometry/Coord2D.h"
41 #include "../../geometry/Point.h"
42 #include "../core/pattern/mvc/ItemModelObservable.h"
43 #include "../core/ContextItem.h"
44 #include "../core/Config.h"
45 #include "../core/pattern/derivativevisitor/AbstractVisitor.h"
46 #include "../core/Systematic.h"
47 
48 // STL
49 #include <map>
50 #include <string>
51 
52 namespace te
53 {
54  namespace layout
55  {
56  class GridSettingsConfigProperties;
57 
58  /*!
59  \brief Class that represents a "Model" part of GridMap MVC component.
60  Its coordinate system is the same of scene (millimeters).
61  He is also the son of ItemModelObservable, so it can become observable.
62 
63  \ingroup layout
64 
65  \sa te::layout::ItemModelObservable
66  */
68  {
69  public:
70 
71  /*!
72  \brief Constructor
73  */
74  GridMapModel();
75 
76  /*!
77  \brief Constructor
78  */
80 
81  /*!
82  \brief Destructor
83  */
84  virtual ~GridMapModel();
85 
86  virtual Properties* getProperties() const;
87 
88  virtual void updateProperties(te::layout::Properties* properties);
89 
90  virtual bool isVisible();
91 
92  virtual void setVisible(bool visible);
93 
94  virtual void setMapScale(double scale);
95 
96  virtual double getMapScale();
97 
98  virtual void setWorldBox(te::gm::Envelope box);
99 
100  virtual void setBoxMapMM(te::gm::Envelope box);
101 
102  virtual void setBoundingBoxItemMM(te::gm::Envelope box);
103 
104  virtual void setSystematic(Systematic* sys);
105 
106  virtual std::map<te::gm::Point*, std::string> getGridInfo();
107 
108  virtual void setVisibleAllTexts(bool visible);
109 
110  virtual void setMapDisplacementX(double displacement);
111 
112  virtual double getMapDisplacementX();
113 
114  virtual void setMapDisplacementY(double displacement);
115 
116  virtual double getMapDisplacementY();
117 
118  virtual void setMapName(std::string name);
119 
120  virtual std::string getMapName();
121 
122  virtual int getSRID();
123 
124  virtual te::gm::Envelope getBoxMapMM();
125 
126  virtual te::gm::Envelope getWorldBox();
127 
128  virtual double getLneHrzGap();
129 
130  virtual double getLneVrtGap();
131 
132  virtual double getInitialGridPointX();
133 
134  virtual double getInitialGridPointY();
135 
136  virtual EnumType* getGridStyle();
137 
138  virtual EnumType* getLineStyle();
139 
140  virtual te::color::RGBAColor getLineColor();
141 
142  virtual int getLineWidth();
143 
144  virtual int getTextPointSize();
145 
146  virtual std::string getFontFamily();
147 
148  virtual te::color::RGBAColor getTextColor();
149 
150  virtual bool isVisibleAllTexts();
151 
152  virtual bool isSuperscriptText();
153 
154  virtual double getLneVrtDisplacement();
155 
156  virtual double getLneHrzDisplacement();
157 
158  virtual bool isBottomText();
159 
160  virtual bool isLeftText();
161 
162  virtual bool isRightText();
163 
164  virtual bool isTopText();
165 
166  virtual bool isBottomRotateText();
167 
168  virtual bool isLeftRotateText();
169 
170  virtual bool isRightRotateText();
171 
172  virtual bool isTopRotateText();
173 
174  protected:
175 
176  virtual void init();
177 
178  virtual void visitDependent(ContextItem context);
179 
180  virtual void calculateGaps(te::gm::Envelope box);
181 
182  virtual void gridTextFreeMemory();
183 
184  std::string m_mapName;
186 
187  double m_mapScale;
188  int m_srid;
190  std::map<te::gm::Point*, std::string> m_gridTexts;
191 
197 
198  /* Grid */
199  bool m_visible;
200  double m_lneHrzGap;
201  double m_lneVrtGap;
204 
205  /* Just one is visible */
207 
208  /* Line */
212 
213  /* Text: Basic Configuration */
215  std::string m_fontText;
217 
218  /* Text: Advanced configuration */
226  bool m_topText;
231  };
232  }
233 }
234 
235 #endif
236 
237 
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...
Class that represents a "Model" part of GridMap MVC component. Its coordinate system is the same of s...
Definition: GridMapModel.h:67
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
GridSettingsConfigProperties * m_settingsConfig
Definition: GridMapModel.h:185
te::gm::Envelope m_worldBox
Definition: GridMapModel.h:194
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
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
std::map< te::gm::Point *, std::string > m_gridTexts
Definition: GridMapModel.h:190
te::color::RGBAColor m_textColor
Definition: GridMapModel.h:216
te::color::RGBAColor m_lineColor
Definition: GridMapModel.h:210
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
Definition: EnumType.h:48
te::gm::Envelope m_boxMapMM
Definition: GridMapModel.h:192
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
te::gm::Envelope m_boundingBoxItemMM
Definition: GridMapModel.h:193