Skip to content
Snippets Groups Projects
Commit 81b26829 authored by Timothée Couble's avatar Timothée Couble
Browse files

Add the substract and multiply operations to vtkVector

parent b8817fd3
No related branches found
No related tags found
No related merge requests found
......@@ -115,6 +115,36 @@ public:
}
///@}
///@{
/**
* Substraction operation of this and the supplied vector.
*/
vtkVector<T, Size> operator-(const vtkVector<T, Size>& other) const
{
vtkVector<T, Size> result(*this);
for (int i = 0; i < Size; ++i)
{
result[i] = this->Data[i] - other[i];
}
return result;
}
///@}
///@{
/**
* Multiply this vector by a scalar value.
*/
vtkVector<T, Size> operator*(const T& other) const
{
vtkVector<T, Size> result(*this);
for (int i = 0; i < Size; ++i)
{
result[i] = this->Data[i] * other;
}
return result;
}
///@}
///@{
/**
* Cast the vector to the specified type, returning the result.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment