From f41bf49c08a34f54f2c453ed5b9f57ad42b553d7 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Fri, 17 Jul 2026 16:12:56 +0200 Subject: [PATCH 01/12] [Tutorials] Disable all g3d tutorials when geom is off. --- tutorials/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 6897acce3dbd0..ffb3ac9fc6bb4 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -171,7 +171,7 @@ if(NOT experimental_genvectorx) endif() if(NOT geom) - set(geom_veto visualisation/geom/*.C geom/*.C visualisation/geom/gdml/*.C legacy/g3d/shapes.* legacy/g3d/na49view.*) + set(geom_veto visualisation/geom/*.C geom/*.C visualisation/geom/gdml/*.C legacy/g3d/*) endif() if(NOT spectrum) From 031310e98f0c358500c11a57cdd197ad10b8bf78 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Fri, 17 Jul 2026 16:58:50 +0200 Subject: [PATCH 02/12] [roottest] Disable treeformula/casting test when geom is off. --- roottest/root/treeformula/casting/CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/roottest/root/treeformula/casting/CMakeLists.txt b/roottest/root/treeformula/casting/CMakeLists.txt index 7d22c14372299..91cda4848ba95 100644 --- a/roottest/root/treeformula/casting/CMakeLists.txt +++ b/roottest/root/treeformula/casting/CMakeLists.txt @@ -6,8 +6,10 @@ ROOTTEST_ADD_TEST(write ROOTTEST_COMPILE_MACRO(Simple.cxx FIXTURES_SETUP root-treeformula-casting-Simple-fixture) -ROOTTEST_ADD_TEST(run - MACRO Run.C - OUTREF Simple.ref - FIXTURES_REQUIRED root-treeformula-casting-write-fixture - root-treeformula-casting-Simple-fixture) +if(geom) + ROOTTEST_ADD_TEST(run + MACRO Run.C + OUTREF Simple.ref + FIXTURES_REQUIRED root-treeformula-casting-write-fixture + root-treeformula-casting-Simple-fixture) +endif() \ No newline at end of file From 11a060dbcfbe8b1f755e25c9658dea370c49b57c Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Fri, 17 Jul 2026 15:59:25 +0200 Subject: [PATCH 03/12] [graf3d] Reduce includes in graf3d headers. --- graf3d/g3d/inc/TNode.h | 6 +++--- graf3d/g3d/inc/TShape.h | 2 +- graf3d/g3d/src/TGeometry.cxx | 13 ++++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/graf3d/g3d/inc/TNode.h b/graf3d/g3d/inc/TNode.h index 23791bd84d530..c0906e088fc08 100644 --- a/graf3d/g3d/inc/TNode.h +++ b/graf3d/g3d/inc/TNode.h @@ -21,14 +21,14 @@ #ifndef ROOT_TNode #define ROOT_TNode -#include "TShape.h" #include "TAttLine.h" #include "TAttFill.h" #include "TAtt3D.h" - -#include "TRotMatrix.h" +#include "TNamed.h" class TBrowser; +class TShape; +class TRotMatrix; class TNode : public TNamed , public TAttLine, public TAttFill, public TAtt3D { diff --git a/graf3d/g3d/inc/TShape.h b/graf3d/g3d/inc/TShape.h index 12e92e42e536c..9a7cfa3e1adc8 100644 --- a/graf3d/g3d/inc/TShape.h +++ b/graf3d/g3d/inc/TShape.h @@ -23,13 +23,13 @@ ////////////////////////////////////////////////////////////////////////// #include "TNamed.h" -#include "TMaterial.h" #include "TAttLine.h" #include "TAttFill.h" #include "TAtt3D.h" #include "X3DBuffer.h" class TBuffer3D; +class TMaterial; class TNode; class TShape : public TNamed, public TAttLine, public TAttFill, public TAtt3D { diff --git a/graf3d/g3d/src/TGeometry.cxx b/graf3d/g3d/src/TGeometry.cxx index b77ace7d0adf8..3cfc0cca42d7d 100644 --- a/graf3d/g3d/src/TGeometry.cxx +++ b/graf3d/g3d/src/TGeometry.cxx @@ -9,14 +9,17 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ -#include "TROOT.h" -#include "TBuffer.h" -#include "THashList.h" -#include "TObjArray.h" #include "TGeometry.h" -#include "TNode.h" #include "TMaterial.h" +#include "TNode.h" +#include "TRotMatrix.h" +#include "TShape.h" + #include "TBrowser.h" +#include "TBuffer.h" +#include "THashList.h" +#include "TObjArray.h" +#include "TROOT.h" TGeometry *gGeometry = nullptr; From 0e6c48a7e312fdfa5088269dbb24e5a84393a924 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Fri, 17 Jul 2026 15:52:50 +0200 Subject: [PATCH 04/12] Reduce dependencies to graf3d. - Splot depended on graf3d, but it didn't use any of its classes. - Montecarlo was including graf3d headers. It is sufficient to include in the .cxx, though. --- math/splot/CMakeLists.txt | 1 - montecarlo/eg/inc/TPrimary.h | 4 ++-- montecarlo/eg/src/TPrimary.cxx | 11 ++++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/math/splot/CMakeLists.txt b/math/splot/CMakeLists.txt index 3906f2f7c8770..a01af591d7b65 100644 --- a/math/splot/CMakeLists.txt +++ b/math/splot/CMakeLists.txt @@ -18,7 +18,6 @@ ROOT_STANDARD_LIBRARY_PACKAGE(SPlot Hist Tree TreePlayer - Graf3d Graf MathCore ) diff --git a/montecarlo/eg/inc/TPrimary.h b/montecarlo/eg/inc/TPrimary.h index f3b0cf86ca7c1..c48f13d0eba74 100644 --- a/montecarlo/eg/inc/TPrimary.h +++ b/montecarlo/eg/inc/TPrimary.h @@ -21,10 +21,10 @@ #ifndef ROOT_TPrimary #define ROOT_TPrimary -#include "TNamed.h" +#include "TObject.h" #include "TAttLine.h" #include "TAtt3D.h" -#include "X3DBuffer.h" +#include "TString.h" class TAttParticle; diff --git a/montecarlo/eg/src/TPrimary.cxx b/montecarlo/eg/src/TPrimary.cxx index 662a0c80d10d7..25991c16836b5 100644 --- a/montecarlo/eg/src/TPrimary.cxx +++ b/montecarlo/eg/src/TPrimary.cxx @@ -17,15 +17,16 @@ Old version of a dynamic particle class created by event generators. This class is now obsolete. Use TParticle instead. */ -#include "TObject.h" +#include "TPrimary.h" + #include "Rtypes.h" -#include "TString.h" #include "TAttParticle.h" -#include "TPrimary.h" -#include "TView.h" #include "TMath.h" -#include "TVirtualPad.h" #include "TPolyLine3D.h" +#include "TString.h" +#include "TView.h" +#include "TVirtualPad.h" +#include "X3DBuffer.h" #include "snprintf.h" From 9ec47606572279e7efe30508e0ec8685c69331e1 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Fri, 17 Jul 2026 16:23:08 +0200 Subject: [PATCH 05/12] [NFC] Organise graf3d CMakeLists. --- graf3d/CMakeLists.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/graf3d/CMakeLists.txt b/graf3d/CMakeLists.txt index 4e3dc90115980..704a524f66eb3 100644 --- a/graf3d/CMakeLists.txt +++ b/graf3d/CMakeLists.txt @@ -4,21 +4,25 @@ # For the licensing terms see $ROOTSYS/LICENSE. # For the list of contributors see $ROOTSYS/README/CREDITS. -add_subdirectory(g3d) # special CMakeLists.txt +add_subdirectory(g3d) + if(NOT WIN32 AND x11) - add_subdirectory(x3d) # special CMakeLists.txt + add_subdirectory(x3d) endif() -add_subdirectory(csg) # special CMakeLists.txt +add_subdirectory(csg) if (opengl) - if(geom) + add_subdirectory(gl) +endif() + +if(geom) + if(opengl) add_subdirectory(eve) add_subdirectory(gviz3d) endif() - add_subdirectory(gl) -endif() -if(webgui AND root7 AND geom) - add_subdirectory(eve7) # special CMakeLists.txt + if(webgui AND root7) + add_subdirectory(eve7) + endif() endif() From 430c5a042aac3338bf756435950e1949dbcce241 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Fri, 17 Jul 2026 19:20:25 +0200 Subject: [PATCH 06/12] [graf3d] Decouple TMarker3D and similar from TGeometry. Markers and lines in Graf3D are coupled to TGeometry, but this coupling can be broken by not including TGeometry. This would only break one single feature, which is that markers and lines transform based on the currently active geometry. This remains supported by declaring a transform function in graf3d/g3d. This transform function can be accessed from TGeometry, eventually allowing for putting TGeometry and all its shapes into a dedicated library. --- graf3d/g3d/CMakeLists.txt | 1 + graf3d/g3d/inc/TGeometryTransformer.h | 19 +++++++++++++++++++ graf3d/g3d/src/TGeometry.cxx | 14 ++++++++++++++ graf3d/g3d/src/TMarker3DBox.cxx | 6 +++--- graf3d/g3d/src/TPolyLine3D.cxx | 6 +++--- graf3d/g3d/src/TPolyMarker3D.cxx | 6 +++--- 6 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 graf3d/g3d/inc/TGeometryTransformer.h diff --git a/graf3d/g3d/CMakeLists.txt b/graf3d/g3d/CMakeLists.txt index 0be29b7b8b03f..970899830d21e 100644 --- a/graf3d/g3d/CMakeLists.txt +++ b/graf3d/g3d/CMakeLists.txt @@ -17,6 +17,7 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Graf3d TCTUB.h TELTU.h TGeometry.h + TGeometryTransformer.h TGTRA.h THelix.h THYPE.h diff --git a/graf3d/g3d/inc/TGeometryTransformer.h b/graf3d/g3d/inc/TGeometryTransformer.h new file mode 100644 index 0000000000000..6139a26aa8d18 --- /dev/null +++ b/graf3d/g3d/inc/TGeometryTransformer.h @@ -0,0 +1,19 @@ +/************************************************************************* + * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ACTIVE_GEOMETRY_TRANSFORM_H +#define ACTIVE_GEOMETRY_TRANSFORM_H + +namespace ROOT::Internal { +/// If a TGeometry has been instantiated, this function transforms points from a local coordinate +/// system to master. To decouple TGeometry from graf3d, this function pointer resides in graf3d, +/// but is written to from TGeometry. +[[maybe_unused]] inline void (*currentTGeometryTransformer)(double *, double *) = nullptr; +} // namespace ROOT::Internal + +#endif \ No newline at end of file diff --git a/graf3d/g3d/src/TGeometry.cxx b/graf3d/g3d/src/TGeometry.cxx index 3cfc0cca42d7d..b64a6bf7113d5 100644 --- a/graf3d/g3d/src/TGeometry.cxx +++ b/graf3d/g3d/src/TGeometry.cxx @@ -14,6 +14,7 @@ #include "TNode.h" #include "TRotMatrix.h" #include "TShape.h" +#include "TGeometryTransformer.h" #include "TBrowser.h" #include "TBuffer.h" @@ -23,6 +24,15 @@ TGeometry *gGeometry = nullptr; +namespace { +// When a TGeometry is active, classes like TPolyline3D and similar transform their points. +// This function executes this transformation, and allowed for moving TGeometry out of graf3d. +void transformLocalToMasterWithCurrentGeometry(double *local, double *master) +{ + assert(gGeometry); + gGeometry->Local2Master(local, master); +} +} // namespace /** \class TGeometry \ingroup g3d @@ -106,6 +116,7 @@ TGeometry::TGeometry() fMatrixPointer = nullptr; fShapePointer = nullptr; gGeometry = this; + ROOT::Internal::currentTGeometryTransformer = &transformLocalToMasterWithCurrentGeometry; fBomb = 1; fMatrix = nullptr; fX=fY=fZ =0.0; @@ -127,6 +138,7 @@ TGeometry::TGeometry(const char *name,const char *title ) : TNamed (name, title) fMatrixPointer = nullptr; fShapePointer = nullptr; gGeometry = this; + ROOT::Internal::currentTGeometryTransformer = &transformLocalToMasterWithCurrentGeometry; fBomb = 1; fMatrix = nullptr; fX=fY=fZ =0.0; @@ -225,6 +237,8 @@ TGeometry::~TGeometry() gGeometry = (TGeometry*) gROOT->GetListOfGeometries()->First(); if (gGeometry == this) gGeometry = (TGeometry*) gROOT->GetListOfGeometries()->After(gGeometry); + if (gGeometry) + ROOT::Internal::currentTGeometryTransformer = nullptr; } gROOT->GetListOfGeometries()->Remove(this); } diff --git a/graf3d/g3d/src/TMarker3DBox.cxx b/graf3d/g3d/src/TMarker3DBox.cxx index 0f2c499294de8..274df133be669 100644 --- a/graf3d/g3d/src/TMarker3DBox.cxx +++ b/graf3d/g3d/src/TMarker3DBox.cxx @@ -19,7 +19,7 @@ #include "TBuffer3D.h" #include "TBuffer3DTypes.h" #include "TVirtualViewer3D.h" -#include "TGeometry.h" +#include "TGeometryTransformer.h" #include "TMath.h" #include @@ -229,14 +229,14 @@ void TMarker3DBox::Paint(Option_t * /* option */ ) SetPoints(buffer.fPnts); // Transform points - if (gGeometry && !buffer.fLocalFrame) { + if (ROOT::Internal::currentTGeometryTransformer && !buffer.fLocalFrame) { Double_t dlocal[3]; Double_t dmaster[3]; for (UInt_t j=0; jLocal2Master(&dlocal[0],&dmaster[0]); + ROOT::Internal::currentTGeometryTransformer(&dlocal[0], &dmaster[0]); buffer.fPnts[3*j] = dmaster[0]; buffer.fPnts[3*j+1] = dmaster[1]; buffer.fPnts[3*j+2] = dmaster[2]; diff --git a/graf3d/g3d/src/TPolyLine3D.cxx b/graf3d/g3d/src/TPolyLine3D.cxx index e09219ca56943..40245b99254d5 100644 --- a/graf3d/g3d/src/TPolyLine3D.cxx +++ b/graf3d/g3d/src/TPolyLine3D.cxx @@ -17,7 +17,7 @@ #include "TVirtualViewer3D.h" #include "TBuffer3D.h" #include "TBuffer3DTypes.h" -#include "TGeometry.h" +#include "TGeometryTransformer.h" #include "TMath.h" #include @@ -503,14 +503,14 @@ void TPolyLine3D::Paint(Option_t * /* option */ ) } // Transform points - if (gGeometry && !buffer.fLocalFrame) { + if (ROOT::Internal::currentTGeometryTransformer && !buffer.fLocalFrame) { Double_t dlocal[3]; Double_t dmaster[3]; for (UInt_t j=0; jLocal2Master(&dlocal[0],&dmaster[0]); + ROOT::Internal::currentTGeometryTransformer(&dlocal[0], &dmaster[0]); buffer.fPnts[3*j] = dmaster[0]; buffer.fPnts[3*j+1] = dmaster[1]; buffer.fPnts[3*j+2] = dmaster[2]; diff --git a/graf3d/g3d/src/TPolyMarker3D.cxx b/graf3d/g3d/src/TPolyMarker3D.cxx index 2366f81156dda..58c349ec22cf6 100644 --- a/graf3d/g3d/src/TPolyMarker3D.cxx +++ b/graf3d/g3d/src/TPolyMarker3D.cxx @@ -17,7 +17,7 @@ #include "TBuffer3D.h" #include "TBuffer3DTypes.h" #include "TVirtualViewer3D.h" -#include "TGeometry.h" +#include "TGeometryTransformer.h" #include "TH1.h" #include "TROOT.h" #include "TMath.h" @@ -356,14 +356,14 @@ void TPolyMarker3D::Paint(Option_t * /*option*/ ) // Transform points - we don't support local->global matrix // so always work in global reference frame - if (gGeometry) { + if (ROOT::Internal::currentTGeometryTransformer) { Double_t dlocal[3]; Double_t dmaster[3]; for (UInt_t j=0; jLocal2Master(&dlocal[0],&dmaster[0]); + ROOT::Internal::currentTGeometryTransformer(&dlocal[0], &dmaster[0]); buffer.fPnts[3*j] = dmaster[0]; buffer.fPnts[3*j+1] = dmaster[1]; buffer.fPnts[3*j+2] = dmaster[2]; From ffefab167f18b506bce5139f717f7d539aba13c9 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Mon, 20 Jul 2026 11:26:40 +0200 Subject: [PATCH 07/12] [graf3d] Add X3DBuffer include to TGeometry shapes. --- graf3d/g3d/src/TBRIK.cxx | 2 +- graf3d/g3d/src/TPCON.cxx | 2 +- graf3d/g3d/src/TSPHE.cxx | 2 +- graf3d/g3d/src/TTUBE.cxx | 2 +- graf3d/g3d/src/TTUBS.cxx | 2 +- graf3d/g3d/src/TXTRU.cxx | 1 + 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/graf3d/g3d/src/TBRIK.cxx b/graf3d/g3d/src/TBRIK.cxx index 5148325070a87..67c7d4a8250a8 100644 --- a/graf3d/g3d/src/TBRIK.cxx +++ b/graf3d/g3d/src/TBRIK.cxx @@ -14,7 +14,7 @@ #include "TBuffer3D.h" #include "TBuffer3DTypes.h" #include "TGeometry.h" - +#include "X3DBuffer.h" /** \class TBRIK \ingroup g3d diff --git a/graf3d/g3d/src/TPCON.cxx b/graf3d/g3d/src/TPCON.cxx index 3579813c630a3..2c9607efe04d1 100644 --- a/graf3d/g3d/src/TPCON.cxx +++ b/graf3d/g3d/src/TPCON.cxx @@ -16,7 +16,7 @@ #include "TBuffer3D.h" #include "TBuffer3DTypes.h" #include "TGeometry.h" - +#include "X3DBuffer.h" /** \class TPCON \ingroup g3d diff --git a/graf3d/g3d/src/TSPHE.cxx b/graf3d/g3d/src/TSPHE.cxx index de6a302ceb368..30b4c3dabedda 100644 --- a/graf3d/g3d/src/TSPHE.cxx +++ b/graf3d/g3d/src/TSPHE.cxx @@ -16,7 +16,7 @@ #include "TBuffer3DTypes.h" #include "TGeometry.h" #include "TMath.h" - +#include "X3DBuffer.h" /** \class TSPHE \ingroup g3d diff --git a/graf3d/g3d/src/TTUBE.cxx b/graf3d/g3d/src/TTUBE.cxx index 5f65177b72a52..6b27c268f12da 100644 --- a/graf3d/g3d/src/TTUBE.cxx +++ b/graf3d/g3d/src/TTUBE.cxx @@ -16,7 +16,7 @@ #include "TBuffer3DTypes.h" #include "TGeometry.h" #include "TMath.h" - +#include "X3DBuffer.h" /** \class TTUBE \ingroup g3d diff --git a/graf3d/g3d/src/TTUBS.cxx b/graf3d/g3d/src/TTUBS.cxx index a4c00e61257d6..0d4c8d90bdca3 100644 --- a/graf3d/g3d/src/TTUBS.cxx +++ b/graf3d/g3d/src/TTUBS.cxx @@ -15,7 +15,7 @@ #include "TBuffer3DTypes.h" #include "TGeometry.h" #include "TMath.h" - +#include "X3DBuffer.h" /** \class TTUBS \ingroup g3d diff --git a/graf3d/g3d/src/TXTRU.cxx b/graf3d/g3d/src/TXTRU.cxx index e62a5903fabae..2c77f5bd90c13 100644 --- a/graf3d/g3d/src/TXTRU.cxx +++ b/graf3d/g3d/src/TXTRU.cxx @@ -15,6 +15,7 @@ #include "TBuffer3DTypes.h" #include "TGeometry.h" #include "TMath.h" +#include "X3DBuffer.h" #include #include From e29aecadcca4a3918663cf20a0dcd41e406a8c33 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Fri, 17 Jul 2026 15:49:43 +0200 Subject: [PATCH 08/12] [graf3d] Move TGeometry (Geant 3 shapes) into their own library. --- graf3d/CMakeLists.txt | 2 + graf3d/TGeometry/CMakeLists.txt | 66 ++++++++++++++++++++ graf3d/TGeometry/inc/LinkDef.h | 44 +++++++++++++ graf3d/{g3d => TGeometry}/inc/TBRIK.h | 0 graf3d/{g3d => TGeometry}/inc/TCONE.h | 0 graf3d/{g3d => TGeometry}/inc/TCONS.h | 0 graf3d/{g3d => TGeometry}/inc/TCTUB.h | 0 graf3d/{g3d => TGeometry}/inc/TELTU.h | 0 graf3d/{g3d => TGeometry}/inc/TGTRA.h | 0 graf3d/{g3d => TGeometry}/inc/TGeometry.h | 0 graf3d/{g3d => TGeometry}/inc/THYPE.h | 0 graf3d/{g3d => TGeometry}/inc/THelix.h | 0 graf3d/{g3d => TGeometry}/inc/TMaterial.h | 0 graf3d/{g3d => TGeometry}/inc/TMixture.h | 0 graf3d/{g3d => TGeometry}/inc/TNode.h | 0 graf3d/{g3d => TGeometry}/inc/TNodeDiv.h | 0 graf3d/{g3d => TGeometry}/inc/TPARA.h | 0 graf3d/{g3d => TGeometry}/inc/TPCON.h | 0 graf3d/{g3d => TGeometry}/inc/TPGON.h | 0 graf3d/{g3d => TGeometry}/inc/TRotMatrix.h | 0 graf3d/{g3d => TGeometry}/inc/TSPHE.h | 0 graf3d/{g3d => TGeometry}/inc/TShape.h | 1 - graf3d/{g3d => TGeometry}/inc/TTRAP.h | 0 graf3d/{g3d => TGeometry}/inc/TTRD1.h | 0 graf3d/{g3d => TGeometry}/inc/TTRD2.h | 0 graf3d/{g3d => TGeometry}/inc/TTUBE.h | 0 graf3d/{g3d => TGeometry}/inc/TTUBS.h | 0 graf3d/{g3d => TGeometry}/inc/TXTRU.h | 0 graf3d/{g3d => TGeometry}/src/TBRIK.cxx | 0 graf3d/{g3d => TGeometry}/src/TCONE.cxx | 0 graf3d/{g3d => TGeometry}/src/TCONS.cxx | 0 graf3d/{g3d => TGeometry}/src/TCTUB.cxx | 0 graf3d/{g3d => TGeometry}/src/TELTU.cxx | 1 - graf3d/{g3d => TGeometry}/src/TGTRA.cxx | 0 graf3d/{g3d => TGeometry}/src/TGeometry.cxx | 0 graf3d/{g3d => TGeometry}/src/THYPE.cxx | 0 graf3d/{g3d => TGeometry}/src/THelix.cxx | 0 graf3d/{g3d => TGeometry}/src/TMaterial.cxx | 0 graf3d/{g3d => TGeometry}/src/TMixture.cxx | 0 graf3d/{g3d => TGeometry}/src/TNode.cxx | 0 graf3d/{g3d => TGeometry}/src/TNodeDiv.cxx | 0 graf3d/{g3d => TGeometry}/src/TPARA.cxx | 0 graf3d/{g3d => TGeometry}/src/TPCON.cxx | 0 graf3d/{g3d => TGeometry}/src/TPGON.cxx | 0 graf3d/{g3d => TGeometry}/src/TRotMatrix.cxx | 0 graf3d/{g3d => TGeometry}/src/TSPHE.cxx | 0 graf3d/{g3d => TGeometry}/src/TShape.cxx | 0 graf3d/{g3d => TGeometry}/src/TTRAP.cxx | 0 graf3d/{g3d => TGeometry}/src/TTRD1.cxx | 0 graf3d/{g3d => TGeometry}/src/TTRD2.cxx | 0 graf3d/{g3d => TGeometry}/src/TTUBE.cxx | 0 graf3d/{g3d => TGeometry}/src/TTUBS.cxx | 0 graf3d/{g3d => TGeometry}/src/TXTRU.cxx | 0 graf3d/g3d/CMakeLists.txt | 50 --------------- graf3d/g3d/inc/LinkDef.h | 34 +--------- 55 files changed, 115 insertions(+), 83 deletions(-) create mode 100644 graf3d/TGeometry/CMakeLists.txt create mode 100644 graf3d/TGeometry/inc/LinkDef.h rename graf3d/{g3d => TGeometry}/inc/TBRIK.h (100%) rename graf3d/{g3d => TGeometry}/inc/TCONE.h (100%) rename graf3d/{g3d => TGeometry}/inc/TCONS.h (100%) rename graf3d/{g3d => TGeometry}/inc/TCTUB.h (100%) rename graf3d/{g3d => TGeometry}/inc/TELTU.h (100%) rename graf3d/{g3d => TGeometry}/inc/TGTRA.h (100%) rename graf3d/{g3d => TGeometry}/inc/TGeometry.h (100%) rename graf3d/{g3d => TGeometry}/inc/THYPE.h (100%) rename graf3d/{g3d => TGeometry}/inc/THelix.h (100%) rename graf3d/{g3d => TGeometry}/inc/TMaterial.h (100%) rename graf3d/{g3d => TGeometry}/inc/TMixture.h (100%) rename graf3d/{g3d => TGeometry}/inc/TNode.h (100%) rename graf3d/{g3d => TGeometry}/inc/TNodeDiv.h (100%) rename graf3d/{g3d => TGeometry}/inc/TPARA.h (100%) rename graf3d/{g3d => TGeometry}/inc/TPCON.h (100%) rename graf3d/{g3d => TGeometry}/inc/TPGON.h (100%) rename graf3d/{g3d => TGeometry}/inc/TRotMatrix.h (100%) rename graf3d/{g3d => TGeometry}/inc/TSPHE.h (100%) rename graf3d/{g3d => TGeometry}/inc/TShape.h (99%) rename graf3d/{g3d => TGeometry}/inc/TTRAP.h (100%) rename graf3d/{g3d => TGeometry}/inc/TTRD1.h (100%) rename graf3d/{g3d => TGeometry}/inc/TTRD2.h (100%) rename graf3d/{g3d => TGeometry}/inc/TTUBE.h (100%) rename graf3d/{g3d => TGeometry}/inc/TTUBS.h (100%) rename graf3d/{g3d => TGeometry}/inc/TXTRU.h (100%) rename graf3d/{g3d => TGeometry}/src/TBRIK.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TCONE.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TCONS.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TCTUB.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TELTU.cxx (99%) rename graf3d/{g3d => TGeometry}/src/TGTRA.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TGeometry.cxx (100%) rename graf3d/{g3d => TGeometry}/src/THYPE.cxx (100%) rename graf3d/{g3d => TGeometry}/src/THelix.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TMaterial.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TMixture.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TNode.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TNodeDiv.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TPARA.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TPCON.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TPGON.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TRotMatrix.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TSPHE.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TShape.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TTRAP.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TTRD1.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TTRD2.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TTUBE.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TTUBS.cxx (100%) rename graf3d/{g3d => TGeometry}/src/TXTRU.cxx (100%) diff --git a/graf3d/CMakeLists.txt b/graf3d/CMakeLists.txt index 704a524f66eb3..c15b817db8706 100644 --- a/graf3d/CMakeLists.txt +++ b/graf3d/CMakeLists.txt @@ -17,6 +17,8 @@ if (opengl) endif() if(geom) + add_subdirectory(TGeometry) + if(opengl) add_subdirectory(eve) add_subdirectory(gviz3d) diff --git a/graf3d/TGeometry/CMakeLists.txt b/graf3d/TGeometry/CMakeLists.txt new file mode 100644 index 0000000000000..ac0da9c9a3ed6 --- /dev/null +++ b/graf3d/TGeometry/CMakeLists.txt @@ -0,0 +1,66 @@ +# Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. +# All rights reserved. +# +# For the licensing terms see $ROOTSYS/LICENSE. +# For the list of contributors see $ROOTSYS/README/CREDITS. + +############################################################################ +# CMakeLists.txt file for building ROOT's TGeometry package +############################################################################ + +ROOT_STANDARD_LIBRARY_PACKAGE(TGeometry + HEADERS + TGeometry.h + TMaterial.h + TNode.h + TRotMatrix.h + TShape.h + TMixture.h + TBRIK.h + TCONE.h + TCONS.h + TCTUB.h + TELTU.h + TGTRA.h + THelix.h + THYPE.h + TNodeDiv.h + TPARA.h + TPCON.h + TPGON.h + TSPHE.h + TTRAP.h + TTRD1.h + TTRD2.h + TTUBE.h + TTUBS.h + TXTRU.h + SOURCES + TGeometry.cxx + TMaterial.cxx + TNode.cxx + TRotMatrix.cxx + TShape.cxx + TMixture.cxx + TBRIK.cxx + TCONE.cxx + TCONS.cxx + TCTUB.cxx + TELTU.cxx + TGTRA.cxx + THelix.cxx + THYPE.cxx + TNodeDiv.cxx + TPARA.cxx + TPCON.cxx + TPGON.cxx + TSPHE.cxx + TTRAP.cxx + TTRD1.cxx + TTRD2.cxx + TTUBE.cxx + TTUBS.cxx + TXTRU.cxx + DEPENDENCIES + Graf3d +) \ No newline at end of file diff --git a/graf3d/TGeometry/inc/LinkDef.h b/graf3d/TGeometry/inc/LinkDef.h new file mode 100644 index 0000000000000..19baa8a4fdf1b --- /dev/null +++ b/graf3d/TGeometry/inc/LinkDef.h @@ -0,0 +1,44 @@ +/************************************************************************* + * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifdef __CLING__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ enum EHelixRangeType; + +#pragma link C++ global gGeometry; +#pragma link C++ class TGeometry-; +#pragma link C++ class TMaterial-; +#pragma link C++ class TMixture-; +#pragma link C++ class TNode-; +#pragma link C++ class TRotMatrix-; +#pragma link C++ class TShape-; +#pragma link C++ class TBRIK+; +#pragma link C++ class TCONE+; +#pragma link C++ class TCONS+; +#pragma link C++ class TCTUB-; +#pragma link C++ class TELTU+; +#pragma link C++ class TGTRA+; +#pragma link C++ class THelix-; +#pragma link C++ class THYPE+; +#pragma link C++ class TNodeDiv+; +#pragma link C++ class TPARA+; +#pragma link C++ class TPCON-; +#pragma link C++ class TPGON+; +#pragma link C++ class TSPHE-; +#pragma link C++ class TTRAP+; +#pragma link C++ class TTRD1+; +#pragma link C++ class TTRD2+; +#pragma link C++ class TTUBE-; +#pragma link C++ class TTUBS+; +#pragma link C++ class TXTRU+; + +#endif diff --git a/graf3d/g3d/inc/TBRIK.h b/graf3d/TGeometry/inc/TBRIK.h similarity index 100% rename from graf3d/g3d/inc/TBRIK.h rename to graf3d/TGeometry/inc/TBRIK.h diff --git a/graf3d/g3d/inc/TCONE.h b/graf3d/TGeometry/inc/TCONE.h similarity index 100% rename from graf3d/g3d/inc/TCONE.h rename to graf3d/TGeometry/inc/TCONE.h diff --git a/graf3d/g3d/inc/TCONS.h b/graf3d/TGeometry/inc/TCONS.h similarity index 100% rename from graf3d/g3d/inc/TCONS.h rename to graf3d/TGeometry/inc/TCONS.h diff --git a/graf3d/g3d/inc/TCTUB.h b/graf3d/TGeometry/inc/TCTUB.h similarity index 100% rename from graf3d/g3d/inc/TCTUB.h rename to graf3d/TGeometry/inc/TCTUB.h diff --git a/graf3d/g3d/inc/TELTU.h b/graf3d/TGeometry/inc/TELTU.h similarity index 100% rename from graf3d/g3d/inc/TELTU.h rename to graf3d/TGeometry/inc/TELTU.h diff --git a/graf3d/g3d/inc/TGTRA.h b/graf3d/TGeometry/inc/TGTRA.h similarity index 100% rename from graf3d/g3d/inc/TGTRA.h rename to graf3d/TGeometry/inc/TGTRA.h diff --git a/graf3d/g3d/inc/TGeometry.h b/graf3d/TGeometry/inc/TGeometry.h similarity index 100% rename from graf3d/g3d/inc/TGeometry.h rename to graf3d/TGeometry/inc/TGeometry.h diff --git a/graf3d/g3d/inc/THYPE.h b/graf3d/TGeometry/inc/THYPE.h similarity index 100% rename from graf3d/g3d/inc/THYPE.h rename to graf3d/TGeometry/inc/THYPE.h diff --git a/graf3d/g3d/inc/THelix.h b/graf3d/TGeometry/inc/THelix.h similarity index 100% rename from graf3d/g3d/inc/THelix.h rename to graf3d/TGeometry/inc/THelix.h diff --git a/graf3d/g3d/inc/TMaterial.h b/graf3d/TGeometry/inc/TMaterial.h similarity index 100% rename from graf3d/g3d/inc/TMaterial.h rename to graf3d/TGeometry/inc/TMaterial.h diff --git a/graf3d/g3d/inc/TMixture.h b/graf3d/TGeometry/inc/TMixture.h similarity index 100% rename from graf3d/g3d/inc/TMixture.h rename to graf3d/TGeometry/inc/TMixture.h diff --git a/graf3d/g3d/inc/TNode.h b/graf3d/TGeometry/inc/TNode.h similarity index 100% rename from graf3d/g3d/inc/TNode.h rename to graf3d/TGeometry/inc/TNode.h diff --git a/graf3d/g3d/inc/TNodeDiv.h b/graf3d/TGeometry/inc/TNodeDiv.h similarity index 100% rename from graf3d/g3d/inc/TNodeDiv.h rename to graf3d/TGeometry/inc/TNodeDiv.h diff --git a/graf3d/g3d/inc/TPARA.h b/graf3d/TGeometry/inc/TPARA.h similarity index 100% rename from graf3d/g3d/inc/TPARA.h rename to graf3d/TGeometry/inc/TPARA.h diff --git a/graf3d/g3d/inc/TPCON.h b/graf3d/TGeometry/inc/TPCON.h similarity index 100% rename from graf3d/g3d/inc/TPCON.h rename to graf3d/TGeometry/inc/TPCON.h diff --git a/graf3d/g3d/inc/TPGON.h b/graf3d/TGeometry/inc/TPGON.h similarity index 100% rename from graf3d/g3d/inc/TPGON.h rename to graf3d/TGeometry/inc/TPGON.h diff --git a/graf3d/g3d/inc/TRotMatrix.h b/graf3d/TGeometry/inc/TRotMatrix.h similarity index 100% rename from graf3d/g3d/inc/TRotMatrix.h rename to graf3d/TGeometry/inc/TRotMatrix.h diff --git a/graf3d/g3d/inc/TSPHE.h b/graf3d/TGeometry/inc/TSPHE.h similarity index 100% rename from graf3d/g3d/inc/TSPHE.h rename to graf3d/TGeometry/inc/TSPHE.h diff --git a/graf3d/g3d/inc/TShape.h b/graf3d/TGeometry/inc/TShape.h similarity index 99% rename from graf3d/g3d/inc/TShape.h rename to graf3d/TGeometry/inc/TShape.h index 9a7cfa3e1adc8..39e304a37ba63 100644 --- a/graf3d/g3d/inc/TShape.h +++ b/graf3d/TGeometry/inc/TShape.h @@ -26,7 +26,6 @@ #include "TAttLine.h" #include "TAttFill.h" #include "TAtt3D.h" -#include "X3DBuffer.h" class TBuffer3D; class TMaterial; diff --git a/graf3d/g3d/inc/TTRAP.h b/graf3d/TGeometry/inc/TTRAP.h similarity index 100% rename from graf3d/g3d/inc/TTRAP.h rename to graf3d/TGeometry/inc/TTRAP.h diff --git a/graf3d/g3d/inc/TTRD1.h b/graf3d/TGeometry/inc/TTRD1.h similarity index 100% rename from graf3d/g3d/inc/TTRD1.h rename to graf3d/TGeometry/inc/TTRD1.h diff --git a/graf3d/g3d/inc/TTRD2.h b/graf3d/TGeometry/inc/TTRD2.h similarity index 100% rename from graf3d/g3d/inc/TTRD2.h rename to graf3d/TGeometry/inc/TTRD2.h diff --git a/graf3d/g3d/inc/TTUBE.h b/graf3d/TGeometry/inc/TTUBE.h similarity index 100% rename from graf3d/g3d/inc/TTUBE.h rename to graf3d/TGeometry/inc/TTUBE.h diff --git a/graf3d/g3d/inc/TTUBS.h b/graf3d/TGeometry/inc/TTUBS.h similarity index 100% rename from graf3d/g3d/inc/TTUBS.h rename to graf3d/TGeometry/inc/TTUBS.h diff --git a/graf3d/g3d/inc/TXTRU.h b/graf3d/TGeometry/inc/TXTRU.h similarity index 100% rename from graf3d/g3d/inc/TXTRU.h rename to graf3d/TGeometry/inc/TXTRU.h diff --git a/graf3d/g3d/src/TBRIK.cxx b/graf3d/TGeometry/src/TBRIK.cxx similarity index 100% rename from graf3d/g3d/src/TBRIK.cxx rename to graf3d/TGeometry/src/TBRIK.cxx diff --git a/graf3d/g3d/src/TCONE.cxx b/graf3d/TGeometry/src/TCONE.cxx similarity index 100% rename from graf3d/g3d/src/TCONE.cxx rename to graf3d/TGeometry/src/TCONE.cxx diff --git a/graf3d/g3d/src/TCONS.cxx b/graf3d/TGeometry/src/TCONS.cxx similarity index 100% rename from graf3d/g3d/src/TCONS.cxx rename to graf3d/TGeometry/src/TCONS.cxx diff --git a/graf3d/g3d/src/TCTUB.cxx b/graf3d/TGeometry/src/TCTUB.cxx similarity index 100% rename from graf3d/g3d/src/TCTUB.cxx rename to graf3d/TGeometry/src/TCTUB.cxx diff --git a/graf3d/g3d/src/TELTU.cxx b/graf3d/TGeometry/src/TELTU.cxx similarity index 99% rename from graf3d/g3d/src/TELTU.cxx rename to graf3d/TGeometry/src/TELTU.cxx index 4e6218d12227f..8fde61dd3595a 100644 --- a/graf3d/g3d/src/TELTU.cxx +++ b/graf3d/TGeometry/src/TELTU.cxx @@ -52,4 +52,3 @@ TELTU::TELTU(const char *name, const char *title, const char *material, Float_t TELTU::~TELTU() { } - diff --git a/graf3d/g3d/src/TGTRA.cxx b/graf3d/TGeometry/src/TGTRA.cxx similarity index 100% rename from graf3d/g3d/src/TGTRA.cxx rename to graf3d/TGeometry/src/TGTRA.cxx diff --git a/graf3d/g3d/src/TGeometry.cxx b/graf3d/TGeometry/src/TGeometry.cxx similarity index 100% rename from graf3d/g3d/src/TGeometry.cxx rename to graf3d/TGeometry/src/TGeometry.cxx diff --git a/graf3d/g3d/src/THYPE.cxx b/graf3d/TGeometry/src/THYPE.cxx similarity index 100% rename from graf3d/g3d/src/THYPE.cxx rename to graf3d/TGeometry/src/THYPE.cxx diff --git a/graf3d/g3d/src/THelix.cxx b/graf3d/TGeometry/src/THelix.cxx similarity index 100% rename from graf3d/g3d/src/THelix.cxx rename to graf3d/TGeometry/src/THelix.cxx diff --git a/graf3d/g3d/src/TMaterial.cxx b/graf3d/TGeometry/src/TMaterial.cxx similarity index 100% rename from graf3d/g3d/src/TMaterial.cxx rename to graf3d/TGeometry/src/TMaterial.cxx diff --git a/graf3d/g3d/src/TMixture.cxx b/graf3d/TGeometry/src/TMixture.cxx similarity index 100% rename from graf3d/g3d/src/TMixture.cxx rename to graf3d/TGeometry/src/TMixture.cxx diff --git a/graf3d/g3d/src/TNode.cxx b/graf3d/TGeometry/src/TNode.cxx similarity index 100% rename from graf3d/g3d/src/TNode.cxx rename to graf3d/TGeometry/src/TNode.cxx diff --git a/graf3d/g3d/src/TNodeDiv.cxx b/graf3d/TGeometry/src/TNodeDiv.cxx similarity index 100% rename from graf3d/g3d/src/TNodeDiv.cxx rename to graf3d/TGeometry/src/TNodeDiv.cxx diff --git a/graf3d/g3d/src/TPARA.cxx b/graf3d/TGeometry/src/TPARA.cxx similarity index 100% rename from graf3d/g3d/src/TPARA.cxx rename to graf3d/TGeometry/src/TPARA.cxx diff --git a/graf3d/g3d/src/TPCON.cxx b/graf3d/TGeometry/src/TPCON.cxx similarity index 100% rename from graf3d/g3d/src/TPCON.cxx rename to graf3d/TGeometry/src/TPCON.cxx diff --git a/graf3d/g3d/src/TPGON.cxx b/graf3d/TGeometry/src/TPGON.cxx similarity index 100% rename from graf3d/g3d/src/TPGON.cxx rename to graf3d/TGeometry/src/TPGON.cxx diff --git a/graf3d/g3d/src/TRotMatrix.cxx b/graf3d/TGeometry/src/TRotMatrix.cxx similarity index 100% rename from graf3d/g3d/src/TRotMatrix.cxx rename to graf3d/TGeometry/src/TRotMatrix.cxx diff --git a/graf3d/g3d/src/TSPHE.cxx b/graf3d/TGeometry/src/TSPHE.cxx similarity index 100% rename from graf3d/g3d/src/TSPHE.cxx rename to graf3d/TGeometry/src/TSPHE.cxx diff --git a/graf3d/g3d/src/TShape.cxx b/graf3d/TGeometry/src/TShape.cxx similarity index 100% rename from graf3d/g3d/src/TShape.cxx rename to graf3d/TGeometry/src/TShape.cxx diff --git a/graf3d/g3d/src/TTRAP.cxx b/graf3d/TGeometry/src/TTRAP.cxx similarity index 100% rename from graf3d/g3d/src/TTRAP.cxx rename to graf3d/TGeometry/src/TTRAP.cxx diff --git a/graf3d/g3d/src/TTRD1.cxx b/graf3d/TGeometry/src/TTRD1.cxx similarity index 100% rename from graf3d/g3d/src/TTRD1.cxx rename to graf3d/TGeometry/src/TTRD1.cxx diff --git a/graf3d/g3d/src/TTRD2.cxx b/graf3d/TGeometry/src/TTRD2.cxx similarity index 100% rename from graf3d/g3d/src/TTRD2.cxx rename to graf3d/TGeometry/src/TTRD2.cxx diff --git a/graf3d/g3d/src/TTUBE.cxx b/graf3d/TGeometry/src/TTUBE.cxx similarity index 100% rename from graf3d/g3d/src/TTUBE.cxx rename to graf3d/TGeometry/src/TTUBE.cxx diff --git a/graf3d/g3d/src/TTUBS.cxx b/graf3d/TGeometry/src/TTUBS.cxx similarity index 100% rename from graf3d/g3d/src/TTUBS.cxx rename to graf3d/TGeometry/src/TTUBS.cxx diff --git a/graf3d/g3d/src/TXTRU.cxx b/graf3d/TGeometry/src/TXTRU.cxx similarity index 100% rename from graf3d/g3d/src/TXTRU.cxx rename to graf3d/TGeometry/src/TXTRU.cxx diff --git a/graf3d/g3d/CMakeLists.txt b/graf3d/g3d/CMakeLists.txt index 970899830d21e..7fa08352593ac 100644 --- a/graf3d/g3d/CMakeLists.txt +++ b/graf3d/g3d/CMakeLists.txt @@ -11,72 +11,22 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Graf3d HEADERS TAxis3D.h - TBRIK.h - TCONE.h - TCONS.h - TCTUB.h - TELTU.h - TGeometry.h TGeometryTransformer.h - TGTRA.h - THelix.h - THYPE.h TMarker3DBox.h - TMaterial.h - TMixture.h - TNodeDiv.h - TNode.h - TPARA.h - TPCON.h - TPGON.h TPoints3DABC.h TPointSet3D.h TPolyLine3D.h TPolyMarker3D.h - TRotMatrix.h - TShape.h - TSPHE.h - TTRAP.h - TTRD1.h - TTRD2.h - TTUBE.h - TTUBS.h TView3D.h - TXTRU.h X3DBuffer.h SOURCES TAxis3D.cxx - TBRIK.cxx - TCONE.cxx - TCONS.cxx - TCTUB.cxx - TELTU.cxx - TGeometry.cxx - TGTRA.cxx - THelix.cxx - THYPE.cxx TMarker3DBox.cxx - TMaterial.cxx - TMixture.cxx - TNode.cxx - TNodeDiv.cxx - TPARA.cxx - TPCON.cxx - TPGON.cxx TPoints3DABC.cxx TPointSet3D.cxx TPolyLine3D.cxx TPolyMarker3D.cxx - TRotMatrix.cxx - TShape.cxx - TSPHE.cxx - TTRAP.cxx - TTRD1.cxx - TTRD2.cxx - TTUBE.cxx - TTUBS.cxx TView3D.cxx - TXTRU.cxx X3DBuffer.c DEPENDENCIES Gpad diff --git a/graf3d/g3d/inc/LinkDef.h b/graf3d/g3d/inc/LinkDef.h index b1b33f46f2c5a..5c36d5fa56789 100644 --- a/graf3d/g3d/inc/LinkDef.h +++ b/graf3d/g3d/inc/LinkDef.h @@ -15,40 +15,12 @@ #pragma link off all functions; #pragma link C++ enum EHelixRangeType; - -#pragma link C++ global gGeometry; - #pragma link C++ class TAxis3D+; -#pragma link C++ class TBRIK+; -#pragma link C++ class TCONE+; -#pragma link C++ class TCONS+; -#pragma link C++ class TCTUB-; -#pragma link C++ class TELTU+; -#pragma link C++ class TGTRA+; -#pragma link C++ class TGeometry-; -#pragma link C++ class THelix-; -#pragma link C++ class THYPE+; -#pragma link C++ class TMaterial-; -#pragma link C++ class TMixture-; -#pragma link C++ class TNode-; -#pragma link C++ class TNodeDiv+; -#pragma link C++ class TPARA+; -#pragma link C++ class TPCON-; -#pragma link C++ class TPGON+; -#pragma link C++ class TPolyLine3D-; -#pragma link C++ class TPolyMarker3D-; -#pragma link C++ class TPointSet3D-; -#pragma link C++ class TRotMatrix-; -#pragma link C++ class TShape-; -#pragma link C++ class TSPHE-; -#pragma link C++ class TTRAP+; -#pragma link C++ class TTRD1+; -#pragma link C++ class TTRD2+; -#pragma link C++ class TTUBE-; -#pragma link C++ class TTUBS+; #pragma link C++ class TMarker3DBox-; #pragma link C++ class TPoints3DABC; -#pragma link C++ class TXTRU+; +#pragma link C++ class TPointSet3D-; +#pragma link C++ class TPolyLine3D-; +#pragma link C++ class TPolyMarker3D-; #pragma link C++ class TView3D-; #endif From 3b0775fe319cd7ba4b8b128b1c5b4f11dcc7dccd Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Fri, 17 Jul 2026 17:09:16 +0200 Subject: [PATCH 09/12] Add TGeometry to root-config --libs. --- config/root-config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/root-config.in b/config/root-config.in index f2c0851bb1b76..f464422e58e6f 100755 --- a/config/root-config.in +++ b/config/root-config.in @@ -73,7 +73,7 @@ fi newlib="-lNew" rootglibs="-lGui" rootevelibs="-lEve -lEG -lGeom -lGed -lRGL" -rootlibs="-lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer\ +rootlibs="-lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lTGeometry -lGpad -lROOTVecOps -lTree -lTreePlayer\ -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lROOTNTuple -lROOTNTupleUtil" # MultiProc is not supported on Windows From aa230d36cf7938d0e8d70352422fda25e219c2db Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Mon, 20 Jul 2026 14:23:30 +0200 Subject: [PATCH 10/12] [graf3d] Add test for interaction between g3d and TGeometry. --- graf3d/TGeometry/CMakeLists.txt | 4 +- graf3d/TGeometry/test/CMakeLists.txt | 1 + graf3d/TGeometry/test/testTGeometry.cxx | 67 +++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 graf3d/TGeometry/test/CMakeLists.txt create mode 100644 graf3d/TGeometry/test/testTGeometry.cxx diff --git a/graf3d/TGeometry/CMakeLists.txt b/graf3d/TGeometry/CMakeLists.txt index ac0da9c9a3ed6..75ca8e23b02b7 100644 --- a/graf3d/TGeometry/CMakeLists.txt +++ b/graf3d/TGeometry/CMakeLists.txt @@ -63,4 +63,6 @@ ROOT_STANDARD_LIBRARY_PACKAGE(TGeometry TXTRU.cxx DEPENDENCIES Graf3d -) \ No newline at end of file +) + +ROOT_ADD_TEST_SUBDIRECTORY(test) \ No newline at end of file diff --git a/graf3d/TGeometry/test/CMakeLists.txt b/graf3d/TGeometry/test/CMakeLists.txt new file mode 100644 index 0000000000000..9434bb0e96c1a --- /dev/null +++ b/graf3d/TGeometry/test/CMakeLists.txt @@ -0,0 +1 @@ +ROOT_ADD_GTEST(testTGeometry testTGeometry.cxx LIBRARIES TGeometry) \ No newline at end of file diff --git a/graf3d/TGeometry/test/testTGeometry.cxx b/graf3d/TGeometry/test/testTGeometry.cxx new file mode 100644 index 0000000000000..dadd511a95a90 --- /dev/null +++ b/graf3d/TGeometry/test/testTGeometry.cxx @@ -0,0 +1,67 @@ +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +// TGeometry transforms graphs, lines and markers of g3d if there is an active rotation. +TEST(TGeometry, TransformTPolyMarker3D) +{ + constexpr auto filename1 = "beforeTransform.svg"; + constexpr auto filename2 = "afterTransform.svg"; + TCanvas c1; + TPolyMarker3D marker; + marker.SetPoint(0, 0.5, 0.5, 0.); + marker.SetMarkerSize(2); + marker.SetMarkerStyle(20); + + // First draw without an active geometry + marker.Draw("same"); + c1.SaveAs(filename1); + c1.Clear(); + + // Then prepare two geometry levels, so the graph is affected by the transformation + TGeometry geo; + [[maybe_unused]] TBRIK *brik = new TBRIK("BRIK", "BRIK", "void", 0.2, 0.3, 0.2); + TRotMatrix rot("rot1", "rot1", 1, 2, 3, 1, 2, 3); + TNode *node = new TNode("BRIKNode", "BRIKNode", "BRIK", 0, 0, -0.1, "rot1"); + node->cd(); + geo.PushLevel(); + TNode *node2 = new TNode("BRIKNode2", "BRIKNode2", "BRIK", 0, 0, -0.1, "rot1"); + geo.UpdateMatrix(node2); + + // The marker will move now + marker.Draw("same"); + geo.Draw("same"); + c1.SaveAs(filename2); + + // Check the svg to ensure that it moved + std::ifstream file1(filename1); + std::ifstream file2(filename2); + std::string line1, line2; + while (std::getline(file1, line1)) { + if (line1.find("circle cx=") != std::string::npos) + break; + } + while (std::getline(file2, line2)) { + if (line2.find("circle cx=") != std::string::npos) + break; + } + EXPECT_TRUE(line1.find(" Date: Mon, 20 Jul 2026 14:25:27 +0200 Subject: [PATCH 11/12] [graf3d] Improve const correctness of TGeometry. --- graf3d/TGeometry/inc/TGeometry.h | 8 ++++---- graf3d/TGeometry/src/TGeometry.cxx | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/graf3d/TGeometry/inc/TGeometry.h b/graf3d/TGeometry/inc/TGeometry.h index 3d56b23358485..30956c8463e53 100644 --- a/graf3d/TGeometry/inc/TGeometry.h +++ b/graf3d/TGeometry/inc/TGeometry.h @@ -89,11 +89,11 @@ class TGeometry : public TNamed { TRotMatrix *GetCurrentPosition(Float_t *x,Float_t *y,Float_t *z) const; Bool_t GetCurrentReflection() const; Bool_t IsFolder() const override {return kTRUE;} - virtual void Local2Master(Double_t *local, Double_t *master); - virtual void Local2Master(Float_t *local, Float_t *master); + virtual void Local2Master(Double_t const *local, Double_t *master) const; + virtual void Local2Master(Float_t const *local, Float_t *master) const; void ls(Option_t *option="rsn2") const override; - virtual void Master2Local(Double_t *master, Double_t *local); - virtual void Master2Local(Float_t *master, Float_t *local); + virtual void Master2Local(Double_t const *master, Double_t *local) const; + virtual void Master2Local(Float_t const *master, Float_t *local) const; virtual void Node(const char *name, const char *title, const char *shapename, Double_t x=0, Double_t y=0, Double_t z=0 , const char *matrixname="", Option_t *option=""); virtual Int_t PushLevel(){return fGeomLevel++;} diff --git a/graf3d/TGeometry/src/TGeometry.cxx b/graf3d/TGeometry/src/TGeometry.cxx index b64a6bf7113d5..a43d0770c0b57 100644 --- a/graf3d/TGeometry/src/TGeometry.cxx +++ b/graf3d/TGeometry/src/TGeometry.cxx @@ -420,12 +420,12 @@ TShape *TGeometry::GetShapeByNumber(Int_t number) const /// This is automatically done by the Paint functions. /// Otherwise TNode::UpdateMatrix should be called before. -void TGeometry::Local2Master(Double_t *local, Double_t *master) +void TGeometry::Local2Master(Double_t const *local, Double_t *master) const { if (GeomLevel()) { Double_t x,y,z; Double_t bomb = GetBomb(); - Double_t *matrix = &fRotMatrix[GeomLevel()][0]; + Double_t const *matrix = &fRotMatrix[GeomLevel()][0]; x = bomb*fX + local[0]*matrix[0] + local[1]*matrix[3] @@ -454,13 +454,13 @@ void TGeometry::Local2Master(Double_t *local, Double_t *master) /// This is automatically done by the Paint functions. /// Otherwise TNode::UpdateMatrix should be called before. -void TGeometry::Local2Master(Float_t *local, Float_t *master) +void TGeometry::Local2Master(Float_t const *local, Float_t *master) const { if (GeomLevel()) { Float_t x,y,z; Float_t bomb = GetBomb(); - Double_t *matrix = &fRotMatrix[GeomLevel()][0]; + Double_t const *matrix = &fRotMatrix[GeomLevel()][0]; x = bomb*fX + local[0]*matrix[0] @@ -516,12 +516,12 @@ void TGeometry::ls(Option_t *option) const /// This is automatically done by the Paint functions. /// Otherwise TNode::UpdateMatrix should be called before. -void TGeometry::Master2Local(Double_t *master, Double_t *local) +void TGeometry::Master2Local(Double_t const *master, Double_t *local) const { if (GeomLevel()) { Double_t x,y,z; Double_t bomb = GetBomb(); - Double_t *matrix = &fRotMatrix[GeomLevel()][0]; + Double_t const *matrix = &fRotMatrix[GeomLevel()][0]; Double_t xms = master[0] - bomb*fX; Double_t yms = master[1] - bomb*fY; @@ -545,13 +545,13 @@ void TGeometry::Master2Local(Double_t *master, Double_t *local) /// This is automatically done by the Paint functions. /// Otherwise TNode::UpdateMatrix should be called before. -void TGeometry::Master2Local(Float_t *master, Float_t *local) +void TGeometry::Master2Local(Float_t const *master, Float_t *local) const { if (GeomLevel()) { Float_t x,y,z; Float_t bomb = GetBomb(); - Double_t *matrix = &fRotMatrix[GeomLevel()][0]; + Double_t const *matrix = &fRotMatrix[GeomLevel()][0]; Double_t xms = master[0] - bomb*fX; Double_t yms = master[1] - bomb*fY; From 7168df41913fc54af1376699dcc8b0b8fed8e1f2 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Mon, 20 Jul 2026 14:41:38 +0200 Subject: [PATCH 12/12] [RelNotes] Add entry for moving TGeometry into its own library. --- README/ReleaseNotes/v642/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README/ReleaseNotes/v642/index.md b/README/ReleaseNotes/v642/index.md index 512aba2f3c274..3161e2ec44078 100644 --- a/README/ReleaseNotes/v642/index.md +++ b/README/ReleaseNotes/v642/index.md @@ -123,6 +123,10 @@ Such file can be loaded locally in any web browser or send as attachment in emai ## Geometry +The [TGeometry](https://root.cern/doc/master/classTGeometry.html) classes (Geant 3 shapes) have been moved out of Graf3D into their own library. +To link to these classes, use the cmake target `TGeometry` (preferred), `root-config --libs`, or link with `-lTGeometry`. +When ROOT is configured with `-Dgeom=Off`, these classes are now off as well. + ## Documentation and Examples ## Build, Configuration and Testing