How to change the label color?

Feel free to ask any question here
xiaolu
Posts: 36
Joined: Fri Apr 02, 2021 9:42 am

How to change the label color?

Post by xiaolu »

hello,

How to change the label color.
label.png
label.png (47.13 KiB) Viewed 5937 times
As shown in the picture, this dot shows magenta and I want to change it to another color such as yellow.

thanks
xiaolu
Posts: 36
Joined: Fri Apr 02, 2021 9:42 am

Re: How to change the label color?

Post 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);
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to change the label color?

Post 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
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to change the label color?

Post 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?
Daniel, CloudCompare admin
xiaolu
Posts: 36
Joined: Fri Apr 02, 2021 9:42 am

Re: How to change the label color?

Post 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....
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to change the label color?

Post 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.
Daniel, CloudCompare admin
xiaolu
Posts: 36
Joined: Fri Apr 02, 2021 9:42 am

Re: How to change the label color?

Post 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
labeland.png (84.29 KiB) Viewed 5801 times
If you zoom in, the ball will become very large and block many points.

And label will not.
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to change the label color?

Post 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.
Daniel, CloudCompare admin
leble
Posts: 4
Joined: Fri Oct 28, 2022 1:08 pm

Re: How to change the label color?

Post 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.
Attachments
distance value.png
distance value.png (79.86 KiB) Viewed 5209 times
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to change the label color?

Post by daniel »

Just right click on the label and it should 'collapse' (yes, that's kind of a hidden feature ;).
Daniel, CloudCompare admin
Post Reply