Tulip  4.6.0
Better Visualization Through Research
library/tulip-gui/include/tulip/GlOverviewGraphicsItem.h
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 ///@cond DOXYGEN_HIDDEN
00020 
00021 #ifndef GLOVERVIEWGRAPHICSITEM_H
00022 #define GLOVERVIEWGRAPHICSITEM_H
00023 
00024 #include <tulip/tulipconf.h>
00025 #include <tulip/Camera.h>
00026 #include <tulip/Color.h>
00027 
00028 #include <QGraphicsPixmapItem>
00029 #include <QGraphicsPathItem>
00030 
00031 #include <set>
00032 
00033 namespace tlp {
00034 
00035 class GlMainView;
00036 class GlScene;
00037 
00038 class TLP_QT_SCOPE GlOverviewGraphicsItem : public QObject, public QGraphicsRectItem {
00039 
00040   Q_OBJECT
00041 
00042 public:
00043 
00044   GlOverviewGraphicsItem(GlMainView *view,GlScene &scene);
00045   ~GlOverviewGraphicsItem();
00046 
00047   void setSize(unsigned int width, unsigned int height);
00048   inline unsigned int getWidth() {
00049     return width;
00050   }
00051   inline unsigned int getHeight() {
00052     return height;
00053   }
00054 
00055   void setFrameColor(const Color &color) {
00056     _frameColor = color;
00057   }
00058 
00059   void setFrameWidth(int width) {
00060     _frameWidth = width;
00061   }
00062 
00063   void setLayerVisible(const std::string &name,bool visible);
00064 
00065 public slots :
00066 
00067   void draw(bool generatePixmap);
00068 
00069 private :
00070 
00071   void mousePressEvent(QGraphicsSceneMouseEvent* event);
00072   void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
00073   void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
00074   void setScenePosition(QPointF pos);
00075 
00076   GlMainView *view;
00077   GlScene &baseScene;
00078   unsigned int width, height;
00079 
00080   QGraphicsPixmapItem overview;
00081   QGraphicsPathItem overviewBorder;
00082   QGraphicsLineItem line[8];
00083   QGraphicsPolygonItem poly[4];
00084 
00085   bool mouseClicked;
00086 
00087   std::set<std::string> _hiddenLayers;
00088 
00089   std::vector<Camera> _oldCameras;
00090 
00091   Color _frameColor;
00092   int _frameWidth;
00093 
00094 };
00095 
00096 }
00097 
00098 #endif // GLOVERVIEWGRAPHICSITEM_H
00099 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties