Open mwestphal opened 1 year ago
Dumping the relevant options as a string of command-line arguments to stdout would allow copy-pasting to get the same state on a subsequent run of the application.
Alternatively/additionally, dumping to the clipboard would allow to use this functionality even when the application was not started from a terminal. In that case loading from the clipboard should also be considered so that the dumped state can be restored within already running instances of the application.
For reference, MeshLab does something like this with its camera state:
ctrl+C
in MeshLab window puts an xml description of the view in the clipboard:
<!DOCTYPE ViewState>
<project>
<VCGCamera CameraType="0" TranslationVector="40.5801 -77.5024 -97.2389 1" LensDistortion="0 0" PixelSizeMm="0.0369161 0.0369161" CenterPx="1081 617" BinaryData="0" ViewportPx="2163 1234" FocalMm="39.451275" RotationMatrix="-0.9226 -0.374897 -0.0908925 0 0.216599 -0.698418 0.682127 0 -0.319208 0.609643 0.725562 0 0 0 0 1 "/>
<ViewSettings TrackScale="0.02384294" FarPlane="5.6360178" NearPlane="0.30310887"/>
</project>
ctrl+V
in MeshLab while such xml string is in the clipboard applies the settings to the view.It would be cool to be able to get strings like --camera-position 10,15,20 --ssao --depth-peeling --tone-mapping ...
from one F3D window to another.
Great ideas ! I wonder if we can manage cross platform clipboard. Afaik VTK does not support it.
Updated with a suggested solution
This is becoming possible with https://github.com/f3d-app/f3d/pull/1580.
Possible formatting suggested by @snoyer :
Updating Options:
camera-direction: '-1,-0.5,-1' # # from 05_all.json₍₁₎:`.*`
config: 'config_build' # from CLI options
input: '/home/glow/dev/f3d/f3d/src/testing/data/dragon.vtu' # from CLI options
axis: 'true' # from 05_all.json₍₁₎:`.*`
scalars: '' # from 05_all.json₍₁₎:`.*`
output: '/home/glow/dev/f3d/f3d/build/Testing/Temporary/TestDefaultConfigFileVTU.png' # from CLI options
ref: '/home/glow/dev/f3d/f3d/src/testing/baselines/TestDefaultConfigFileVTU.png' # from CLI options
anti-aliasing: 'true' # from 05_all.json₍₁₎:`.*`
tone-mapping: 'true' # from 05_all.json₍₁₎:`.*`
translucency-support: 'true' # from 05_all.json₍₁₎:`.*`
grid: 'true' # from 05_all.json₍₁₎:`.*`
hdri-ambient: 'true' # from 05_all.json₍₁₎:`.*`
resolution: '300,300' # from CLI options
animation-progress: 'true' # from 05_all.json₍₁₎:`.*`
filename: 'true' # from 05_all.json₍₁₎:`.*`
progress: 'true' # from 05_all.json₍₁₎:`.*`
bar: 'true' # from 10_native.json₍₂₎:`.*(dcm|nrrd|mhd|mha|vt.)`
verbose: 'debug' # from CLI options
# 05_all.json₍₁₎: /home/glow/dev/f3d/f3d/build/share/f3d/configs/config_build.d/05_all.json
# 10_native.json₍₂₎: /home/glow/dev/f3d/f3d/build/share/f3d/configs/config_build.d/10_native.json
Context
F3D support printing information about the current state of the application by pressing ?, specfically about the configuration of the camera. While useful, this feature could become great if it dumped more info, especially enough info to just copy/paste to recreate the state of the application.
Suggested Solution
?