5 #ifndef _SPICA_POINT3D_H_
6 #define _SPICA_POINT3D_H_
12 #include "core/vector3d.h"
20 Point3_(T x, T y, T z);
21 Point3_(
const Point3_<T>& p);
22 explicit Point3_(
const Vector3_<T>& v);
26 static Point3_<T> binary_op(
const Point3_<T>& p1,
const Point3_<T>& p2,
const Fn& f);
28 static Point3_<T> maximum(
const Point3_<T>& p1,
const Point3_<T>& p2);
29 static Point3_<T> minimum(
const Point3_<T>& p1,
const Point3_<T>& p2);
31 Point3_<T>& operator=(
const Point3_<T>& p);
32 Point3_<T>& operator+=(
const Point3_<T>& p);
33 Point3_<T>& operator*=(T s);
34 Point3_<T>& operator/=(T s);
35 bool operator==(
const Point3_<T>& p)
const;
36 bool operator!=(
const Point3_<T>& p)
const;
37 T operator[](
int i)
const;
38 operator Vector3_<T>()
const;
40 inline T x()
const {
return x_; }
41 inline T y()
const {
return y_; }
42 inline T z()
const {
return z_; }
44 std::string toString()
const;
51 static_assert(std::is_arithmetic<T>::value,
"Template type must be arithmetic!!");
54 using Point3i = Point3_<int>;
55 using Point3f = Point3_<float>;
56 using Point3d = Point3_<double>;
61 std::ostream& operator<<(std::ostream& os, const spica::Point3_<T>& p);
84 #include "point3d_detail.h"
86 #endif // _SPICA_POINT3D_H_
Three-dimensional vector.
Definition: core.hpp:56