Hi,
I am trying to add a simple functionality to the "crop" tool in CloudCompare. Currently in crop tool user needs to manually enter the x,y,z coordinates to crop the cloud. I am trying to implement a picking option in the same, so that x,y,z can be obtained from the pick. Since the crop window is modal,i am not able to pick the cloud point when the crop window is active. I tried several methods to change the modality of the window but not working!!!. So my question is...Is it possible to change the modality of the crop window without much edit in code?(because i am not expertise in c++ and Qt)...if yes... how?.
Thanks in advance :)
Change modality of window
Change modality of window
- Attachments
-
- ccBoundingBoxEditorDlg.cpp
- Capture2.PNG (7.03 KiB) Viewed 2735 times
-
- mainwindow.cpp
- Capture.PNG (8.03 KiB) Viewed 2735 times
Re: Change modality of window
Properly handling point picking in a dialog is not an easy task (see how the 'Camera options' dialog works. There's a new mechanism called 'ccPickingHub' that helps in this process, but you still need to handle the window modality properly and register and unregister the dialog from the picking hub.
Anyway, in your case I think the issue is that 'exec' makes the dialog modal by definition. You would have to use 'start' instead. However, the call to 'start' is not blocking, so you need to wait for the user to click on Ok (for instance) and transfer all the code that is done after 'exec' to another function (slot) that will only be called when the dialog is closed.
This is basically what is done in the overlay tools (interactive segmentation, transformation, etc.) as well as in the camera parameters dialog in a way.
Anyway, in your case I think the issue is that 'exec' makes the dialog modal by definition. You would have to use 'start' instead. However, the call to 'start' is not blocking, so you need to wait for the user to click on Ok (for instance) and transfer all the code that is done after 'exec' to another function (slot) that will only be called when the dialog is closed.
This is basically what is done in the overlay tools (interactive segmentation, transformation, etc.) as well as in the camera parameters dialog in a way.
Daniel, CloudCompare admin