All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ContextItem.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 ContextItem.h
22 
23  \brief Class responsible for maintaining the drawing context of a graphic component.
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_CONTEXT_ITEM_H
29 #define __TERRALIB_LAYOUT_INTERNAL_CONTEXT_ITEM_H
30 
31 // TerraLib
32 #include "ParamsCreate.h"
33 #include "../../color/RGBAColor.h"
34 #include "Utils.h"
35 #include "../../maptools/Canvas.h"
36 #include "Config.h"
37 #include "../../geometry/Coord2D.h"
38 
39 namespace te
40 {
41  namespace layout
42  {
43  /*!
44  \brief Class responsible for maintaining the drawing context of a MVC component.
45  It is always used by the "Model" part of the MVC in draw method, as well as the part "View" in updateObserver method.
46 
47  \ingroup layout
48  */
50  {
51  public:
52 
53  /*!
54  \brief Constructor
55  */
56  ContextItem();
57 
58  /*!
59  \brief Constructor
60 
61  \param params
62  \param zoomFactor zoom factor
63  */
64  ContextItem(ParamsCreate params, double zoomFactor);
65 
66  /*!
67  \brief Destructor
68  */
69  virtual ~ContextItem();
70 
71  /*!
72  \brief
73  */
74  virtual void setParams(ParamsCreate params);
75 
76  /*!
77  \brief
78  */
79  virtual ParamsCreate getParams();
80 
81  /*!
82  \brief Change current zoom factor.
83 
84  \param zoomFactor current zoom factor
85  */
86  virtual void setZoomFactor(double zoomFactor);
87 
88  /*!
89  \brief Returns current zoom factor.
90 
91  \return current zoom factor
92  */
93  virtual double getZoomFactor();
94 
95  /*!
96  \brief Stores pixmap generated after drawing.
97 
98  \param pixmap generated after drawing
99  */
100  virtual void setPixmap(te::color::RGBAColor** pixmap);
101 
102  /*!
103  \brief Returns pixmap generated after drawing.
104 
105  \return pixmap
106  */
107  virtual te::color::RGBAColor** getPixmap();
108 
109  /*!
110  \brief Returns whether the canvas should or should not be resized.
111 
112  \return true if canvas should be resized, false otherwise
113  */
114  virtual bool isResizeCanvas();
115 
116  /*!
117  \brief Change whether the canvas should or should not be resized.
118 
119  \param clear true if canvas should be resized, false otherwise.
120  */
121  virtual void setResizeCanvas(bool clear);
122 
123  /*!
124  \brief Return canvas.
125 
126  \return canvas
127  */
128  virtual te::map::Canvas* getCanvas();
129 
130  /*!
131  \brief Change canvas.
132 
133  \param canvas
134  */
135  virtual void setCanvas(te::map::Canvas* canvas);
136 
137  /*!
138  \brief
139  */
140  virtual Utils* getUtils();
141 
142  /*!
143  \brief
144  */
145  virtual void setUtils(Utils* utils);
146 
147  /*!
148  \brief
149  */
150  virtual double getDpiX();
151 
152  /*!
153  \brief
154  */
155  virtual void setDpiX(double dpi);
156 
157  /*!
158  \brief
159  */
160  virtual double getDpiY();
161 
162  /*!
163  \brief
164  */
165  virtual void setDpiY(double dpi);
166 
167  /*
168  \brief
169  */
170  virtual void setShow( bool show );
171 
172  /*!
173  \brief
174  */
175  virtual bool isShow();
176 
177  void setPos (te::gm::Coord2D pos);
178 
179  te::gm::Coord2D getPos ();
180 
181  void setChangePos (bool change);
182 
183  bool isChangePos ();
184 
185  protected:
187  double m_zoomFactor; //!<
189  bool m_resizeCanvas; //!<
190  bool m_show; //!<
191  Utils* m_utils; //!<
193  double m_dpiX; //!<
194  double m_dpiY; //!<
197  };
198  }
199 }
200 
201 #endif
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Definition: ContextItem.h:49
te::map::Canvas * m_canvas
Definition: ContextItem.h:192
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
te::gm::Coord2D m_pos
Definition: ContextItem.h:195
te::color::RGBAColor ** m_pixmap
Definition: ContextItem.h:188
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:91
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
Configuration flags for the Terrralib Layout module.
Utility class with functions to manipulate the canvas and conversion between projections.
Definition: Utils.h:61