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





Description

AgAreaTypePatternCollection used to access the List of coords of the AreaTarget AreaType

Object Model

Public Methods

Public Method Add Adds a lat lon value. Lat parameter uses Latitude Dimension. Lon parameter uses Longitude Dimension.
Public Method Insert Inserts a lat lon value (the value is inserted into the specified index without having to remove all elements) Lat parameter uses Latitude Dimension. Lon parameter uses Longitude Dimension.
Public Method Remove Remove an Item using a given index.
Public Method RemoveAll Remove all the elements of the collection.
Public Method ToArray Returns the lat lons as a two dimensional array.

Public Properties

Public Property Count Returns the number of lat lons.
Public Property Item Returns the lat lon with the Index.

Example

Define area target boundary and position from list of lat/lon/alt
[C#] Copy Code
// By using the fine grained interfaces, 
// BeginUpdate/EndUpdate prevent intermediate redraws 
root.BeginUpdate(); 
areaTarget.AreaType = AgEAreaType.ePattern; 
IAgAreaTypePatternCollection patterns = areaTarget.AreaTypeData as IAgAreaTypePatternCollection; 
patterns.Add(48.89718.637); 
patterns.Add(46.53413.919); 
patterns.Add(44.17321.476); 
root.EndUpdate(); 
 

List all points in an area target
[C#] Copy Code
if (areaTarget.AreaType == AgEAreaType.ePattern) 

    // Get IAgAreaTypePatternCollection interface from AreaTypeData 
    IAgAreaTypePatternCollection patternPoints = areaTarget.AreaTypeData as IAgAreaTypePatternCollection; 
 
    // ToArray returns a two dimensional array of latitude and longitude points 
    Array areaTargetPoints = patternPoints.ToArray(); 
 
    Console.WriteLine("All points in Area Target"); 
    for (int i = 0; i < areaTargetPoints.GetLength(0); ++i) 
    { 
        Console.WriteLine("  Latitude {0} Longitude: {1}"
            Convert.ToDouble(areaTargetPoints.GetValue(i, 0)), 
            Convert.ToDouble(areaTargetPoints.GetValue(i, 1))); 
    } 

 

Define area target boundary and position from list of lat/lon/alt
[Visual Basic .NET] Copy Code
' By using the fine grained interfaces,
' BeginUpdate/EndUpdate prevent intermediate redraws
root.BeginUpdate()
areaTarget.AreaType = AgEAreaType.ePattern
Dim patterns As IAgAreaTypePatternCollection = TryCast(areaTarget.AreaTypeData, IAgAreaTypePatternCollection)
patterns.Add(48.897, 18.637)
patterns.Add(46.534, 13.919)
patterns.Add(44.173, 21.476)
root.EndUpdate()

List all points in an area target
[Visual Basic .NET] Copy Code
If areaTarget.AreaType = AgEAreaType.ePattern Then
    ' Get IAgAreaTypePatternCollection interface from AreaTypeData
    Dim patternPoints As IAgAreaTypePatternCollection = TryCast(areaTarget.AreaTypeData, IAgAreaTypePatternCollection)

    ' ToArray returns a two dimensional array of latitude and longitude points
    Dim areaTargetPoints As Array = patternPoints.ToArray()

    Console.WriteLine("All points in Area Target")
    Dim i As Integer = 0
    While i <>
        Console.WriteLine(" Latitude {0} Longitude: {1}", Convert.ToDouble(areaTargetPoints.GetValue(i, 0)), Convert.ToDouble(areaTargetPoints.GetValue(i, 1)))
        System.Threading.Interlocked.Increment(i)
    End While
End If

Define area target boundary and position from list of lat/lon/alt
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model Root 
% IAgAreaTarget areaTarget: AreaTarget object 
 
% By using the fine grained interfaces, 
% BeginUpdate/EndUpdate prevent intermediate redraws 
root.BeginUpdate(); 
areaTarget.AreaType = 'ePattern'; 
patterns = areaTarget.AreaTypeData; 
patterns.Add(48.897, 18.637); 
patterns.Add(46.534, 13.919); 
patterns.Add(44.173, 21.476); 
root.EndUpdate(); 
areaTarget.AutoCentroid = true; 
 
 

CoClasses that Implement IAgAreaTypePatternCollection

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1