66VTK_ABI_NAMESPACE_BEGIN
 
   67template <
typename T, 
int Size>
 
   98    for (
int i = 0; i < Size; ++i)
 
  100      result += this->
Data[i] * this->
Data[i];
 
  118    const double norm(this->
Norm());
 
  123    const double inv(1.0 / norm);
 
  124    for (
int i = 0; i < Size; ++i)
 
  126      this->
Data[i] = 
static_cast<T
>(this->
Data[i] * inv);
 
  152    for (
int i = 0; i < Size; ++i)
 
  154      result += this->
Data[i] * other[i];
 
  164  template <
typename TR>
 
  168    for (
int i = 0; i < Size; ++i)
 
  170      result[i] = 
static_cast<TR
>(this->
Data[i]);
 
  205  void Set(
const T& x, 
const T& y)
 
  272  void Set(
const T& x, 
const T& y, 
const T& z)
 
  330    return (this->
Data[0] < v.
Data[0]) ||
 
  332      (this->
Data[0] == v.
Data[0] && this->Data[1] == v.
Data[1] && this->Data[2] < v.
Data[2]);
 
  367  void Set(
const T& x, 
const T& y, 
const T& z, 
const T& w)
 
  420#define vtkVectorNormalized(vectorType, type, size)                                                \ 
  421  vectorType Normalized() const                                                                    \ 
  423    return vectorType(vtkVector<type, size>::Normalized().GetData());                              \ 
  426#define vtkVectorDerivedMacro(vectorType, type, size)                                              \ 
  427  vtkVectorNormalized(vectorType, type, size);                                                     \ 
  428  explicit vectorType(type s)                                                                      \ 
  432  explicit vectorType(const type* i)                                                               \ 
  436  explicit vectorType(const vtkTuple<type, size>& o)                                               \ 
  437    : Superclass(o.GetData())                                                                      \ 
  440  vectorType(const vtkVector<type, size>& o)                                                       \ 
  441    : Superclass(o.GetData())                                                                      \ 
  486#define vtkVector3Cross(vectorType, type)                                                          \ 
  487  vectorType Cross(const vectorType& other) const                                                  \ 
  489    return vectorType(vtkVector3<type>::Cross(other).GetData());                                   \ 
  563template <
typename A, 
int Size>
 
  567  for (
int i = 0; i < Size; ++i)
 
  577template <
typename A, 
int Size>
 
  581  for (
int i = 0; i < Size; ++i)
 
  583    ret[i] = v1[i] + v2[i];
 
  591template <
typename T, 
int Size>
 
  594  for (
int dim = 0; dim < Size; ++dim)
 
  605template <
typename T, 
int Size, 
typename Scalar>
 
  608  for (
int dim = 0; dim < Size; ++dim)
 
  619template <
typename A, 
int Size>
 
  623  for (
int i = 0; i < Size; ++i)
 
  625    ret[i] = v1[i] - v2[i];
 
  633template <
typename T, 
int Size>
 
  636  for (
int dim = 0; dim < Size; ++dim)
 
  647template <
typename A, 
int Size>
 
  651  for (
int i = 0; i < Size; ++i)
 
  653    ret[i] = v1[i] * v2[i];
 
  661template <
typename A, 
typename B, 
int Size>
 
  665  for (
int i = 0; i < Size; ++i)
 
  667    ret[i] = v1[i] * scalar;
 
  675template <
