Ejemplo n.º 1
0
        /// <summary>
        /// Load the annotation using a binary reader.
        /// </summary>
        /// <param name="br">Specifies the binary reader used to load the data.</param>
        /// <returns>The newly loaded annoation is returned.</returns>
        public static Annotation Load(BinaryReader br)
        {
            int            nInstanceId = br.ReadInt32();
            NormalizedBBox bbox        = NormalizedBBox.Load(br);

            return(new Annotation(bbox, nInstanceId));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add a new bbox to the label.
        /// </summary>
        /// <param name="nLabel"></param>
        /// <param name="bbox"></param>
        public void Add(int nLabel, NormalizedBBox bbox)
        {
            if (m_rgItems[nLabel] == null)
            {
                m_rgItems[nLabel] = new List <NormalizedBBox>();
            }

            m_rgItems[nLabel].Add(bbox);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Add a new bbox to the label.
        /// </summary>
        /// <param name="nLabel"></param>
        /// <param name="bbox"></param>
        public void Add(int nLabel, NormalizedBBox bbox)
        {
            if (!m_rgItems.ContainsKey(nLabel))
            {
                m_rgItems.Add(nLabel, new List <NormalizedBBox>());
            }

            m_rgItems[nLabel].Add(bbox);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Returns a copy of the Annotation.
        /// </summary>
        /// <returns>A new copy of the annotation is returned.</returns>
        public Annotation Clone()
        {
            NormalizedBBox bbox = null;

            if (m_bbox != null)
            {
                bbox = m_bbox.Clone();
            }

            return(new Annotation(bbox, m_nInstanceId));
        }
Ejemplo n.º 5
0
 /// <summary>
 /// The constructor.
 /// </summary>
 /// <param name="bbox">Specifies the bounding box.</param>
 /// <param name="nInstanceId">Specifies the instance ID.</param>
 public Annotation(NormalizedBBox bbox, int nInstanceId = 0)
 {
     m_bbox        = bbox;
     m_nInstanceId = nInstanceId;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// The constructor.
 /// </summary>
 /// <param name="bbox">Specifies the group bounding box.</param>
 /// <param name="nGroupLabel">Specifies the group label.</param>
 public AnnotationGroup(NormalizedBBox bbox, int nGroupLabel = 0)
 {
     m_bbox        = bbox;
     m_nGroupLabel = nGroupLabel;
 }