-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrPoint2D.h
91 lines (73 loc) · 2.28 KB
/
rPoint2D.h
1
/* * Forward class declarations */#ifndef rPoint2Dhh#define rPoint2Dhh#include <iostream>#include <math.h>class rPoint2D;class Rect2D;class rLatLon;class rLatLonint;class Trixel;/* * Class declarations */class rPoint;class rVector;class rPoint2D { friend std::ostream& operator<<(std::ostream&, rPoint2D&); /* used with cout */ protected: public: double x; double y; rPoint2D (); rPoint2D (double, double); rPoint2D (rVector); rPoint2D (rPoint); ~rPoint2D () {}; rPoint2D& operator=(rPoint2D ); rPoint2D& operator=(rLatLon ); rPoint2D& operator=(rLatLonint ); rPoint2D& operator=(rPoint ); rPoint2D& operator=(rVector &); //operator rVector(); //operator rLatLon(); //operator rPoint(); void abs () { x = ::fabs (x); y = ::fabs (y); } int operator==(rPoint2D p) { return (x == p.x && y == p.y );} int operator<=(rPoint2D p) { return (x<=p.x && y<=p.y); } int operator<(rPoint2D p) { return (x<p.x && y<p.y); } int operator>=(rPoint2D p) { return (x>=p.x && y>=p.y); } int operator>(rPoint2D p) { return (x>p.x && y>p.y); }/* friend int operator<=(rPoint2D &p, rPoint2D &r) { return (p.x<=r.x && p.y<=r.y); } friend int operator<(rPoint2D &p, rPoint2D &r) { return (p.x<r.x && p.y<r.y); } friend int operator>=(rPoint2D &p, rPoint2D &r) { return (p.x>=r.x && p.y>=r.y); } friend int operator>(rPoint2D &p, rPoint2D &r) { return (p.x>r.x && p.y>r.y); }*/ /*assign an array of three values to the rPoint */ rPoint2D& operator&=(double*); rPoint2D& operator+=(rPoint2D); rPoint2D& operator-=(rPoint2D); rPoint2D& operator*=(rPoint2D); rPoint2D& operator/=(rPoint2D); rPoint2D& operator+(double); rPoint2D& operator-(double); rPoint2D& operator*(double); rPoint2D& operator/(double); rPoint2D& operator+=(double); rPoint2D& operator-=(double); rPoint2D& operator*=(double); rPoint2D& operator/=(double); rPoint2D& set (double, double); // void dout ();/* the display routine */ /* friend Rect2D; friend Trixel; friend rPoint2D operator+(rPoint2D ,rPoint2D ); friend rPoint2D operator-(rPoint2D ,rPoint2D ); friend rPoint2D operator*(rPoint2D ,rPoint2D ); friend rPoint2D operator/(rPoint2D ,rPoint2D );*/};#endif