示例#1
0
 /// <summary>
 /// Removes the key value pair from the HUD
 /// </summary>
 /// <param name="labeler">The labeler that requested the removal</param>
 /// <param name="key">The key of the entry to remove</param>
 public void RemoveEntry(CameraLabeler labeler, string key)
 {
     if (m_Entries.ContainsKey(labeler))
     {
         m_Entries[labeler].Remove(key);
     }
 }
示例#2
0
 /// <summary>
 /// Updates (or creates) an entry with the passed in key value pair
 /// </summary>
 /// <param name="labeler">The labeler that requested the HUD entry</param>
 /// <param name="key">The key of the HUD entry</param>
 /// <param name="value">The value of the entry</param>
 public void UpdateEntry(CameraLabeler labeler, string key, string value)
 {
     if (!m_Entries.ContainsKey(labeler))
     {
         m_Entries[labeler] = new Dictionary <string, string>();
     }
     m_Entries[labeler][key] = value;
 }
示例#3
0
        /// <summary>
        /// Removes the given <see cref="CameraLabeler"/> from the list of labelers under this PerceptionCamera, if it
        /// is in the list. The labeler is cleaned up in the process. Labelers removed from a PerceptionCamera should
        /// not be used again.
        /// </summary>
        /// <param name="cameraLabeler"></param>
        /// <returns></returns>
        public bool RemoveLabeler(CameraLabeler cameraLabeler)
        {
            if (m_Labelers.Remove(cameraLabeler))
            {
                if (cameraLabeler.isInitialized)
                {
                    cameraLabeler.InternalCleanup();
                }

                return(true);
            }
            return(false);
        }
示例#4
0
 /// <summary>
 /// Removes all of the passed in entries from the HUD
 /// </summary>
 /// <param name="labeler">The labeler that requested the removal</param>
 public void RemoveEntries(CameraLabeler labeler)
 {
     m_Entries.Remove(labeler);
 }
示例#5
0
 /// <summary>
 /// Add the given <see cref="CameraLabeler"/> to the PerceptionCamera. It will be set up and executed by this
 /// PerceptionCamera each frame it captures data.
 /// </summary>
 /// <param name="cameraLabeler">The labeler to add to this PerceptionCamera</param>
 public void AddLabeler(CameraLabeler cameraLabeler) => m_Labelers.Add(cameraLabeler);