00001
00002
00003
00004
00005
00006 #ifndef GEOMETRY_POINT_H
00007 #define GEOMETRY_POINT_H
00008
00009 #include "geometry/Vector.h"
00010
00014 class Point: public Hep3Vector , public GeomObject
00015 {
00016 public:
00017 Point(const Point& p):Hep3Vector(p),GeomObject(){}
00018 Point():Hep3Vector(0,0,0){}
00019 Point(double x, double y, double z):Hep3Vector(x,y,z){}
00020
00021
00022 Point& operator=(const Point& v){return (Point&)Hep3Vector::operator=(v);}
00023 Point& operator+=(const Vector& v){return (Point&)Hep3Vector::operator+=(v);}
00024 Point& operator-=(const Vector& v){return (Point&)Hep3Vector::operator-=(v);}
00025
00026
00027
00028
00029
00030 GeomObject& transform(const CoordTransform&);
00031
00032
00033
00034 const char* nameOf()const{return "Point";}
00035 void printOn(std::ostream& f =std::cout)const;
00036
00037 private:
00038
00039 Point operator*(double ){return Point();}
00040 Point operator/(double ){return Point();}
00041 Point operator+(const Point& ){return Point();};
00042
00043 };
00044
00045
00046 inline std::ostream& operator<<(std::ostream& out, const Point& v)
00047 { v.printOn(out); return out;}
00048
00049
00050
00051 inline Point operator - (const Point & a, const Vector & b) {
00052 Point p(a.x() - b.x(), a.y() - b.y(), a.z() - b.z()); return p;}
00053
00054 inline Vector operator - (const Point & a, const Point & b) {
00055 Vector v(a.x() - b.x(), a.y() - b.y(), a.z() - b.z()); return v;}
00056
00057 inline Point operator + (const Point & a, const Vector & b) {
00058 Point p(a.x() + b.x(), a.y() + b.y(), a.z() + b.z()); return p;}
00059
00060 inline Point operator + (const Vector & a, const Point & b) {
00061 Point p(a.x() + b.x(), a.y() + b.y(), a.z() + b.z()); return p;}
00062
00063
00064
00065
00066
00067 #endif
00068