00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PAPYRUSROTATOR_H
00020 #define PAPYRUSROTATOR_H
00021
00022 #include <papyrus/selector.h>
00023
00024 namespace Papyrus
00025 {
00026
00030 class Rotator : public Selector
00031 {
00032 public:
00033 typedef PapyrusSmartPointer<Rotator> pointer;
00034
00035 Rotator(Group::pointer selection_group = Group::pointer(),
00036 SelectionMode mode = SELECT_PRESS,
00037 int selection_depth = 1,
00038 double radian_interval = 0.0
00039 );
00040
00041 Rotator(Group::pointer select_from_group,
00042 Group::pointer selection_group,
00043 SelectionMode mode = SELECT_PRESS,
00044 int selection_depth = 1,
00045 double radian_interval = 0.0
00046 );
00047
00048 static Rotator::pointer create(Group::pointer selection_group = Group::pointer(),
00049 SelectionMode mode = SELECT_PRESS,
00050 int selection_depth = 1,
00051 double radian_interval = 0.0
00052 );
00053
00054 static Rotator::pointer create(Group::pointer select_from_group,
00055 Group::pointer selection_group,
00056 SelectionMode mode = SELECT_PRESS,
00057 int selection_depth = 1,
00058 double radian_interval = 0.0
00059 );
00060
00061 ~Rotator();
00062
00063
00064
00065
00066
00067 protected:
00068 double m_original_position[2], m_centroid[2];
00069 double m_radian_interval;
00070 double m_last_angle;
00071
00072 virtual bool on_motion(const Event::Motion& event);
00073 virtual bool on_button_press(const Event::ButtonPress& event);
00074
00075 };
00076
00077 }
00078
00079 #endif