00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef INSTIGATE_GEOMETRY_CONCEPT_LINE
00010 #define INSTIGATE_GEOMETRY_CONCEPT_LINE
00011
00025
00026
00027
00028 #include <stl/concept.hpp>
00029
00030
00031
00032
00033
00034
00035 namespace instigate {
00036 namespace geometry {
00037 namespace concept {
00045 namespace line {
00046 template<typename T>
00047 struct interface;
00048
00049 template<typename T>
00050 struct requirements;
00051 }
00052 }
00053 }
00054 }
00055
00067 template <typename T>
00068 struct instigate::geometry::concept::line::interface
00069 : public instigate::default_constructible::interface<T>
00070 , public instigate::assignable::interface<T>
00071 {
00073 public:
00079 typedef typename T::point_type point_type;
00080
00082 typedef typename T::coordinate_type coordinate_type;
00083
00084 public:
00095 static void set_source_x(T& p, const coordinate_type& v)
00096 {
00097 p.set_source_x(v);
00098 }
00099
00110 static void set_source_y(T& p, const coordinate_type& v)
00111 {
00112 p.set_source_y(v);
00113 }
00114
00125 static void set_target_x(T& p, const coordinate_type& v)
00126 {
00127 p.set_target_x(v);
00128 }
00129
00140 static void set_target_y(T& p, const coordinate_type& v)
00141 {
00142 p.set_target_y(v);
00143 }
00144
00155 static const coordinate_type get_source_x(const T& p)
00156 {
00157 return p.get_source_x();
00158 }
00159
00170 static const coordinate_type get_source_y(const T& p)
00171 {
00172 return p.get_source_y();
00173 }
00174
00185 static const coordinate_type get_target_x(const T& p)
00186 {
00187 return p.get_target_x();
00188 }
00189
00200 static const coordinate_type get_target_y(const T& p)
00201 {
00202 return p.get_target_y();
00203 }
00204
00205 };
00206
00213 template <typename T>
00214 struct instigate::geometry::concept::line::requirements
00215 : public instigate::default_constructible::requirements<T>
00216 , public instigate::assignable::requirements<T>
00217 {
00218
00219 void require_nested_typename_point_type()
00220 {
00221 typedef instigate::geometry::concept::line::
00222 interface<T> LC;
00223 typedef typename LC::point_type P;
00224 }
00225
00226 void require_set_source_x_function(T& p, typename instigate::
00227 geometry::concept::line::interface<T>::coordinate_type x)
00228 {
00229 typedef instigate::geometry::concept::line::
00230 interface<T> LC;
00231 LC::set_source_x(p, x);
00232 }
00233
00234 void require_set_source_y_function(T& p, typename instigate::
00235 geometry::concept::line::interface<T>::coordinate_type y)
00236 {
00237 typedef instigate::geometry::concept::
00238 line::interface<T> LC;
00239 LC::set_source_y(p, y);
00240 }
00241
00242 void require_set_target_x_function(T& p, typename instigate::
00243 geometry::concept::line::interface<T>::coordinate_type x)
00244 {
00245 typedef instigate::geometry::concept::line::
00246 interface<T> LC;
00247 LC::set_target_x(p, x);
00248 }
00249
00250 void require_set_target_y_function(T& p, typename instigate::
00251 geometry::concept::line::interface<T>::coordinate_type y)
00252 {
00253 typedef instigate::geometry::concept::line::
00254 interface<T> LC;
00255 LC::set_target_y(p, y);
00256 }
00257
00258 typename instigate::geometry::concept::line::interface<T>::
00259 coordinate_type require_get_source_x_function(const T& p)
00260 {
00261 typedef instigate::geometry::concept::line::
00262 interface<T> LC;
00263 return LC::get_source_x(p);
00264 }
00265
00266 typename instigate::geometry::concept::line::interface<T>::
00267 coordinate_type require_get_source_y_function(const T& p)
00268 {
00269 typedef instigate::geometry::concept::line::
00270 interface<T> LC;
00271 return LC::get_source_y(p);
00272 }
00273
00274 typename instigate::geometry::concept::line::interface<T>::
00275 coordinate_type require_get_target_x_function(const T& p)
00276 {
00277 typedef instigate::geometry::concept::line::
00278 interface<T> LC;
00279 return LC::get_target_x(p);
00280 }
00281
00282 typename instigate::geometry::concept::line::interface<T>::
00283 coordinate_type require_get_target_y_function(const T& p)
00284 {
00285 typedef instigate::geometry::concept::line::
00286 interface<T> LC;
00287 return LC::get_target_y(p);
00288 }
00289
00290 requirements()
00291 : instigate::default_constructible::
00292 requirements<T>()
00293 , instigate::assignable::
00294 requirements<T>()
00295 {
00296 (void)&requirements<T>::require_nested_typename_point_type;
00297 (void)&requirements<T>::require_set_source_x_function;
00298 (void)&requirements<T>::require_set_source_y_function;
00299 (void)&requirements<T>::require_set_target_x_function;
00300 (void)&requirements<T>::require_set_target_y_function;
00301 (void)&requirements<T>::require_get_source_x_function;
00302 (void)&requirements<T>::require_get_source_y_function;
00303 (void)&requirements<T>::require_get_target_x_function;
00304 (void)&requirements<T>::require_get_target_y_function;
00305 }
00306
00307 };
00308
00309
00310
00311 #endif // INSTIGATE_GEOMETRY_CONCEPT_LINE