BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Qt/GraphicsViewNavigation.h
Go to the documentation of this file.
00001 // Copyright (c) 2008  GeometryFactory Sarl (France).
00002 // All rights reserved.
00003 //
00004 // This file is part of CGAL (www.cgal.org); you may redistribute it under
00005 // the terms of the Q Public License version 1.0.
00006 // See the file LICENSE.QPL distributed with CGAL.
00007 //
00008 // Licensees holding a valid commercial license may use this file in
00009 // accordance with the commercial license agreement provided with the software.
00010 //
00011 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 //
00014 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/GraphicsView/include/CGAL/Qt/GraphicsViewNavigation.h $
00015 // $Id: GraphicsViewNavigation.h 45691 2008-09-23 12:16:00Z lrineau $
00016 // 
00017 //
00018 // Author(s)     : Andreas Fabri <Andreas.Fabri@geometryfactory.com>
00019 //                 Laurent Rineau <Laurent.Rineau@geometryfactory.com>
00020 
00021 #ifndef CGAL_QT_GRAPHICS_VIEW_NAVIGATION_H
00022 #define CGAL_QT_GRAPHICS_VIEW_NAVIGATION_H
00023 
00024 #include <CGAL/auto_link/Qt4.h>
00025 #include <QObject>
00026 #include <QPointF>
00027 #include <QString>
00028 #include <QCursor>
00029 #include <QRect>
00030 #include <QRectF>
00031 
00032 class QGraphicsView;
00033 class QGraphicsScene;
00034 class QEvent;
00035 class QGraphicsRectItem;
00036 
00037 namespace CGAL {
00038 namespace Qt {
00039 
00040 class GraphicsViewNavigation: public QObject {
00041 
00042   Q_OBJECT
00043 
00044   signals:
00045   void mouseCoordinates(QString);
00046 
00047 public:
00048   GraphicsViewNavigation();
00049   ~GraphicsViewNavigation();
00050   
00051   bool eventFilter(QObject *obj, QEvent *event);
00052 
00053 private:
00054 
00055   void scaleView(QGraphicsView*, qreal scaleFactor);
00056   void translateView(QGraphicsView*, int dx,  int dy);
00057   void drag_to(QGraphicsView*, QPoint new_pos);
00058   void display_parameters(QGraphicsView*);
00059 
00060   QGraphicsRectItem* rectItem;
00061   QPointF rect_first_point;
00062   bool dragging;
00063   QPointF dragging_start;
00064   QCursor cursor_backup;
00065 };
00066 
00067 } // namespace Qt
00068 } // namespace CGAL
00069 
00070 #endif // CGAL_QT_GRAPHICS_VIEW_NAVIGATION_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines