Page 1 of 2
How to change the label color?
Posted: Wed Aug 04, 2021 3:47 am
by xiaolu
hello,
How to change the label color.
- label.png (47.13 KiB) Viewed 5965 times
As shown in the picture, this dot shows magenta and I want to change it to another color such as yellow.
thanks
Re: How to change the label color?
Posted: Wed Aug 04, 2021 7:16 am
by xiaolu
I wrote it like this, but its color didn't change.
Code: Select all
cc2DLabel* label = nullptr;
label = new cc2DLabel("test");
label->setVisible(true);
label->setEnabled(true);
label->setTempColor(ccColor::blue);
label->enableTempColor(true);
label->showColors(true);
m_app->addToDB(label);
Re: How to change the label color?
Posted: Wed Aug 04, 2021 4:22 pm
by daniel
If you are referring to the point symbol (the sphere), then it's a global display parameter:
https://github.com/CloudCompare/CloudCo ... ext.h#L107
Re: How to change the label color?
Posted: Wed Aug 04, 2021 4:26 pm
by daniel
I am more and more concerned by the kind of changes you are trying to make... And I have the feeling that we are helping you to do something that will never be contributed back to the project...
Can you give us a little bit more clarity on what you are trying to do?
Re: How to change the label color?
Posted: Thu Aug 05, 2021 1:10 am
by xiaolu
I want to implement a function that loads two point clouds and then clicks on a point in the first cloud to change the color of the clicked point to, for example, yellow.
Then click on a point in the second point cloud to change the color of that point too, for example red, and then do other calculations on both points.
Then I came up with the idea of using labels to achieve such a function.
So I came to ask for help on how to change the color of the labels....
Re: How to change the label color?
Posted: Thu Aug 05, 2021 9:01 pm
by daniel
I was surprised that your 'Y' label appears to be black instead of green. Have you changed that or is it a display bug?
Otherwise, I guess it would be easier to display (temporarily) some spheres where the points are if you want to achieve this result. You'll be able to control the diameter and color of each sphere.
Re: How to change the label color?
Posted: Thu Aug 12, 2021 9:27 am
by xiaolu
Thanks for the reply
'Y' tag that problem I do not know what happened reopen the cc once and it is fine.
If you load the sphere, the view is not as good as label, as shown in the picture
- labeland.png (84.29 KiB) Viewed 5829 times
If you zoom in, the ball will become very large and block many points.
And label will not.
Re: How to change the label color?
Posted: Thu Aug 12, 2021 8:12 pm
by daniel
Then if you are in a plugin, you could probably create your own entity that looks a lot like a 2D label (but that only implements the sphere part) so that you can control the color, etc.
Re: How to change the label color?
Posted: Fri Nov 25, 2022 12:51 pm
by leble
Hello! I have a similar but maybe slightly different question. How to add a label but with only one item/description. In this case, I would like a label with only the value of the distance between the models. Because I don't need other data for the description, only the distance value.
Re: How to change the label color?
Posted: Fri Nov 25, 2022 9:46 pm
by daniel
Just right click on the label and it should 'collapse' (yes, that's kind of a hidden feature ;).