Description
Access Constraint used for min/max constraints.
Public Properties
EnableMax | Enable the Max property. |
EnableMin | Enable the Min property. |
Max | Max value for the access constrain. |
Min | Min value for the access constraint. |
Interfaces
CoClasses that Implement IAgAccessCnstrMinMax
Example
Add and configure a sun elevation angle access constraint
[C#] |
---|
// To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
IAgAccessCnstrMinMax minmax = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrSunElevationAngle) as IAgAccessCnstrMinMax;
minmax.EnableMin = true;
minmax.Min = 22.2;
minmax.EnableMax = true;
minmax.Max = 77.7;
|
|
Add and configure a lunar elevation angle access constraint
[C#] |
---|
// To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
IAgAccessCnstrMinMax minmax = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLunarElevationAngle) as IAgAccessCnstrMinMax;
minmax.EnableMin = true;
minmax.Min = 11.1;
minmax.EnableMax = true;
minmax.Max = 88.8;
|
|
Add and configure an altitude access constraint
[C#] |
---|
// To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
// Attitude constraint
IAgAccessCnstrMinMax altitude = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrAltitude) as IAgAccessCnstrMinMax;
altitude.EnableMin = true;
altitude.Min = 20.5;
|
|
Enumerate the available constraints collection
[C#] |
---|
// The AvailableConstraints method returns a rectangular two-dimensional array of available constraints.
// A row of the array consists of two elements where the first element is a symbolic name of the constraint,
// and the second is a corresponding enumeration value.
Array arAvailable = accessConstraints.AvailableConstraints();
for (int i = 0; i < arAvailable.GetLength(0); i++)
{
string availName = (string)arAvailable.GetValue(i, 0);
AgEAccessConstraints eAccessConstraint = (AgEAccessConstraints)(int)arAvailable.GetValue(i, 1);
Console.WriteLine("\tConstraint {0}: {1} ({2})", i, availName, eAccessConstraint);
}
|
|
Add and configure a sun elevation angle access constraint
[Visual Basic .NET] |
---|
' To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
Dim minmax As IAgAccessCnstrMinMax = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrSunElevationAngle), IAgAccessCnstrMinMax)
minmax.EnableMin = True
minmax.Min = 22.2
minmax.EnableMax = True
minmax.Max = 77.7
|
|
Add and configure a lunar elevation angle access constraint
[Visual Basic .NET] |
---|
' To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
Dim minmax As IAgAccessCnstrMinMax = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLunarElevationAngle), IAgAccessCnstrMinMax)
minmax.EnableMin = True
minmax.Min = 11.1
minmax.EnableMax = True
minmax.Max = 88.8
|
|
Add and configure an altitude access constraint
[Visual Basic .NET] |
---|
' To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
' Attitude constraint
Dim altitude As IAgAccessCnstrMinMax = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrAltitude), IAgAccessCnstrMinMax)
altitude.EnableMin = True
altitude.Min = 20.5
|
|
Enumerate the available constraints collection
[Visual Basic .NET] |
---|
' The AvailableConstraints method returns a rectangular two-dimensional array of available constraints.
' A row of the array consists of two elements where the first element is a symbolic name of the constraint,
' and the second is a corresponding enumeration value.
Dim arAvailable As Array = accessConstraints.AvailableConstraints()
Dim i As Integer = 0
While i < arAvailable.GetLength(0)
Dim availName As String = DirectCast(arAvailable.GetValue(i, 0), String)
Dim eAccessConstraint As AgEAccessConstraints = DirectCast(DirectCast(arAvailable.GetValue(i, 1), Integer), AgEAccessConstraints)
Console.WriteLine(vbTab & "Constraint {0}: {1} ({2})", i, availName, eAccessConstraint)
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
|
|