GUIPerspectiveChanger.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // A virtual class that allows to steer the visual output in dependence to
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef GUIPerspectiveChanger_h
00020 #define GUIPerspectiveChanger_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <fx.h>
00033 #include "GUISUMOAbstractView.h"
00034 
00035 
00036 // ===========================================================================
00037 // class declarations
00038 // ===========================================================================
00039 class GUISUMOAbstractView;
00040 class Position2D;
00041 class Boundary;
00042 
00043 
00044 // ===========================================================================
00045 // class definitions
00046 // ===========================================================================
00057 class GUIPerspectiveChanger {
00058 public:
00059     enum MouseState {
00060         MOUSEBTN_NONE = 0,
00061         MOUSEBTN_LEFT = 1,
00062         MOUSEBTN_RIGHT = 2,
00063         MOUSEBTN_MIDDLE = 4
00064     };
00065 
00067     GUIPerspectiveChanger(GUISUMOAbstractView &callBack);
00068 
00070     virtual ~GUIPerspectiveChanger();
00071 
00072     virtual void onLeftBtnPress(void *data);
00073     virtual bool onLeftBtnRelease(void *data);
00074     virtual void onRightBtnPress(void *data);
00075     virtual bool onRightBtnRelease(void *data);
00076     virtual void onMouseWheel(void *data);
00077     virtual void onMouseMove(void *data);
00078 
00080     virtual SUMOReal getRotation() const = 0;
00081 
00083     virtual SUMOReal getXPos() const = 0;
00084 
00086     virtual SUMOReal getYPos() const = 0;
00087 
00089     virtual SUMOReal getZoom() const = 0;
00090 
00092     virtual void recenterView() = 0;
00093 
00097     virtual void centerTo(const Boundary &netBoundary,
00098                           const Position2D &pos, SUMOReal radius, bool applyZoom=true) = 0;
00099 
00102     virtual void centerTo(const Boundary &netBoundary,
00103                           Boundary bound, bool applyZoom=true) = 0;
00104 
00107     virtual void setViewport(SUMOReal zoom, SUMOReal xPos, SUMOReal yPos) = 0;
00108 
00110     FXint getMouseXPosition() const;
00111 
00113     FXint getMouseYPosition() const;
00114 
00116     void setNetSizes(size_t width, size_t height);
00117 
00119     void applyCanvasSize(size_t width, size_t height);
00120 
00121 protected:
00123     GUISUMOAbstractView &myCallback;
00124 
00126     size_t myNetWidth, myNetHeight;
00127 
00129     size_t myCanvasWidth, myCanvasHeight;
00130 
00132     FXint myMouseXPosition, myMouseYPosition;
00133 
00134 };
00135 
00136 
00137 #endif
00138 
00139 /****************************************************************************/
00140 

Generated on Wed May 5 00:06:30 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6