Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxPointR2.h

00001 /*
00002  *  Copyright (c) 1999, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Silvia D. Olabarriaga  (silvia@wins.uva.nl)
00008  *  Dennis Koelma (koelma@wins.uva.nl)
00009  */
00010 
00011 #ifndef HxPointR2_h
00012 #define HxPointR2_h
00013 
00014 
00015 #include "HxIoFwd.h"
00016 #include "HxVec2Double.h"
00017 
00018 class HxVectorR2;
00019 
00020 
00023 class HxPointR2 {
00024 public:
00026                     HxPointR2();
00027 
00029                     HxPointR2(double d1, double d2);
00030 
00032                     HxPointR2(const HxVec2Double& v);
00033 
00034 
00036     double          x() const;
00037 
00039     double          y() const;
00040 
00042     HxPointR2       add(const HxVectorR2& arg) const;
00043 
00045     HxPointR2       sub(const HxVectorR2& arg) const;
00046 
00048     STD_OSTREAM&    put(STD_OSTREAM&) const;
00049 
00050     STD_OSTREAM&    dump(HxPointR2&) const;
00051 
00052     HxString        toString() const;
00053 
00054 private:
00055     friend class HxVectorR2;
00056 
00057     HxVec2Double    _data;
00058 };
00059 
00060 
00061 inline STD_OSTREAM&
00062 operator<<(STD_OSTREAM& os, const HxPointR2 p)
00063 {
00064     return p.put(os);
00065 }
00066 
00067 inline
00068 HxPointR2::HxPointR2() : _data(0,0)
00069 {
00070 }
00071 
00072 inline
00073 HxPointR2::HxPointR2(double d1, double d2) : _data(d1, d2)
00074 {
00075 }
00076 
00077 inline
00078 HxPointR2::HxPointR2(const HxVec2Double& v) : _data(v)
00079 {
00080 }
00081 
00082 inline double
00083 HxPointR2::x() const
00084 {
00085     return _data.x();
00086 }
00087 
00088 inline double
00089 HxPointR2::y() const
00090 {
00091     return _data.y();
00092 }
00093 
00094 inline HxString
00095 HxPointR2::toString() const
00096 {
00097     return _data.toString();
00098 }
00099 
00100 inline STD_OSTREAM& 
00101 HxPointR2::put(STD_OSTREAM& os) const
00102 {
00103     return os << _data;
00104 }
00105 
00106 inline HxString
00107 makeString(const HxPointR2& p)
00108 {
00109     return p.toString();
00110 }
00111 
00112 #endif

Generated on Tue Feb 3 14:18:41 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001