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 #ifndef OLENA_CORE_POINT1D_HH
00029 # define OLENA_CORE_POINT1D_HH
00030
00031 # include <oln/config/system.hh>
00032 # include <ntg/core/predecls.hh>
00033 # include <oln/core/coord.hh>
00034 # include <oln/core/abstract/point.hh>
00035 # include <iostream>
00036
00037 namespace oln {
00038
00039
00040
00041 class dpoint1d;
00042 class point1d;
00043
00044
00050 template<>
00051 struct point_traits<point1d> : public point_traits<abstract::point<point1d> >
00052 {
00053 enum { dim = 1 };
00054 typedef dpoint1d dpoint_type;
00055 };
00056
00068 class point1d : public abstract::point<point1d>
00069 {
00070 public:
00071
00072 typedef abstract::point<point1d> super_type;
00073 typedef point_traits<point1d>::dpoint_type dpoint_type;
00074
00075 friend class abstract::point<point1d>;
00076
00077 point1d();
00078
00080
00081 point1d(coord col);
00082
00084
00085 coord
00086 col() const;
00087
00089
00090 coord&
00091 col();
00092
00093 static std::string
00094 name()
00095 {
00096 return "point1d";
00097 }
00098
00099 protected:
00100
00101
00106 point1d
00107 plus_dp(const dpoint1d& dp) const;
00108
00113 point1d
00114 minus_dp(const dpoint1d& dp) const;
00115
00120 point1d&
00121 plus_assign_dp(const dpoint1d& dp);
00122
00127 point1d&
00128 minus_assign_dp(const dpoint1d& dp);
00129
00134 dpoint1d
00135 minus_p(const point1d& p) const;
00136
00141 point1d
00142 minus() const;
00143
00144 };
00145
00146 namespace internal
00147 {
00148
00154 template<>
00155 struct default_less<point1d> : public default_less<point1d::super_type>
00156 {
00157 };
00158 }
00159
00160
00161 }
00162
00164
00165 inline std::ostream&
00166 operator<<(std::ostream& o, const oln::point1d& p);
00167
00168 # include <oln/core/point1d.hxx>
00169
00170 #endif // ! OLENA_CORE_POINT1D_HH