Description
A raster, the data of which, is updated
dynamically at the specified
Update Delta. The
class can be used to stream video and other dynamic raster data to
textures and other
Raster clients. Note to Implementers:
When implementing a derived class of RasterStream, you must provide
an implementation for the
Update method. The
Attributes property of the
Raster should be set in the constructor of the derived class.
Public
Methods
Update |
When overridden in a
derived class, updates the raster data associated with the raster
stream at the specified time. When the Update method is called,
the raster stream contains a raster data buffer defined by the
current Attributes of the stream for
updating the raster data. The time parameter provides the current
and next Scene Manager time. Return true if
the raster data was updated, otherwise return false. |
Public
Properties
UpdateDelta |
Gets or sets the update
delta of the raster stream in seconds. The Update Delta
defines the interval at which the Update method will be
called. The default Update Delta is
0, which will call the Update method every time
the Scene Manager time changes.
When animating, this means the Update method would be
called on every animation step. |
Example
Load and display a
raster stream
| [C#] |
Copy Code
|
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager;
IAgStkGraphicsScreenOverlayCollectionBase overlayManager = (IAgStkGraphicsScreenOverlayCollectionBase)manager.ScreenOverlays.Overlays;
//
// Create the RasterStream from the plugin
//
IAgStkGraphicsProjectionRasterStreamPluginActivator activator =
manager.Initializers.ProjectionRasterStreamPluginActivator.Initialize();
IAgStkGraphicsProjectionRasterStreamPluginProxy proxy =
activator.CreateFromDisplayName("ProjectionRasterStreamPlugin.CSharp");
//
// Use reflection to set the plugin's properties
//
Type plugin = proxy.RealPluginObject.GetType();
plugin.GetProperty("RasterPath").SetValue(proxy.RealPluginObject, imageFile, null);
IAgStkGraphicsRasterStream rasterStream = proxy.RasterStream;
rasterStream.UpdateDelta = 0.01667;
//
// Creates the texture screen overlay to display the raster
//
IAgStkGraphicsRendererTexture2D texture = manager.Textures.FromRaster((IAgStkGraphicsRaster)rasterStream);
IAgStkGraphicsTextureScreenOverlay overlay =
manager.Initializers.TextureScreenOverlay.InitializeWithXYWidthHeight(0, 0,
texture.Template.Width, texture.Template.Height);
overlay.Texture = texture;
((IAgStkGraphicsOverlay)overlay).Origin = AgEStkGraphicsScreenOverlayOrigin.eStkGraphicsScreenOverlayOriginCenterLeft;
overlayManager.Add((IAgStkGraphicsScreenOverlay)overlay);
|
|
Load and display a
raster stream
| [Visual Basic .NET] |
Copy Code
|
Dim
manager As IAgStkGraphicsSceneManager
= DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim overlayManager As IAgStkGraphicsScreenOverlayCollectionBase =
DirectCast(manager.ScreenOverlays.Overlays,
IAgStkGraphicsScreenOverlayCollectionBase)
Dim activator As
IAgStkGraphicsProjectionRasterStreamPluginActivator =
manager.Initializers.ProjectionRasterStreamPluginActivator.Initialize()
Dim proxy As IAgStkGraphicsProjectionRasterStreamPluginProxy
= activator.CreateFromDisplayName("ProjectionRasterStreamPlugin.VBNET")
Dim plugin As Type =
proxy.RealPluginObject.[GetType]()
plugin.GetProperty("RasterPath").SetValue(proxy.RealPluginObject,
imageFile, Nothing)
Dim rasterStream As IAgStkGraphicsRasterStream =
proxy.RasterStream
rasterStream.UpdateDelta = 0.01667
Dim texture As IAgStkGraphicsRendererTexture2D =
manager.Textures.FromRaster(DirectCast(rasterStream,
IAgStkGraphicsRaster))
Dim overlay As IAgStkGraphicsTextureScreenOverlay =
manager.Initializers.TextureScreenOverlay.InitializeWithXYWidthHeight(0,
0, texture.Template.Width, texture.Template.Height)
overlay.Texture = texture
DirectCast(overlay, IAgStkGraphicsOverlay).Origin =
AgEStkGraphicsScreenOverlayOrigin.eStkGraphicsScreenOverlayOriginCenterLeft
overlayManager.Add(DirectCast(overlay,
IAgStkGraphicsScreenOverlay))
|
|
See Also