00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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