Description
A composite of display conditions combined
using a
Binary Logic Operation. For example, several
Time
Interval Display Condition objects can be added to a composite.
The composite can then be assigned to an object so the object is
only
rendered when
the current animation time is within one of the time
intervals.
Object Model
Public Methods
Add |
Adds a display condition to
the end of the composite. |
AddWithNegate |
Adds a display condition to
the end of the composite. |
Clear |
Removes all display
conditions from the composite. |
GetNegate |
Determines if a logical
not operation is applied to a display condition in the
composite. |
GetNegateAt |
Determines if a logical
not operation is applied to a display condition in the
composite. |
Insert |
Inserts a display condition
at the given zero-based index, shifting existing display
conditions. |
InsertWithNegate |
Inserts a display condition
at the given zero-based index, shifting existing display
conditions. |
Remove |
Removes a display condition
from the composite. |
RemoveAt |
Removes the display
condition at the given zero-based index, shifting existing display
conditions. |
Reserve |
Requests enough memory for
the composite to contain at least count display conditions.
Count will not be affected but
Capacity may be. |
SetNegate |
Sets if a logical
not operation is applied to a display condition in the
composite when the composite is evaluated. |
SetNegateAt |
Sets if a logical
not operation is applied to a display condition in the
composite when the composite is evaluated. |
Public Properties
Capacity |
Gets the number of display
conditions for which memory has been allocated. This will always be
greater or equal to
Count. |
Count |
Gets the number of display
conditions in the composite. |
Item |
Returns the condition at
the given zero-based index. |
LogicOperation |
Gets or sets the binary
logic operation applied to all display conditions in the composite
when the composite is evaluated. To combine logical
and and or operations in the same
expression, create composites containing composites. |
Example
Draw a primitive
based on multiple conditions
[C#] |
Copy Code
|
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager;
Array position = new object[] {29.98, -90.25, 0.0 };
IAgStkGraphicsModelPrimitive model = manager.Initializers.ModelPrimitive.InitializeWithStringUri(
modelFile);
model.SetPositionCartographic("Earth", ref position);
model.Scale = Math.Pow(10, 1.5);
IAgDate start1 = root.ConversionUtility.NewDate("UTCG", "30 May 2008 14:00:00.000");
IAgDate end1 = root.ConversionUtility.NewDate("UTCG", "30 May 2008 14:30:00.000");
((IAgAnimation)root).CurrentTime = double.Parse(start1.Format("epSec"));
IAgDate start2 = root.ConversionUtility.NewDate("UTCG", "30 May 2008 15:00:00.000");
IAgDate end2 = root.ConversionUtility.NewDate("UTCG", "30 May 2008 15:30:00.000");
IAgStkGraphicsTimeIntervalDisplayCondition time1 = manager.Initializers.TimeIntervalDisplayCondition.InitializeWithTimes(start1, end1);
IAgStkGraphicsTimeIntervalDisplayCondition time2 = manager.Initializers.TimeIntervalDisplayCondition.InitializeWithTimes(start2, end2);
IAgStkGraphicsCompositeDisplayCondition composite = manager.Initializers.CompositeDisplayCondition.Initialize();
composite.Add((IAgStkGraphicsDisplayCondition)time1);
composite.Add((IAgStkGraphicsDisplayCondition)time2);
composite.LogicOperation = AgEStkGraphicsBinaryLogicOperation.eStkGraphicsBinaryLogicOperationOr;
((IAgStkGraphicsPrimitive)model).DisplayCondition = composite as IAgStkGraphicsDisplayCondition;
IAgCrdnAxesFindInAxesResult result = root.VgtRoot.WellKnownAxes.Earth.Fixed.FindInAxes(((IAgScenario)root.CurrentScenario).Epoch, ((
IAgCrdnAxes)axes));
model.Orientation = result.Orientation;
manager.Primitives.Add((IAgStkGraphicsPrimitive)model);
|
|
Draw a primitive
based on multiple conditions
[Visual Basic .NET] |
Copy Code
|
Dim manager As
IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario,
IAgScenario).SceneManager
Dim position As Array =
New Object() {29.98, -90.25, 0.0}
Dim model As IAgStkGraphicsModelPrimitive =
manager.Initializers.ModelPrimitive.InitializeWithStringUri( _
modelFile)
model.SetPositionCartographic("Earth",
position)
model.Scale = Math.Pow(10, 1.5)
Dim start1 As IAgDate =
root.ConversionUtility.NewDate("UTCG",
"30 May 2008 14:00:00.000")
Dim end1 As IAgDate =
root.ConversionUtility.NewDate("UTCG",
"30 May 2008 14:30:00.000")
DirectCast(root, IAgAnimation).CurrentTime = Double.Parse(start1.Format("epSec"))
Dim start2 As IAgDate =
root.ConversionUtility.NewDate("UTCG",
"30 May 2008 15:00:00.000")
Dim end2 As IAgDate =
root.ConversionUtility.NewDate("UTCG",
"30 May 2008 15:30:00.000")
Dim time1 As IAgStkGraphicsTimeIntervalDisplayCondition =
manager.Initializers.TimeIntervalDisplayCondition.InitializeWithTimes(start1,
end1)
Dim time2 As IAgStkGraphicsTimeIntervalDisplayCondition =
manager.Initializers.TimeIntervalDisplayCondition.InitializeWithTimes(start2,
end2)
Dim composite As IAgStkGraphicsCompositeDisplayCondition =
manager.Initializers.CompositeDisplayCondition.Initialize()
composite.Add(DirectCast(time1,
IAgStkGraphicsDisplayCondition))
composite.Add(DirectCast(time2,
IAgStkGraphicsDisplayCondition))
composite.LogicOperation =
AgEStkGraphicsBinaryLogicOperation.eStkGraphicsBinaryLogicOperationOr
DirectCast(model, IAgStkGraphicsPrimitive).DisplayCondition =
TryCast(composite, IAgStkGraphicsDisplayCondition)
Dim result As IAgCrdnAxesFindInAxesResult
=
root.VgtRoot.WellKnownAxes.Earth.Fixed.FindInAxes(DirectCast(root.CurrentScenario,
IAgScenario).Epoch, DirectCast(axes, IAgCrdnAxes))
model.Orientation = result.Orientation
manager.Primitives.Add(DirectCast(model,
IAgStkGraphicsPrimitive))
|
|
Display a
Primitive During an Interval
[MATLAB] |
Copy Code
|
% IAgScenario scenario: Scenario object
% IAgStkGraphicsModelPrimitive model: Graphics Primitive
manager = scenario.SceneManager;
composite = manager.Initializers.CompositeDisplayCondition.Initialize;
start = root.ConversionUtility.NewDate('EpSec', num2str(scenario.StartTime));
stop = root.ConversionUtility.NewDate('EpSec', num2str(scenario.StartTime + 600));
timeInterval = manager.Initializers.TimeIntervalDisplayCondition.InitializeWithTimes(start, stop);
composite.Add(timeInterval);
model.DisplayCondition = composite;
|
|
See Also
CoClasses that Implement
IAgStkGraphicsCompositeDisplayCondition