Class HistoryDrawingVisualizer<T>
Abstract base class for visualizers that maintain a rolling history of received messages and render all of them together in a single 3D drawing pass.
Inheritance
Inherited Members
Namespace: Unity.SimulationPro.Foundation.Visualizations
Assembly: Unity.SimulationPro.Foundation.Visualizations.dll
Syntax
public abstract class HistoryDrawingVisualizer<T> : BaseVisualFactory<T>, IVisualFactory, IPriority where T : IMessage
Type Parameters
| Name | Description |
|---|---|
| T | The ROS message type this visualizer subscribes to. |
Properties
CanShowDrawing
Gets a value indicating whether this factory produces visuals that support 3D drawing output.
Declaration
public override bool CanShowDrawing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
HistoryLength
Gets or sets the maximum number of messages retained in the history queue.
Declaration
public int HistoryLength { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
CreateGUI(IEnumerable<Tuple<T, MessageMetadata>>)
Returns an Action that renders 2D GUI for the entire message history by combining individual GUI actions.
Declaration
public virtual Action CreateGUI(IEnumerable<Tuple<T, MessageMetadata>> messages)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Tuple<T, MessageMetadata>> | messages | The history of messages paired with their metadata. |
Returns
| Type | Description |
|---|---|
| Action | A combined GUI rendering action. |
CreateGUI(T, MessageMetadata)
Returns an Action that renders the 2D GUI for a single message. By default displays a string representation of the message.
Declaration
public virtual Action CreateGUI(T message, MessageMetadata meta)
Parameters
| Type | Name | Description |
|---|---|---|
| T | message | The message data to visualize. |
| MessageMetadata | meta | Contextual metadata about the message. |
Returns
| Type | Description |
|---|---|
| Action | A GUI rendering action. |
CreateVisual(string)
Creates a new IVisual instance for the given topic. Called the first time a topic is encountered.
Declaration
protected override IVisual CreateVisual(string topic)
Parameters
| Type | Name | Description |
|---|---|---|
| string | topic | ROS topic name. |
Returns
| Type | Description |
|---|---|
| IVisual | A new IVisual for the topic. |
Overrides
Draw(Drawing3d, IEnumerable<Tuple<T, MessageMetadata>>)
Called to render the full message history into the drawing. Delegates to Draw(Drawing3d, IEnumerable<T>) by default.
Declaration
public virtual void Draw(Drawing3d drawing, IEnumerable<Tuple<T, MessageMetadata>> messages)
Parameters
| Type | Name | Description |
|---|---|---|
| Drawing3d | drawing | The 3D drawing canvas. |
| IEnumerable<Tuple<T, MessageMetadata>> | messages | The history of messages paired with their metadata. |
Draw(Drawing3d, IEnumerable<T>)
Override this method to render all messages in the history into the provided Drawing3d canvas.
Declaration
public virtual void Draw(Drawing3d drawing, IEnumerable<T> messages)
Parameters
| Type | Name | Description |
|---|---|---|
| Drawing3d | drawing | The 3D drawing canvas. |
| IEnumerable<T> | messages | The history of messages. |