Error to access mainwindow

Questions related to plugins development
dmmontes
Posts: 5
Joined: Tue Dec 26, 2017 6:06 pm

Error to access mainwindow

Postby dmmontes » Mon Feb 05, 2018 9:56 am

Hi, I'm developping a plugin but when I try to access to MainWindow::TheInstance, for example, I get an error LNK2019: "two external whitout resolve...". What can I do to access to this functions or others? Thank you

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

Re: Error to access mainwindow

Postby daniel » Mon Feb 05, 2018 11:05 am

You have to use the 'm_app' member of the plugin to access the main application resources.

See how the other plugins are doing it.
Daniel, CloudCompare admin

dmmontes
Posts: 5
Joined: Tue Dec 26, 2017 6:06 pm

Re: Error to access mainwindow

Postby dmmontes » Mon Feb 05, 2018 12:51 pm

I have searched but there aren't plugins that use functions like MainWindow::TheInstance or MainWindow::putObjectBackIntoDBTree. These functions are used only in qcc/ and aren't accesible from m_app, at least, I couldn't. Is there any method to do that?

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

Re: Error to access mainwindow

Postby daniel » Mon Feb 05, 2018 7:43 pm

The m_app interface is actually the MainWindow instance but limited to the methods that plugins are currently allowed to access (for various reasons).

If you can explain why you need to access the 'putObjectBackIntoDBTree' specifically we may add it to the interface. In this particular case, you shouldn't call 'putObjectBackIntoDBTree' if you haven't called 'removeObjectTemporarilyFromDBTree' before. Is this really what you want to do?
Daniel, CloudCompare admin

dmmontes
Posts: 5
Joined: Tue Dec 26, 2017 6:06 pm

Re: Error to access mainwindow

Postby dmmontes » Tue Feb 06, 2018 2:05 pm

Yes I would like to use both methods. I'm working in a plugin to interactuate with the program with a device. So I must use these methods to move or rotate a single mesh and apply changes.
Last edited by dmmontes on Tue Feb 06, 2018 2:09 pm, edited 1 time in total.

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

Re: Error to access mainwindow

Postby daniel » Tue Feb 06, 2018 8:00 pm

Actually these methods are just here to make sure that children of the entity (in the DB tree) which may be discarded by the process you are applying are correctly removed from the DB tree.

In effect, if your clouds or meshes don't have any octree, or if you manually remove the octree before transforming the entities, then you don't need to call them. But I'll make these methods accessible for the sake of "cleanliness".
Daniel, CloudCompare admin

dmmontes
Posts: 5
Joined: Tue Dec 26, 2017 6:06 pm

Re: Error to access mainwindow

Postby dmmontes » Tue Feb 06, 2018 8:24 pm

Ok, thank you very much, notify me when this be posible

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

Re: Error to access mainwindow

Postby daniel » Tue Feb 06, 2018 10:08 pm

Daniel, CloudCompare admin


Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 1 guest