Private API
Common methods
GridVisualize.AbstractPlotterType — Type
abstract type AbstractPlotterTypeAbstract type for dispatching on plotter
Base.getindex — Method
getindex(p, i, j)
Return a SubVisualizer
GridVisualize.ismeshcat — Method
ismeshcat(Plotter)
Heuristically check if Plotter is MeshCat
GridVisualize.tridata — Method
tridata(grid, gridscale)
Return tridata to be splatted to PyPlotter calls
GridVisualizeTools.extract_visible_bfaces3D — Method
extract_visible_bfaces3D(
grid,
xyzcut;
gridscale,
primepoints,
Tp,
Tf
)
Extract visible boundary faces - those not cut off by the planes x=xyzcut[1] or y=xyzcut[2] or z=xyzcut[3].
Return corresponding points and facets for each region for drawing as mesh (Makie,MeshCat) or trisurf (pyplot)
GridVisualizeTools.extract_visible_cells3D — Method
extract_visible_cells3D(
grid,
xyzcut;
cellcoloring,
gridscale,
primepoints,
Tp,
Tf
)
Extract visible tetrahedra - those intersecting with the planes x=xyzcut[1] or y=xyzcut[2] or z=xyzcut[3].
Return corresponding points and facets for each region for drawing as mesh (Makie,MeshCat) or trisurf (pyplot)
GridVisualizeTools.marching_tetrahedra — Method
marching_tetrahedra(
grid,
func,
planes,
flevels;
gridscale,
kwargs...
)
Extract isosurfaces and plane interpolation for function on 3D tetrahedral mesh. See marching_tetrahedra(coord,cellnodes,func,planes,flevels;tol, primepoints, primevalues, Tv, Tp, Tf)
GridVisualizeTools.marching_triangles — Method
marching_triangles(grid, func, lines, levels; gridscale)
Collect isoline snippets and/or intersection points with lines and values ready for linesegments!
GridVisualizeTools.marching_triangles — Method
marching_triangles(grid, func, levels; gridscale)
Deprecated
GridVisualize.compute_2d_rotation_matrix — Method
compute_2d_rotation_matrix(target_vector)
Compute and return a rotation matrix 𝐑²ˣ²
which rotates the second unit vector y = [0, 1]ᵀ
in the direction of a given target_vector t ∈ 𝐑²
target_vector: vector with 2 components (not necessarily of unit length)GridVisualize.compute_3d_z_rotation_matrix — Method
compute_3d_z_rotation_matrix(target_vector)
Compute and return a rotation matrix 𝐑³ˣ³
which rotates the third unit vector z = [0, 0, 1]ᵀ
in the direction of a given target_vector t ∈ 𝐑³
target_vector: vector with 3 components (not necessarily of unit length)GridVisualize.eval_slice_expr! — Method
eval_slice_expr!(vec, pair)
Provide a Symbol-Number pair as a slice expression.
Allowed symbols are :x, :y and :z.
Example:
- :x = 4 becomes :(x - 4)
- :y = -3 becomes :(y + 3)GridVisualize.eval_slice_expr! — Method
eval_slice_expr!(vec, expr)
Evaluate an expression of the form :(αx ± βy ± γz ± δ)
and compute the vector vec = [ α, β, γ, δ ].
At least one nonzero symbol :x, :y or :z needs to be present.
Providing a :z symbol assumes that length(vec) == 4.
Examples:
- :(x-3) => [ 1, 0, 0, -3 ]
- :(2x - z + 3) => [2, 0, 1, 3]GridVisualize.slice_plot! — Method
slice_plot!(ctx, _, grid, values)
Extract a 1D line plot from a 2D plot
The intersection of the given 2D grid with a given line is computed and rotated onto the
first coordinate axis.
For a simple line (x = const / y = const) the original coordinates of the other axis are
preserved.
Else, for a generic line, the new axis has non-negative values and starts at [0,0].
ctx: plotting context
grid: 2D ExtendableGrid
values: value vector corresponding to the grid nodes
line: Vector [a,b,c], s.t., ax + by + d = 0 defines the line that slices the 2D gridGridVisualize.slice_plot! — Method
slice_plot!(ctx, _, grid, values)
Extract a 2D plane plot of a 3D plot
The intersection of the given 3D grid with a given plane is computed and rotated into a 2D
coordinate system.
For a simple plane (x = const / y = const / z = const) the original coordinates of the free
axes are preserved. The plotted axes order is in this case
x = const: ( y, z )
y = const: ( x, z )
z = const: ( x, y )
Else, for a generic plane, the new coordinate system has non-negative values and start at [0,0].
ctx: Plotting context
grid: 3D ExtendableGrid
values: value vector corresponding to the grid nodes
plane: Vector [a,b,c,d], s.t., ax + by + cz + d = 0 defines the plane that slices the 3D gridGridVisualize.ispyplot — Function
ispyplot(Plotter)
Heuristically check if Plotter is PyPlot
GridVisualize.ispythonplot — Function
ispythonplot(Plotter)
Heuristically check if Plotter is PythonPlot
GridVisualize.isplutovista — Function
isplutovista(Plotter)
Heuristically check if Plotter is PlutoVista
GridVisualize.isplots — Function
isplots(Plotter)
Heuristically check if Plotter is Plots
GridVisualize.ismakie — Function
ismakie(Plotter)
Heuristically check if Plotter is Makie/WGLMakie
GridVisualize.isvtkview — Function
isvtkview(Plotter)
Heuristically check if Plotter is VTKView
Makie
GridVisualizeMakieExt — Module
module GridVisualizeMakieExtMakie extension module for GridVisualize.jl. This is almost fully supported and works with GLMakie, CairoMalie and WGLMakie.
GridVisualizeMakieExt.makescene2d — Function
makescene2d(ctx)
Complete scene with title and status line showing interaction state. This uses a gridlayout and its protrusion capabilities.
GridVisualizeMakieExt.makescene3d — Function
makescene3d(ctx)Complete scene with title and status line showing interaction state. This uses a gridlayout and its protrusion capabilities.
GridVisualizeMakieExt.makeaxis3d — Function
makeaxis3d(ctx)
Dispatch between LScene and new Axis3. Axis3 does not allow zoom, so we support LScene in addition.
GridVisualizeMakieExt.scene_interaction — Function
scene_interaction(update_scene,view,switchkeys::Vector{Symbol}=[:nothing])Control multiple scene elements via keyboard up/down keys. Each switchkey is assumed to correspond to one of these elements. Pressing a switch key transfers control to its associated element.
Control of values of the current associated element is performed by triggering change values via up/down (± 1) resp. pageup/pagedown (±10) keys
The update_scene callback gets passed the change value and the symbol.
FlippableLayout
GridVisualizeMakieExt.FlippableLayout — Module
This module is a submodule of [GridVisualizeMakieExt](@ref).
It manages a layoutscene with interactive layout and blocking functionality.
Thanks to Julius Krumbiegel for providing a basic implementation of focus switching.
GridVisualize avoids creating dependencies on plotting backends. So we provide a way to emulate "import Makie" by allowing to set it as a global variable in the GridVisualizeMakieExt.FlippableLayout.setmakie!. As a consequence, we can't use Makie types at compile time.
GridVisualizeMakieExt.FlippableLayout.FLayout — Type
mutable struct FLayoutStruct describing flippable layout data. We don't type annotate with Makie types as they are unknown at start time.
visible: Visible GridLayout
offscreen: Hidden GridLayot
blocked: Has the layout been blocked by the block key ?
layoutables: Layoutables attached to layout
condition: Condition variable working together with the blocked field.
GridVisualizeMakieExt.FlippableLayout.setmakie! — Function
setmakie!(MyMakie)Set the Makie module. This Makie can be GLMakie,WGLMakie,CairoMakie
GridVisualizeMakieExt.FlippableLayout.yieldwait — Function
yieldwait(fliplayoutscene)Yield and wait in case of scene being blocked via space key toggle
GridVisualizeMakieExt.FlippableLayout.flayoutscene — Function
flayoutscene(;blocked=false, kwargs...)Layoutscene with interactive layout and blocking functionality.
The , key switches between focused view showing only one subscene and "gallery view" showing all layoutables at once.
The space key toggles blocking of the execution of the main therad when yield is replaced by yieldwait. Initial blocking state is set by the blocked kwarg.
The kwargs... are the same as of AbstractPlotting.layoutscene.
The idea is that this can work in some cases as a drop-in replacement of layoutscene.
PlutoVista
GridVisualizePlutoVistaExt — Module
module GridVisualizePlutoVistaExtExtension module for PlutoVista.jl
PyPlot/PythonPlot
GridVisualizePyPlotExt — Module
module GridVisualizePyPlotExtExtension module for PyPlot.jl. Supports almost all frontend methods.
GridVisualize.tridata — Function
tridata(grid, gridscale)
Return tridata to be splatted to PyPlotter calls
Plots
GridVisualizePlotsExt — Module
module GridVisualizePlotsExtExtension module for Plots.jl. Supports part of the frontend methods.
GridVisualizePlotsExt.rectdata — Function
rectdata(grid, gridscale, U)
Return rectangular grid data + function to be splatted into Plots calls
ImplEvalSlice
GridVisualize.ImplEvalSlice — Module
Implementation details for slice evaluation. Do not use directly.
Experimental
GridVisualizeVTKViewExt — Module
module GridVisualizeVTKViewExtExtension module for VTKView.jl. Experimental.
GridVisualizeMeshCatExt — Module
module GridVisualizeMeshCatExtExtension module for MeshCat.jl. Experimental.