8000 Refactoring with scripts and stream commands help by najlkin · Pull Request #335 · GLVis/glvis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Refactoring with scripts and stream commands help #335

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

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

najlkin
Copy link
Contributor
@najlkin najlkin commented May 6, 2025
10000

Refactored the code base, separating scripts handling and introducing a help for script commands (which can be placed on the website too). At the moment it is:

Available commands are:
mesh <file> - Visualize the mesh.
solution <mesh> <solution> - Visualize the solution.
psolution <np> <mesh prefix> <keep attributes> <solution prefix> - Visualize the distributed solution.
quadrature <mesh> <quadrature> - Visualize the quadrature.
pquadrature <np> <mesh prefix> <keep attributes> <quadrature prefix> - Visualize the distributed quadrature.
data_coll_mesh <type> <data coll> - Visualize the mesh from data collection.
data_coll_field <type> <data coll> <field> - Visualize the field from data collection.
data_coll_quad <type> <data coll> <quad> - Visualize the Q-field from data collection.
data_coll_cycle <cycle> - Preset the cycle of the data collection.
data_coll_protocol <protocol> - Preset the protocol of the data collection.
screenshot <file> - Take a screenshot, saving it to the file.
viewcenter <x> <y> - Change the viewcenter.
perspective <on/off> - Turn on or off perspective projection.
light <on/off> - Turn on or off light.
view <theta> <phi> - Change the solid angle of view.
zoom <zoom> - Change the zoom factor.
shading <flat/smooth/cool> - Change the shading algorithm.
subdivisions <times> <dummy> - Change the refinement level.
valuerange <min> <max> - Change the value range.
autoscale <off/on/value/mesh> - Change the autoscale algorithm.
levellines <min> <max> <num> - Set the level lines.
axis_numberformat '<format>' - Set the axis number format.
colorbar_numberformat '<format>' - Set the colorbar number format.
window <x> <y> <w> <h> - Set the position and size of the window.
keys <key> - Send the control key sequence.
palette <index> - Set the palette index.
palette_repeat <times> - Set the repetition of the palette.
toggle_attributes <1/0> [[<1/0>] ...]; - Toggle visibility of the attributes.
rotmat <[0,0]> <[1,0]> ... <[3,3]> - Set the rotation matrix.
camera <cam[0]> ... <cam[2]> <dir[0]> ... <dir[2]> <up[0]> ... <up[2]> - Set the camera position, direction and upward vector.
scale <scale> - Set the scaling factor.
translate <x> <y> <z> - Set the translation coordinates.
plot_caption '<caption>' - Set the plot caption.

Similarly, handling of stream commands has been refactored, offering the following help:

Available commands are:
mesh <mesh> - Visualize the mesh.
solution <mesh> <solution> - Visualize the solution.
quadrature <mesh> <quadrature> - Visualize the quadrature.
fem2d_data <mesh> <data> - Visualize the 2D scalar data.
vfem2d_data <mesh> <data_x> <data_y> - Visualize the 2D vector data.
vfem2d_data_keys <mesh> <data_x> <data_y> <keys> - Visualize the 2D vector data and apply control keys.
fem3d_data <mesh> <data> - Visualize the 3D scalar data.
vfem3d_data <mesh> <data_x> <data_y> <data_z> - Visualize the 3D vector data.
vfem3d_data_keys <mesh> <data_x> <data_y> <data_z> <keys> - Visualize the 3D vector data and apply control keys.
fem2d_gf_data <mesh> <solution> - Visualize the 2D scalar grid function.
fem2d_gf_data_keys <mesh> <solution> <keys> - Visualize the 2D scalar grid function and apply control keys.
vfem2d_gf_data <mesh> <solution> - Visualize the 2D vector grid function.
vfem2d_gf_data_keys <mesh> <solution> <keys> - Visualize the 2D vector grid function and apply control keys.
fem3d_gf_data <mesh> <solution> - Visualize the 3D scalar grid function.
fem3d_gf_data_keys <mesh> <solution> <keys> - Visualize the 3D scalar grid function and apply control keys.
vfem3d_gf_data <mesh> <solution> - Visualize the 3D vector grid function.
vfem3d_gf_data_keys <mesh> <solution> <keys> - Visualize the 3D vector grid function and apply control keys.
raw_scalar_2d <data> - Visualize the 2D scalar data (see stream_reader.cpp).
parallel <num proc> <proc> - Prefix for distributed mesh/solution/quadrature.
screenshot <file> - Take a screenshot, saving it to the file.
viewcenter <x> <y> - Change the viewcenter.
view <theta> <phi> - Change the solid angle of view.
zoom <zoom> - Change the zoom factor.
shading <flat/smooth/cool> - Change the shading algorithm.
subdivisions <times> <dummy> - Change the refinement level.
valuerange <min> <max> - Change the value range.
autoscale <off/on/value/mesh> - Change the autoscale algorithm.
levellines <min> <max> <num> - Set the level lines.
axis_numberformat '<format>' - Set the axis number format.
colorbar_numberformat '<format>' - Set the colorbar number format.
window_size <w> <h> - Set the size of the window.
window_geometry <x> <y> <w> <h> - Set the position and size of the window.
window_title '<title>' - Set title of the window.
keys <keys> - Send the control key sequence.
palette <index> - Set the palette index.
palette_repeat <times> - Set the repetition of the palette.
camera <cam[0]> ... <cam[2]> <dir[0]> ... <dir[2]> <up[0]> ... <up[2]> - Set the camera position, direction and upward vector.
plot_caption '<caption>' - Set the plot caption.
axis_labels '<x label>' '<y label>' '<z label>' - Set labels of the axes.
pause - Stop the stream until space is pressed.
autopause <0/off/1/on> - Turns off or on autopause.

🌟 Besides there are multiple other improvements:

  • Introduced Window structure bundling (some of) the shared objects, eliminating the global state. This is a lightweight version of Refactoring to remove global state #170 .
  • Removed most of the references to GetAppWindow() (a global function for obtaining thread-local SdlWindow)
  • Unified GLVisInitVis() and display() in aux_js.cpp.
  • Unified handling of streams (through StreamReader), so all data types can be animated 🎞️ .
  • Fixed the flag for keeping of real attributes in the script command, which was broken since Parallel streams for web version #235 .
  • Fixed the flag for keeping of real attributes in streams
  • Fixed the default padding digits for data collections.

✔️ Tests:

  • some script
  • serial stream
  • parallel stream
  • cmd-line file loading
  • saved stream
  • js

@najlkin najlkin self-assigned this May 6, 2025
@najlkin najlkin changed the title Refactoring and scripts commands help Refactoring with scripts and stream commands help May 6, 2025
@najlkin najlkin mentioned this pull request May 12, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0