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

Make a new GUI::Window with A Button - Open3D #4501

Closed
vanloctc opened this issue Dec 27, 2021 · 5 comments
Closed

Make a new GUI::Window with A Button - Open3D #4501

vanloctc opened this issue Dec 27, 2021 · 5 comments
Assignees
Labels

Comments

@vanloctc
Copy link

vanloctc commented Dec 27, 2021

Hi Open3D Teams and Everyone,

Thank you for your hard work - Open3D Teams.
I'm investigating Open3D Library and wondering that Is there any Open3D-API support for new a window (separate window) when clicking the button - from the main screen.

  1. The GUI::Window can create by a singleton class. So If I want to add a new window. I need to use
    (Step1) open3D::visualization::GUI::Application::AddWindow(main screen)
    (Step2) Application::Run().
  2. If I want to add one more window, I will add by the same way
    (Step1) open3D::visualization::GUI::Application::AddWindow(main screen 1)
    (Step2) open3D::visualization::GUI::Application::AddWindow(main screen 2)
    (Step3) Application::Run().
  3. I am wondering, Does Open3D support the button for making a new window?
    (Step1) open3D::visualization::GUI::Application::AddWindow(main screen 1) --> Button "CreateWindow"
    (Step2) Application::Run().
    (Step3) the user selects "CreateWindow" Button, the new window appear (include GUI and Visualizer)

Thank you very much.
open3d.visualization.gui.Application Link - version 0.13.0

GUI
UI
Window

@errissa
Copy link
Collaborator

errissa commented Dec 27, 2021

Yes, it is possible to create a new window from a callback once the application is running. Your point number 3 is correct. For an example of multiple windows please see the example examples/python/gui/multiple-windows.py. It's in Python but the Python API is almost exactly the same as the C++ API so it should be helpful.

@errissa
Copy link
Collaborator

errissa commented Dec 27, 2021

We actually have a C++ version of the multiple-windows.py example. It's called MultipleWindows.cpp and can be found here.

@vanloctc
Copy link
Author

We actually have a C++ version of the multiple-windows.py example. It's called MultipleWindows.cpp and can be found here.

Thank you for your answer.
I was really surprised when you said that Open3D had supported for (3). Let's me make a clearly (3) above:
Step1: open3D::visualization::GUI::Application::AddWindow(main screen 1) --> Button "CreateWindow"
Step2: Application::Run().
Step3: The user selects "CreateWindow" Button for making a new window
Step4: The "CreateWindow" Button can call open3D::visualization::GUI::Application::AddWindow(Separate Screen) for open/close this window
--> "Separate Screen" - new window - can contain "GUI(Button), Image or visualizer class . <--- Is this right?
ForEx: I take an interface of Open3D Reconstruction [Version0.13.0] for example. See image Open3D-Window.png below for details.
Thank you very much.
Open3D-Window

@errissa
Copy link
Collaborator

errissa commented Dec 28, 2021

Yes, correct. As I said, please take a look at MutlipleWindows.cpp example code, specifically the OnSnapshot callback. Unless I misunderstand your question the MultipleWindows.cpp example does exactly what you want to do.

@vanloctc
Copy link
Author

vanloctc commented Dec 28, 2021

Yes, correct. As I said, please take a look at MutlipleWindows.cpp example code, specifically the OnSnapshot callback. Unless I misunderstand your question the MultipleWindows.cpp example does exactly what you want to do.

Yes, I had tried at both MultipleWindow source code (C++ and Python). But after selecting "Take snapshot in new window Button", it will display a new window and then close all programs without any messager. I don't see anything unusual in the source code. Is that an error?
See the image below for details.

My Open3D information:

  1. Version 0.13.0
  2. Install on Window 10

Besides, Is there any support with GUI::Application?. I really want to know a function as "add_action" at O3DVisualizer Class, but that does not exist at GUI::Application class (link below) http://www.open3d.org/docs/0.13.0/python_api/open3d.visualization.gui.Application.html#open3d.visualization.gui.Application

Thank you very much.
Snapshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants