Hi,
I have a short question about mitk::PlanarPolygon. It seems to be
defined that polygon should have a minimum of two points. For me a
polygon with less then 3 points makes no sense, since it has no area and
not really a circumference since it is just a line which would make it
just a length.
But that is just definition stuff. What I cannot understand is, why
would the function GetNumberOfControlPoints return 2 if you have not
inserted any control point to begin with. Another even more interesting
point is, that if you add a new control point with AddControlPoint(),
GetNumberOfControlPoints() will return the number of your inserted
control points + the two initial points that were defined at start.
They are not overwritten if you add actual data.
Example:
mitk::PlanarPolygon::Pointer poly = mitk::PlanarPolygon::New();
for(int i=0; i< 5; i++)
{
mitk::Point2D p;
p[0] = x;
p[1] = y;
poly ->AddControlPoint(p);
}
return poly;
This poly would have 7 control points. Iterating it you must always
accord for the initial two points and start with GetControlPoint(i+2)
You can't even get a list of all inserted points which would make sense
since you can even get a list of all polygon features.
Am I missing something fundamental logic in mitk::PlanarPolygon???
Regards,
Matthias
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users