From e837f2eb1999e8560a4ed2f3486e4524b92c5fc8 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 10 Jun 2019 20:19:57 -0500 Subject: [PATCH] Adding an xml setting for the showing the overlaps. --- include/openmc/plot.h | 3 ++- src/plot.cpp | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/openmc/plot.h b/include/openmc/plot.h index 48920afad..1621def93 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -112,7 +112,7 @@ public: Position width_; //!< Plot width in geometry PlotBasis basis_; //!< Plot basis (XY/XZ/YZ) std::array pixels_; //!< Plot size in pixels - bool color_overlaps_ = true; + bool color_overlaps_; int level_; //!< Plot universe level }; @@ -210,6 +210,7 @@ private: void set_user_colors(pugi::xml_node plot_node); void set_meshlines(pugi::xml_node plot_node); void set_mask(pugi::xml_node plot_node); + void set_color_overlaps(pugi::xml_node plot_node); // Members public: diff --git a/src/plot.cpp b/src/plot.cpp index 78b1c6a71..91effefb3 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -657,6 +657,19 @@ Plot::set_mask(pugi::xml_node plot_node) } } +void Plot::set_color_overlaps(pugi::xml_node plot_node) { + color_overlaps_ = false; + if (check_for_node(plot_node, "show_overlaps")) { + color_overlaps_ = get_node_value_bool(plot_node, "show_overlaps"); + } + + // make sure we allocate the vector for counting overlap checks if + // they're going to be plotted + if (color_overlaps_ && settings::run_mode == RUN_MODE_PLOTTING) { + settings::check_overlaps = true; + } +} + Plot::Plot(pugi::xml_node plot_node) : index_meshlines_mesh_{-1} { @@ -672,6 +685,7 @@ Plot::Plot(pugi::xml_node plot_node) set_user_colors(plot_node); set_meshlines(plot_node); set_mask(plot_node); + set_color_overlaps(plot_node); } // End Plot constructor //============================================================================== @@ -868,6 +882,7 @@ void create_voxel(Plot pl) pltbase.basis_ = PlotBasis::xy; pltbase.pixels_ = pl.pixels_; pltbase.level_ = -1; // all universes for voxel files + pltbase.color_overlaps_ = pl.color_overlaps_; ProgressBar pb; for (int z = 0; z < pl.pixels_[2]; z++) {