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

Rework libf3d options to use strong typing #1244

Closed
Tracked by #1243
mwestphal opened this issue Jan 31, 2024 · 3 comments
Closed
Tracked by #1243

Rework libf3d options to use strong typing #1244

mwestphal opened this issue Jan 31, 2024 · 3 comments
Assignees
Labels
type:enhancement New feature or request
Milestone

Comments

@mwestphal
Copy link
Contributor

Context
libf3d rely on options which are a string based framework that let libf3d user set many options
however this frame is too flexible and it is very hard to recover informations about the type of the option, default values and so on.

This framework require a smart rework

Suggested solution

  • Declare options as a .json file
  • Generate C++ code based on the json file with a strong typed API that also support default values
  • Generate python code bindings based on the json file
@mwestphal mwestphal mentioned this issue Jan 31, 2024
23 tasks
@mwestphal mwestphal added this to F3D Feb 3, 2024
@mwestphal mwestphal added this to the 3.0.0 milestone Feb 4, 2024
@mwestphal mwestphal moved this to Investigate in F3D Feb 4, 2024
@mwestphal mwestphal added the type:enhancement New feature or request label Feb 9, 2024
@mwestphal
Copy link
Contributor Author

First json draft:

{
  "options": [
    {   
      "name": "render.line-width",
      "type": "double",
      "default_value": "1.0"
    },  
    {   
      "name": "scene.up-direction",
      "type": "string",
      "default_value": "+Y"
    },  
    {   
      "name": "model.scivis.colormap",
      "type": "double_vector",
      "default_value": "0.0, 0.0, 0.0, 0.0, 0.4, 0.9, 0.0, 0.0, 0.8, 0.9, 0.9, 0.0, 1.0, 1.0, 1.0, 1.0"
    }   
  ]
}

@mwestphal
Copy link
Contributor Author

Iterating on json:

{
  "render.line-width":
  {
    "type": "double",
    "default_value": "1.0"
  },  
  "scene.up-direction":
  {
    "type": "direction",
    "default_value": "+Y"
  },  
  "model.scivis.colormap":
  {
    "type": "colormap",
    "default_value": "0.0, 0.0, 0.0, 0.0, 0.4, 0.9, 0.0, 0.0, 0.8, 0.9, 0.9, 0.0, 1.0, 1.0, 1.0, 1.0"
  }
}

@mwestphal
Copy link
Contributor Author

#1471

@github-project-automation github-project-automation bot moved this from Investigate to Done in F3D Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

1 participant