AGI STK Objects 11 Send comments on this topic.
IAgVeWaypointsCollection Collection





Description

Represents a collection of waypoints used with GreatArc vehicles

Object Model

Public Methods

Public Method Add Adds a new element to the collection.
Public Method Contains Determines whether the collection contains the waypoint at the specified time.
Public Method IndexOf Determines whether the collection contains the specified waypoint and returns an index of existing waypoint. The index < 0="" indicates="" the="" way="" point="" is="" not="" in="" the="" collection.="">
Public Method RemoveAll Removes all elements from the collection.
Public Method RemoveAt Removes an element from the collection using specified index.
Public Method ToArray Returns a two-dimensional array that contains the way points. Each sub-array represents a waypoint. The order of the elements is Time, Latitude, Longitude, Altitude,Speed,Acceleration,TurnRadius

Public Properties

Public Property Count Returns the number of elements in a collection.
Public Property Item Given an index, returns an element in the collection.

Example

List all waypoints in a Waypoint Collection
[C#] Copy Code
// Array with waypoints to insert 
object[,] waypoints = new object[,] 
    { 
        { 20.3619.410, -99.125"1 Jan 2012 12:00:00.000" }, 
        { 20.3019.421, -99.135"1 Jan 2012 13:00:00.000" }, 
        { 20.3019.434, -99.137"1 Jan 2012 14:00:00.000" } 
    }; 
 
propagator.Method = AgEVeWayPtCompMethod.eDetermineVelFromTime; 
 
// Remove any previous waypoints 
propagator.Waypoints.RemoveAll(); 
 
// Insert the waypoints 
for (int i = 0; i < waypoints.GetLength(0); i++) 

    IAgVeWaypointsElement waypoint = propagator.Waypoints.Add(); 
    waypoint.Altitude = (double)waypoints[i, 0]; 
    waypoint.Latitude = waypoints[i, 1]; 
    waypoint.Longitude = waypoints[i, 2]; 
    waypoint.Time = waypoints[i, 3]; 

 
// List the waypoints after extracting them into an array 
Array waypointArray = propagator.Waypoints.ToArray(); 
for (int j = 0; j < waypointArray.GetLength(0); ++j) 

    Console.WriteLine("  Time: {0} Latitude: {1} Longitude: {2} Altitude: {3}"
        waypointArray.GetValue(j, 0), 
        Convert.ToDouble(waypointArray.GetValue(j, 1)), 
        Convert.ToDouble(waypointArray.GetValue(j, 2)), 
        Convert.ToDouble(waypointArray.GetValue(j, 3))); 

 

List all waypoints in a Waypoint Collection
[Visual Basic .NET] Copy Code
' Array with waypoints to insert
Dim waypoints As Object(,) = New Object(,) {{20.36, 19.41, -99.125, "1 Jan 2012 12:00:00.000"}, {20.3, 19.421, -99.135, "1 Jan 2012 13:00:00.000"}, {20.3, 19.434, -99.137, "1 Jan 2012 14:00:00.000"}}

propagator.Method = AgEVeWayPtCompMethod.eDetermineVelFromTime

' Remove any previous waypoints
propagator.Waypoints.RemoveAll()

' Insert the waypoints
Dim i As Integer = 0
While i <>
    Dim waypoint As IAgVeWaypointsElement = propagator.Waypoints.Add()
    waypoint.Altitude = DirectCast(waypoints(i, 0), Double)
    waypoint.Latitude = waypoints(i, 1)
    waypoint.Longitude = waypoints(i, 2)
    waypoint.Time = waypoints(i, 3)
    System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While

' List the waypoints after extracting them into an array
Dim waypointArray As Array = propagator.Waypoints.ToArray()
Dim j As Integer = 0
While j <>
    Console.WriteLine(" Time: {0} Latitude: {1} Longitude: {2} Altitude: {3}", waypointArray.GetValue(j, 0), Convert.ToDouble(waypointArray.GetValue(j, 1)), Convert.ToDouble(waypointArray.GetValue(j, 2)), Convert.ToDouble(waypointArray.GetValue(j, 3)))
    System.Threading.Interlocked.Increment(j)
End While

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1