AGI STK Objects 11 Send comments on this topic.
ComputeTracks Method (IAgMtoAnalysisVisibility)
See Also  Example
Mode
TrackIds
Time





Description

Returns an array of track ids with a bool value indicating if it's visible to the specified object.

Syntax

[Visual Basic .NET]
Public Function ComputeTracks( _
   ByVal Mode As AgEMtoVisibilityMode, _
   ByRef TrackIds As System.Array, _
   ByVal Time As System.Object _
) As System.Array

[C#]
public System.Array ComputeTracks(
AgEMtoVisibilityMode Mode,
ref System.Array TrackIds,
System.Object Time
);

[Managed C++]
public: System::Array ComputeTracks(
AgEMtoVisibilityMode Mode,
System::Array ^^ TrackIds,
VARIANT Time
);

[Java]
public Object[] computeTracks(
AgEMtoVisibilityMode Mode,
Object[] TrackIds,
Variant Time
);

[Unmanaged C++]
public: HRESULT ComputeTracks(
AgEMtoVisibilityMode Mode,
SAFEARRAY ** TrackIds,
VARIANT Time,
SAFEARRAY ** Array
);

Parameters

Mode
Member Value Description
eVisibilityModeEach 2 Returns the Track_id and 1 or 0 for every track; where 1 indicates the track is visible and 0 indicates it is not.
eVisibilityModeEachVisible 3 Returns the Track_id and 1 only for those tracks having visibility. If all objects are invisible then the message 'No Visibility' is returned.
eVisibilityModeEachNotVisible 4 Returns the Track_id and 0 for those tracks not having visibility. If all objects are visible then the message 'Complete Visibility' is returned.
TrackIds
Time

Example

Which tracks of the specified subset of tracks are visible from the other STK Object at the specified time?
[C#] Copy Code
IAgMtoAnalysisVisibility mtoVisibility = mto.Analysis.Visibility; 
mtoVisibility.UseTerrain = false// Set to true to use terrain instead of line of sight. 
mtoVisibility.Entirety = AgEMtoEntirety.eMtoEntiretyPartial; // Only applies if MTO is static (i.e. non time dependent). 
 
Array tracksOfInterest = new object[] 
                         { 
                             127 
                         }; 
 
mtoVisibility.StkObjectPath = "Satellite/J2Satellite"
 
// ComputeTracks expects as the second parameter a one dimensional array of mto track ids 
// ComputeTracks returns a two dimensional array whose values are track id and visiblity 
Array trackVisibilityArray = mtoVisibility.ComputeTracks(AgEMtoVisibilityMode.eVisibilityModeEach, ref tracksOfInterest, "1 Jan 2012 12:05:00.000"); 
 
// Output results 
Console.WriteLine("ComputeTracks:"); 
for (int i = 0; i < trackVisibilityArray.GetLength(0); ++i) 

    Console.WriteLine("   Track {0} visibility: {1}"
        Convert.ToInt32(trackVisibilityArray.GetValue(i, 0)), 
        Convert.ToInt32(trackVisibilityArray.GetValue(i, 1))); 

 

Which tracks of the specified subset of tracks are visible from the other STK Object at the specified time?
[Visual Basic .NET] Copy Code
Dim mtoVisibility As IAgMtoAnalysisVisibility = mto.Analysis.Visibility
mtoVisibility.UseTerrain = False
' Set to true to use terrain instead of line of sight.
mtoVisibility.Entirety = AgEMtoEntirety.eMtoEntiretyPartial
' Only applies if MTO is static (i.e. non time dependent).
#If Not CSToJava Then
#Else
#End If
Dim tracksOfInterest As Array = New Object() {1, 2, 7}

mtoVisibility.StkObjectPath = "Satellite/J2Satellite"

' ComputeTracks expects as the second parameter a one dimensional array of mto track ids
' ComputeTracks returns a two dimensional array whose values are track id and visiblity
#If Not CSToJava Then
Dim trackVisibilityArray As Array = mtoVisibility.ComputeTracks(AgEMtoVisibilityMode.eVisibilityModeEach, tracksOfInterest, "1 Jan 2012 12:05:00.000")
#Else
#End If

' Output results
Console.WriteLine("ComputeTracks:")
Dim i As Integer = 0
While i < trackVisibilityArray.GetLength(0)
    Console.WriteLine(" Track {0} visibility: {1}", Convert.ToInt32(trackVisibilityArray.GetValue(i, 0)), Convert.ToInt32(trackVisibilityArray.GetValue(i, 1)))
    System.Threading.Interlocked.Increment(i)
End While

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1