Private API
Common methods
GridVisualize.AbstractPlotterType — Typeabstract type AbstractPlotterTypeAbstract type for dispatching on plotter
Base.getindex — Methodgetindex(p, i, j)
Return a SubVisualizer
Base.size — Methodsize(p)
Return the layout of a GridVisualizer
GridVisualize.ismeshcat — Methodismeshcat(Plotter)
Heuristically check if Plotter is MeshCat
GridVisualizeTools.extract_visible_bfaces3D — Methodextract_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 — Methodextract_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 — Methodmarching_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 — Methodmarching_triangles(grid, func, lines, levels; gridscale)
Collect isoline snippets and/or intersection points with lines and values ready for linesegments!
GridVisualizeTools.marching_triangles — Methodmarching_triangles(grid, func, levels; gridscale)
Deprecated
GridVisualize.compute_2d_rotation_matrix — Methodcompute_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 — Methodcompute_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! — Methodeval_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! — Methodeval_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! — Methodslice_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! — Methodslice_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 — Functionispyplot(Plotter)
Heuristically check if Plotter is PyPlot
GridVisualize.isplutovista — Functionisplutovista(Plotter)
Heuristically check if Plotter is PlutoVista
GridVisualize.isplots — Functionisplots(Plotter)
Heuristically check if Plotter is Plots
GridVisualize.ismakie — Functionismakie(Plotter)
Heuristically check if Plotter is Makie/WGLMakie
GridVisualize.isvtkview — Functionisvtkview(Plotter)
Heuristically check if Plotter is VTKView
Makie
GridVisualizeMakieExt — Modulemodule GridVisualizeMakieExtMakie extension module for GridVisualize.jl. This is almost fully supported and works with GLMakie, CairoMalie and WGLMakie.
GridVisualizeMakieExt.makescene2d — Functionmakescene2d(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 — Functionmakeaxis3d(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 — ModuleThis 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 — Typemutable 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! — Functionsetmakie!(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 — Functionflayoutscene(;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 — Modulemodule GridVisualizePlutoVistaExtExtension module for PlutoVista.jl
PyPlot
GridVisualizePyPlotExt — Modulemodule GridVisualizePyPlotExtExtension module for PyPlot.jl. Supports almost all frontend methods.
GridVisualizePyPlotExt.tridata — Functiontridata(grid, gridscale)
Return tridata to be splatted to PyPlot calls
Plots
GridVisualizePlotsExt — Modulemodule GridVisualizePlotsExtExtension module for Plots.jl. Supports part of the frontend methods.
GridVisualizePlotsExt.rectdata — Functionrectdata(grid, gridscale, U)
Return rectangular grid data + function to be splatted into Plots calls
ImplEvalSlice
GridVisualize.ImplEvalSlice — ModuleImplementation details for slice evaluation. Do not use directly.
Experimental
GridVisualizeVTKViewExt — Modulemodule GridVisualizeVTKViewExtExtension module for VTKView.jl. Experimental.
GridVisualizeMeshCatExt — Modulemodule GridVisualizeMeshCatExtExtension module for MeshCat.jl. Experimental.