// -*- c++ -*- #pragma once #ifndef __RAYS_POINT_H__ #define __RAYS_POINT_H__ #include namespace Rays { struct Point { union { struct {coord x, y, z;}; coord array[3]; }; 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); Point& operator -= (const Point& rhs); Point& operator *= (const Point& rhs); Point& operator /= (const Point& rhs); Point& operator /= (coord rhs); friend bool operator == (const Point& lhs, const Point& rhs); friend bool operator != (const Point& lhs, const Point& rhs); friend Point operator + (const Point& lhs, const Point& rhs); friend Point operator - (const Point& lhs, const Point& rhs); friend Point operator * (const Point& lhs, const Point& rhs); friend Point operator / (const Point& lhs, const Point& rhs); friend Point operator / (const Point& lhs, coord rhs); };// Point }// Rays #endif//EOH