kmoks / fedem-gui

Graphical user interface for FEDEM
https://openfedem.org
Apache License 2.0
0 stars 0 forks source link

SoQt -> Quarter #2

Closed sanguinariojoe closed 8 months ago

sanguinariojoe commented 8 months ago

The way this works is first instructing CMake to look for Quarter, and if it is not found, it looks for SoQt as a fallback method. To this end I hijacked the definition SOQT_DLL, whcih maybe you do not like @kmoks . Of course we can change that.

If SoQt fallback is considered, nothing is theoretically changing. However, if Quarter is found, then a new class called FdQuarterViewer is added, which is indeed impersonating the SoQtViewer

I am not really used to Fedem, so i suspect a lot of stuff stopped working. So I suppose I need to ask you @kmoks to test it and give me feedback.

kmoks commented 8 months ago

I looked at your PR now @sanguinariojoe , and did some minor changes (see HEAD commit on my qt6-quarter branch:

I managed to build this on my Linux system using the Quarter library (which I first built myself from the 1.2.1 sources). Although it runs, we are not there yet. As most of the commands for manipulating the 3D view are not working, like zoom, pan and rotate using the mouse, predefined view buttons, etc. So far I only found that using the arrow keys on the keyboard works, for panning the view one step sideways or up and down. Maybe your new class FdQuarterViewer needs some more functionality? I did not look at your implementation details there yet.

sanguinariojoe commented 8 months ago

Yeah, that' what I suspected, but I did not know for sure since you have a lot of event handling.

Do not panic, it is probably easy to fix.

The first possible problem is we need to call viewer->setNavigationModeFile(QUrl("coin:///scxml/navigation/examiner.xml")); at some point (see the basic Quarter example here,). However, I tried to add it on a random place, and it did not work. Probably it should be done after setting the root scene.

Another possibility is that the event() -> FdQtViewer::processEvent() -> FdQuarterViewer::processEvent() -> event() system I figured out is not working.

So what I am doing is testing the impersonation on a simpler problem and fix it there. Then I move to the actual code

sanguinariojoe commented 8 months ago

Well, I recovered some functionality! Now the mouse wheel seems to do zoom ok, and the middle and right button sets the cursor. They do not rotate or pan though

It is quite strange, because if I track when the Quarter processSoEvent() is called, everything seems right. Maybe some callback is blocking it?

To be continued...

sanguinariojoe commented 8 months ago

I see you already cherry-picked this on your qt6-quarter branch, so I am closing this and continue from there