Class VisualizationTopicsTabEntry
Represents a single row in the VisualizationTopicsTab, tracking whether 2D and 3D visualizations are active and managing the associated HUD window.
Inherited Members
Namespace: Unity.SimulationPro.Foundation.Visualizations
Assembly: Unity.SimulationPro.Foundation.Visualizations.dll
Syntax
public class VisualizationTopicsTabEntry
Constructors
VisualizationTopicsTabEntry(IConnector, ITopicInfo, Texture2D)
Creates a new VisualizationTopicsTabEntry for the given topic.
Declaration
public VisualizationTopicsTabEntry(IConnector connector, ITopicInfo topicInfo, Texture2D background)
Parameters
| Type | Name | Description |
|---|---|---|
| IConnector | connector | The connector to use for factory lookup. |
| ITopicInfo | topicInfo | The topic information object. |
| Texture2D | background | The background texture used for the hover style. |
Properties
CanShowDrawing
Gets a value indicating whether the registered factory supports 3D drawing output.
Declaration
public bool CanShowDrawing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
CanShowWindow
Gets a value indicating whether a visual factory is registered for this topic, enabling the 2D window toggle.
Declaration
public bool CanShowWindow { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsVisualizingDrawing
Gets a value indicating whether 3D drawing for this topic is currently enabled.
Declaration
public bool IsVisualizingDrawing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsVisualizingUI
Gets a value indicating whether the 2D HUD window for this topic is currently active.
Declaration
public bool IsVisualizingUI { get; }
Property Value
| Type | Description |
|---|---|
| bool |
MessageTypeId
Gets the message type ID associated with this topic.
Declaration
public MessageTypeId MessageTypeId { get; }
Property Value
| Type | Description |
|---|---|
| MessageTypeId |
Title
Gets the display title, appending " (response)" for service response topics.
Declaration
public string Title { get; }
Property Value
| Type | Description |
|---|---|
| string |
Topic
Gets the ROS topic name.
Declaration
public string Topic { get; }
Property Value
| Type | Description |
|---|---|
| string |
TopicInfo
Gets the underlying ITopicInfo for this entry.
Declaration
public ITopicInfo TopicInfo { get; }
Property Value
| Type | Description |
|---|---|
| ITopicInfo |
Visual
Gets the IVisual instance currently active for this topic entry, or null if no visualization has been created yet.
Declaration
public IVisual Visual { get; }
Property Value
| Type | Description |
|---|---|
| IVisual |
Methods
AddSaveStates(List<SaveState>)
Appends a VisualizationTopicsTabEntry.SaveState for this entry to results if any visualization is currently active. Also appends the service response sub-entry if present.
Declaration
public void AddSaveStates(List<VisualizationTopicsTabEntry.SaveState> results)
Parameters
| Type | Name | Description |
|---|---|---|
| List<VisualizationTopicsTabEntry.SaveState> | results | The list to append the save state(s) to. |
DrawGUI()
Renders the GUI row(s) for this topic entry, including any service response sub-entry.
Declaration
public void DrawGUI()
DrawGUILine()
Renders the single-row GUI for this topic, including the 2D and 3D toggle checkboxes and the topic-name button.
Declaration
public void DrawGUILine()
GetVisualFactory()
Returns the best-matching IVisualFactory for this topic, fetching it from the registry if not yet cached.
Declaration
public IVisualFactory GetVisualFactory()
Returns
| Type | Description |
|---|---|
| IVisualFactory | The highest-priority factory, or |
LoadSaveState(SaveState)
Restores the visualization state from the given VisualizationTopicsTabEntry.SaveState, recreating the HUD window if needed.
Declaration
public void LoadSaveState(VisualizationTopicsTabEntry.SaveState save)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualizationTopicsTabEntry.SaveState | save | The previously saved state to restore. |
SetOpenWindowCallback(Action<IVisualFactory, string, MessageTypeId>)
Registers a callback invoked in the editor when a user selects a factory from the context menu for a topic row.
Declaration
public static void SetOpenWindowCallback(Action<IVisualFactory, string, MessageTypeId> callback)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<IVisualFactory, string, MessageTypeId> | callback | The callback to invoke, receiving the selected factory, topic name, and message type ID. |
SetVisualFactory(IVisualFactory)
Replaces the current factory with the given one, discarding the previously active IVisual and re-applying the current visualization state.
Declaration
public void SetVisualFactory(IVisualFactory visualFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| IVisualFactory | visualFactory | The new factory to use, or |
SetVisualizing(bool, bool)
Enables or disables 2D and 3D visualization for this topic, creating or activating the HUD window and visual as needed.
Declaration
public void SetVisualizing(bool ui, bool drawing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | ui | Whether the 2D HUD window should be shown. |
| bool | drawing | Whether 3D drawing should be enabled. |