Description
Represents a collection of waypoints used
with GreatArc vehicles
Object Model
Public Methods
Add |
Adds a new element to the
collection. |
Contains |
Determines whether the
collection contains the waypoint at the specified time. |
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.=""> |
RemoveAll |
Removes all elements from
the collection. |
RemoveAt |
Removes an element from the
collection using specified index. |
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
Count |
Returns the number of
elements in a collection. |
Item |
Given an index, returns an
element in the collection. |
Example
List all waypoints in
a Waypoint Collection
[C#] |
Copy Code
|
object[,] waypoints = new object[,]
{
{ 20.36, 19.410, -99.125, "1 Jan 2012 12:00:00.000" },
{ 20.30, 19.421, -99.135, "1 Jan 2012 13:00:00.000" },
{ 20.30, 19.434, -99.137, "1 Jan 2012 14:00:00.000" }
};
propagator.Method = AgEVeWayPtCompMethod.eDetermineVelFromTime;
propagator.Waypoints.RemoveAll();
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];
}
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
|
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
propagator.Waypoints.RemoveAll()
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
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
|
|