All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataFrame.h
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of TerraView - A Free and Open Source GIS Application.
4 
5  TerraView is free software: you can redistribute it and/or modify
6  it under the terms of the GNU 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  TerraView 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 General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with TerraLib Code Editor. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@dpi.inpe.br>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/canvas/FrameData.h
22 
23  \brief The main class of FrameData.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_DATA_FRAME_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_DATA_FRAME_H
28 
29 // TerraLib
30 #include "../Config.h"
31 #include "../canvas/MultiThreadMapDisplay.h"
32 #include "Frame.h"
33 
34 // Qt
35 #include <QRect>
36 #include <QRectF>
37 #include <QPixmap>
38 #include <QWidget>
39 
40 class QMenu;
41 class QAction;
42 
43 namespace te
44 {
45  namespace qt
46  {
47  namespace widgets
48  {
49  class LayoutEditor;
50  class GeographicGridFrame;
51  class UTMGridFrame;
52  class GraphicScaleFrame;
53  /*!
54  \class DataFrame
55 
56  \brief A DataFrame ....
57 
58  */
60  {
61  Q_OBJECT
62 
63  public:
64  DataFrame(const QRectF& frameRect, te::qt::widgets::LayoutEditor* me, Qt::WindowFlags f = Qt::Window);
65  DataFrame(const DataFrame& rhs);
66 
67  virtual ~DataFrame();
68  DataFrame& operator=(const DataFrame& rhs);
69 
71  void getLayerList(te::map::AbstractLayerPtr, std::list<te::map::AbstractLayerPtr>&);
72  QRectF getDataRect();
73  void setDataRect(QRectF& r);
74  void adjust();
75  void adjustWidgetToFrameRect(const QRectF& r);
76  double getScale();
77  void setScale(double v);
78  void sendEventToChildren(bool);
79  bool eventFilter(QObject*, QEvent*);
80  te::map::AbstractLayer* getData();
81  void setData(te::map::AbstractLayerPtr d, int nsrid = TE_UNKNOWN_SRS, QRectF r = QRectF());
82  bool transformEnvelope(te::gm::Envelope& e, int oldsrid, int newsrid);
83  double getDataUnitToMilimeter();
84  void findDataUnitToMilimeter(const te::gm::Envelope& e, int srid);
85  void draw();
86  void setCursor();
87  void rubberBand();
88  void getSelectionPoint(const QPoint& p);
89  QPoint getCenterSelected();
90  void verifyConstraints();
91  void showSelectionPoints();
92  void hideSelectionPoints();
93  void toolTip(const QPoint&, const QString&);
94  QPoint getGlobalPositionCenter();
95  void setDataChanged(bool);
96  void drawButtonClicked();
97  QPixmap* getLastDisplayContent();
98  QPixmap* getPixmap();
99  void setMagneticDeclination(double angle);
100  double getMagneticDeclination();
101 
102  void hide();
103  void show();
104  void lower();
105  void createUTMGrid();
106  void removeUTMGrid();
107  void createGeographicGrid();
108  void removeGeographicGrid();
109  void createGraphicScale();
110  void removeGraphicScale();
111  void magneticDeclination();
112  te::qt::widgets::GeographicGridFrame* getGeoGridFrame();
113  te::qt::widgets::UTMGridFrame* getUTMGridFrame();
114  te::qt::widgets::GraphicScaleFrame* getGraphicScaleFrame();
115  //void createNorthOrientation();
116  //void removeNorthOrientation();
117  //void createLegend();
118  //void removeLegend();
119 
120  void setSelectionColor(QColor selColor);
121  void drawLayerSelection();
122 
123  protected slots:
124  void onDrawLayersFinished(const QMap<QString, QString>& errors);
125 
126  private:
129  double m_scale;
130  double m_dataUnitToMilimeter; // conversion factor to milimeter
134 
135  bool m_undo;
136  QRectF m_dataRect;
139  std::list<te::map::AbstractLayerPtr> m_visibleLayers;
141  int m_mouseTask; // 0=none, 1=zoomin, 2=zoomout, 3=pan (sobre o dado)
142 
143  //te::qt::widgets::NorthOrientationFrame* m_northFrame;
144 
145  //te::qt::widgets::LegendFrame* m_lagendFrame;
146 
147  QMenu *m_menu;
155  };
156  } // end namespace widgets
157  } // end namespace qt
158 } // end namespace te
159 
160 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_DATA_FRAME_H
QAction * m_removeGraphicScaleAction
Definition: DataFrame.h:153
A DataFrame ....
Definition: DataFrame.h:59
QAction * m_removeUTMGridAction
Definition: DataFrame.h:149
This is the base class for layers.
Definition: AbstractLayer.h:76
te::qt::widgets::UTMGridFrame * m_UTMGridFrame
Definition: DataFrame.h:132
QAction * m_createUTMGridAction
Definition: DataFrame.h:148
QAction * m_createGeographicGridAction
Definition: DataFrame.h:150
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
Definition: Config.h:44
te::qt::widgets::GraphicScaleFrame * m_graphicScaleFrame
Definition: DataFrame.h:133
te::qt::widgets::MultiThreadMapDisplay * m_mapDisplay
Definition: DataFrame.h:127
A UTMGridFrame ....
Definition: UTMGridFrame.h:50
te::map::AbstractLayer * m_data
Definition: DataFrame.h:138
std::list< te::map::AbstractLayerPtr > m_visibleLayers
Definition: DataFrame.h:139
te::qt::widgets::GeographicGridFrame * m_geoGridFrame
Definition: DataFrame.h:131
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:66
QAction * m_magneticDeclinationAction
Definition: DataFrame.h:154
QAction * m_removeGeographicGridAction
Definition: DataFrame.h:151
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
QAction * m_createGraphicScaleAction
Definition: DataFrame.h:152
A multi thread Qt4 widget to control the display of a set of layers.