X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FNCollection%2FNCollection_Vec2.hxx;h=f54cae29def746e1b17c20c7ec60c821554888de;hb=f9b30c0db34c00de8b7a3d0724f3b46e23dfd590;hpb=a5278fc126a36055aa61c4fa3a5ee7331a1801ab diff --git a/src/NCollection/NCollection_Vec2.hxx b/src/NCollection/NCollection_Vec2.hxx index c1ebb0509a..f54cae29de 100644 --- a/src/NCollection/NCollection_Vec2.hxx +++ b/src/NCollection/NCollection_Vec2.hxx @@ -57,6 +57,18 @@ public: v[1] = theY; } + //! Conversion constructor (explicitly converts some 2-component vector with other element type + //! to a new 2-component vector with the element type Element_t, + //! whose elements are static_cast'ed corresponding elements of theOtherVec2 vector) + //! @tparam OtherElement_t the element type of the other 2-component vector theOtherVec2 + //! @param theOtherVec2 the 2-component vector that needs to be converted + template + explicit NCollection_Vec2 (const NCollection_Vec2& theOtherVec2) + { + v[0] = static_cast (theOtherVec2[0]); + v[1] = static_cast (theOtherVec2[1]); + } + //! Assign new values to the vector. void SetValues (const Element_t theX, const Element_t theY)