Could be added 2D label (picked point) between two already picked points (in middle or some other ratio)?
I do calculations, i get XYZ, but i cant find any cc2DLabel contstructor that could take such parameters.
As every 2D label has to be associated with point in point cloud, so is it impossible to add this way?
Same question is about adding 2D label on position there "picked point" has projection on some plane?
Adding 2D label (picked point) between two already picked
Re: Adding 2D label (picked point) between two already picke
Labels to measure the distance between two points already exist (you can interactively create them with the 'Point picking' tool, and programmatically by adding two points in the same label (see ccLabel::addPoint).
For the other question, I'm not sure to understand it, sorry! (maybe you can provide me with a drawing?)
For the other question, I'm not sure to understand it, sorry! (maybe you can provide me with a drawing?)
Daniel, CloudCompare admin
Re: Adding 2D label (picked point) between two already picke
Yes i know about measuring distance between two points.
But i need third point between two. I will measure distance from that point to other point or plane.
And here is picture about second question:
Plane is drawn on points 1, 2 and 4.
Point 3 is in middle between 1 and 2.
Point 5 is outside plane #1.
Point 6 is on plane and vector#1 intersection. (vector#1 is on point 5 and is perpendicular to plane#1)
I caculate XYZ of Point 6, and i need "point" on that position.
I could start using primitives "spheres" for "picked points" representation in CC, but is there way to add text labels near all primitives?
But i need third point between two. I will measure distance from that point to other point or plane.
And here is picture about second question:
Plane is drawn on points 1, 2 and 4.
Point 3 is in middle between 1 and 2.
Point 5 is outside plane #1.
Point 6 is on plane and vector#1 intersection. (vector#1 is on point 5 and is perpendicular to plane#1)
I caculate XYZ of Point 6, and i need "point" on that position.
I could start using primitives "spheres" for "picked points" representation in CC, but is there way to add text labels near all primitives?
Re: Adding 2D label (picked point) between two already picke
You can create a new cloud with the points you want to attach labels to? This cloud doesn't need to be visible (+ it can be a child of another one).
And the only text label that is available is for picked points.
And the only text label that is available is for picked points.
Daniel, CloudCompare admin
Re: Adding 2D label (picked point) between two already picke
Could i add point to existing cloud?
I get execution error on code like this:
should be resize called or reserve?
or new must be created?
And how to get index of last added point?
I get execution error on code like this:
Code: Select all
if (Cloud->resize(Cloud->capacity() + 1))
{
Cloud->addPoint(Points[2]); <-- this line throws error
...
}
or new must be created?
And how to get index of last added point?
Re: Adding 2D label (picked point) between two already picke
If you 'resize' a cloud, it will be filled with (0,0,0) points. You can then change those points coordinates, but it's not very clean.
You should call 'reserve' here (it only allocates memory to add points later). Then your code should work.
And 'cloud->size()' returns the current number of points, while 'capacity()' returns the maximum number of points. So the last inserted point index is:
You should call 'reserve' here (it only allocates memory to add points later). Then your code should work.
And 'cloud->size()' returns the current number of points, while 'capacity()' returns the maximum number of points. So the last inserted point index is:
Code: Select all
int index = (int)cloud->size()-1;
Daniel, CloudCompare admin
Re: Adding 2D label (picked point) between two already picke
Tried, it works, new point is added to cloud, and i can create 2d label on that point:
but if i select that new 2d label in DB tree or in rendered "view" - i get error:
(last row is commented because of that)
Am i missing something?
Code: Select all
if (Cloud->reserve(Cloud->size() + 1))
{
Cloud->addPoint(Points[2]);
cc2DLabel *middlePoint = new cc2DLabel();
middlePoint->addPoint(Cloud, Cloud->size() - 1);
middlePoint->setDisplay(Cloud->getDisplay());
middlePoint->setVisible(Cloud->isVisible());
middlePoint->setDisplayedIn2D(false);
middlePoint->setName(NewName);
Parent->addChild(middlePoint);
m_app->addToDB(middlePoint);
//m_app->setSelectedInDB(middlePoint, true);
}
(last row is commented because of that)
Am i missing something?
Re: Adding 2D label (picked point) between two already picke
Your cloud seems to have normals.
So you must also add a normal for the new point (and if your cloud has color or SFs you must also add those).
So you must also add a normal for the new point (and if your cloud has color or SFs you must also add those).
Daniel, CloudCompare admin
Re: Adding 2D label (picked point) between two already picke
added:
works fine. no colors or scalar fields needed. (point cloud is from imported *.stl mesh)
Code: Select all
Cloud->addPoint(Points[2]);
Cloud->addNorm(0, 0, 0);