Class HistoryDrawingVisualizer<T>.HistoryDrawingVisual
Maintains a bounded queue of messages and redraws the history each time a new message arrives.
Implements
Inherited Members
Namespace: Unity.SimulationPro.Foundation.Visualizations
Assembly: Unity.SimulationPro.Foundation.Visualizations.dll
Syntax
public class HistoryDrawingVisualizer<T>.HistoryDrawingVisual : IVisual
Constructors
HistoryDrawingVisual(IConnector, string, HistoryDrawingVisualizer<T>, int)
Creates a new HistoryDrawingVisualizer<T>.HistoryDrawingVisual and subscribes to the specified topic.
Declaration
public HistoryDrawingVisual(IConnector connector, string topic, HistoryDrawingVisualizer<T> factory, int historyLength)
Parameters
| Type | Name | Description |
|---|---|---|
| IConnector | connector | The connector to subscribe on. |
| string | topic | ROS topic name. |
| HistoryDrawingVisualizer<T> | factory | The parent factory used for drawing and GUI creation. |
| int | historyLength | The maximum number of messages to retain in the history queue. |
Properties
IsDrawingEnabled
Gets a value indicating whether 3D drawing is currently enabled for this visual.
Declaration
public bool IsDrawingEnabled { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
AddMessage(IMessage)
Enqueues the incoming message, evicting the oldest entry if the queue is full, and triggers a redraw if drawing is enabled.
Declaration
public void AddMessage(IMessage message)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessage | message | The message data to visualize. |
DeleteDrawing()
Destroys the underlying Drawing3d object and sets it to null.
Declaration
public void DeleteDrawing()
OnGUI()
On GUI.
Declaration
public void OnGUI()
Redraw()
Redraw.
Declaration
public void Redraw()
SetDrawingEnabled(bool)
Enables or disables 3D drawing for this visual.
Declaration
public void SetDrawingEnabled(bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled | Whether drawing should be enabled. |