浏览代码

Updated documentation

/aisv647_visualizations
Steven Borkman 4 年前
当前提交
bf785008
共有 5 个文件被更改,包括 20 次插入14 次删除
  1. 4
      com.unity.perception/Runtime/GroundTruth/Labelers/CameraLabeler.cs
  2. 10
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/ControlPanel.cs
  3. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/HUDPanel.cs
  4. 10
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/KeyValuePanel.cs
  5. 2
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/VisualizationCanvas.cs

4
com.unity.perception/Runtime/GroundTruth/Labelers/CameraLabeler.cs


/// <summary>
/// Called immediately after <see cref="setup"/>. Implement this to initialize labeler's visualization
/// capability if one exists <see cref="supportVisualization"/>.
/// <param name="panel">The target control panel for the labeler's visualization component</param>
/// <param name="panel">The target control panel for the labeler's visualization component</param>
/// <param name="enabled">The current enabled state of the visualizer</param>
/// <param name="enabled">The current enabled state of the visualizer</param>
protected virtual void OnVisualizerEnabledChanged(bool enabled) {}
/// <summary>
/// Called during the Update each frame the the labeler is enabled and <see cref="SensorHandle.ShouldCaptureThisFrame"/> is true.

10
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/ControlPanel.cs


/// Adds a new UI control to the control panel. If the control cannot be added and the method will
/// return false. Also, all UI elements must have a LayoutElement component and if they do not,
/// this method will reject the new element, and return false.
/// </summary>
/// </summary>
public bool AddNewControl(GameObject uiControl)
{
if (uiControl.GetComponent<RectTransform>() == null)

/// Removes the passed in component from the control panel. Returns
/// false if the element does not exist. Returns true on a successful removal.
/// The caller is responsible for destroying the control.
/// </summary>
/// </summary>
public bool RemoveControl(GameObject uiControl)
{
if (m_Controls.Remove(uiControl))

/// Creates a new toggle control with passed in name. The passed in listener will be
/// called on toggle clicks. If anything goes wrong this method will return null.
/// Returns the control panel element upon a successful add.
/// </summary>
/// </summary>
public GameObject AddToggleControl(string name, UnityAction<bool> listener)
{
if (listener == null)

/// <summary>
/// Creates a new slider control with the passed in name and default value. The slider's value runs from 0 to 1.
/// The passed in listener will be called on slider changes. If anything goes wrong this method will return null.
/// Returns the control panel elemet upon a succssful add.
/// Returns the control panel element upon a successful add.
/// </summary>
/// </summary>
public GameObject AddSliderControl(string name, float defaultValue, UnityAction<float> listener)
{
if (listener == null)

8
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/HUDPanel.cs


/// <summary>
/// Updates (or creates) an entry with the passed in key value pair
/// </summary>
/// </summary>
public void UpdateEntry(string key, string value)
{
(bool, KeyValuePanel) val;

/// <summary>
/// Removes the key value pair from the HUD
/// <param name="key">The key of the entry to remove</param>
/// <param name="key">The key of the entry to remove</param>
public void RemoveEntry(string key)
{
if (entries.ContainsKey(key))

/// <summary>
/// Removes all of the passed in entries from the HUD
/// <param name="keys">List of keys to remove from the panel</param>
/// <param name="keys">List of keys to remove from the panel</param>
public void RemoveEntries(List<string> keys)
{
foreach (var k in keys) RemoveEntry(k);

/// Removes all of the passed in entries from the HUD
/// <param name="keys">List of keys t remove from the panel</param>
/// <param name="keys">List of keys t remove from the panel</param>
public void RemoveEntries(string[] keys)
{
foreach (var k in keys) RemoveEntry(k);

10
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/KeyValuePanel.cs


/// </summary>
public class KeyValuePanel : MonoBehaviour
{
/// <summary>
/// Key UI text element of the panel
/// </summary>
/// <summary>
/// Value UI text element of the panel
/// </summary>
/// <param name="k">The key of the key/value pair</param>
/// <param name="k">The key of the key/value pair</param>
public void SetKey(string k)
{
if (k == null || k == string.Empty) return;

/// <summary>
/// Sets the value of this key value pair
/// <param name="v">The value of the key/value pair</param>
/// <param name="v">The value of the key/value pair</param>
public void SetValue(string v)
{
value.text = v;

2
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/VisualizationCanvas.cs


/// Adds a new UI components to the visualization canvas. Pass in fullscreen if the component should take up
/// the entire screen. Pass in setAsLowestElement if the component should be rendered behind all other components.
/// This method will return false if the element could not be added, true if everything works properly.
/// </summary>
/// </summary>
public bool AddComponent(GameObject component, bool fullScreen = true, bool setAsLowestElement = false)
{
if (component == null)

正在加载...
取消
保存