diff --git a/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShape.h b/GeoModelCore/GeoModelKernel/GeoModelKernel/GeoShape.h index c58e237e0ac860fedbb367a9aab9be1738f8816a..5547dff6dfb1842de8e9bbd9a830839ebf67e5b1 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 7eebbfbf23e36c0f975024e972e476d28b5f005e..0b24f2cd17bb4ea4a3985612cb6711458837f2f9 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 f26055a03d042ee229a9f8f10d8235c74e26f423..619a4a30266cf69474447ec8430408db0db91a6d 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) {