00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00033
00034
00035 #ifndef esve_viewers_dimn_Surface_Tie_hxx
00036 #define esve_viewers_dimn_Surface_Tie_hxx
00037
00038 #include <esve/viewers/dimn/Valuator_Effect.hxx>
00039 #include <esve/components/dimn/Simple_UI_Tie.hxx>
00040 #include <esve/types/quat.hxx>
00041 #include <esve/types/pure.hxx>
00042 #include <esve/types/complex.hxx>
00043 #include <map>
00044 #include <string>
00045
00046 namespace esve { namespace viewers { namespace dimn {
00047
00058
00059 template< typename T_Surface >
00060 class Surface_Tie
00061 : public components::dimn::Valuator_Handler<types::real>,
00062 public components::dimn::Valuator_Handler<types::complex>,
00063 public components::dimn::Valuator_Handler<types::pure>,
00064 public components::dimn::Valuator_Handler<types::quat>
00065 {
00066 private:
00067 typedef components::dimn::Valuator_Handler<types::real> super ;
00068
00069 #if !defined(NDEBUG)
00070 template< class U > static void m_unused( const U & ) { }
00071
00072 struct m_Requirements
00073 {
00074 m_Requirements()
00075 {
00076 typedef void (T_Surface::*R)() ;
00077 R r1 = &T_Surface::update_domain ;
00078 R r2 = &T_Surface::update_domain_clip ;
00079 R r3 = &T_Surface::update_surface ;
00080 R r4 = &T_Surface::update_surface_clip ;
00081 R r5 = &T_Surface::update_color ;
00082 m_unused(r1) ;
00083 m_unused(r2) ;
00084 m_unused(r3) ;
00085 m_unused(r4) ;
00086 m_unused(r5) ;
00087 }
00088 } m_requirements ;
00089 #endif // !defined(NDEBUG)
00090
00091 typedef T_Surface m_Surface ;
00092 typedef typename m_Surface::Spec m_Spec ;
00093
00094 typedef std::map<const components::dimn::Valuator<types::real>*,
00095 Valuator_Effect> m_Real_Map ;
00096 typedef std::pair<const components::dimn::Valuator<types::real>*,
00097 Valuator_Effect> m_Real_Pair ;
00098
00099 typedef std::map<const components::dimn::Valuator<types::complex>*,
00100 Valuator_Effect> m_Complex_Map ;
00101 typedef std::pair<const components::dimn::Valuator<types::complex>*,
00102 Valuator_Effect> m_Complex_Pair ;
00103
00104 typedef std::map<const components::dimn::Valuator<types::pure>*,
00105 Valuator_Effect> m_Pure_Map ;
00106 typedef std::pair<const components::dimn::Valuator<types::pure>*,
00107 Valuator_Effect> m_Pure_Pair ;
00108
00109 typedef std::map<const components::dimn::Valuator<types::quat>*,
00110 Valuator_Effect> m_Quat_Map ;
00111 typedef std::pair<const components::dimn::Valuator<types::quat>*,
00112 Valuator_Effect> m_Quat_Pair ;
00113
00114 struct m_Tie : public components::dimn::Simple_UI_Tie<m_Spec>
00115 {
00116 m_Tie( components::dimn::Simple_UI & ui, m_Spec & target )
00117 : components::dimn::Simple_UI_Tie<m_Spec>(ui, target) { }
00118
00119 using components::dimn::Simple_UI_Tie<m_Spec>::handle_valuator ;
00120 } ;
00121
00122 Surface_Tie( const Surface_Tie & ) ;
00123 Surface_Tie & operator=( const Surface_Tie & ) ;
00124
00125 void m_update_surface( Valuator_Effect ) ;
00126
00127 m_Tie m_tie ;
00128
00129 m_Real_Map m_real_map ;
00130 m_Complex_Map m_complex_map ;
00131 m_Pure_Map m_pure_map ;
00132 m_Quat_Map m_quat_map ;
00133
00134 m_Surface & m_surface ;
00135
00136 public:
00137 typedef m_Surface Surface ;
00138 typedef m_Spec Spec ;
00139
00140 typedef typename m_Tie::Real_Member Real_Member ;
00141 typedef typename m_Tie::Real_Reader Real_Reader ;
00142 typedef typename m_Tie::Real_Writer Real_Writer ;
00143
00144 typedef typename m_Tie::Complex_Member Complex_Member ;
00145 typedef typename m_Tie::Complex_Reader Complex_Reader ;
00146 typedef typename m_Tie::Complex_Writer Complex_Writer ;
00147
00148 typedef typename m_Tie::Pure_Member Pure_Member ;
00149 typedef typename m_Tie::Pure_Reader Pure_Reader ;
00150 typedef typename m_Tie::Pure_Writer Pure_Writer ;
00151
00152 typedef typename m_Tie::Quat_Member Quat_Member ;
00153 typedef typename m_Tie::Quat_Reader Quat_Reader ;
00154 typedef typename m_Tie::Quat_Writer Quat_Writer ;
00155
00156 Surface_Tie( components::dimn::Simple_UI & ui,
00157 Spec & spec,
00158 Surface & surface ) ;
00159
00160 components::dimn::Valuator<types::real> &
00161 create_valuator( Real_Member,
00162 Valuator_Effect,
00163 const std::string & name = "" ) ;
00164
00165 components::dimn::Valuator<types::real> &
00166 create_valuator( Real_Reader,
00167 Real_Writer,
00168 Valuator_Effect,
00169 const std::string & name = "" ) ;
00170
00171 components::dimn::Valuator<types::complex> &
00172 create_valuator( Complex_Member,
00173 Valuator_Effect,
00174 const std::string & name = "" ) ;
00175
00176 components::dimn::Valuator<types::complex> &
00177 create_valuator( Complex_Reader,
00178 Complex_Writer,
00179 Valuator_Effect,
00180 const std::string & name = "" ) ;
00181
00182 components::dimn::Valuator<types::pure> &
00183 create_valuator( Pure_Member,
00184 Valuator_Effect,
00185 const std::string & name = "" ) ;
00186
00187 components::dimn::Valuator<types::pure> &
00188 create_valuator( Pure_Reader,
00189 Pure_Writer,
00190 Valuator_Effect,
00191 const std::string & name = "" ) ;
00192
00193 components::dimn::Valuator<types::quat> &
00194 create_valuator( Quat_Member,
00195 Valuator_Effect,
00196 const std::string & name = "" ) ;
00197
00198 components::dimn::Valuator<types::quat> &
00199 create_valuator( Quat_Reader,
00200 Quat_Writer,
00201 Valuator_Effect,
00202 const std::string & name = "" ) ;
00203
00204 ~Surface_Tie() ;
00205
00206 protected:
00207 bool handle_valuator(
00208 const components::dimn::Valuator<types::real> & ) ;
00209 bool handle_valuator(
00210 const components::dimn::Valuator<types::complex> & ) ;
00211 bool handle_valuator(
00212 const components::dimn::Valuator<types::pure> & ) ;
00213 bool handle_valuator(
00214 const components::dimn::Valuator<types::quat> & ) ;
00215 } ;
00216
00217 }}}
00218
00219 #include <esve/viewers/dimn/Surface_Tie.template.cxx>
00220
00221 #endif
00222