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

HxArrowR2.h

00001 /*
00002  *  Copyright (c) 1998, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Dennis Koelma (koelma@wins.uva.nl)
00008  *  Edo Poll (poll@wins.uva.nl)
00009  */
00010 
00011 #ifndef HxArrowR2_h
00012 #define HxArrowR2_h
00013 
00014 #include "HxPointR2.h"
00015 #include "HxVectorR2.h"
00016 
00021 class HxArrowR2 {
00022 public:
00024                         HxArrowR2();
00025 
00027                         HxArrowR2(const HxVectorR2& v);
00028 
00030                         HxArrowR2(const HxPointR2& p, const HxVectorR2& v);
00031 
00033                         HxArrowR2(double ox, double oy, double dx, double dy);
00034 
00036                         ~HxArrowR2();
00037 
00039     HxPointR2           origin();
00040 
00042     HxVectorR2          displace();
00043 
00045     STD_OSTREAM&        put(STD_OSTREAM&) const;
00046 
00047 private:
00048     HxPointR2           _origin;
00049     HxVectorR2          _displace;
00050 };
00051 
00052 inline STD_OSTREAM&
00053 operator<<(STD_OSTREAM& os, const HxArrowR2 a)
00054 {
00055     return a.put(os);
00056 }
00057 
00058 inline
00059 HxArrowR2::HxArrowR2()
00060 {
00061 }
00062 
00063 inline
00064 HxArrowR2::HxArrowR2(const HxVectorR2& v) : _origin(0, 0), _displace(v)
00065 {
00066 }
00067 
00068 inline
00069 HxArrowR2::HxArrowR2(const HxPointR2& p, const HxVectorR2& v) : _origin(p),
00070                                                                 _displace(v)
00071 {
00072 }
00073 
00074 inline
00075 HxArrowR2::HxArrowR2(double ox, double oy, double dx, double dy) :
00076                                             _origin(ox, oy), _displace(dx, dy)
00077 {
00078 }
00079 
00080 inline
00081 HxArrowR2::~HxArrowR2()
00082 {
00083 }
00084 
00085 inline HxPointR2
00086 HxArrowR2::origin()
00087 {
00088     return _origin;
00089 }
00090 
00091 inline HxVectorR2
00092 HxArrowR2::displace()
00093 {
00094     return _displace;
00095 }
00096 
00097 inline STD_OSTREAM& 
00098 HxArrowR2::put(STD_OSTREAM& os) const
00099 {
00100     return os << _origin <<  " " << _displace;
00101 }
00102 
00103 #endif

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