Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 2d camera mode controls for rendering and project_2d #1484

Merged
merged 6 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Notable changes to Ascent are documented in this file. This changelog started on
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project aspires to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## Unreleased
### Preferred dependency versions for ascent@develop
- [email protected]
- [email protected] (requires [patch 1](https://github.com/Alpine-DAV/ascent/blob/0aef6cffd522be7419651e6adf586f9a553297d0/scripts/build_ascent/2024_05_03_vtkm-mr3215-ext-geom-fix.patch)
- [email protected] (requires [patch 1](https://github.com/Alpine-DAV/ascent/blob/0aef6cffd522be7419651e6adf586f9a553297d0/scripts/build_ascent/2024_05_03_vtkm-mr3215-ext-geom-fix.patch)
[patch 2](https://github.com/Alpine-DAV/ascent/blob/develop/scripts/build_ascent/2024_07_02_vtkm-mr3246-raysubset_bugfix.patch) )
- [email protected]
- [email protected]
Expand All @@ -31,11 +31,12 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s
- Added `fields` option to the project 2d to support scalar rendering of specific fields.
- Added `dataset_bounds` option to the project 2d, which can be used instead of a full 3D camera specification
- Added support for triggers to execute actions from multiple files via an `actions_files` option that takes a list of actions files.
- Added an `external_surfaces` transform filter, that can be used to reduce memory requirements in pipelines where you plan to only process the external faces of a data set.
- Added an `external_surfaces` transform filter, that can be used to reduce memory requirements in pipelines where you plan to only process the external faces of a data set.
- Added a `declare_fields` action, that allows users to explicitly list the fields to return for field filtering. This option avoids complex field parsing logic.
- Added a 2d camera mode (`camera/2d: [left, right, bottom, top]`) to scene render cameras and the `project_2d` (scalar rendering) filter cameras.

### Changed
- Changed the replay utility's binary names such that `replay_ser` is now `ascent_replay` and `raplay_mpi` is now `ascent_replay_mpi`. This will help prevent potential name collisions with other tools that also have replay utilities.
- Changed the replay utility's binary names such that `replay_ser` is now `ascent_replay` and `raplay_mpi` is now `ascent_replay_mpi`. This will help prevent potential name collisions with other tools that also have replay utilities.

### Fixed
- Resolved a few cases where MPI_COMM_WORLD was used instead instead of the selected MPI communicator.
Expand Down Expand Up @@ -75,7 +76,7 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s
### Changed
- Changed the Data Binning filter to accept a `reduction_field` parameter (instead of `var`), and similarly the axis parameters to take `field` (instead of `var`). The `var` style parameters are still accepted, but deprecated and will be removed in a future release.
- Changed the Streamline and WarpXStreamline filters to apply the VTK-m Tube filter to their outputs, allowing for the results to be rendered.
- Updated CMake Python build infrastructure to use
- Updated CMake Python build infrastructure to use

### Fixed
- Various small bug fixes
Expand Down Expand Up @@ -128,12 +129,12 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s
- Added extract `flatten` from Conduit Blueprint
- Added Log base 10 filter. Filter type is `log10`
- Added Log base 2 filter. Filter type is `log2`
- Added Feature Map in the docs. Detailing Devil Ray and VTKh features
- Added Feature Map in the docs. Detailing Devil Ray and VTKh features
- Added `scripts/build_ascent/build_ascent.sh` a script that demonstrates how to manually build Ascent and its main dependencies
- Added ability to override dimensions for the rendered bounding box around a dataset
- Added CMake option `ENABLE_HIDDEN_VISIBILITY` (default=ON), which controls if hidden visibility is used for private symbols
- Added documentation for how to use ROCm's rocprof profiler for GPUs with Ascent
- Added support for Caliper performance annotations
- Added support for Caliper performance annotations
- Added automatic slice filter that evaluates a number of slices and outputs the one with the highest entropy

### Changed
Expand All @@ -157,15 +158,15 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s
- Added OCCA Derived Field Generation support
- Added more math expressions
- Added a time expression
- Added Cinema rendering support for Devil Ray
- Added `streamline` and `particle_advection` transforms
- Added Cinema rendering support for Devil Ray
- Added `streamline` and `particle_advection` transforms
- Added history gradient expressions
- Added the ability save named sessions
- Added new options to specify Cinema rendering parameters
- Added the ability save subsets of expression results to session files
- Added the ability to add comments to PNG files that Ascent creates
- Added timings out control option to Ascent (and Flow)
- Added support to render Polygonal nd Polyhedral Meshes
- Added support to render Polygonal nd Polyhedral Meshes
- Added option to turn of world annotations
- Added FIDES Support

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,33 @@ parse_image_dims(const conduit::Node &node, int &width, int &height)

}


//-----------------------------------------------------------------------------
void
parse_camera(const conduit::Node camera_node, vtkm::rendering::Camera &camera)
{
typedef vtkm::Vec<vtkm::Float32,3> vtkmVec3f;

//
// Get the optional camera parameters
//

// check for 2d mode first
if(camera_node.has_child("2d"))
{
// camera:
// 2d: [l,r,b,t]
camera.SetModeTo2D();
conduit::Node n;
camera_node["2d"].to_float64_array(n);
const float64 *view_vals = n.as_float64_ptr();

camera.SetViewRange2D(view_vals[0],
view_vals[1],
view_vals[2],
view_vals[3]);
}

if(camera_node.has_child("look_at"))
{
conduit::Node n;
Expand Down Expand Up @@ -248,8 +267,8 @@ parse_color_table(const conduit::Node &color_table_node)
}
else if (control_points_node.dtype().is_object())
{
if (control_points_node.has_child("r") &&
control_points_node.has_child("g") &&
if (control_points_node.has_child("r") &&
control_points_node.has_child("g") &&
control_points_node.has_child("b"))
{
clear = true;
Expand Down
Loading