typename A, 
int Size>
 
  679  for (
int i = 0; i < Size; ++i)
 
  681    ret[i] = v1[i] / v2[i];
 
  693#define vtkVectorOperatorNegate(vectorType, type, size)                                            \ 
  694  inline vectorType operator-(const vectorType& v)                                                 \ 
  696    return vectorType((-static_cast<vtkVector<type, size>>(v)).GetData());                         \ 
  698#define vtkVectorOperatorPlus(vectorType, type, size)                                              \ 
  699  inline vectorType operator+(const vectorType& v1, const vectorType& v2)                          \ 
  702      (static_cast<vtkVector<type, size>>(v1) + static_cast<vtkVector<type, size>>(v2))            \ 
  705#define vtkVectorOperatorMinus(vectorType, type, size)                                             \ 
  706  inline vectorType operator-(const vectorType& v1, const vectorType& v2)                          \ 
  709      (static_cast<vtkVector<type, size>>(v1) - static_cast<vtkVector<type, size>>(v2))            \ 
  712#define vtkVectorOperatorMultiply(vectorType, type, size)                                          \ 
  713  inline vectorType operator*(const vectorType& v1, const vectorType& v2)                          \ 
  716      (static_cast<vtkVector<type, size>>(v1) * static_cast<vtkVector<type, size>>(v2))            \ 
  719#define vtkVectorOperatorMultiplyScalar(vectorType, type, size)                                    \ 
  720  template <typename B>                                                                            \ 
  721  inline vectorType operator*(const vectorType& v1, const B& scalar)                               \ 
  723    return vectorType((static_cast<vtkVector<type, size>>(v1) * scalar).GetData());                \ 
  725#define vtkVectorOperatorMultiplyScalarPre(vectorType, type, size)                                 \ 
  726  template <typename B>                                                                            \ 
  727  inline vectorType operator*(const B& scalar, const vectorType& v1)                               \ 
  729    return vectorType((static_cast<vtkVector<type, size>>(v1) * scalar).GetData());                \ 
  731#define vtkVectorOperatorDivide(vectorType, type, size)                                            \ 
  732  inline vectorType operator/(const vectorType& v1, const vectorType& v2)                          \ 
  735      (static_cast<vtkVector<type, size>>(v1) / static_cast<vtkVector<type, size>>(v2))            \ 
  739#define vtkVectorOperatorMacro(vectorType, type, size)                                             \ 
  740  vtkVectorOperatorNegate(vectorType, type, size);                                                 \ 
  741  vtkVectorOperatorPlus(vectorType, type, size);                                                   \ 
  742  vtkVectorOperatorMinus(vectorType, type, size);                                                  \ 
  743  vtkVectorOperatorMultiply(vectorType, type, size);                                               \ 
  744  vtkVectorOperatorMultiplyScalar(vectorType, type, size);                                         \ 
  745  vtkVectorOperatorMultiplyScalarPre(vectorType, type, size);                                      \ 
  746  vtkVectorOperatorDivide(vectorType, type, size) 
templated base type for containers of constant size.
 
T Data[Size]
The only thing stored in memory!
 
const T & GetX() const
Get the x component of the vector, i.e.
 
const T & GetY() const
Get the y component of the vector, i.e.
 
void Set(const T &x, const T &y)
Set the x and y components of the vector.
 
vtkVector2(const T *init)
 
void SetY(const T &y)
Set the y component of the vector, i.e.
 
vtkVector2(const T &x, const T &y)
 
vtkVector2(const T &scalar)
 
void SetX(const T &x)
Set the x component of the vector, i.e.
 
bool operator<(const vtkVector2< T > &v) const
Lexicographical comparison of two vector.
 
vtkVectorDerivedMacro(vtkVector2d, double, 2)
 
vtkVector2d(double x, double y)
 
vtkVector2< double > Superclass
 
vtkVector2< float > Superclass
 
vtkVector2f(float x, float y)
 
vtkVectorDerivedMacro(vtkVector2f, float, 2)
 
Some derived classes for the different vectors commonly used.
 
vtkVector2i(int x, int y)
 
vtkVector2< int > Superclass
 
vtkVectorDerivedMacro(vtkVector2i, int, 2)
 
void SetZ(const T &z)
Set the z component of the vector, i.e.
 
const T & GetY() const
Get the y component of the vector, i.e.
 
bool operator<(const vtkVector3< T > &v) const
Lexicographical comparison of two vector.
 
vtkVector3(const T *init)
 
const T & GetZ() const
Get the z component of the vector, i.e.
 
void SetX(const T &x)
Set the x component of the vector, i.e.
 
vtkVector3(const T &scalar)
 
void Set(const T &x, const T &y, const T &z)
Set the x, y and z components of the vector.
 
