From 41e28cf47db0588fcd396f776b4fd0c19d56ccb1 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Mon, 19 Feb 2018 12:12:55 +0100
Subject: [PATCH] [MeL] Move private method implementation into cpp.

---
 MeshLib/Vtk/VtkMappedMeshSource.cpp | 30 ++++++++++++++++++++++++++++
 MeshLib/Vtk/VtkMappedMeshSource.h   | 31 +----------------------------
 2 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/MeshLib/Vtk/VtkMappedMeshSource.cpp b/MeshLib/Vtk/VtkMappedMeshSource.cpp
index 7764c261aa9..6f390619694 100644
--- a/MeshLib/Vtk/VtkMappedMeshSource.cpp
+++ b/MeshLib/Vtk/VtkMappedMeshSource.cpp
@@ -163,4 +163,34 @@ int VtkMappedMeshSource::RequestInformation(vtkInformation*,
     return 1;
 }
 
+template <typename T>
+bool VtkMappedMeshSource::addProperty(MeshLib::Properties const& properties,
+                                      std::string const& prop_name) const
+{
+    if (!properties.existsPropertyVector<T>(prop_name))
+        return false;
+    // TODO: Hack removing const
+    auto* propertyVector = const_cast<MeshLib::PropertyVector<T>*>(
+        properties.getPropertyVector<T>(prop_name));
+    if (!propertyVector)
+        return false;
+
+    vtkNew<vtkAOSDataArrayTemplate<T>> dataArray;
+    const bool hasArrayOwnership = false;
+    dataArray->SetArray(propertyVector->data(),
+                        static_cast<vtkIdType>(propertyVector->size()),
+                        static_cast<int>(!hasArrayOwnership));
+    dataArray->SetNumberOfComponents(propertyVector->getNumberOfComponents());
+    dataArray->SetName(prop_name.c_str());
+
+    if (propertyVector->getMeshItemType() == MeshLib::MeshItemType::Node)
+        this->PointData->AddArray(dataArray.GetPointer());
+    else if (propertyVector->getMeshItemType() == MeshLib::MeshItemType::Cell)
+        this->CellData->AddArray(dataArray.GetPointer());
+    else if (propertyVector->getMeshItemType() ==
+             MeshLib::MeshItemType::IntegrationPoint)
+        this->FieldData->AddArray(dataArray.GetPointer());
+
+    return true;
+}
 }  // Namespace MeshLib
diff --git a/MeshLib/Vtk/VtkMappedMeshSource.h b/MeshLib/Vtk/VtkMappedMeshSource.h
index 587d4acaa5d..ad0bf10889c 100644
--- a/MeshLib/Vtk/VtkMappedMeshSource.h
+++ b/MeshLib/Vtk/VtkMappedMeshSource.h
@@ -79,36 +79,7 @@ private:
     /// \param prop_name The name of the property vector to be mapped
     template <typename T>
     bool addProperty(MeshLib::Properties const& properties,
-                     std::string const& prop_name) const
-    {
-        if (!properties.existsPropertyVector<T>(prop_name))
-            return false;
-        // TODO: Hack removing const
-        auto* propertyVector = const_cast<MeshLib::PropertyVector<T>*>(
-            properties.getPropertyVector<T>(prop_name));
-        if (!propertyVector)
-            return false;
-
-        vtkNew<vtkAOSDataArrayTemplate<T>> dataArray;
-        const bool hasArrayOwnership = false;
-        dataArray->SetArray(propertyVector->data(),
-                            static_cast<vtkIdType>(propertyVector->size()),
-                            static_cast<int>(!hasArrayOwnership));
-        dataArray->SetNumberOfComponents(
-            propertyVector->getNumberOfComponents());
-        dataArray->SetName(prop_name.c_str());
-
-        if (propertyVector->getMeshItemType() == MeshLib::MeshItemType::Node)
-            this->PointData->AddArray(dataArray.GetPointer());
-        else if (propertyVector->getMeshItemType() ==
-                 MeshLib::MeshItemType::Cell)
-            this->CellData->AddArray(dataArray.GetPointer());
-        else if (propertyVector->getMeshItemType() ==
-                 MeshLib::MeshItemType::IntegrationPoint)
-            this->FieldData->AddArray(dataArray.GetPointer());
-
-        return true;
-    }
+                     std::string const& prop_name) const;
 
     const MeshLib::Mesh* _mesh;
 
-- 
GitLab