STK Graphics PrimitivesSend comments on this topic.
IAgStkGraphicsCompositeDisplayCondition Interface

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.

Public Methods

Public Method AddAdds a display condition to the end of the composite.
Public Method AddWithNegateAdds a display condition to the end of the composite.
Public Method ClearRemoves all display conditions from the composite.
Public Method GetNegateDetermines if a logical not operation is applied to a display condition in the composite.
Public Method GetNegateAtDetermines if a logical not operation is applied to a display condition in the composite.
Public Method InsertInserts a display condition at the given zero-based index, shifting existing display conditions.
Public Method InsertWithNegateInserts a display condition at the given zero-based index, shifting existing display conditions.
Public Method RemoveRemoves a display condition from the composite.
Public Method RemoveAtRemoves the display condition at the given zero-based index, shifting existing display conditions.
Public Method ReserveRequests enough memory for the composite to contain at least count display conditions. Count will not be affected but Capacity may be.
Public Method SetNegateSets if a logical not operation is applied to a display condition in the composite when the composite is evaluated.
Public Method SetNegateAtSets if a logical not operation is applied to a display condition in the composite when the composite is evaluated.

Public Properties

Public Property CapacityGets the number of display conditions for which memory has been allocated. This will always be greater or equal to Count.
Public Property CountGets the number of display conditions in the composite.
Public Property ItemReturns the condition at the given zero-based index.
Public Property LogicOperationGets 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.

Interfaces

Implemented Interface
IAgStkGraphicsDisplayCondition

CoClasses that Implement IAgStkGraphicsCompositeDisplayCondition

Example

Draw a primitive based on multiple conditions
[C#]
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]
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
[Python - STK API]
# IAgScenario scenario: Scenario object
# IAgStkGraphicsModelPrimitive model: Graphics Primitive
manager = scenario.SceneManager
composite = manager.Initializers.CompositeDisplayCondition.Initialize()
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec')
start = root.ConversionUtility.NewDate('EpSec', str(scenario.StartTime))
stop = root.ConversionUtility.NewDate('EpSec', str(scenario.StartTime + 600))
timeInterval = manager.Initializers.TimeIntervalDisplayCondition.InitializeWithTimes(start, stop)
composite.Add(timeInterval)
model.DisplayCondition = composite

Display a Primitive During an Interval
[MATLAB]
% IAgScenario scenario: Scenario object
% IAgStkGraphicsModelPrimitive model: Graphics Primitive
manager = scenario.SceneManager;
composite = manager.Initializers.CompositeDisplayCondition.Initialize;
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec')
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

© 2024 Analytical Graphics, Inc. All Rights Reserved.