Skip to content

Commit

Permalink
viewconfig: remaining occurrences
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Sep 16, 2024
1 parent 39fa00b commit 9cd5062
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ class ObjTrackingGeometryWriter {
std::size_t outputPrecision = 6; ///< floating point precision
std::string outputDir = ".";

Acts::ViewConfig containerView = Acts::ViewConfig({220, 220, 220});
Acts::ViewConfig volumeView = Acts::ViewConfig({220, 220, 0});
Acts::ViewConfig sensitiveView = Acts::ViewConfig({0, 180, 240});
Acts::ViewConfig passiveView = Acts::ViewConfig({240, 280, 0});
Acts::ViewConfig gridView = Acts::ViewConfig({220, 0, 0});
Acts::ViewConfig containerView = {.color = {220, 220, 220}};
Acts::ViewConfig volumeView = {.color = {220, 220, 0}};
Acts::ViewConfig sensitiveView = {.color = {0, 180, 240}};
Acts::ViewConfig passiveView = {.color = {240, 280, 0}};
Acts::ViewConfig gridView = {.color = {220, 0, 0}};
};

/// Constructor
Expand Down
6 changes: 3 additions & 3 deletions Examples/Python/src/Obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void addObj(Context& ctx) {
const GeometryContext& viewContext,
const std::array<int, 3>& viewRgb, unsigned int viewSegements,
const std::string& fileName) {
Acts::ViewConfig sConfig = Acts::ViewConfig{viewRgb};
Acts::ViewConfig sConfig = Acts::ViewConfig{.color = viewRgb};
sConfig.nSegments = viewSegements;
Acts::GeometryView3D view3D;
Acts::ObjVisualization3D obj;
Expand All @@ -60,7 +60,7 @@ void addObj(Context& ctx) {
const GeometryContext& viewContext,
const std::array<int, 3>& viewRgb, unsigned int viewSegements,
const std::string& fileName) {
Acts::ViewConfig sConfig = Acts::ViewConfig{viewRgb};
Acts::ViewConfig sConfig = Acts::ViewConfig{.color = viewRgb};
sConfig.nSegments = viewSegements;
Acts::GeometryView3D view3D;
Acts::ObjVisualization3D obj;
Expand All @@ -79,7 +79,7 @@ void addObj(Context& ctx) {
const GeometryContext& viewContext,
const std::array<int, 3>& viewRgb, unsigned int viewSegements,
const std::string& fileName) {
Acts::ViewConfig sConfig = Acts::ViewConfig{viewRgb};
Acts::ViewConfig sConfig = Acts::ViewConfig{.color = viewRgb};
sConfig.nSegments = viewSegements;
Acts::GeometryView3D view3D;
Acts::ObjVisualization3D obj;
Expand Down
6 changes: 3 additions & 3 deletions Tests/UnitTests/Core/Geometry/ProtoLayerHelperTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(ProtoLayerHelperTests) {
layerSurfaces.end());
}

ViewConfig unsorted({252, 160, 0});
ViewConfig unsorted{.color = {252, 160, 0}};
for (auto& sf : cylinderSurfaces) {
GeometryView3D::drawSurface(objVis, *sf, tgContext, Transform3::Identity(),
unsorted);
Expand All @@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(ProtoLayerHelperTests) {
std::size_t il = 0;
for (auto& layer : radialLayers) {
for (auto& sf : layer.surfaces()) {
ViewConfig sorted(sortedColors[il]);
ViewConfig sorted{.color = sortedColors[il]};
GeometryView3D::drawSurface(objVis, *sf, tgContext,
Transform3::Identity(), sorted);
}
Expand Down Expand Up @@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(ProtoLayerHelperTests) {
il = 0;
for (auto& layer : discLayersZ) {
for (auto& sf : layer.surfaces()) {
ViewConfig ViewConfig(sortedColors[il]);
ViewConfig ViewConfig{.color = sortedColors[il]};
GeometryView3D::drawSurface(objVis, *sf, tgContext,
Transform3::Identity(), ViewConfig);
}
Expand Down
12 changes: 6 additions & 6 deletions Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,15 +1158,15 @@ BOOST_AUTO_TEST_CASE(Material) {
ObjVisualization3D obj;

bool triangulate = true;
ViewConfig viewSensitive = ViewConfig({0, 180, 240});
ViewConfig viewSensitive = {.color = {0, 180, 240}};
viewSensitive.triangulate = triangulate;
ViewConfig viewPassive = ViewConfig({240, 280, 0});
ViewConfig viewPassive = {.color = {240, 280, 0}};
viewPassive.triangulate = triangulate;
ViewConfig viewVolume = ViewConfig({220, 220, 0});
ViewConfig viewVolume = {.color = {220, 220, 0}};
viewVolume.triangulate = triangulate;
ViewConfig viewContainer = ViewConfig({220, 220, 0});
ViewConfig viewContainer = {.color = {220, 220, 0}};
viewContainer.triangulate = triangulate;
ViewConfig viewGrid = ViewConfig({220, 0, 0});
ViewConfig viewGrid = {.color = {220, 0, 0}};
viewGrid.nSegments = 8;
viewGrid.offset = 3.;
viewGrid.triangulate = triangulate;
Expand All @@ -1186,7 +1186,7 @@ BOOST_AUTO_TEST_CASE(Material) {
ObjVisualization3D obj;

double localErrorScale = 10000000.;
ViewConfig mcolor({255, 145, 48});
ViewConfig mcolor{.color = {255, 145, 48}};
mcolor.offset = 2;
// mcolor.visible = true;

Expand Down
16 changes: 8 additions & 8 deletions Tests/UnitTests/Core/Visualization/EventDataView3DBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ void createDetector(GeometryContext& tgContext,
static inline std::string testBoundTrackParameters(IVisualization3D& helper) {
std::stringstream ss;

ViewConfig pcolor({20, 120, 20});
ViewConfig scolor({235, 198, 52});
ViewConfig pcolor{.color = {20, 120, 20}};
ViewConfig scolor{.color = {235, 198, 52}};

auto gctx = GeometryContext();
auto identity = Transform3::Identity();
Expand Down Expand Up @@ -245,7 +245,7 @@ static inline std::string testMeasurement(IVisualization3D& helper,
eBoundLoc0, eBoundLoc1, loc, cov2D, surface->geometryId()});
}

ViewConfig mcolor({255, 145, 48});
ViewConfig mcolor{.color = {255, 145, 48}};
mcolor.offset = 0.01;

// Draw the measurements
Expand Down Expand Up @@ -378,14 +378,14 @@ static inline std::string testMultiTrajectory(IVisualization3D& helper) {
double localErrorScale = 100.;
double directionErrorScale = 100000;

ViewConfig scolor({214, 214, 214});
ViewConfig mcolor({255, 145, 48});
ViewConfig scolor{.color = {214, 214, 214}};
ViewConfig mcolor{.color = {255, 145, 48}};
mcolor.offset = -0.01;
ViewConfig ppcolor({51, 204, 51});
ViewConfig ppcolor{.color = {51, 204, 51}};
ppcolor.offset = -0.02;
ViewConfig fpcolor({255, 255, 0});
ViewConfig fpcolor{.color = {255, 255, 0}};
fpcolor.offset = -0.03;
ViewConfig spcolor({0, 125, 255});
ViewConfig spcolor{.color = {0, 125, 255}};
spcolor.offset = -0.04;

EventDataView3D::drawMultiTrajectory(
Expand Down
4 changes: 2 additions & 2 deletions Tests/UnitTests/Core/Visualization/PrimitivesView3DBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ GeometryContext gctx = GeometryContext();
static inline std::string run(IVisualization3D& helper) {
std::stringstream ss;

ViewConfig lineView({0, 0, 255});
ViewConfig lineView{.color = {0, 0, 255}};
lineView.lineThickness = 0.1;

// Line visualization ------------------------------------------------
Expand Down Expand Up @@ -71,7 +71,7 @@ static inline std::string run(IVisualization3D& helper) {
// Error visualization: local ---------------------------------------------
Acts::GeometryView3D::drawSurface(helper, *plane, gctx);

ViewConfig errorVis({250, 0, 0});
ViewConfig errorVis{.color = {250, 0, 0}};
errorVis.lineThickness = 0.025;

SquareMatrix2 cov = SquareMatrix2::Identity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ static inline std::string run(IVisualization3D& helper, bool triangulate,
const std::string& tag) {
std::stringstream cStream;

ViewConfig viewSensitive = ViewConfig({0, 180, 240});
ViewConfig viewSensitive = {.color = {0, 180, 240}};
viewSensitive.triangulate = triangulate;
ViewConfig viewPassive = ViewConfig({240, 280, 0});
ViewConfig viewPassive = {.color = {240, 280, 0}};
viewPassive.triangulate = triangulate;
ViewConfig viewVolume = ViewConfig({220, 220, 0});
ViewConfig viewVolume = {.color = {220, 220, 0}};
viewVolume.triangulate = triangulate;
ViewConfig viewContainer = ViewConfig({220, 220, 0});
ViewConfig viewContainer = {.color = {220, 220, 0}};
viewContainer.triangulate = triangulate;
ViewConfig viewGrid = ViewConfig({220, 0, 0});
ViewConfig viewGrid = {.color = {220, 0, 0}};
viewGrid.nSegments = 8;
viewGrid.offset = 3.;
viewGrid.triangulate = triangulate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,14 @@ BOOST_AUTO_TEST_CASE(Geant4DetecturSurfaceFactory_Transforms) {
Acts::ObjVisualization3D obj;
Acts::Vector3 origin(0, 0, 0);
Acts::GeometryView3D::drawArrowForward(obj, origin, Acts::Vector3(100, 0, 0),
1000, 10,
Acts::ViewConfig({255, 0, 0}));
1000, 10, {.color = {255, 0, 0}});
Acts::GeometryView3D::drawArrowForward(obj, origin, Acts::Vector3(0, 100, 0),
1000, 10,
Acts::ViewConfig({0, 255, 0}));
1000, 10, {.color = {0, 255, 0}});
Acts::GeometryView3D::drawArrowForward(obj, origin, Acts::Vector3(0, 0, 100),
1000, 10,
Acts::ViewConfig({0, 0, 255}));
Acts::GeometryView3D::drawArrowForward(
obj, surface->center(gctx), surface->center(gctx) + 100 * normal, 1000,
10, Acts::ViewConfig({0, 255, 0}));
1000, 10, {.color = {0, 0, 255}});
Acts::GeometryView3D::drawArrowForward(obj, surface->center(gctx),
surface->center(gctx) + 100 * normal,
1000, 10, {.color = {0, 255, 0}});
auto surfaces = cache.sensitiveSurfaces;
for (const auto& [k, val] : Acts::enumerate(cache.sensitiveSurfaces)) {
const auto& [el, surf] = val;
Expand Down
6 changes: 3 additions & 3 deletions Tests/UnitTests/Plugins/TGeo/TGeoArb8ConversionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ namespace Acts::Test {

GeometryContext tgContext = GeometryContext();

ViewConfig red({200, 0, 0});
ViewConfig green({0, 200, 0});
ViewConfig blue({0, 0, 200});
ViewConfig red{.color = {200, 0, 0}};
ViewConfig green{.color = {0, 200, 0}};
ViewConfig blue{.color = {0, 0, 200}};

/// @brief Unit test to convert a TGeoTrd2 into a Plane
///
Expand Down
6 changes: 3 additions & 3 deletions Tests/UnitTests/Plugins/TGeo/TGeoBBoxConversionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ namespace Acts::Test {

GeometryContext tgContext = GeometryContext();

ViewConfig red({200, 0, 0});
ViewConfig green({0, 200, 0});
ViewConfig blue({0, 0, 200});
ViewConfig red{.color = {200, 0, 0}};
ViewConfig green{.color = {0, 200, 0}};
ViewConfig blue{.color = {0, 0, 200}};

/// @brief Unit test to convert a Bbox into a Plane
///
Expand Down
6 changes: 3 additions & 3 deletions Tests/UnitTests/Plugins/TGeo/TGeoTrd1ConversionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ namespace Acts::Test {

GeometryContext tgContext = GeometryContext();

ViewConfig red({200, 0, 0});
ViewConfig green({0, 200, 0});
ViewConfig blue({0, 0, 200});
ViewConfig red{.color = {200, 0, 0}};
ViewConfig green{.color = {0, 200, 0}};
ViewConfig blue{.color = {0, 0, 200}};

/// @brief Unit test to convert a TGeoTrd1 into a Plane
///
Expand Down
6 changes: 3 additions & 3 deletions Tests/UnitTests/Plugins/TGeo/TGeoTrd2ConversionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ namespace Acts::Test {

GeometryContext tgContext = GeometryContext();

ViewConfig red({200, 0, 0});
ViewConfig green({0, 200, 0});
ViewConfig blue({0, 0, 200});
ViewConfig red{.color = {200, 0, 0}};
ViewConfig green{.color = {0, 200, 0}};
ViewConfig blue{.color = {0, 0, 200}};

/// @brief Unit test to convert a TGeoTrd2 into a Plane
///
Expand Down
6 changes: 3 additions & 3 deletions Tests/UnitTests/Plugins/TGeo/TGeoTubeConversionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ namespace Acts::Test {

GeometryContext tgContext = GeometryContext();

ViewConfig red({200, 0, 0});
ViewConfig green({0, 200, 0});
ViewConfig blue({0, 0, 200});
ViewConfig red{.color = {200, 0, 0}};
ViewConfig green{.color = {0, 200, 0}};
ViewConfig blue{.color = {0, 0, 200}};

std::vector<std::string> allowedAxes = {"XY*", "Xy*", "xy*", "xY*",
"YX*", "yx*", "yX*", "Yx*"};
Expand Down

0 comments on commit 9cd5062

Please sign in to comment.