• Main Page
  • Related Pages
  • Classes
  • Files
  • File List

src/ScalableObject.hh

00001 /*
00002  * Copyright Staffan Gimåker 2007, 2009-2010.
00003  * Copyright Anders Boberg 2006-2007.
00004  *
00005  * ---
00006  *
00007  * This file is part of peekabot.
00008  *
00009  * peekabot is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 3 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * peekabot is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00021  */
00022 
00023 #ifndef PEEKABOT_SCALABLE_OBJECT_HH_INCLUDED
00024 #define PEEKABOT_SCALABLE_OBJECT_HH_INCLUDED
00025 
00026 
00027 #include <Eigen/Core>
00028 #include <boost/signals2.hpp>
00029 
00030 #include "Types.hh"
00031 #include "XMLHandler.hh"
00032 #include "PropMap.hh"
00033 
00034 
00035 namespace peekabot
00036 {
00037     class ScopedHandler;
00038 
00048     class ScalableObject
00049     {
00050     public:
00051         ScalableObject() throw();
00052 
00055         ScalableObject(ScopedHandler *handler);
00056 
00057         virtual ~ScalableObject() {}
00058 
00059         const Eigen::Vector3f &get_scale() const;
00060 
00063         float get_x_scale() const throw();
00064 
00067         float get_y_scale() const throw();
00068 
00071         float get_z_scale() const throw();
00072 
00073         void set_scale(const Eigen::Vector3f &scale) throw();
00074 
00075         void set_scale(float x_scale, float y_scale, float z_scale) throw();
00076 
00082         void set_x_scale(float x_scale) throw();
00083 
00084 
00090         void set_y_scale(float y_scale) throw();
00091 
00097         void set_z_scale(float z_scale) throw();
00098 
00101 
00102         typedef boost::signals2::signal<void ()> ScaleSetSignal;
00103 
00104         // ---
00105 
00106         inline ScaleSetSignal &scale_set_signal() const
00107         {
00108             return m_scale_set_signal;
00109         }
00110 
00112 
00113     protected:
00114         virtual PropMap &get_prop_adapters();
00115 
00116     private:
00117         static void create_prop_adapters(PropMap &adapters);
00118 
00121 
00124         void scale_start_handler(
00125             const std::string & name,
00126             XMLHandler::AttributeMap &attributes,
00127             ScopedHandler *handler) throw();
00128 
00131         void scale_cdata_handler(
00132             const std::string &cdata,
00133             ScopedHandler *handler) throw();
00134 
00136 
00137     private:
00138         Eigen::Vector3f m_scale;
00139 
00140         mutable ScaleSetSignal m_scale_set_signal;
00141     };
00142 }
00143 
00144 
00145 #endif // PEEKABOT_SCALABLE_OBJECT_HH_INCLUDED

Generated on Sun Jan 30 2011 for peekabot by  doxygen 1.7.1