Skip to content

Commit

Permalink
feat(geo): Visualize surface, use view config default colors
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Oct 2, 2024
1 parent af499c6 commit 6f1768d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
6 changes: 4 additions & 2 deletions Core/include/Acts/Geometry/TrackingGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ class TrackingGeometry {
/// @param gctx The geometry context
/// @param viewConfig Global view config
/// @param portalViewConfig View config for portals
/// @param sensitiveViewConfig View configuration for sensitive surfaces
void visualize(IVisualization3D& helper, const GeometryContext& gctx,
const ViewConfig& viewConfig = {},
const ViewConfig& portalViewConfig = {}) const;
const ViewConfig& viewConfig = s_viewVolume,
const ViewConfig& portalViewConfig = s_viewPortal,
const ViewConfig& sensitiveViewConfig = s_viewSensitive) const;

private:
// the known world
Expand Down
9 changes: 6 additions & 3 deletions Core/include/Acts/Geometry/TrackingVolume.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "Acts/Utilities/BinnedArray.hpp"
#include "Acts/Utilities/Logger.hpp"
#include "Acts/Utilities/TransformRange.hpp"
#include "Acts/Visualization/ViewConfig.hpp"

#include <cstddef>
#include <memory>
Expand Down Expand Up @@ -477,10 +478,12 @@ class TrackingVolume : public Volume {
/// @param helper The visualization helper describing the output format
/// @param gctx The geometry context
/// @param viewConfig The view configuration
/// @param portalViewConfig View configuration for portals
/// @param sensitiveViewConfig View configuration for sensitive surfaces
void visualize(IVisualization3D& helper, const GeometryContext& gctx,
const ViewConfig& viewConfig = {},
const ViewConfig& portalViewConfig = {
.color{"#308c48"}}) const;
const ViewConfig& viewConfig = s_viewVolume,
const ViewConfig& portalViewConfig = s_viewPortal,
const ViewConfig& sensitiveViewConfig = s_viewSensitive) const;

private:
void connectDenseBoundarySurfaces(
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Surfaces/Surface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ class Surface : public virtual GeometryObject,
const GeometryContext& gctx, const Vector3& position) const = 0;

void visualize(IVisualization3D& helper, const GeometryContext& gctx,
const ViewConfig& viewConfig = {}) const;
const ViewConfig& viewConfig = s_viewSurface) const;

protected:
/// Output Method for std::ostream, to be overloaded by child classes
Expand Down
7 changes: 4 additions & 3 deletions Core/src/Geometry/TrackingGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ Acts::TrackingGeometry::geoIdSurfaceMap() const {

void Acts::TrackingGeometry::visualize(
IVisualization3D& helper, const GeometryContext& gctx,
const ViewConfig& viewConfig, const ViewConfig& portalViewConfig) const {
highestTrackingVolume()->visualize(helper, gctx, viewConfig,
portalViewConfig);
const ViewConfig& viewConfig, const ViewConfig& portalViewConfig,
const ViewConfig& sensitiveViewConfig) const {
highestTrackingVolume()->visualize(helper, gctx, viewConfig, portalViewConfig,
sensitiveViewConfig);
}
7 changes: 6 additions & 1 deletion Core/src/Geometry/TrackingVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,10 +687,15 @@ void TrackingVolume::addSurface(std::shared_ptr<Surface> surface) {
void TrackingVolume::visualize(IVisualization3D& helper,
const GeometryContext& gctx,
const ViewConfig& viewConfig,
const ViewConfig& portalViewConfig) const {
const ViewConfig& portalViewConfig,
const ViewConfig& sensitiveViewConfig) const {
helper.object(volumeName());
Volume::visualize(helper, gctx, viewConfig);

for (const auto& surface : surfaces()) {
surface.visualize(helper, gctx, sensitiveViewConfig);
}

for (const auto& child : volumes()) {
child.visualize(helper, gctx, viewConfig, portalViewConfig);
}
Expand Down

0 comments on commit 6f1768d

Please sign in to comment.