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_
multires_image::TileView
Definition: tile_view.h:41
multires_image::QGLMap::ViewCenter
tf::Point ViewCenter()
Definition: QGLMap.h:61
multires_image
Definition: multires_view_node.h:51
multires_image::QGLMap::mouseDoubleClickEvent
void mouseDoubleClickEvent(QMouseEvent *e)
Definition: QGLMap.cpp:193
multires_image::QGLMap::SceneCenter
tf::Point SceneCenter()
Definition: QGLMap.h:60
multires_image::QGLMap::mousePressEvent
void mousePressEvent(QMouseEvent *e)
Definition: QGLMap.cpp:184
multires_image::QGLMap::resizeGL
void resizeGL(int w, int h)
Definition: QGLMap.cpp:169
signals
#define signals
multires_image::Tile
Definition: tile.h:50
multires_image::QGLMap::SignalZoomChange
void SignalZoomChange(double z)
multires_image::QGLMap::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *e)
Definition: QGLMap.cpp:205
slots
#define slots
multires_image::QGLMap::m_mouseDownX
int m_mouseDownX
Definition: QGLMap.h:92
multires_image::QGLMap::QGLMap
QGLMap(QWidget *parent=0)
Definition: QGLMap.cpp:37
multires_image::QGLMap::~QGLMap
~QGLMap()
Definition: QGLMap.cpp:55
multires_image::QGLMap::m_mouseDownY
int m_mouseDownY
Definition: QGLMap.h:93
multires_image::QGLMap::m_scale
double m_scale
Definition: QGLMap.h:89
tf::Point
tf::Vector3 Point
multires_image::QGLMap::SetTextureMemory
void SetTextureMemory(int64_t bytes)
Definition: QGLMap.cpp:135
multires_image::QGLMap::DeleteTexture
void DeleteTexture(Tile *tile)
Definition: QGLMap.cpp:130
multires_image::QGLMap::Exit
void Exit()
Definition: QGLMap.cpp:59
multires_image::QGLMap::m_scene_center
tf::Point m_scene_center
Definition: QGLMap.h:103
multires_image::QGLMap::LoadTexture
void LoadTexture(Tile *tile)
Definition: QGLMap.cpp:125
tile_view.h
multires_image::QGLMap::m_view_top_left
tf::Point m_view_top_left
Definition: QGLMap.h:97
multires_image::QGLMap::m_tileView
TileView * m_tileView
Definition: QGLMap.h:95
multires_image::QGLMap::m_scene_top_left
tf::Point m_scene_top_left
Definition: QGLMap.h:101
multires_image::QGLMap::paintGL
void paintGL()
Definition: QGLMap.cpp:174
transform_datatypes.h
multires_image::QGLMap::m_mouseDown
bool m_mouseDown
Definition: QGLMap.h:91
multires_image::QGLMap::Recenter
void Recenter()
Definition: QGLMap.cpp:239
multires_image::QGLMap::initializeGL
void initializeGL()
Definition: QGLMap.cpp:153
multires_image::QGLMap::SignalMemorySize
void SignalMemorySize(int64_t bytes)
multires_image::QGLMap::wheelEvent
void wheelEvent(QWheelEvent *e)
Definition: QGLMap.cpp:116
multires_image::QGLMap::ChangeCenter
void ChangeCenter(double x, double y)
Definition: QGLMap.cpp:142
multires_image::QGLMap::UpdateView
void UpdateView()
Definition: QGLMap.cpp:67
multires_image::QGLMap::SignalViewChange
void SignalViewChange(double x1, double y1, double x2, double y2)
multires_image::QGLMap::m_initialized
bool m_initialized
Definition: QGLMap.h:87
multires_image::QGLMap::m_view_bottom_right
tf::Point m_view_bottom_right
Definition: QGLMap.h:98
multires_image::QGLMap::SetTiles
void SetTiles(TileSet *tiles)
Definition: QGLMap.cpp:93
multires_image::QGLMap::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *e)
Definition: QGLMap.cpp:198
tile.h
multires_image::TileSet
Definition: tile_set.h:43
multires_image::QGLMap::ui
Ui::QGLMapClass ui
Definition: QGLMap.h:85
multires_image::QGLMap::m_scene_bottom_right
tf::Point m_scene_bottom_right
Definition: QGLMap.h:102
multires_image::QGLMap::m_view_center
tf::Point m_view_center
Definition: QGLMap.h:99
multires_image::QGLMap
Definition: QGLMap.h:48
multires_image::QGLMap::MousePan
void MousePan(int x, int y)
Definition: QGLMap.cpp:211


multires_image
Author(s): Marc Alban
autogenerated on Sun Sep 8 2024 02:27:21