STATE_track_insert_point

 

 


   Inserts a point to the given index.
   The points at the given index will be shift one place above and the given point will be inserted
   The total number of points of the track will be increased by one
   Index 0 is the first point.
   Note that consecutive identicale points are not allowed so if the inserted point
   is equal to one of its future neighbors the function will return VR_ERROR
   and the point wont be inserted.
   Not that it is allowed to have identicale points on a track just not consecutively (one after the other)
  
  	Parameters:
  		track_handle: The track handle
  
  		point_index: A value between 0 to STATE_track_get_number_of_points()
  
  		pt: The X,Y,Z values to set for the given point index.
  
   Return value:
  		Returns OK or VR_ERROR. VR_ERROR is returned if one of the neighboring points
  		is identicle
  
  	Example A: 
  		  Adding a point as the first point
  		double p[3]={1,2,3};
  		STATE_track_insert_point(my_track, p, 0);
  
  	Example B:
  		  adding a point as the last point
  		  note that this is equal to STATE_track_add_point_to_end()
  			double p[3]={1,2,3};
  			int number_of_points=STATE_track_get_number_of_points(my_track);			
  			STATE_track_insert_point(my_track, p, number_of_points);
  
  	See also: 
  		STATE_track_add_point_to_end(), STATE_track_set_point()
  

 

 

Go to page 1      Select API

 

Copyright © 2007 3DSTATE Corporation. www.3dstate.com