Error to access mainwindow

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

Error to access mainwindow

Post by dmmontes »

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: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Error to access mainwindow

Post by daniel »

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

Post by dmmontes »

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: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Error to access mainwindow

Post by daniel »

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

Post by dmmontes »

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: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Error to access mainwindow

Post by daniel »

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

Post by dmmontes »

Ok, thank you very much, notify me when this be posible
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Error to access mainwindow

Post by daniel »

Daniel, CloudCompare admin
Post Reply