All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ContextItem.cpp
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.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "ContextItem.h"
30 
32  m_zoomFactor(1.),
33  m_pixmap(0),
34  m_resizeCanvas(true),
35  m_show(false),
36  m_utils(0),
37  m_canvas(0),
38  m_dpiX(96),
39  m_dpiY(96),
40  m_changePos(false)
41 {
42 
43 }
44 
45 te::layout::ContextItem::ContextItem( ParamsCreate params, double zoomFactor ) :
46  m_params(params),
47  m_zoomFactor(zoomFactor),
48  m_pixmap(0),
49  m_resizeCanvas(true),
50  m_show(false),
51  m_utils(0),
52  m_canvas(0),
53  m_dpiX(96),
54  m_dpiY(96),
55  m_changePos(false)
56 {
57 
58 }
59 
61 {
62 
63 }
64 
66 {
67  m_params = params;
68 }
69 
71 {
72  return m_params;
73 }
74 
75 void te::layout::ContextItem::setZoomFactor( double zoomFactor )
76 {
77  m_zoomFactor = zoomFactor;
78 }
79 
81 {
82  return m_zoomFactor;
83 }
84 
86 {
87  m_pixmap = pixmap;
88 }
89 
91 {
92  return m_pixmap;
93 }
94 
96 {
97  return m_resizeCanvas;
98 }
99 
101 {
102  m_resizeCanvas = clear;
103 }
104 
106 {
107  return m_canvas;
108 }
109 
111 {
112  m_canvas = canvas;
113 }
114 
116 {
117  return m_utils;
118 }
119 
121 {
122  m_utils = utils;
123 }
124 
126 {
127  return m_dpiX;
128 }
129 
131 {
132  m_dpiX = dpi;
133 }
134 
136 {
137  return m_dpiY;
138 }
139 
141 {
142  m_dpiY = dpi;
143 }
144 
146 {
147  m_show = show;
148 }
149 
151 {
152  return m_show;
153 }
154 
156 {
157  m_pos = pos;
158 }
159 
161 {
162  return m_pos;
163 }
164 
166 {
167  m_changePos = change;
168 }
169 
171 {
172  return m_changePos;
173 }
te::gm::Coord2D getPos()
virtual void setCanvas(te::map::Canvas *canvas)
Change canvas.
virtual void setPixmap(te::color::RGBAColor **pixmap)
Stores pixmap generated after drawing.
Definition: ContextItem.cpp:85
virtual ~ContextItem()
Destructor.
Definition: ContextItem.cpp:60
virtual void setShow(bool show)
virtual void setUtils(Utils *utils)
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
virtual double getZoomFactor()
Returns current zoom factor.
Definition: ContextItem.cpp:80
virtual ParamsCreate getParams()
Definition: ContextItem.cpp:70
virtual te::color::RGBAColor ** getPixmap()
Returns pixmap generated after drawing.
Definition: ContextItem.cpp:90
void setPos(te::gm::Coord2D pos)
virtual void setParams(ParamsCreate params)
Definition: ContextItem.cpp:65
virtual Utils * getUtils()
Class responsible for maintaining the drawing context of a graphic component.
void setChangePos(bool change)
virtual te::map::Canvas * getCanvas()
Return canvas.
virtual double getDpiY()
virtual double getDpiX()
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:91
virtual void setResizeCanvas(bool clear)
Change whether the canvas should or should not be resized.
virtual void setDpiX(double dpi)
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
virtual void setDpiY(double dpi)
Utility class with functions to manipulate the canvas and conversion between projections.
Definition: Utils.h:61
virtual void setZoomFactor(double zoomFactor)
Change current zoom factor.
Definition: ContextItem.cpp:75
virtual bool isResizeCanvas()
Returns whether the canvas should or should not be resized.
Definition: ContextItem.cpp:95
ContextItem()
Constructor.
Definition: ContextItem.cpp:31