2 * psychlops_g_fundamental.h
3 * Psychlops Standard Library (Universal)
5 * Last Modified 2005/10/05 by Kenchi HOSOKAWA
6 * (C) 2005 Kenchi HOSOKAWA, Kazushi MARUYA, Takao SATO
9 #ifndef HEADER_PSYCHLOPS_GRAPHIC_FUNDAMENTAL
10 #define HEADER_PSYCHLOPS_GRAPHIC_FUNDAMENTAL
24 friend class Drawable;
28 inline void setbypix(const double ix, const double iy, const double iz) { x = ix; y = iy; z = iz; }
31 inline Point() : x(0.0), y(0.0), z(0.0) {}
32 inline Point(const double ix, const double iy, const double iz = 0) : x(ix), y(iy), z(iz) {}
33 inline Point& set(const double ix, const double iy, const double iz = 0) { x = ix; y = iy; z = iz; return *this; }
34 inline Point& shift(const double h, const double v, const double d = 0) { x+=h; y+=v; z+=d; return *this; }
36 Point& centering(const Figure& fig);
37 inline Point& centering(const double h, const double v, const double d = 0) { x=h; y=v; z=d; return *this; }
38 inline Point& setX(const double val) { x = val; return *this; }
39 inline Point& setY(const double val) { y = val; return *this; }
40 inline Point& setZ(const double val) { z = val; return *this; }
41 inline double getX() const { return x; }
42 inline double getY() const { return y; }
43 inline double getZ() const { return z; }
45 inline Point operator+(const Point& rhs) { return Point(x+rhs.x, y+rhs.y, z+rhs.z); }
46 inline Point operator-(const Point& rhs) { return Point(x-rhs.x, y-rhs.y, z-rhs.z); }
\r
47 double length() const;
51 } /* <- namespace Psychlops */
63 // Listings of Classes in this file
67 // Listings of Graphics standard classes
84 Length(const int val);
85 Length(const double val);
86 Length(const Length &val);
87 operator double() const;
88 Length & operator =(const double val);
92 extern LENGTH_ARCDEG arcdeg;
93 Length operator *(double arcdeg, LENGTH_ARCDEG &unit);
96 extern LENGTH_PIXEL pixel;
97 Length operator *(double arcdeg, LENGTH_PIXEL &unit);
103 extern ANGLE_DEGREE degree;
104 Angle operator *(double degrees, ANGLE_DEGREE &unit);
107 extern ANGLE_RADIAN radian;
108 Angle operator *(double radian, ANGLE_RADIAN &unit);
112 static const double PERIOD;
113 static const double HALF_PERIOD;
114 static const double SCALE_TO_DEGREE;
116 Angle(double decadegrees, int dummy);
121 Angle(const double degrees);
122 Angle(const double degrees, ANGLE_DEGREE &unit);
123 Angle(const double radians, ANGLE_RADIAN &unit);
124 Angle(const Angle &init);
125 operator double() const;
126 Angle operator =(const double val);
127 Angle operator +(Angle rhs) const;
128 Angle operator -(Angle rhs) const;
129 Angle & operator +=(Angle rhs);
130 Angle & operator -=(Angle rhs);
132 double at_degree() const;
133 double at_radian() const;
137 void set_as_degree(double degrees);
138 void set_as_decadegree(double decadegree);
139 void set_as_radian(double radians);
143 } /* <- namespace Psycholops */