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.
Custom Scalar Field Value
Re: Custom Scalar Field Value
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).
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
Re: Custom Scalar Field Value
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