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) 2001-2014 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 "Properties.h"
33 #include "../../../maptools/Canvas.h"
34 #include "../../../maptools/Enums.h"
35 #include "Property.h"
36 #include "../../../geometry/Envelope.h"
37 
38 namespace te
39 {
40  namespace layout
41  {
42  class GridModel
43  {
44  public:
45 
46  GridModel();
47  virtual ~GridModel();
48 
49  virtual void draw(te::map::Canvas* canvas, te::gm::Envelope box, int srid) = 0;
50 
51  virtual te::layout::Property getProperty() = 0;
52  virtual void updateProperty(Property property) = 0;
53 
54  virtual std::string getName();
55  virtual void setName(std::string name);
56 
57  virtual bool isVisible();
58  virtual void setVisible(bool visible);
59 
60  virtual void setMapScale(double scale);
61 
62  virtual void setWorldBox(te::gm::Envelope box);
63 
64  virtual void setBoxMapMM(te::gm::Envelope box);
65 
66  virtual void setBoundingBoxItemMM(te::gm::Envelope box);
67 
68  protected:
69 
70  virtual void drawVerticalLines(te::map::Canvas* canvas, te::gm::Envelope box) = 0;
71 
72  virtual void drawHorizontalLines(te::map::Canvas* canvas, te::gm::Envelope box) = 0;
73 
74  virtual void calculateGaps(te::gm::Envelope box) = 0;
75 
76  protected:
77 
79  double m_mapScale;
80  std::string m_name;
81  int m_srid;
82 
86 
87  /* Grid */
88  bool m_visible;
89  double m_lneHrzGap;
90  double m_lneVrtGap;
93 
94  /* Just one is visible */
96 
97  /* Line */
101 
102  /* Text: Basic Configuration */
104  std::string m_fontText;
106 
107  /* Text: Advanced configuration */
115  bool m_topText;
120  };
121  }
122 }
123 
124 #endif //__TERRALIB_LAYOUT_INTERNAL_GRID_MODEL_H
virtual void calculateGaps(te::gm::Envelope box)=0
virtual std::string getName()
Definition: GridModel.cpp:72
te::gm::Envelope m_worldBox
Definition: GridModel.h:85
LayoutGridStyle m_gridStyle
Definition: GridModel.h:95
double m_lneHrzDisplacement
Definition: GridModel.h:111
virtual te::layout::Property getProperty()=0
std::string m_name
Definition: GridModel.h:80
te::color::RGBAColor m_lineColor
Definition: GridModel.h:99
virtual void drawVerticalLines(te::map::Canvas *canvas, te::gm::Envelope box)=0
virtual void setVisible(bool visible)
Definition: GridModel.cpp:87
virtual void setName(std::string name)
Definition: GridModel.cpp:77
te::gm::Envelope m_boxMapMM
Definition: GridModel.h:83
virtual void setWorldBox(te::gm::Envelope box)
Definition: GridModel.cpp:97
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
double m_initialGridPointY
Definition: GridModel.h:92
virtual void draw(te::map::Canvas *canvas, te::gm::Envelope box, int srid)=0
virtual void setMapScale(double scale)
Definition: GridModel.cpp:92
virtual void updateProperty(Property property)=0
double m_initialGridPointX
Definition: GridModel.h:91
te::color::RGBAColor m_textColor
Definition: GridModel.h:105
virtual void drawHorizontalLines(te::map::Canvas *canvas, te::gm::Envelope box)=0
virtual void setBoxMapMM(te::gm::Envelope box)
Definition: GridModel.cpp:102
virtual bool isVisible()
Definition: GridModel.cpp:82
double m_lneVrtDisplacement
Definition: GridModel.h:110
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:91
LineDashStyle
This enum encodes enumerated values telling how lines should be drawn. e.g. as a plain line or dash l...
Definition: Enums.h:55
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
te::map::LineDashStyle m_lineStyle
Definition: GridModel.h:98
virtual void setBoundingBoxItemMM(te::gm::Envelope box)
Definition: GridModel.cpp:107
std::string m_fontText
Definition: GridModel.h:104
te::gm::Envelope m_boundingBoxItemMM
Definition: GridModel.h:84
te::layout::Property m_property
Definition: GridModel.h:78