Custom Scalar Field Value

For any question about plugins!
Post Reply
Charlesw
Posts: 45
Joined: Mon Apr 10, 2017 3:54 pm

Custom Scalar Field Value

Post by Charlesw »

I have added a custom scalar field into the coding base you had programmed.

**What is the proper syntax to simply take the currently selected entity (CCHObject - pts imported) in the DBtree

and change the scalar field stored and showing for that particular cloud to my new custom scalar field definition.


I'm not getting errors in my attempts however I am also seeing no color changes in the cloud after updating the display and UI.
daniel
Site Admin
Posts: 7330
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Custom Scalar Field Value

Post by daniel »

You can look at the 'MainWindow::doActionAddConstantSF' to see how to retrieve exactly one cloud (or mesh) selected by the user.

Then you'll find what you are looking for in the same method:
- all scalar fields have a unique name and an associated index-
- you generally have to find your scalar field based on its name (getScalarFieldIndexByName) and if the returned index is positive, then you can use it to change the displayed SF (with setCurrentDisplayedScalarField).
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7330
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Custom Scalar Field Value

Post by daniel »

In the end don't forget to update the 3D display to see the change ;). And also the 'Properties' view.

Code: Select all

updateUI();
if (cloud->getDisplay())
    cloud->getDisplay()->redraw(false);
Daniel, CloudCompare admin
Post Reply