VR-Forces 4.0.4 Class Documentation
include/tmEventHandler/navigationHandler.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2003 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: navigationHandler.h,v $ $Revision: 1.19 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00012 #ifndef NAVIGATIONHANDLER_H_
00013 #define NAVIGATIONHANDLER_H_
00014 
00015 #include "tmqt/eventHandler.h"
00016 #include "vrfGuiCore/menuItems.h"
00017 
00018 #include <QtCore/QPoint>
00019 #include <QtCore/QTimer>
00020 
00021 class DtTMViewportExtents;
00022 class DtExtent;
00023 class DtTMArea;
00024 class DtModelData;
00025 
00028 
00029 #include "tmEventHandler/tmEventHandlerDefines.h"
00030 class DT_DLL_tmEventHandler DtNavigationHandler : public DtEventHandler
00031 {
00032    Q_OBJECT
00033 
00034 public:
00036    DtNavigationHandler();
00037    
00039    virtual ~DtNavigationHandler();
00040    
00041 public:
00043    static DtEventHandler* create(DtEventController* owner, void* usr);
00044 
00045    virtual bool aboutToDraw(DtTMMapArea* area, QPainter* pix);
00046 
00047    virtual bool userDefinedAction(DtUserDefinedType iAction, void* usr);
00048 
00049 public slots:
00050    virtual bool mouseEvent(DtTMMapArea*, QMouseEvent* evnt, const DtPoint& pnt);
00051    virtual bool keyboardEvent(DtTMMapArea* area, QKeyEvent* evnt);
00052 
00053    virtual void timedPan();
00054 
00055 protected:
00057    virtual bool processNavigationKey(DtTMMapArea* area, int key, int state);
00058 
00059 protected:
00060    virtual void mouseZoom(DtTMMapArea* area, QMouseEvent *e);
00061 
00062    virtual void reorderRectangle(QRect& rect);
00063    virtual void resizeRectToFitAspectRatio(QRect& r, const double& ratio);
00064    virtual void resizeRectToFitAspectRatio(DtExtent& ext, DtTMViewportExtents* extents);
00065    virtual void resizeRectToFitAspectRatioFromCenter(DtExtent& ext, DtTMViewportExtents* extents);
00066    virtual DtExtent zoom(const DtExtent& ext, double mag) const;
00067 
00068    virtual void zoomToExtent(DtTMMapArea* area);
00069 
00071    virtual DtExtent getZoomExtentRect(DtTMMapArea* area, const DtModelData* d) const;
00072 
00073    virtual void zoomToExtent(DtTMMapArea* area, const QRect& rect);
00074    virtual DtExtent convertRectToExtent(DtTMMapArea* area, const QRect& rect) const;
00075 
00077    virtual void setCursor(QEvent*);
00078 
00079 protected:
00080    DtUserDefinedType myNavigationDirection;
00081    QTimer myPanTimer;
00082    bool myShiftTracking;
00083    QPoint myMouseBegin;
00084    QPoint myMouseLast;
00085    DtTMArea*   myTimerMap;
00086    int myKey;
00087    int myState;
00088    bool myLeftButton;
00089    bool myMouseShiftMap;
00090    bool myInMapShiftMode;
00091 
00092    DtPoint  myMapBegin;
00093    DtPoint  myMapLast;
00094 };
00095 
00096 #endif //NAVIGATIONHANDLER_H_
00097 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)