include/rays/point.h in rays-0.1.7 vs include/rays/point.h in rays-0.1.8
- old
+ new
@@ -9,41 +9,67 @@
namespace Rays
{
- struct Point
+ struct Coord2
{
union
{
+ struct {coord x, y;};
+ coord array[2];
+ };
+
+ Coord2& reset (coord value = 0);
+
+ Coord2& reset (coord x, coord y);
+
+ coord& operator [] (size_t index);
+
+ const coord& operator [] (size_t index) const;
+
+ };// Coord2
+
+
+ struct Coord3
+ {
+
+ union
+ {
struct {coord x, y, z;};
coord array[3];
};
+ Coord3& reset (coord value = 0);
+
+ Coord3& reset (coord x, coord y, coord z = 0);
+
+ coord& operator [] (size_t index);
+
+ const coord& operator [] (size_t index) const;
+
+ };// Coord3
+
+
+ struct Point : public Coord3
+ {
+
Point (coord value = 0);
Point (coord x, coord y, coord z = 0);
Point dup () const;
- Point& reset (coord value = 0);
-
- Point& reset (coord x, coord y, coord z = 0);
-
Point& move_to (coord x, coord y, coord z = 0);
Point& move_to (const Point& point);
Point& move_by (coord x, coord y, coord z = 0);
Point& move_by (const Point& point);
String inspect () const;
-
- coord& operator [] (size_t index);
-
- const coord& operator [] (size_t index) const;
Point operator - () const;
Point& operator += (const Point& rhs);