rotator.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 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 //     double radian_interval();
00064 
00065 //     void set_radian_interval( double radian_interval );
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

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