Commit 7251a4bb authored by Yohann Bearzi's avatar Yohann Bearzi
Browse files

Added templated version of vtkMath::Assign

parent 5456c32a
Pipeline #226523 waiting for manual action with stages
......@@ -310,15 +310,22 @@ public:
static double Gaussian(double mean, double std);
/**
* Assign values to a 3-vector (double version). Result is stored in b according to b = a.
* Assign values to a 3-vector (templated version). Result is stored in b according to b = a.
* Each parameter must implement operator[].
*/
static void Assign(const double a[3], double b[3])
template <class VectorT1, class VectorT2>
static void Assign(const VectorT1& a, VectorT2&& b)
{
b[0] = a[0];
b[1] = a[1];
b[2] = a[2];
}
/**
* Assign values to a 3-vector (double version). Result is stored in b according to b = a.
*/
static void Assign(const double a[3], double b[3]) { vtkMath::Assign<>(a, b); }
/**
* Addition of two 3-vectors (float version). Result is stored in c according to c = a + b.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment