f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Feature request: flag to view all files in the same view

Open nermolov opened this issue 3 years ago • 9 comments

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!

nermolov avatar Dec 09 '21 17:12 nermolov

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: a

What do you think @Meakk ?

mwestphal avatar Dec 09 '21 19:12 mwestphal

@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 avatar Dec 09 '21 22:12 Meakk

@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.

nermolov avatar Dec 10 '21 02:12 nermolov

Could you share a sketch or screenshot of what you hope ti have ideally ?

mwestphal avatar Dec 10 '21 06:12 mwestphal

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).

Meakk avatar Dec 10 '21 15:12 Meakk

I dived in F3D's code to add an append option. ~~My goal is to submit a pull request.~~

SamuelTallet avatar Jan 24 '22 12:01 SamuelTallet

@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.

mwestphal avatar Jan 25 '22 06:01 mwestphal

Finally, I won't submit a PR. Here's plan I had in mind:

  • Add an --append argument with a default value set to false.
  • Store geometry actors in a vtkAssembly instead of a vtkActor.

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: call this->LoadFile(f3d::loader::LoadFileEnum::LOAD_NEXT) many times to load all files.

SamuelTallet avatar Feb 24 '22 13:02 SamuelTallet

related to #129

mwestphal avatar Aug 14 '22 04:08 mwestphal

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 ?

mwestphal avatar Sep 25 '22 06:09 mwestphal

This was added in F3D 2.0!

mwestphal avatar Jun 05 '23 16:06 mwestphal