diff --git a/CHANGELOG.md b/CHANGELOG.md index 62c23fdaf..25d41dc1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s ### Fixed - Resolved a few cases where MPI_COMM_WORLD was used instead instead of the selected MPI communicator. - Resolved a bug where a sharing a coordset between multiple polytopal topologies would corrupt mesh processing. +- Fixed a bug with Cinema resource output that could lead to corrupted html results. +- Fixed a bug where controls for world and screen annotations where ignored in Cinema renders. ## [0.9.3] - Released 2024-05-11 ### Preferred dependency versions for ascent@0.9.3 diff --git a/src/libs/ascent/runtimes/flow_filters/ascent_runtime_rendering_filters.cpp b/src/libs/ascent/runtimes/flow_filters/ascent_runtime_rendering_filters.cpp index 55108311d..0c28ee744 100644 --- a/src/libs/ascent/runtimes/flow_filters/ascent_runtime_rendering_filters.cpp +++ b/src/libs/ascent/runtimes/flow_filters/ascent_runtime_rendering_filters.cpp @@ -736,7 +736,7 @@ class CinemaManager { conduit::Node render_copy = render_node; - // allow zoom to be ajusted + // allow zoom to be adjusted conduit::Node zoom; if(render_copy.has_path("camera/zoom")) { @@ -774,6 +774,7 @@ class CinemaManager } tmp.SetCamera(camera); + renders->push_back(tmp); } } diff --git a/src/libs/ascent/utils/ascent_resources.cpp b/src/libs/ascent/utils/ascent_resources.cpp index ae1b41036..87e092720 100644 --- a/src/libs/ascent/utils/ascent_resources.cpp +++ b/src/libs/ascent/utils/ascent_resources.cpp @@ -87,8 +87,12 @@ expand_resource_tree_to_file_system(const conduit::Node &resource_tree, { ASCENT_ERROR("expand_to_file_system failed to open file: " << "\"" << child_file << "\""); + } - ofs << curr.as_string(); + std::string sval; + // construct string obeying bounds + sval.assign(curr.as_char8_str(), curr.dtype().number_of_elements()); + ofs << sval; } else { diff --git a/src/libs/vtkh/rendering/Render.cpp b/src/libs/vtkh/rendering/Render.cpp index 67e241d4c..8de6708d5 100644 --- a/src/libs/vtkh/rendering/Render.cpp +++ b/src/libs/vtkh/rendering/Render.cpp @@ -238,6 +238,8 @@ Render::Copy() const copy.m_bg_color = m_bg_color; copy.m_fg_color = m_fg_color; copy.m_render_annotations = m_render_annotations; + copy.m_render_world_annotations = m_render_world_annotations; + copy.m_render_screen_annotations = m_render_screen_annotations; copy.m_render_background = m_render_background; copy.m_shading = m_shading; copy.m_canvas = CreateCanvas(); @@ -266,6 +268,12 @@ Render::Print() const std::cout<<"=== annotations : " <<(m_render_annotations ? "On" : "Off") <<"\n"; + std::cout<<"=== world annotations : " + <<(m_render_world_annotations ? "On" : "Off") + <<"\n"; + std::cout<<"=== screen annotations : " + <<(m_render_screen_annotations ? "On" : "Off") + <<"\n"; std::cout<<"=== background : " <<(m_render_background ? "On" : "Off") <<"\n"; diff --git a/src/tests/ascent/t_ascent_cinema_a.cpp b/src/tests/ascent/t_ascent_cinema_a.cpp index 11e414051..60b69d9d4 100644 --- a/src/tests/ascent/t_ascent_cinema_a.cpp +++ b/src/tests/ascent/t_ascent_cinema_a.cpp @@ -114,6 +114,100 @@ TEST(ascent_cinema_a, test_cinema_a) EXPECT_TRUE(conduit::utils::is_file(output_file)); } + +//----------------------------------------------------------------------------- +TEST(ascent_cinema_a, test_cinema_a_annotations_off) +{ + // the vtkm runtime is currently our only rendering runtime + Node n; + ascent::about(n); + // only run this test if ascent was built with vtkm support + if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled") + { + ASCENT_INFO("Ascent support disabled, skipping test"); + return; + } + + // + // Create example mesh. + // + Node data, verify_info; + conduit::blueprint::mesh::examples::braid("hexs", + EXAMPLE_MESH_SIDE_DIM, + EXAMPLE_MESH_SIDE_DIM, + EXAMPLE_MESH_SIDE_DIM, + data); + + EXPECT_TRUE(conduit::blueprint::mesh::verify(data,verify_info)); + + std::string db_no_annot = "test_db1_no_annotations"; + std::string db_world_no_annot = "test_db1_no_world_annotations"; + std::string db_no_screen_annot = "test_db1_no_screen_annotations"; + + string output_path_base = conduit::utils::join_file_path(".","cinema_databases"); + conduit::utils::remove_path_if_exists(conduit::utils::join_file_path(output_path_base, db_no_annot)); + conduit::utils::remove_path_if_exists(conduit::utils::join_file_path(output_path_base, db_world_no_annot)); + conduit::utils::remove_path_if_exists(conduit::utils::join_file_path(output_path_base, db_no_screen_annot)); + + Node actions; + + conduit::Node pipelines; + pipelines["pl1/f1/type"] = "contour"; + conduit::Node &contour_params = pipelines["pl1/f1/params"]; + contour_params["field"] = "braid"; + contour_params["iso_values"] = 0.; + + conduit::Node scenes; + scenes["scene1/plots/plt1/type"] = "pseudocolor"; + scenes["scene1/plots/plt1/pipeline"] = "pl1"; + scenes["scene1/plots/plt1/field"] = "braid"; + + // no annotations + scenes["scene1/renders/r1/type"] = "cinema"; + scenes["scene1/renders/r1/phi"] = 2; + scenes["scene1/renders/r1/theta"] = 2; + scenes["scene1/renders/r1/db_name"] = db_no_annot; + scenes["scene1/renders/r1/annotations"] = "false"; + + // no world annotations + scenes["scene1/renders/r2/type"] = "cinema"; + scenes["scene1/renders/r2/phi"] = 2; + scenes["scene1/renders/r2/theta"] = 2; + scenes["scene1/renders/r2/db_name"] = db_world_no_annot; + scenes["scene1/renders/r2/world_annotations"] = "false"; + + // no screen annotations + scenes["scene1/renders/r3/type"] = "cinema"; + scenes["scene1/renders/r3/phi"] = 2; + scenes["scene1/renders/r3/theta"] = 2; + scenes["scene1/renders/r3/db_name"] = db_no_screen_annot; + scenes["scene1/renders/r3/screen_annotations"] = "false"; + + // add the pipeline + conduit::Node &add_pipelines = actions.append(); + add_pipelines["action"] = "add_pipelines"; + add_pipelines["pipelines"] = pipelines; + + // add scene + conduit::Node &add_scenes = actions.append(); + add_scenes["action"] = "add_scenes"; + add_scenes["scenes"] = scenes; + actions.print(); + + // Run Ascent + Ascent ascent; + ascent.open(); + ascent.publish(data); + ascent.execute(actions); + ascent.close(); + + // check that we created the db dirs + EXPECT_TRUE(conduit::utils::is_directory(conduit::utils::join_file_path(output_path_base, db_no_annot))); + EXPECT_TRUE(conduit::utils::is_directory(conduit::utils::join_file_path(output_path_base, db_world_no_annot))); + EXPECT_TRUE(conduit::utils::is_directory(conduit::utils::join_file_path(output_path_base, db_no_screen_annot))); +} + + //----------------------------------------------------------------------------- TEST(ascent_cinema_a, test_angle_range_1) {