STK ObjectsSend comments on this topic.
IAgAreaTypePatternCollection Interface

Description

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

Public Methods

Public Method AddAdds a lat lon value. Lat parameter uses Latitude Dimension. Lon parameter uses Longitude Dimension.
Public Method InsertInserts 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 RemoveRemove an Item using a given index.
Public Method RemoveAllRemove all the elements of the collection.
Public Method ToArrayReturns the lat lons as a two dimensional array.

Public Properties

Public Property CountReturns the number of lat lons.
Public Property ItemReturns the lat lon with the Index.

Interfaces

Implemented Interface
IAgAreaTypeData

CoClasses that Implement IAgAreaTypePatternCollection

Example

Define area target boundary and position from list of lat/lon/alt
[C#]
// 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(40.040, -76.304);
patterns.Add(40.337, -75.922);
patterns.Add(40.028, -75.628);
root.EndUpdate();
List all points in an area target
[C#]
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]
' 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(40.04, -76.304)
patterns.Add(40.337, -75.922)
patterns.Add(40.028, -75.628)
root.EndUpdate()
List all points in an area target
[Visual Basic .NET]
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 < areaTargetPoints.GetLength(0)
		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
[Python - STK API]
# 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 = AgEAreaType.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

Define area target boundary and position from list of lat/lon/alt
[MATLAB]
% 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;


        
© 2024 Analytical Graphics, Inc. All Rights Reserved.