00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef VRS_SG_ZOOMGROUNDPLATENAVIGATION_H
00021 #define VRS_SG_ZOOMGROUNDPLATENAVIGATION_H
00022
00023 #include <vrs/sg/groundplatenavigation.h>
00024
00025 namespace VRS {
00026
00030 class VRS_CORE_API ZoomGroundPlateNavigation : public GroundPlateNavigation {
00031 public:
00032
00033 ZoomGroundPlateNavigation(double yValOfGroundPlate = 0.0);
00034
00035 static const MouseButtonFunctionID Zoom;
00036
00041 void setWheelZoomFactor(double factor = 0.8);
00042
00044 double getWheelZoomFactor() const;
00045
00048 void setDragZoomFactor(double factor = 0.5);
00049
00051 double getDragZoomFactor() const;
00052
00054 void setMinDistance(double distance = 0.001);
00055
00057 double getMinDistance() const;
00058
00061 void setMaxDistance(double distance = 0.0);
00062
00064 double getMaxDistance() const;
00065
00066
00067 virtual void onDragMotion(
00068 int x, int y,
00069 SO<MotionEvent>,
00070 MouseButtonFunctionID id,
00071 int startX, int startY);
00072
00073 virtual void onDragEnd(
00074 int x, int y,
00075 SO<ButtonEvent>,
00076 MouseButtonFunctionID id,
00077 int startX, int startY);
00078
00080 virtual void onWheelEvent(SO<WheelEvent> we);
00081
00082 VRS_TYPEINFO(ZoomGroundPlateNavigation, GroundPlateNavigation);
00083
00084 protected:
00085 static const double EPSILON;
00086
00087
00088 virtual void zoom(double factor, SO<Canvas> canvas);
00089
00090
00091
00092
00093
00094 bool updateFocus(const Vector& from, const Vector& to, SO<Canvas> canvas,
00095 Vector& newFocus);
00096
00097
00098 void updateFocus(SO<Canvas> canvas);
00099
00100 bool focusValid_;
00101 Vector lastFocus_;
00102 double wheelZoomFactor_;
00103 double dragZoomFactor_;
00104 double minDistance_;
00105 double maxDistance_;
00106 };
00107
00108 }
00109
00110 #endif // VRS_SG_ZOOMGROUNDPLATENAVIGATION_H