Class Scene
- Namespace
- VisioForge.Core.SceneSwitching
- Assembly
- VisioForge.Core.dll
Represents a named scene containing a collection of source placements. A scene defines which sources are visible and their layout properties (position, size, z-order, opacity). Scene switching changes the active scene without modifying the underlying pipeline topology.
public class SceneInheritance
Inherited Members
Constructors
Scene(string)
Initializes a new instance of the VisioForge.Core.SceneSwitching.Scene class.
public Scene(string name)Parameters
namestring-
The name of the scene.
Properties
ID
Gets the unique identifier for this scene.
public Guid ID { get; }Property Value
ItemCount
Gets the number of items in this scene.
public int ItemCount { get; }Property Value
Name
Gets or sets the name of this scene.
public string Name { get; set; }Property Value
Methods
AddItem(Guid, SceneItemTransform)
Adds or replaces a source item in this scene. Each source can only appear once per scene; if the source already exists, its item is replaced with the new transform.
public SceneItem AddItem(Guid sourceId, SceneItemTransform transform)Parameters
sourceIdGuid-
The ID of the registered source to add.
transformSceneItemTransform-
The visual transform properties for the source in this scene.
Returns
- SceneItem
-
The created VisioForge.Core.SceneSwitching.SceneItem.
AddItem(Guid, Rect, uint, double)
Adds or replaces a source item in this scene with explicit parameters. Each source can only appear once per scene; if the source already exists, its item is replaced with the new parameters.
public SceneItem AddItem(Guid sourceId, Rect rectangle, uint zOrder, double opacity = 1)Parameters
sourceIdGuid-
The ID of the registered source to add.
rectangleRect-
The position and size rectangle.
zOrderuint-
The z-order value.
opacitydouble-
The opacity value.
Returns
- SceneItem
-
The created VisioForge.Core.SceneSwitching.SceneItem.
BeginUpdate()
Begins a batch update. Changes will not trigger notifications until VisioForge.Core.SceneSwitching.Scene.EndUpdate is called.
public void BeginUpdate()EndUpdate()
Ends a batch update and fires a single change notification.
public void EndUpdate()GetItem(Guid)
Gets a scene item by its ID.
public SceneItem GetItem(Guid itemId)Parameters
itemIdGuid-
The ID of the scene item.
Returns
- SceneItem
-
The VisioForge.Core.SceneSwitching.SceneItem if found; otherwise,
null.
GetItems()
Gets all scene items.
public SceneItem[] GetItems()Returns
- SceneItem[]
-
An array of all VisioForge.Core.SceneSwitching.SceneItem instances in this scene.
GetItemsBySource(Guid)
Gets all scene items that reference a specific source.
public SceneItem[] GetItemsBySource(Guid sourceId)Parameters
sourceIdGuid-
The ID of the source to find items for.
Returns
- SceneItem[]
-
An array of VisioForge.Core.SceneSwitching.SceneItem instances referencing the specified source.
GetSourceIds()
Gets the set of unique source IDs used in this scene.
public HashSet<Guid> GetSourceIds()Returns
RemoveItem(Guid)
Removes a scene item by its ID.
public bool RemoveItem(Guid itemId)Parameters
itemIdGuid-
The ID of the scene item to remove.
Returns
- bool
-
trueif the item was found and removed; otherwise,false.
ToString()
Returns a string representation of this scene.
public override string ToString()