PlanarFigure currently has a method GetControlPoints() which returns an STL vector containing the control points of the figure. However, the container does not necessarily have the correct number of points set, for example in the case of PlanarPolygon, the number of elements can be one more than the actual number of control points, and the last element is undefined.
This can be a problem if this container is used for accessing control points directly, or for retrieving the number of control points.
Two possible solutions are:
- Disallow direct access to this container (remove GetControlPoints() method); the user then needs to use the methods GetControlPoint( int ) and GetNumberOfControlPoints()
- Make sure that the returned container is always consistent with the REAL number of control points