From 2353817e4d81e677fcfb88d017448b83d5d7a065 Mon Sep 17 00:00:00 2001
From: Johannes Junggeburth <johannes.josef.junggeburth@cern.ch>
Date: Thu, 9 Jan 2025 12:04:10 +0100
Subject: [PATCH] GeoTranslate3D add constructor from Vector3D

(cherry picked from commit 1b09afbe711cecf9a37fa962ada5200e88e68f0c)

Co-authored-by: Johannes Josef Junggeburth <johannes.josef.junggeburth@cern.ch>
---
 GeoModelCore/GeoModelHelpers/src/cloneVolume.cxx           | 5 +----
 .../GeoModelKernel/GeoModelKernel/GeoDefinitions.h         | 7 +++++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/GeoModelCore/GeoModelHelpers/src/cloneVolume.cxx b/GeoModelCore/GeoModelHelpers/src/cloneVolume.cxx
index 63f625ae5..6177229d4 100644
--- a/GeoModelCore/GeoModelHelpers/src/cloneVolume.cxx
+++ b/GeoModelCore/GeoModelHelpers/src/cloneVolume.cxx
@@ -7,8 +7,7 @@
 #include "GeoModelKernel/GeoFullPhysVol.h"
 #include "GeoModelKernel/GeoPhysVol.h"
 
-PVLink cloneVolume(const PVLink& volume, 
-                   bool allowShared) {
+PVLink cloneVolume(const PVLink& volume, bool allowShared) {
     PVLink newVolume{volume};
     if (!allowShared || hasFullPhysVolInTree(volume)) {
         if (typeid(*volume) == typeid(GeoPhysVol)) {
@@ -27,8 +26,6 @@ PVLink cloneVolume(const PVLink& volume,
             newVolume->add(const_cast<GeoGraphNode*>(node));
           }
         }
-        
     }
     return newVolume;
-    
 }
diff --git a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoDefinitions.h b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoDefinitions.h
index d1861a649..efe8538f8 100644
--- a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoDefinitions.h
+++ b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoDefinitions.h
@@ -70,9 +70,12 @@ namespace GeoTrf {
 
   class Translate3D : public Transform3D {
   public:
+    
+    Translate3D(const GeoTrf::Vector3D& v):
+      Translate3D{v.x(),v.y(),v.z()}{}
+
     Translate3D(double x, double y, double z)
-      : Transform3D(Translation3D(x,y,z))
-      {}
+      : Transform3D(Translation3D(x,y,z)){}
     virtual ~Translate3D() = default;
   };
 
-- 
GitLab