MeVisLabToolboxReference
|
00001 #ifndef __SoView2DSliceZoom_H 00002 #define __SoView2DSliceZoom_H 00003 //---------------------------------------------------------------------------------- 00004 // **InsertLicense** code 00005 //---------------------------------------------------------------------------------- 00012 //---------------------------------------------------------------------------------- 00013 00014 #ifndef __SoView2DInteractionExtension_H 00015 #include "SoView2DInteractionExtension.h" 00016 #endif 00017 00018 //------------------------------------------------------------------ 00021 class SOVIEW2D_API SoView2DSliceZoom : public SoView2DInteractionExtension { 00022 00023 SO_NODE_HEADER(SoView2DSliceZoom); 00024 00025 public: 00026 00027 enum DragMode { 00028 DRAG_TAKE_AND_PUSH, 00029 DRAG_APPROACH_AND_DEPART 00030 }; 00031 00033 SoSFFloat min; 00035 SoSFFloat max; 00037 SoSFFloat sensitivity; 00038 // mhi 20051013: allow inversion of currently implemented mouse move direction. 00039 SoSFEnum dragMode; 00041 SoSFBool useAlternativeZoomFormula; 00042 00045 SoSFBool evalStarted; 00046 00047 00049 static void initClass(); 00050 00052 SoView2DSliceZoom(); 00053 00055 virtual void startDrawing(View2DSliceList *slicelist); 00056 00058 bool evalEvent(SoView2D* view2d, View2DSliceList* slicelist, 00059 View2DEvent* ec, View2DEventPhase phase); 00060 00061 00062 protected: 00063 void doZoom(float diffY, SoView2D* view2d); 00064 00066 00067 virtual void startPressAt(const SoPointerPosition& pos); 00068 virtual void dragMoveTo(const SoPointerPosition& pos); 00069 virtual SoPointingAction* endPress(int clickCount); 00071 00073 float _oldY; 00075 float _currentx; 00077 float _currenty; 00079 float _newcenterx; 00081 float _newcentery; 00083 bool _gotoOn; 00084 00086 bool _started; 00087 }; 00088 00089 #endif