Description
Access or create VGT calculation scalars associated with an object or a central body.
Public Methods
Contains | Searches for a an element with a given name. Returns false if the specified element does not exist. |
GetItemByIndex | Retrieves an element from the collection by index. |
GetItemByName | Retrieves an element from the collection by name. |
Remove | Removes a specified element. |
Public Properties
Context | Returns a context object. The context can be used to find out which central body or STK object this instance is associated with. |
Count | Returns a number of elements in the group. |
Factory | Returns a factory object used to create calc scalar components. |
Item | Returns an element by name or at a specified position. |
Example
Enumerate the existing calc scalars.
[C#] |
---|
// Enumerate the existing CalcScalars using specified CrdnProvider.
foreach (IAgCrdnCalcScalar calcScalar in provider.CalcScalars)
{
// All calc scalars implement IAgCrdn interface which provides
// information about the calc scalar instance and its type.
IAgCrdn crdn = calcScalar as IAgCrdn;
Console.WriteLine("Name: {0}, type: {1}", crdn.Name, calcScalar.Type);
}
|
|
Iterate through existing calc scalars.
[C#] |
---|
// Iterate through the the group of existing calc scalars associated
// with the specified CrdnProvider.
for (int i = 0; i < provider.CalcScalars.Count; i++)
{
IAgCrdnCalcScalar calcScalar = provider.CalcScalars[i];
// All calc scalars implement IAgCrdn interface which provides
// information about the calc scalar's instance and its type.
IAgCrdn crdn = provider.CalcScalars[i] as IAgCrdn;
// Print the calc scalar's name and type to the standard output.
Console.WriteLine("Name: {0}, type: {1}", crdn.Name, calcScalar.Type);
}
|
|
Enumerate the existing calc scalars.
[Visual Basic .NET] |
---|
' Enumerate the existing CalcScalars using specified CrdnProvider.
For Each calcScalar As IAgCrdnCalcScalar In provider.CalcScalars
' All calc scalars implement IAgCrdn interface which provides
' information about the calc scalar instance and its type.
Dim crdn As IAgCrdn = TryCast(calcScalar, IAgCrdn)
Console.WriteLine("Name: {0}, type: {1}", crdn.Name, calcScalar.Type)
Next
|
|
Iterate through existing calc scalars.
[Visual Basic .NET] |
---|
' Iterate through the the group of existing calc scalars associated
' with the specified CrdnProvider.
Dim i As Integer = 0
While i < provider.CalcScalars.Count
Dim calcScalar As IAgCrdnCalcScalar = provider.CalcScalars(i)
' All calc scalars implement IAgCrdn interface which provides
' information about the calc scalar's instance and its type.
Dim crdn As IAgCrdn = TryCast(provider.CalcScalars(i), IAgCrdn)
' Print the calc scalar's name and type to the standard output.
Console.WriteLine("Name: {0}, type: {1}", crdn.Name, calcScalar.Type)
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
|
|