Tulip  4.2.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
GlOverviewGraphicsItem.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef GLOVERVIEWGRAPHICSITEM_H
22 #define GLOVERVIEWGRAPHICSITEM_H
23 
24 
25 #include <QtGui/QGraphicsPixmapItem>
26 #include <QtOpenGL/QGLFramebufferObject>
27 #include <tulip/GlScene.h>
28 
29 namespace tlp {
30 
31 class GlMainView;
32 
33 class TLP_QT_SCOPE GlOverviewGraphicsItem : public QObject, public QGraphicsRectItem {
34 
35  Q_OBJECT
36 
37 public:
38 
39  GlOverviewGraphicsItem(GlMainView *view,GlScene &scene);
40  ~GlOverviewGraphicsItem();
41 
42  void setSize(unsigned int width, unsigned int height);
43 
44  void setLayerVisible(const std::string &name,bool visible);
45 
46 public slots :
47 
48  void draw(bool generatePixmap);
49 
50 private :
51 
52  void mousePressEvent(QGraphicsSceneMouseEvent* event);
53  void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
54  void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
55  void setScenePosition(QPointF pos);
56 
57 
58  GlMainView *view;
59  GlScene &baseScene;
60  unsigned int width, height;
61  QGLFramebufferObject *glFrameBuffer;
62 
63  QGraphicsPixmapItem overview;
64  QGraphicsLineItem line[4];
65  QGraphicsPolygonItem poly[4];
66 
67  bool mouseClicked;
68 
69  std::set<std::string> _hiddenLayers;
70 
71  static std::map<std::pair<int,int>,QGLFramebufferObject*> framebufferObjects;
72 
73  std::vector<Camera> _oldCameras;
74 
75 };
76 
77 }
78 
79 #endif // GLOVERVIEWGRAPHICSITEM_H
80 ///@endcond