mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-24 20:15:26 -04:00
Fix reading of horizontal field of view for ray-traced plots (#3330)
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
This commit is contained in:
parent
8fb48f125f
commit
39ad29d82e
3 changed files with 86 additions and 6 deletions
12
src/plot.cpp
12
src/plot.cpp
|
|
@ -1083,7 +1083,7 @@ WireframeRayTracePlot::WireframeRayTracePlot(pugi::xml_node node)
|
|||
|
||||
void WireframeRayTracePlot::set_wireframe_color(pugi::xml_node plot_node)
|
||||
{
|
||||
// Copy plot background color
|
||||
// Copy plot wireframe color
|
||||
if (check_for_node(plot_node, "wireframe_color")) {
|
||||
vector<int> w_rgb = get_node_array<int>(plot_node, "wireframe_color");
|
||||
if (w_rgb.size() == 3) {
|
||||
|
|
@ -1503,13 +1503,15 @@ void RayTracePlot::set_look_at(pugi::xml_node node)
|
|||
void RayTracePlot::set_field_of_view(pugi::xml_node node)
|
||||
{
|
||||
// Defaults to 70 degree horizontal field of view (see .h file)
|
||||
if (check_for_node(node, "field_of_view")) {
|
||||
double fov = std::stod(get_node_value(node, "field_of_view", true));
|
||||
if (check_for_node(node, "horizontal_field_of_view")) {
|
||||
double fov =
|
||||
std::stod(get_node_value(node, "horizontal_field_of_view", true));
|
||||
if (fov < 180.0 && fov > 0.0) {
|
||||
horizontal_field_of_view_ = fov;
|
||||
} else {
|
||||
fatal_error(fmt::format(
|
||||
"Field of view for plot {} out-of-range. Must be in (0, 180).", id()));
|
||||
fatal_error(fmt::format("Horizontal field of view for plot {} "
|
||||
"out-of-range. Must be in (0, 180) degrees.",
|
||||
id()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue