Main Page
Modules
Namespaces
Classes
Files
File List
File Members
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
*/
49
class
TELAYOUTEXPORT
ContextItem
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
:
186
ParamsCreate
m_params
;
//!<
187
double
m_zoomFactor
;
//!<
188
te::color::RGBAColor
**
m_pixmap
;
//!<
189
bool
m_resizeCanvas
;
//!<
190
bool
m_show
;
//!<
191
Utils
*
m_utils
;
//!<
192
te::map::Canvas
*
m_canvas
;
//!<
193
double
m_dpiX
;
//!<
194
double
m_dpiY
;
//!<
195
te::gm::Coord2D
m_pos
;
196
bool
m_changePos
;
197
};
198
}
199
}
200
201
#endif
te::layout::ContextItem
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Definition:
ContextItem.h:49
te::layout::ContextItem::m_utils
Utils * m_utils
Definition:
ContextItem.h:191
te::layout::ParamsCreate
Definition:
ParamsCreate.h:35
te::layout::ContextItem::m_canvas
te::map::Canvas * m_canvas
Definition:
ContextItem.h:192
TELAYOUTEXPORT
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition:
Config.h:99
te::layout::ContextItem::m_pos
te::gm::Coord2D m_pos
Definition:
ContextItem.h:195
te::layout::ContextItem::m_show
bool m_show
Definition:
ContextItem.h:190
te::layout::ContextItem::m_dpiY
double m_dpiY
Definition:
ContextItem.h:194
te::layout::ContextItem::m_pixmap
te::color::RGBAColor ** m_pixmap
Definition:
ContextItem.h:188
te::gm::Coord2D
An utility struct for representing 2D coordinates.
Definition:
Coord2D.h:40
te::layout::ContextItem::m_resizeCanvas
bool m_resizeCanvas
Definition:
ContextItem.h:189
te::layout::ContextItem::m_dpiX
double m_dpiX
Definition:
ContextItem.h:193
te::layout::ContextItem::m_zoomFactor
double m_zoomFactor
Definition:
ContextItem.h:187
te::map::Canvas
A canvas is an abstraction of a drawing area.
Definition:
Canvas.h:91
ParamsCreate.h
Utils.h
te::color::RGBAColor
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition:
RGBAColor.h:57
Config.h
Configuration flags for the Terrralib Layout module.
te::layout::Utils
Utility class with functions to manipulate the canvas and conversion between projections.
Definition:
Utils.h:61
te::layout::ContextItem::m_changePos
bool m_changePos
Definition:
ContextItem.h:196
te::layout::ContextItem::m_params
ParamsCreate m_params
Definition:
ContextItem.h:186
TL5_2015_release
terralib5
src
terralib
layout
core
ContextItem.h
Generated on Wed Jun 3 2015 10:22:54 for TerraLib by
1.8.7