From f55502e21fc42f1b9e30910c2488b583eeeee1cc Mon Sep 17 00:00:00 2001 From: Evgueni Tcherniaev <evgueni.tcherniaev@cern.ch> Date: Wed, 25 Sep 2024 14:16:35 +0200 Subject: [PATCH] Temporary disable volume caching --- GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShape.h | 8 +++++--- GeoModelCore/GeoModelKernel/src/GeoShapeSubtraction.cxx | 2 ++ GeoModelCore/GeoModelKernel/src/GeoShapeUnion.cxx | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShape.h b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShape.h index c58e237e0..5547dff6d 100644 --- a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShape.h +++ b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShape.h @@ -83,12 +83,14 @@ class GeoShape : public RCBase // Returns volume value double getVolumeValue () const { - return m_shape_volume.load(); + return -1.; + //return m_shape_volume.load(); } // Sets volume value void setVolumeValue (double value) const { - m_shape_volume = value; + if (value != 0.) return; + //m_shape_volume = value; } protected: @@ -101,7 +103,7 @@ class GeoShape : public RCBase private: // Cached volume - mutable std::atomic<double> m_shape_volume{-1.}; + //mutable std::atomic<double> m_shape_volume{-1.}; }; #endif diff --git a/GeoModelCore/GeoModelKernel/src/GeoShapeSubtraction.cxx b/GeoModelCore/GeoModelKernel/src/GeoShapeSubtraction.cxx index 7eebbfbf2..0b24f2cd1 100755 --- a/GeoModelCore/GeoModelKernel/src/GeoShapeSubtraction.cxx +++ b/GeoModelCore/GeoModelKernel/src/GeoShapeSubtraction.cxx @@ -16,6 +16,8 @@ GeoShapeSubtraction::GeoShapeSubtraction (const GeoShape* A, const GeoShape* B): m_opA {A}, m_opB {B} {} double GeoShapeSubtraction::volume (int npoints) const { + if (npoints >= 0) return GeoShape::volume(npoints); + double vol = getVolumeValue(); if (vol < 0) { diff --git a/GeoModelCore/GeoModelKernel/src/GeoShapeUnion.cxx b/GeoModelCore/GeoModelKernel/src/GeoShapeUnion.cxx index f26055a03..619a4a302 100755 --- a/GeoModelCore/GeoModelKernel/src/GeoShapeUnion.cxx +++ b/GeoModelCore/GeoModelKernel/src/GeoShapeUnion.cxx @@ -17,6 +17,8 @@ GeoShapeUnion::GeoShapeUnion (const GeoShape* A, const GeoShape* B): double GeoShapeUnion::volume (int npoints) const { + if (npoints >= 0) return GeoShape::volume(npoints); + double vol = getVolumeValue(); if (vol < 0) { -- GitLab