-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move Makie-based visualization routines into ext/ folder * fix some comments * remove unused legacy function * cleanup to remove unused function and move docstrings * remove unnecessary test * Apply suggestions from code review Co-authored-by: Hendrik Ranocha <[email protected]> * revert to include legacy version of updatePlot function to avoid breaking changes * Apply suggestions from code review Co-authored-by: Michael Schlottke-Lakemper <[email protected]> --------- Co-authored-by: Hendrik Ranocha <[email protected]> Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
- Loading branch information
1 parent
e05584a
commit 1fb6471
Showing
7 changed files
with
97 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Package extension for adding Makie-based features to HOHQMesh.jl | ||
module HOHQMeshMakieExt | ||
|
||
# Required for visualization code | ||
if isdefined(Base, :get_extension) | ||
using Makie | ||
else | ||
# Until Julia v1.9 is the minimum required version for HOHQMesh.jl, we still support Requires.jl | ||
using ..Makie | ||
end | ||
|
||
# Use all exported symbols to avoid having to rewrite all the visualization routines | ||
using HOHQMesh | ||
|
||
# Use additional symbols that are not exported | ||
using HOHQMesh: Project, hasBackgroundGrid, projectBounds, projectGrid | ||
|
||
# Import functions such that they can be extended with new methods | ||
import HOHQMesh: plotProject!, updatePlot! | ||
|
||
include("VizMesh.jl") | ||
include("VizProject.jl") | ||
|
||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
# Convenience constants to make plotting easier | ||
const MODEL = 1; const GRID = 2; const MESH = 4; const EMPTY = 0 | ||
const REFINEMENTS = 8; const ALL = 15 | ||
|
||
# Add function definitions here such that they can be exported from HOHQMesh.jl | ||
# and extended in the HOHQMeshMakieExt package extension or by the | ||
# Makie-specific code loaded by Requires.jl | ||
|
||
""" | ||
plotProject!(proj::Project, plotOptions::Int = 0) | ||
Plot objects specified by the `plotOptions`. Construct the `plotOptions` by the sum | ||
of what is to be drawn from the choices `MODEL`, `GRID`, `MESH`, `REFINEMENTS`. | ||
Example: To plot the model and the grid, `plotOptions = MODEL + GRID`. To plot | ||
just the mesh, `plotOptions = MESH`. | ||
To plot everything, `plotOptions = MODEL + GRID + MESH + REFINEMENTS` | ||
Contents are overlaid in the order: `GRID`, `MESH`, `MODEL`, `REFINEMENTS` | ||
!!! note "Requires Makie.jl" | ||
Please note that for this function to work, you need to load Makie.jl | ||
in your REPL (e.g., by calling `using GLMakie`). | ||
""" | ||
function plotProject! end | ||
# Note: The function implementation is found in `ext/VizProject.jl`. | ||
|
||
|
||
""" | ||
updatePlot!(proj::Project, plotOptions::Int) | ||
Replot with the new plotOptions = combinations (sums) of | ||
GRID, MESH, MODEL, REFINEMENTS | ||
Example: `updatePlot!(p, MESH + MODEL)` | ||
!!! note "Requires Makie.jl" | ||
Please note that for this function to work, you need to load Makie.jl | ||
in your REPL (e.g., by calling `using GLMakie`). | ||
""" | ||
function updatePlot! end | ||
# Note: The function implementation is found in `ext/VizProject.jl`. |