From bca51e441f967698b835ec18fbc0a0b2a15c3d2c Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Mon, 26 Aug 2019 13:35:40 +0200
Subject: [PATCH] [ParL] Add SpatialPos ctor same as setAll().

Simplifies creation of SpatialPosition object with
multiple parts of it set simultaniously.
---
 ParameterLib/SpatialPosition.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/ParameterLib/SpatialPosition.h b/ParameterLib/SpatialPosition.h
index e1d98fea266..1cc1e7043fe 100644
--- a/ParameterLib/SpatialPosition.h
+++ b/ParameterLib/SpatialPosition.h
@@ -24,6 +24,20 @@ namespace ParameterLib
 class SpatialPosition
 {
 public:
+    SpatialPosition() = default;
+
+    SpatialPosition(
+        boost::optional<std::size_t> const& node_id,
+        boost::optional<std::size_t> const& element_id,
+        boost::optional<unsigned> const& integration_point,
+        boost::optional<MathLib::TemplatePoint<double, 3>> const& coordinates)
+        : _node_id(node_id),
+          _element_id(element_id),
+          _integration_point(integration_point),
+          _coordinates(coordinates)
+    {
+    }
+
     boost::optional<std::size_t> getNodeID() const { return _node_id; }
     boost::optional<std::size_t> getElementID() const { return _element_id; }
     boost::optional<unsigned> getIntegrationPoint() const
-- 
GitLab