Skip to content
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

Dump "camera" info should dump information about all options #596

Open
Tracked by #1243
mwestphal opened this issue Feb 1, 2023 · 4 comments
Open
Tracked by #1243

Dump "camera" info should dump information about all options #596

mwestphal opened this issue Feb 1, 2023 · 4 comments
Labels
help wanted Please help with this issue! type:enhancement New feature or request
Milestone

Comments

@mwestphal
Copy link
Contributor

mwestphal commented Feb 1, 2023

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

  • Loop over the whole libf3d options and dump all info
  • Add a callback in the interactor that will be triggered on ?
  • Use that callback to dump info about all the CLI options
  • Improve CLI option to support looping over them
  • Consider copying to clipboard if possible
@mwestphal mwestphal added the type:enhancement New feature or request label Feb 1, 2023
@snoyer
Copy link
Contributor

snoyer commented Feb 2, 2023

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.

@mwestphal
Copy link
Contributor Author

Great ideas ! I wonder if we can manage cross platform clipboard. Afaik VTK does not support it.

@mwestphal mwestphal added this to the 3.0.0 milestone Sep 17, 2023
@mwestphal mwestphal added the help wanted Please help with this issue! label Jan 7, 2024
@mwestphal
Copy link
Contributor Author

Updated with a suggested solution

@mwestphal mwestphal removed this from the 3.0.0 milestone Feb 3, 2024
@mwestphal mwestphal added this to the 3.0.0 milestone Jul 5, 2024
@mwestphal mwestphal mentioned this issue Jul 13, 2024
23 tasks
@mwestphal
Copy link
Contributor Author

This is becoming possible with #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Please help with this issue! type:enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

2 participants