All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GridModel.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 GridModel.h
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_GRID_MODEL_H
29 #define __TERRALIB_LAYOUT_INTERNAL_GRID_MODEL_H
30 
31 // TerraLib
32 #include "../core/property/Properties.h"
33 #include "../../maptools/Canvas.h"
34 #include "../../maptools/Enums.h"
35 #include "../core/property/Property.h"
36 #include "../../geometry/Envelope.h"
37 #include "../core/Utils.h"
38 #include "../core/Systematic.h"
39 #include "../../geometry/Coord2D.h"
40 #include "../../geometry/Point.h"
41 #include "../core/Config.h"
42 
43 // STL
44 #include <map>
45 #include <string>
46 
47 namespace te
48 {
49  namespace layout
50  {
51  class EnumType;
52 
54  {
55  public:
56 
57  GridModel();
58  virtual ~GridModel();
59 
60  virtual void draw(te::map::Canvas* canvas, Utils* utils, te::gm::Envelope box, int srid) = 0;
61 
62  virtual te::layout::Property getProperty() = 0;
63 
64  virtual void updateProperty(Property property) = 0;
65 
66  virtual std::string getName();
67 
68  virtual void setName(std::string name);
69 
70  virtual bool isVisible();
71 
72  virtual void setVisible(bool visible);
73 
74  virtual void setMapScale(double scale);
75 
76  virtual void setWorldBox(te::gm::Envelope box);
77 
78  virtual void setBoxMapMM(te::gm::Envelope box);
79 
80  virtual void setBoundingBoxItemMM(te::gm::Envelope box);
81 
82  virtual void setSystematic(Systematic* sys);
83 
84  virtual std::map<te::gm::Point*, std::string> getGridInfo();
85 
86  virtual void setVisibleAllTexts(bool visible);
87 
88  virtual bool isVisibleAllTexts();
89 
90  virtual void setMapDisplacementX(double displacement);
91 
92  virtual void setMapDisplacementY(double displacement);
93 
94  virtual int getPointSize();
95 
96  virtual std::string getFontFamily();
97 
98  protected:
99 
100  virtual void drawVerticalLines(te::map::Canvas* canvas, Utils* utils, te::gm::Envelope box) = 0;
101 
102  virtual void drawHorizontalLines(te::map::Canvas* canvas, Utils* utils, te::gm::Envelope box) = 0;
103 
104  virtual void calculateGaps(te::gm::Envelope box) = 0;
105 
106  virtual void gridTextFreeMemory();
107 
108  protected:
109 
111  double m_mapScale;
112  std::string m_name;
113  int m_srid;
115  std::map<te::gm::Point*, std::string> m_gridTexts;
116 
122 
123  /* Grid */
124  bool m_visible;
125  double m_lneHrzGap;
126  double m_lneVrtGap;
129 
130  /* Just one is visible */
132 
133  /* Line */
137 
138  /* Text: Basic Configuration */
140  std::string m_fontText;
142 
143  /* Text: Advanced configuration */
151  bool m_topText;
156  };
157  }
158 }
159 
160 #endif //__TERRALIB_LAYOUT_INTERNAL_GRID_MODEL_H
EnumType * m_gridStyle
Definition: GridModel.h:131
EnumType * m_lineStyle
Definition: GridModel.h:134
std::map< te::gm::Point *, std::string > m_gridTexts
Definition: GridModel.h:115
te::gm::Envelope m_worldBox
Definition: GridModel.h:119
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
double m_lneHrzDisplacement
Definition: GridModel.h:147
Systematic * m_systematic
Definition: GridModel.h:114
std::string m_name
Definition: GridModel.h:112
te::color::RGBAColor m_lineColor
Definition: GridModel.h:135
te::gm::Envelope m_boxMapMM
Definition: GridModel.h:117
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
double m_initialGridPointY
Definition: GridModel.h:128
double m_initialGridPointX
Definition: GridModel.h:127
te::color::RGBAColor m_textColor
Definition: GridModel.h:141
double m_lneVrtDisplacement
Definition: GridModel.h:146
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:91
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
Definition: EnumType.h:48
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
std::string m_fontText
Definition: GridModel.h:140
te::gm::Envelope m_boundingBoxItemMM
Definition: GridModel.h:118
Utility class with functions to manipulate the canvas and conversion between projections.
Definition: Utils.h:61
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
te::layout::Property m_property
Definition: GridModel.h:110