Before inserting any points via AddElement(), the maximum number of points that will be added needs to be declared via ReserveElements(). The actual number of points that were added is available via NumElements().