From dc2479eba1ec7a4d069e766394d84f6ac772f949 Mon Sep 17 00:00:00 2001 From: "Dmitry Yu. Naumov" <github@naumov.de> Date: Tue, 23 Jun 2015 19:32:00 +0000 Subject: [PATCH] [MeL] Add Node ctor from std::array of 3 doubles. --- MeshLib/Node.cpp | 5 +++++ MeshLib/Node.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/MeshLib/Node.cpp b/MeshLib/Node.cpp index adb3da1fd08..ece3d311e82 100644 --- a/MeshLib/Node.cpp +++ b/MeshLib/Node.cpp @@ -22,6 +22,11 @@ Node::Node(const double coords[3], std::size_t id) { } +Node::Node(std::array<double, 3> const& coords, std::size_t id) + : MathLib::Point3dWithID(coords, id) +{ +} + Node::Node(double x, double y, double z, std::size_t id) : MathLib::Point3dWithID(std::array<double,3>({{x, y, z}}), id) { diff --git a/MeshLib/Node.h b/MeshLib/Node.h index c599cdf3932..cbf789f62e2 100644 --- a/MeshLib/Node.h +++ b/MeshLib/Node.h @@ -49,6 +49,9 @@ public: /// Constructor using a coordinate array Node(const double coords[3], std::size_t id = std::numeric_limits<std::size_t>::max()); + /// Constructor using a coordinate array + Node(std::array<double, 3> const& coords, std::size_t id = std::numeric_limits<std::size_t>::max()); + /// Constructor using single coordinates Node(double x, double y, double z, std::size_t id = std::numeric_limits<std::size_t>::max()); -- GitLab