how to create new 3Dviewer in code?

Feel free to ask any question here
Post Reply
xiaolu
Posts: 36
Joined: Fri Apr 02, 2021 9:42 am

how to create new 3Dviewer in code?

Post by xiaolu »

hi there,

I want to write a plugin that

The function is: click this plugin to create a new 3d viewer,

and then display the new point cloud on this new 3dviewer.

I can't create a new 3d viewer with code, can you tell me some code.

thanks.
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: how to create new 3Dviewer in code?

Post by daniel »

You should look at how other plugins are doing it. For instance the https://github.com/CloudCompare/CloudCo ... ard/qBroom
Daniel, CloudCompare admin
xiaolu
Posts: 36
Joined: Fri Apr 02, 2021 9:42 am

Re: how to create new 3Dviewer in code?

Post by xiaolu »

This plugin makes its own interface, and then links 3dviewer to its own interface.

I want to create a new 3dviwer to put in the main cc interface. Like this
DeepinScreenshot_select-area_20210617100440.png
DeepinScreenshot_select-area_20210617100440.png (75.82 KiB) Viewed 1353 times
(I know cc comes with such a feature, but I want to implement it in my plugin so I can do it without changing anything inside cc.)

I have now implemented the following code to pop up a super large 3dviewer, but I can't link it with the cc main form.

Code: Select all

  
    QWidget* viewWidget = nullptr;
    ccGLWindow* view3D = nullptr;
    m_app->createGLWindow(view3D,viewWidget);

    viewWidget->showMaximized();
    viewWidget->update();
    
Can you tell me how to link

thanks~
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: how to create new 3Dviewer in code?

Post by daniel »

Well, I don't see any other choice than making the 'new3DView' method accessible to plugins (via the ccMainAppInterface).

And you'll have to make a PR on the master branch (since it impacts the main project).
Daniel, CloudCompare admin
Post Reply