void clearPath ( int path ) { int first_vertex = getFirstVertex ( path ) ; if ( first_vertex != - 1 ) { // TODO: can ve do this in one shot? int vertex = first_vertex ; for ( int i = 0 , n = getPathSize ( path ) ; i < n ; i ++ ) { int v = vertex ; vertex = getNextVertex ( vertex ) ; freeVertex_ ( v ) ; } int geometry = getGeometryFromPath ( path ) ; setGeometryVertexCount_ ( geometry , getPointCount ( geometry ) - getPathSize ( path ) ) ; } setPathSize_ ( path , 0 ) ; }
Clears all vertices from the path