From 67f2a90dda081ce519ac82b60ee5b8f5477d8ab0 Mon Sep 17 00:00:00 2001
From: Michael Kuron <mkuron@icp.uni-stuttgart.de>
Date: Thu, 27 Jul 2017 16:18:12 +0200
Subject: [PATCH] Add user ID to sphere VTK output

---
 src/pe/vtk/SphereVtkOutput.cpp | 1 +
 src/pe/vtk/SphereVtkOutput.h   | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/src/pe/vtk/SphereVtkOutput.cpp b/src/pe/vtk/SphereVtkOutput.cpp
index a0f6045fa..90672a0f6 100644
--- a/src/pe/vtk/SphereVtkOutput.cpp
+++ b/src/pe/vtk/SphereVtkOutput.cpp
@@ -41,6 +41,7 @@ std::vector< SphereVtkOutput::Attributes > SphereVtkOutput::getAttributes() cons
    attributes.push_back( Attributes( vtk::typeToString< float >(), "orientation", uint_c(3) ) );
    attributes.push_back( Attributes( vtk::typeToString< int >(),   "rank", uint_c(1) ) );
    attributes.push_back( Attributes( vtk::typeToString< id_t >(),   "id", uint_c(1) ) );
+   attributes.push_back( Attributes( vtk::typeToString< id_t >(),  "uid", uint_c(1) ) );
 
    return attributes;
 }
diff --git a/src/pe/vtk/SphereVtkOutput.h b/src/pe/vtk/SphereVtkOutput.h
index 756a2273e..238c1fa8e 100644
--- a/src/pe/vtk/SphereVtkOutput.h
+++ b/src/pe/vtk/SphereVtkOutput.h
@@ -90,6 +90,9 @@ void SphereVtkOutput::push( std::ostream& os, const uint_t data, const uint_t po
    case 5:
       vtk::toStream( os, numeric_cast< id_t >(bodies_.at( point )->getTopSuperBody()->getSystemID()) );
       break;
+   case 6:
+      vtk::toStream( os, numeric_cast< id_t >(bodies_.at( point )->getTopSuperBody()->getID()) );
+      break;
    }
 
 }
@@ -121,6 +124,9 @@ void SphereVtkOutput::push( vtk::Base64Writer& b64, const uint_t data, const uin
    case 5:
       b64 << numeric_cast< id_t >(bodies_.at( point )->getTopSuperBody()->getSystemID());
       break;
+   case 6:
+      b64 << numeric_cast< id_t >(bodies_.at( point )->getTopSuperBody()->getID());
+      break;
    }
 }
 
-- 
GitLab