AGI STK VGT 11Send comments on this topic.
CreateEventIntervalCollectionLighting Method (IAgCrdnEventIntervalCollectionFactory)
See Also  Example
Name
Description
Windows






Windows & Linux

Description

Create an event interval collection defined by computing sunlight, penumbra and umbra intervals as seen at specified location using specified selection of eclipsing bodies.

Syntax

[Visual Basic .NET]
Public Function CreateEventIntervalCollectionLighting( _
   ByVal Name As String, _
   ByVal Description As String _
) As IAgCrdnEventIntervalCollection
[C#]
public IAgCrdnEventIntervalCollection CreateEventIntervalCollectionLighting(
   string Name,
   string Description
);
[Managed C++]
public: IAgCrdnEventIntervalCollection^ CreateEventIntervalCollectionLighting(
   String __gc ^ Name,
   String __gc ^ Description
);
[Java]
public IAgCrdnEventIntervalCollection createEventIntervalCollectionLighting(
   String Name,
   String Description
);
[Unmanaged C++]
public: HRESULT CreateEventIntervalCollectionLighting(
   BSTR Name,
   BSTR Description,
   IAgCrdnEventIntervalCollection ** ReturnValue
);

Parameters

Name
Description

Remarks

Spaces and most punctuation ( except for "-_().") cannot be used as a part of a component name when creating new components via VGT API.

Example

Create and configure lighting event interval collection.
[C#]Copy Code
IAgCrdnEventIntervalCollection intervalCollection = provider.EventIntervalCollections.Factory.CreateEventIntervalCollectionLighting("MyIntervalCollectionLightning",  "MyDescription"); 
IAgCrdnEventIntervalCollectionLighting asCollectionLightning = intervalCollection as IAgCrdnEventIntervalCollectionLighting; 
 
// Optionally use a separate central body 
asCollectionLightning.UseObjectEclipsingBodies = true
asCollectionLightning.Location = provider.Points["Center"]; 
asCollectionLightning.EclipsingBodies = new object[] { "Saturn""Jupiter" }; 
 
IAgCrdnIntervalsVectorResult intervalResult = intervalCollection.FindIntervalCollection(); 
if (intervalResult.IsValid) 

    foreach (IAgCrdnIntervalCollection intervals in intervalResult.IntervalCollections) 
    { 
        foreach (IAgCrdnInterval interval in intervals) 
        { 
            Console.WriteLine("Start: " + interval.Start); 
            Console.WriteLine("Start: " + interval.Stop); 
        } 
    } 

 

Create and configure lighting event interval collection.
[Visual Basic .NET]Copy Code
Dim intervalCollection As IAgCrdnEventIntervalCollection = provider.EventIntervalCollections.Factory.CreateEventIntervalCollectionLighting("MyIntervalCollectionLightning", "MyDescription")
Dim asCollectionLightning As IAgCrdnEventIntervalCollectionLighting = TryCast(intervalCollection, IAgCrdnEventIntervalCollectionLighting)

' Optionally use a separate central body
asCollectionLightning.UseObjectEclipsingBodies = True
asCollectionLightning.Location = provider.Points("Center")
asCollectionLightning.EclipsingBodies = New Object() {"Saturn", "Jupiter"}

Dim intervalResult As IAgCrdnIntervalsVectorResult = intervalCollection.FindIntervalCollection()
If intervalResult.IsValid Then
    For Each intervals As IAgCrdnIntervalCollection In intervalResult.IntervalCollections
        For Each interval As IAgCrdnInterval In intervals
            Console.WriteLine("Start: " + interval.Start)
            Console.WriteLine("Start: " + interval.[Stop])
        Next
    Next
End If

See Also

© 2018 Analytical Graphics, Inc. All Rights Reserved.