diff --git a/include/openmc/plot.h b/include/openmc/plot.h index 061c366f7..da83f42aa 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -57,6 +57,11 @@ struct RGBColor { uint8_t red, green, blue; }; +// some default colors +const RGBColor WHITE {255, 255, 255}; +const RGBColor RED {255, 0, 0}; + + typedef xt::xtensor ImageData; struct IdData { @@ -218,10 +223,10 @@ public: PlotType type_; //!< Plot type (Slice/Voxel) PlotColorBy color_by_; //!< Plot coloring (cell/material) int meshlines_width_; //!< Width of lines added to the plot - int index_meshlines_mesh_; //!< Index of the mesh to draw on the plot + int index_meshlines_mesh_ {-1}; //!< Index of the mesh to draw on the plot RGBColor meshlines_color_; //!< Color of meshlines on the plot - RGBColor not_found_; //!< Plot background color - RGBColor overlap_color_; //!< Plot overlap color + RGBColor not_found_ {WHITE}; //!< Plot background color + RGBColor overlap_color_ {RED}; //!< Plot overlap color std::vector colors_; //!< Plot colors std::string path_plot_; //!< Plot output filename }; diff --git a/src/plot.cpp b/src/plot.cpp index 93d0abaf2..4dd62fbed 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -28,8 +28,6 @@ namespace openmc { // Constants //============================================================================== -const RGBColor WHITE {255, 255, 255}; -const RGBColor RED {255, 0, 0}; constexpr int PLOT_LEVEL_LOWEST {-1}; //!< lower bound on plot universe level constexpr int32_t NOT_FOUND {-2}; @@ -291,9 +289,6 @@ Plot::set_bg_color(pugi::xml_node plot_node) << id_; fatal_error(err_msg); } - } else { - // default to a white background - not_found_ = WHITE; } }