00001 #ifndef rot3band_h 00002 #define rot3band_h 00003 00004 /* 00005 3-D rubberband 00006 On the button press a globe appears centered at the mouse location 00007 Dragging the mouse causes the globe to rotate as though the mouse 00008 was always at the same location on the globe. If the mouse is dragged 00009 off the globe, the mouse is treated as though it is on the edge. The mouse 00010 is always treated as though it is on the front hemisphere. 00011 00012 Well, maybe someday. 00013 Can type x, y, z to get immediate rotations in which axes are out of screen. 00014 00015 Multiple invocations of the Rotate3Band accumulate rotations. 00016 */ 00017 00018 #include "rubband.h" 00019 #include "rotate3d.h" 00020 00021 class Rotate3Band : public Rubberband { 00022 public: 00023 Rotate3Band(Rotation3d* = nil, RubberAction* = nil, Canvas* = nil); 00024 virtual ~Rotate3Band(); 00025 00026 virtual void press(Event&); 00027 virtual void drag(Event&); 00028 virtual void draw(Coord, Coord); 00029 00030 virtual boolean event(Event&); // looks for x, y, z press 00031 Rotation3d* rotation(); 00032 virtual void help(); 00033 private: 00034 Rotation3d* rot_; 00035 float x_old_, y_old_; 00036 }; 00037 00038 #endif