|
Returns the array of points
You can then access the array yourself for getting and setting points
Be careful not access the array with an out-of-range index
This could cause your program to crash
indexes should be in the range 0,1,2 ... ,(number_of_points-1)*3+2
Access example:
points_array=STATE_track_get_points(track_handle);
x=points_array[point_index*3+0];
y=points_array[point_index*3+1];
z=points_array[point_index*3+2];
The last index possible is
array[(number_of_points-1)*3 +2] we have (number_of_points-1) because we start with 0
to get the number of points do:
number_of_points=STATE_track_get_number_of_points(track_handle);
The function will always return the same address (array) for a given track.
Example:
This example shows how to create a copy of a track
double *points=STATE_track_get_points(src_track);
int number_of_points=STATE_track_get_number_of_points(src_track)
STATE_track_create("my_track", YES, points, number_of_points);
|