Skip to content

Commit

Permalink
fix: GeoVisualization - Fix compiler warning that's appearing in Athe…
Browse files Browse the repository at this point in the history
…na (#2585)

The athena compiler is throwing a warning if the Visualization library
is loaded.
```
/var/lib/jenkins/workspace/CI-MERGE-REQUEST-EL9/main/Tracking/Acts/ActsGeometry/src/SimpleCylinderDetBuilderTool.cxx: In member function 'virtual Acts::Experimental::DetectorComponent ActsTrk::SimpleCylinderDetBuilderTool::construct(const Acts::GeometryContext&) const':
/var/lib/jenkins/workspace/CI-MERGE-REQUEST-EL9/main/Tracking/Acts/ActsGeometry/src/SimpleCylinderDetBuilderTool.cxx:35:53: warning: 'static' expression 'Acts::s_viewSensitive' of type 'Acts::ViewConfig' passed to pointer or reference function argument of 'Acts::GeometryView3D::drawDetectorVolume' within function 'virtual Acts::Experimental::DetectorComponent ActsTrk::SimpleCylinderDetBuilderTool::construct(const Acts::GeometryContext&) const'; may not be thread-safe
   35 |             Acts::GeometryView3D::drawDetectorVolume(helper, *cylinderDetectorVolume, gctx->context());
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/lib/jenkins/workspace/CI-MERGE-REQUEST-EL9/main/Tracking/Acts/ActsGeometry/src/SimpleCylinderDetBuilderTool.cxx:8:
/build/ci-builds/main/Athena/install/AthenaExternals/24.0.15/InstallArea/x86_64-el9-gcc13-opt/include/Acts/Visualization/GeometryView3D.hpp:34:19: note: Declared here:
   34 | static ViewConfig s_viewSensitive = ViewConfig({0, 180, 240});
      |                   ^~~~~~~~~~~~~~~
/var/lib/jenkins/workspace/CI-MERGE-REQUEST-EL9/main/Tracking/Acts/ActsGeometry/src/SimpleCylinderDetBuilderTool.cxx:35:53: note: See <https://gitlab.cern.ch/atlas/atlasexternals/tree/master/External/CheckerGccPlugins#thread_plugin>.
   35 |             Acts::GeometryView3D::drawDetectorVolume(helper, *cylinderDetectorVolume, gctx->context());

```
I hope that's  fixing the warning.
  • Loading branch information
junggjo9 committed Oct 26, 2023
1 parent 0027d4c commit 6b5a2f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Core/include/Acts/Visualization/GeometryView3D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class DetectorVolume;
class Portal;
} // namespace Experimental

static ViewConfig s_viewSensitive = ViewConfig({0, 180, 240});
static ViewConfig s_viewPassive = ViewConfig({240, 280, 0});
static ViewConfig s_viewVolume = ViewConfig({220, 220, 0});
static ViewConfig s_viewGrid = ViewConfig({220, 0, 0});
static ViewConfig s_viewLine = ViewConfig({0, 0, 220});
static const ViewConfig s_viewSensitive;
static const ViewConfig s_viewPassive;
static const ViewConfig s_viewVolume;
static const ViewConfig s_viewGrid;
static const ViewConfig s_viewLine;

struct GeometryView3D {
/// Helper method to draw Polyhedron objects
Expand Down
10 changes: 10 additions & 0 deletions Core/src/Visualization/GeometryView3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ std::string getWorkingDirectory() {

} // namespace

namespace Acts {
namespace Experimental {
ViewConfig s_viewSensitive = ViewConfig({0, 180, 240});
ViewConfig s_viewPassive = ViewConfig({240, 280, 0});
ViewConfig s_viewVolume = ViewConfig({220, 220, 0});
ViewConfig s_viewGrid = ViewConfig({220, 0, 0});
ViewConfig s_viewLine = ViewConfig({0, 0, 220});
} // namespace Experimental
} // namespace Acts

void Acts::GeometryView3D::drawPolyhedron(IVisualization3D& helper,
const Polyhedron& polyhedron,
const ViewConfig& viewConfig) {
Expand Down

0 comments on commit 6b5a2f1

Please sign in to comment.