scaler.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation version 2.1.                *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Lesser General Public      *
00015  *   License along with this library; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
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 //     void grid( double& x, double& y );
00072 
00077 //     void set_grid( double x, double y );
00078 
00079 //     void set_grid_x( double x );
00080 
00081 //     void set_grid_y( double y );
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

Generated on Sun Mar 11 10:01:28 2007 by  doxygen 1.5.1