src/rcrt/math/Point2D.h

Go to the documentation of this file.
00001 #ifndef POINT2D_H_
00002 #define POINT2D_H_
00003 
00004 #include "Vec2D.h"
00005 #include <iostream>
00006 
00007 namespace rcrt
00008 {
00009 
00010 class Point2D
00011 {
00012 private:
00013         float values[2];
00014         void assign(const Point2D& vec);
00015         
00016 public:
00017         Point2D();
00018         Point2D(float xc, float yc);
00019         Point2D(const Point2D& p);
00020         virtual ~Point2D();
00021         
00022         const Point2D& operator= (const Point2D& p);
00023         Point2D operator+ (const Vec2D& vec) const;
00024         Point2D operator- (const Vec2D& vec) const;
00025         Vec2D operator+ (const Point2D& p) const;
00026         Vec2D operator- (const Point2D& p) const;
00027         float operator[] (int i) const;
00028         float& operator[] (int i);
00029         
00030         Point2D operator* (const float f) const;
00031         Point2D operator/ (const float f) const;
00032         
00033         Vec2D getPosVec2D() const;
00034         Point2D abs() const;
00035         
00036         const float& x() const;
00037         const float& y() const;
00038 };
00039 
00040 inline std::ostream& operator<<(std::ostream& o, const Point2D& v)
00041 {
00042         o << "P2D(" << v.x() << "," << v.y() << ")";
00043         return o;
00044 }
00045 
00046 }
00047 
00048 #endif /*POINT2D_H_*/

Generated on Thu Jan 31 19:26:19 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3