Page 1 of 1

Custom Scalar Field Value

Posted: Thu Apr 20, 2017 7:45 pm
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.

Re: Custom Scalar Field Value

Posted: Fri Apr 21, 2017 9:41 am
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).

Re: Custom Scalar Field Value

Posted: Fri Apr 21, 2017 9:45 am
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);