
Index: ChangeLog from Simon Odou <simon@lrde.epita.fr> * oln/basics1d.hh: New. * oln/core/1d/point1d.hh: New. * oln/core/3d: New. * oln/core/3d/point3d.hh: New. * oln/basics3d.hh: New. ChangeLog | 8 +++++ oln/basics1d.hh | 9 ++++++ oln/basics3d.hh | 9 ++++++ oln/core/1d/point1d.hh | 58 +++++++++++++++++++++++++++++++++++++++ oln/core/3d/point3d.hh | 72 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 156 insertions(+) Index: ChangeLog --- ChangeLog (revision 9) +++ ChangeLog (working copy) @@ -1,3 +1,11 @@ +2005-01-21 Simon Odou <simon@lrde.epita.fr> + + * oln/basics1d.hh: New. + * oln/core/1d/point1d.hh: New. + * oln/core/3d: New. + * oln/core/3d/point3d.hh: New. + * oln/basics3d.hh: New. + 2005-01-21 Damien Thivolle <damien@lrde.epita.fr> * oln/makefile.src: Update file dependencies. Index: oln/basics1d.hh --- oln/basics1d.hh (revision 0) +++ oln/basics1d.hh (revision 0) @@ -0,0 +1,9 @@ +#ifndef OLENA_BASICS1D_HH +# define OLENA_BASICS1D_HH + + +# include <oln/basics.hh> + +# include <oln/core/1d/point1d.hh> + +#endif // ! OLENA_BASICS1D_HH Index: oln/core/1d/point1d.hh --- oln/core/1d/point1d.hh (revision 0) +++ oln/core/1d/point1d.hh (revision 0) @@ -0,0 +1,58 @@ +#ifndef OLENA_CORE_1D_POINT1D_HH +# define OLENA_CORE_1D_POINT1D_HH + +# include <ostream> + +# include <oln/core/abstract/point.hh> +# include <oln/core/coord.hh> + +namespace oln { + + struct point1d : public abstract::point< point1d > + { + point1d() : + index_(0) + { + } + + point1d(coord_t index_) : + index_(index_) + { + } + + point1d(const point1d& rhs) : + index_(rhs.index_) + { + } + + point1d& operator=(const point1d& rhs) + { + if (&rhs == this) + return *this; + this->index_ = rhs.index_; + return *this; + } + + bool impl_eq(const point1d& rhs) const + { + return this->index_ == rhs.index_; + } + + const coord_t index() const { return index_; } + + coord_t& index() { return index_; } + + protected: + coord_t index_; + }; + +} // end of namespace oln + + +std::ostream& operator<<(std::ostream& ostr, const oln::point1d& p) +{ + return ostr << '(' << p.index() << ')'; +} + + +#endif // ! OLENA_CORE_1D_POINT1D_HH Index: oln/core/3d/point3d.hh --- oln/core/3d/point3d.hh (revision 0) +++ oln/core/3d/point3d.hh (revision 0) @@ -0,0 +1,72 @@ +#ifndef OLENA_CORE_3D_POINT3D_HH +# define OLENA_CORE_3D_POINT3D_HH + +# include <ostream> + +# include <oln/core/abstract/point.hh> +# include <oln/core/coord.hh> + +namespace oln { + + struct point3d : public abstract::point< point3d > + { + point3d() : + slice_(0), + row_(0), + col_(0) + { + } + + point3d(coord_t slice_, coord_t row_, coord_t col_) : + slice_(slice_), + row_(row_), + col_(col_) + { + } + + point3d(const point3d& rhs) : + slice_(slice_), + row_(rhs.row_), + col_(rhs.col_) + { + } + + point3d& operator=(const point3d& rhs) + { + if (&rhs == this) + return *this; + this->slice_ = rhs.slice_; + this->row_ = rhs.row_; + this->col_ = rhs.col_; + return *this; + } + + bool impl_eq(const point3d& rhs) const + { + return this->slice_ == rhs.slice_ and + this->row_ == rhs.row_ and + this->col_ == rhs.col_; + } + + const coord_t slice() const { return slice_; } + const coord_t row() const { return row_; } + const coord_t col() const { return col_; } + + coord_t& slice() { return slice_; } + coord_t& row() { return row_; } + coord_t& col() { return col_; } + + protected: + coord_t slice_, row_, col_; + }; + +} // end of namespace oln + + +std::ostream& operator<<(std::ostream& ostr, const oln::point3d& p) +{ + return ostr << '(' << p.slice() << ',' << p.row() << ',' << p.col() << ')'; +} + + +#endif // ! OLENA_CORE_3D_POINT3D_HH Index: oln/basics3d.hh --- oln/basics3d.hh (revision 0) +++ oln/basics3d.hh (revision 0) @@ -0,0 +1,9 @@ +#ifndef OLENA_BASICS3D_HH +# define OLENA_BASICS3D_HH + + +# include <oln/basics.hh> + +# include <oln/core/3d/point3d.hh> + +#endif // ! OLENA_BASICS3D_HH