QGLMap.h
Go to the documentation of this file.
1 // *****************************************************************************
2 //
3 // Copyright (c) 2014, Southwest Research Institute® (SwRI®)
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are met:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of Southwest Research Institute® (SwRI®) nor the
14 // names of its contributors may be used to endorse or promote products
15 // derived from this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 // ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
21 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 //
28 // *****************************************************************************
29 
30 #ifndef MULTIRES_IMAGE_QGLMAP_H_
31 #define MULTIRES_IMAGE_QGLMAP_H_
32 
33 // QT libraries
34 #include <QGLWidget>
35 #include <QMouseEvent>
36 #include <QWheelEvent>
37 
38 // QT auto-generated headers
39 #include "ui_QGLMap.h"
40 
41 #include <tf/transform_datatypes.h>
42 
43 #include <multires_image/tile.h>
45 
46 namespace multires_image
47 {
48  class QGLMap : public QGLWidget
49  {
50  Q_OBJECT
51 
52  public:
53  explicit QGLMap(QWidget *parent = 0);
54  ~QGLMap();
55 
56  void Exit();
57  void UpdateView();
58  void SetTiles(TileSet* tiles);
59 
62 
63  signals:
64  void SignalZoomChange(double z);
65  void SignalViewChange(double x1, double y1, double x2, double y2);
66  void SignalMemorySize(int64_t bytes);
67 
68  public slots:
69  void LoadTexture(Tile* tile);
70  void DeleteTexture(Tile* tile);
71  void ChangeCenter(double x, double y);
72  void SetTextureMemory(int64_t bytes);
73 
74  protected:
75  void initializeGL();
76  void resizeGL(int w, int h);
77  void paintGL();
78  void mousePressEvent(QMouseEvent* e);
79  void mouseDoubleClickEvent(QMouseEvent* e);
80  void mouseReleaseEvent(QMouseEvent* e);
81  void mouseMoveEvent(QMouseEvent* e);
82  void wheelEvent(QWheelEvent* e);
83 
84  private:
85  Ui::QGLMapClass ui;
86 
88 
89  double m_scale;
90 
94 
96 
100 
104 
105  void Recenter();
106  void MousePan(int x, int y);
107  };
108 }
109 
110 #endif // MULTIRES_IMAGE_QGLMAP_H_
tf::Point m_view_center
Definition: QGLMap.h:99
void DeleteTexture(Tile *tile)
Definition: QGLMap.cpp:130
tf::Point m_scene_bottom_right
Definition: QGLMap.h:102
tf::Point ViewCenter()
Definition: QGLMap.h:61
#define signals
Ui::QGLMapClass ui
Definition: QGLMap.h:85
void mouseMoveEvent(QMouseEvent *e)
Definition: QGLMap.cpp:205
void wheelEvent(QWheelEvent *e)
Definition: QGLMap.cpp:116
void LoadTexture(Tile *tile)
Definition: QGLMap.cpp:125
tf::Point m_scene_top_left
Definition: QGLMap.h:101
void SetTextureMemory(int64_t bytes)
Definition: QGLMap.cpp:135
tf::Vector3 Point
void mouseReleaseEvent(QMouseEvent *e)
Definition: QGLMap.cpp:198
void resizeGL(int w, int h)
Definition: QGLMap.cpp:169
void SignalMemorySize(int64_t bytes)
tf::Point SceneCenter()
Definition: QGLMap.h:60
tf::Point m_view_bottom_right
Definition: QGLMap.h:98
TileView * m_tileView
Definition: QGLMap.h:95
void mouseDoubleClickEvent(QMouseEvent *e)
Definition: QGLMap.cpp:193
tf::Point m_view_top_left
Definition: QGLMap.h:97
void SignalZoomChange(double z)
void SignalViewChange(double x1, double y1, double x2, double y2)
void mousePressEvent(QMouseEvent *e)
Definition: QGLMap.cpp:184
void ChangeCenter(double x, double y)
Definition: QGLMap.cpp:142
#define slots
void SetTiles(TileSet *tiles)
Definition: QGLMap.cpp:93
void MousePan(int x, int y)
Definition: QGLMap.cpp:211
tf::Point m_scene_center
Definition: QGLMap.h:103
QGLMap(QWidget *parent=0)
Definition: QGLMap.cpp:37


multires_image
Author(s): Marc Alban
autogenerated on Fri Dec 16 2022 03:59:39