VR-Forces 4.0.4 Class Documentation
include/tmEventHandler/mapAreaSelectionHandler.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2003 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: mapAreaSelectionHandler.h,v $ $Revision: 1.7 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00012 #ifndef MAPAREASELECTIONHANDLER_H_
00013 #define MAPAREASELECTIONHANDLER_H_
00014 
00015 #include "tmqt/eventHandler.h"
00016 
00017 class DtBaseWindow;
00018 class DtTMMapArea;
00019 class DtModelData;
00020 
00021 #include "tmEventHandler/tmEventHandlerDefines.h"
00022 class DT_DLL_tmEventHandler DtMapAreaSelectionHandler : public DtEventHandler
00023 {
00024    Q_OBJECT
00025    
00026 public:
00027 
00029    DtMapAreaSelectionHandler();
00030    
00032    virtual ~DtMapAreaSelectionHandler();
00033 
00034 public:
00036    static DtEventHandler* create(DtEventController* owner, void* usr);
00037 
00038 protected:
00039    virtual bool keyboardEvent(DtTMMapArea*, QKeyEvent* evnt);
00040 
00042    virtual bool isMovementKey(int) const;
00043 
00045    virtual void moveModelData(DtTMMapArea*, DtModelData* data, int key);
00046 
00048    virtual DtPoint getOriginPoint(DtTMMapArea* area, DtModelData* data) const;
00049 
00051    virtual bool connecting(DtTMMapArea*);
00052    virtual bool disconnecting(DtTMMapArea*);
00053 
00054 protected:
00057    virtual bool isSelectedPointMove(DtTMMapArea*, DtModelData*) const;
00058 
00060    virtual bool isSelectedCircleMove(DtTMMapArea*, DtModelData*) const;
00061 
00064    virtual void moveSelectedPoint(DtTMMapArea*, DtModelData*, const DtPoint& delta);
00065 
00068    virtual void circleMove(DtTMMapArea*, DtModelData*, const DtPoint& delta);
00069 
00071    virtual void dragMove(DtTMMapArea*, DtModelData*, const DtPoint& delta);
00072 
00073 public:
00074 
00078    void setXMovement(double);
00079    double xMovement() const;
00080 
00081    void setYMovement(double);
00082    double yMovement() const;
00083 
00084    void setZMovement(double);
00085    double zMovement() const;
00086 
00087 protected:
00089    virtual void moveModelData(DtTMMapArea*area, DtModelData* data, const DtPoint& newOrigin);
00090 
00092    virtual bool isMoveableEvent(DtTMMapArea* area, int key) const;
00093 
00094 protected slots:
00096    virtual void selectionChanged(const QVector<DtModelKey>&);
00097 
00098 protected:
00099    double myXMovement;
00100    double myYMovement;
00101    double myZMovement;
00102 };
00103 
00104 inline void DtMapAreaSelectionHandler::setXMovement(double i)
00105 {
00106    myXMovement = i;
00107 }
00108 
00109 inline double DtMapAreaSelectionHandler::xMovement() const
00110 {
00111    return myXMovement;
00112 }
00113 
00114 inline void DtMapAreaSelectionHandler::setYMovement(double i)
00115 {
00116    myYMovement = i;
00117 }
00118 
00119 inline double DtMapAreaSelectionHandler::yMovement() const
00120 {
00121    return myYMovement;
00122 }
00123 
00124 inline void DtMapAreaSelectionHandler::setZMovement(double d)
00125 {
00126    myZMovement = d;
00127 }
00128 
00129 inline double DtMapAreaSelectionHandler::zMovement() const
00130 {
00131    return myZMovement;
00132 }
00133 
00134 #endif //MAPAREASELECTIONHANDLER_H_

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)