f3d
f3d copied to clipboard
Feature request: flag to view all files in the same view
Is your feature request related to a problem? Please describe. Can't view multiple files at the same time
Describe the solution you'd like A flag to view all passed files in the same view rather than skipping between them
Contribution I could potentially contribute, but would appreciate some pointers on how to do so!
That is something we thought about but would definitely be not trivial. We could be done more easilly is some kind of "FolderView" where one only see thumbnails (static image) of each files in a grid and can switch between files easily, then actually open a specific file wheen needed.
Still a big task but seems doable, and in line with what other softwares do. It could look like this:
What do you think @Meakk ?
@nermolov Do you want to visualize all the files in the same view because they are related, or view every file in its own view in a multi-view window?
@Meakk I would like to visualize them in the same view because they're related, e.g. multiple components for the same part generated by a CAD system.
Could you share a sketch or screenshot of what you hope ti have ideally ?
It can be a very useful feature indeed. Maybe an option --append
where all the meshes are appended to the view instead of replacing the previous one. For instance, a call f3d --append *.step
would display all the step files in the current directory.
It's quite complex to implement considering the current architecture is designed for a single file (see bool F3DLoader::LoadFile(int load)
) and we also need to consider different file types (full scene or geometry only).
I dived in F3D's code to add an append
option. ~~My goal is to submit a pull request.~~
@SamuelTallet
While a good idea, this issue is not a easy one and i would not recommend it as a first contribution, especially as @Meakk and I are working on #52 .
That being said, before knowing how it could be done, we need to check IF it could be done, and this should ne a much more manageable task.
For that, you would need to just not clean the renderer and try loading multiples files.
Finally, I won't submit a PR. Here's plan I had in mind:
- Add an
--append
argument with a default value set tofalse
. - Store geometry actors in a
vtkAssembly
instead of avtkActor
.
vtkAssembly is an object that groups vtkProp3Ds [...]
- If append: don't remove the renderer, reuse the same renderer.
- When we get geometry actor from importer, append this actor to geometry actors collection with
vtkAssembly::AddPart()
. - In
F3DStarter::Start()
, if append: callthis->LoadFile(f3d::loader::LoadFileEnum::LOAD_NEXT)
many times to load all files.
related to #129
One way to approach this instead of "appending" is to consider multiples file to be a "serie of file" and to load them using a dedicated reader that will create a composite output, one file being one block of the output. Of course, the serie reader will internally use the right reader for each file.
This would be fully transparent to the libf3d, (one reader produce one dataset that will be shown) and most of the logic will be in F3D.
One question is the right config file to use, I suppose that we will use the one from the first file and be done with it.
Wdyt @Meakk ?
This was added in F3D 2.0!