vtkVector3(const T &x, const T &y, const T &z)
 
vtkVector3< T > Cross(const vtkVector3< T > &other) const
Return the cross product of this X other.
 
const T & GetX() const
Get the x component of the vector, i.e.
 
void SetY(const T &y)
Set the y component of the vector, i.e.
 
vtkVector3Cross(vtkVector3d, double)
 
vtkVector3< double > Superclass
 
vtkVector3d(double x, double y, double z)
 
vtkVectorDerivedMacro(vtkVector3d, double, 3)
 
vtkVector3Cross(vtkVector3f, float)
 
vtkVectorDerivedMacro(vtkVector3f, float, 3)
 
vtkVector3f(float x, float y, float z)
 
vtkVector3< float > Superclass
 
vtkVector3Cross(vtkVector3i, int)
 
vtkVectorDerivedMacro(vtkVector3i, int, 3)
 
vtkVector3< int > Superclass
 
vtkVector3i(int x, int y, int z)
 
void SetY(const T &y)
Set the y component of the vector, i.e.
 
vtkVector4(const T &x, const T &y, const T &z, const T &w)
 
void SetZ(const T &z)
Set the z component of the vector, i.e.
 
const T & GetZ() const
Get the z component of the vector, i.e.
 
void SetW(const T &w)
Set the w component of the vector, i.e.
 
vtkVector4(const T *init)
 
void Set(const T &x, const T &y, const T &z, const T &w)
Set the x, y, z and w components of a 3D vector in homogeneous coordinates.
 
const T & GetY() const
Get the y component of the vector, i.e.
 
void SetX(const T &x)
Set the x component of the vector, i.e.
 
vtkVector4(const T &scalar)
 
const T & GetX() const
Get the x component of the vector, i.e.
 
const T & GetW() const
Get the w component of the vector, i.e.
 
vtkVectorDerivedMacro(vtkVector4d, double, 4)
 
vtkVector4d(double x, double y, double z, double w)
 
vtkVector4< int > Superclass
 
vtkVector4i(int x, int y, int z, int w)
 
vtkVectorDerivedMacro(vtkVector4i, int, 4)
 
templated base type for storage of vectors.
 
vtkVector(const T &scalar)
Initialize all of the vector's elements with the supplied scalar.
 
T Dot(const vtkVector< T, Size > &other) const
The dot product of this and the supplied vector.
 
double Normalize()
Normalize the vector in place.
 
vtkVector(const T *init)
Initialize the vector's elements with the elements of the supplied array.
 
vtkVector< TR, Size > Cast() const
Cast the vector to the specified type, returning the result.
 
double Norm() const
Get the norm of the vector, i.e.
 
vtkVector< T, Size > Normalized() const
Return the normalized form of this vector.
 
T SquaredNorm() const
Get the squared norm of the vector.
 
#define vtkVectorOperatorMacro(vectorType, type, size)
 
vtkVector< A, Size > operator/(const vtkVector< A, Size > &v1, const vtkVector< A, Size > &v2)
Performs division of vectors of the same type.
 
vtkVector< A, Size > operator+(const vtkVector< A, Size > &v1, const vtkVector< A, Size > &v2)
Performs addition of vectors of the same basic type.
 
vtkVector< T, Size > & operator-=(vtkVector< T, Size > &a, const vtkVector< T, Size > &b)
Subtract the vector b to the vector a of the same basic type.
 
vtkVector< A, Size > operator*(const vtkVector< A, Size > &v1, const vtkVector< A, Size > &v2)
Performs multiplication of vectors of the same basic type.
 
vtkVector< A, Size > operator-(const vtkVector< A, Size > &v)
This following operators enhance the vtkVector classes, allowing various operator overloads one might...
 
vtkVector< T, Size > & operator+=(vtkVector< T, Size > &a, const vtkVector< T, Size > &b)
Add the vector b to the vector a of the same basic type.
 
vtkVector< T, Size > & operator*=(vtkVector< T, Size > &a, Scalar f)
Multiply a vector a by a scalar.