00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PAPYRUSSCALER_H
00020 #define PAPYRUSSCALER_H
00021
00022 #include <papyrus/selector.h>
00023 #include <papyrus/handlebox.h>
00024
00025 namespace Papyrus
00026 {
00027
00031 class Scaler : public Selector
00032 {
00033 public:
00034 typedef PapyrusSmartPointer<Scaler> pointer;
00035
00036 Scaler(Group::pointer selection_group = Group::pointer(),
00037 SelectionMode mode = SELECT_PRESS,
00038 int selection_depth = 1,
00039 unsigned side = 0 );
00040
00041 Scaler(Group::pointer select_from_group,
00042 Group::pointer selection_group,
00043 SelectionMode mode = SELECT_PRESS,
00044 int selection_depth = 1,
00045 unsigned side = 0 );
00046
00047 static Scaler::pointer create(Group::pointer selection_group = Group::pointer(),
00048 SelectionMode mode = SELECT_PRESS,
00049 int selection_depth = 1,
00050 unsigned side = 0 );
00051
00052 static Scaler::pointer create(Group::pointer select_from_group,
00053 Group::pointer selection_group,
00054 SelectionMode mode = SELECT_PRESS,
00055 int selection_depth = 1,
00056 unsigned side = 0 );
00057
00058 ~Scaler();
00059
00060 virtual void set_selection_group( Group::pointer selection_group, bool add_drawable_only = true );
00061
00062 unsigned sides();
00063
00064 void set_sides( unsigned sides );
00065
00066 void enable_sides( unsigned sides );
00067
00068 void disable_sides( unsigned sides );
00069
00071
00072
00077
00078
00079
00080
00081
00082
00083 protected:
00084 double m_original_position[2];
00085 unsigned m_sides;
00086 double m_grid[2];
00087 Handlebox::pointer m_handlebox;
00088
00089 virtual bool on_motion(const Event::Motion& event);
00090 virtual bool on_button_press(const Event::ButtonPress& event);
00091
00092 };
00093
00094 }
00095
00096 #endif