5 #ifndef _SPICA_NORMAL3D_H_
6 #define _SPICA_NORMAL3D_H_
11 #include "core/vect_math.h"
20 Normal3_(T x, T y, T z);
21 explicit Normal3_(
const Vector3_<T>& v);
22 Normal3_(
const Normal3_<T>& n);
25 Normal3_<T>& operator=(
const Normal3_<T>& n);
26 bool operator==(
const Normal3_<T>& n)
const;
27 bool operator!=(
const Normal3_<T>& n)
const;
28 Normal3_<T> operator-()
const;
29 Normal3_<T> operator+=(
const Normal3_<T>& n);
30 Normal3_<T> operator-=(
const Normal3_<T>& n);
31 Normal3_<T> operator*=(T s);
32 Normal3_<T> operator/=(T s);
33 T operator[](
int i)
const;
34 explicit operator Vector3_<T>()
const;
36 inline T x()
const {
return x_; }
37 inline T y()
const {
return y_; }
38 inline T z()
const {
return z_; }
41 double squaredNorm()
const;
42 Normal3_<T> normalized()
const;
44 std::string toString()
const;
52 static_assert(std::is_arithmetic<T>::value,
53 "Template type must be arithmetic!!");
56 using Normal3f = Normal3_<float>;
57 using Normal3d = Normal3_<double>;
62 std::ostream& operator<<(std::ostream& os, const spica::Normal3_<T>& n);
80 #include "normal3d_detail.h"
82 #endif // _SPICA_NORMAL3D_H_