STK ObjectsSend comments on this topic.
IAgAreaTarget Interface

Description

Provides access to the properties and methods defining an AreaTarget object.

Public Properties

Public Property AccessConstraintsGet the constraints imposed on the area target. Basic constraints for area targets apply to all points within or along the area target. If the constraint is satisfied for at least one point, access to the area target is considered valid.
Public Property AllowObjectAccessOpt whether access to the object is constrained with respect to the entire object, as opposed to any part of it.
Public Property AreaTypeThe method for defining the area target boundary. A member of the AgEAreaType enumeration.
Public Property AreaTypeDataGet the data defining the boundary with the selected method.
Public Property AutoCentroidOpt whether to have the centroid automatically computed.
Public Property CommonTasksCommon tasks associated with AreaTargets.
Public Property GraphicsGet the area target's 2D Graphics properties.
Public Property LocalTimeOffsetThe amount of the time offset from GMT, if this option is used. Uses Time Dimension.
Public Property PositionGet the position of the area target centroid.
Public Property UseLocalTimeOffsetOpt whether to use a local time offset from GMT.
Public Property UseTerrainDataOpt whether to use terrain data for altitude updates.
Public Property VOGet the area target's 3D Graphics properties.

Interfaces

CoClasses that Implement IAgAreaTarget

Example

Create an area target (on the current scenario central body)
[C#]
// Create the AreaTarget on the current scenario central body (use
// NewOnCentralBody to specify explicitly the central body)
IAgAreaTarget areaTarget = root.CurrentScenario.Children.New(AgESTKObjectType.eAreaTarget, "MyAreaTarget") as IAgAreaTarget;
Create an area target (on the current scenario central body)
[Visual Basic .NET]
' Create the AreaTarget on the current scenario central body (use
' NewOnCentralBody to specify explicitly the central body)
Dim areaTarget As IAgAreaTarget = TryCast(root.CurrentScenario.Children.[New](AgESTKObjectType.eAreaTarget, "MyAreaTarget"), IAgAreaTarget)
Create an area target (on the current scenario central body)
[Python - STK API]
# IAgStkObjectRoot root: STK Object Model Root

# Create the AreaTarget on the current scenario central body (use
# NewOnCentralBody to specify explicitly the central body)
areaTarget = root.CurrentScenario.Children.New(AgESTKObjectType.eAreaTarget, 'MyAreaTarget')

Set an elliptical area target
[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.eEllipse
ellipse = areaTarget.AreaTypeData
ellipse.SemiMajorAxis = 85.25  # in km (distance dimension)
ellipse.SemiMinorAxis = 80.75  # in km (distance dimension)
ellipse.Bearing = 44  # in deg (angle dimension)
root.EndUpdate()

Set an elliptical area target (using common tasks)
[Python - STK API]
# IAgStkObjectRoot root: STK Object Model Root
# IAgAreaTarget areaTarget: AreaTarget object

# By using the CommonTasks interface
areaTarget.CommonTasks.SetAreaTypeEllipse(85.25, 80.75, 44)

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 (using common tasks)
[Python - STK API]
# IAgStkObjectRoot root: STK Object Model Root
# IAgAreaTarget areaTarget: AreaTarget object
# Remove all points in the area target
areaTarget.AreaTypeData.RemoveAll()

# By using the CommonTasks interface,
# make an array of lattitude and longitude boundary points
boundary = [[29, -12], [29, 34], [6, 34], [6, -12]]

# SetAreaTypePattern expects a two dimensional array of latitude and longitude values
areaTarget.CommonTasks.SetAreaTypePattern(boundary)

List all points in an area target
[Python - STK API]
# IAgAreaTarget areaTarget: AreaTarget object
if (areaTarget.AreaType == AgEAreaType.ePattern):

    # Get IAgAreaTypePatternCollection interface from AreaTypeData
    patternPoints = areaTarget.AreaTypeData

    # ToArray returns a two dimensional array of latitude and longitude points
    areaTargetPoints = patternPoints.ToArray()

    print('All points in Area Target')
    for i in range(0, len(areaTargetPoints)):
        print('Latitude: %s Longitude: %s' % (str(areaTargetPoints[i][0]), str(areaTargetPoints[i][1])))

Create an area target (on the current scenario central body)
[MATLAB]
% IAgStkObjectRoot root: STK Object Model Root

% Create the AreaTarget on the current scenario central body (use
% NewOnCentralBody to specify explicitly the central body)
areaTarget = root.CurrentScenario.Children.New('eAreaTarget', 'MyAreaTarget');


        
Set an elliptical area target
[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 = 'eEllipse';
ellipse = areaTarget.AreaTypeData;
ellipse.SemiMajorAxis = 85.25; % in km (distance dimension)
ellipse.SemiMinorAxis = 80.75; % in km (distance dimension)
ellipse.Bearing = 44; % in deg (angle dimension)
root.EndUpdate();


        
Set an elliptical area target (using common tasks)
[MATLAB]
% IAgStkObjectRoot root: STK Object Model Root
% IAgAreaTarget areaTarget: AreaTarget object

% By using the CommonTasks interface
areaTarget.CommonTasks.SetAreaTypeEllipse(85.25, 80.75, 44);


        
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;


        
Define area target boundary and position from list of lat/lon/alt (using common tasks)
[MATLAB]
% IAgStkObjectRoot root: STK Object Model Root
% IAgAreaTarget areaTarget: AreaTarget object
% Remove all points in the area target
areaTarget.AreaTypeData.RemoveAll;

% By using the CommonTasks interface,
% make an array of lattitude and longitude boundary points
boundary = {29, -12;
            29, 34;
            6, 34;
            6, -12};

% SetAreaTypePattern expects a two dimensional array of latitude and longitude values
areaTarget.CommonTasks.SetAreaTypePattern(boundary);


        
List all points in an area target
[MATLAB]
% IAgAreaTarget areaTarget: AreaTarget object
if strcmp(areaTarget.AreaType, 'ePattern')

    % Get IAgAreaTypePatternCollection interface from AreaTypeData
    patternPoints = areaTarget.AreaTypeData;

    % ToArray returns a two dimensional array of latitude and longitude points
    areaTargetPoints = patternPoints.ToArray();

    disp('All points in Area Target');
    for i= 1:length(areaTargetPoints)
        disp(['Latitude ' num2str(areaTargetPoints{i, 1}) ' Longitude: ' num2str(areaTargetPoints{i, 2})]);
    end
end


        
© 2024 Analytical Graphics, Inc. All Rights Reserved.