Exemplo n.º 1
0
        /// <summary>
        /// Parse and read an annotation position object
        /// </summary>
        /// <param name="pos">The log annotation position to read</param>
        /// <returns>Possible errors occured during the parsing</returns>
        public LogAnnotParseError ParseAnnotationPosition(LogAnnotationPosition pos)
        {
            //Check the parent
            if (pos.LogAnnotation != this)
            {
                return(LogAnnotParseError.INVALID_PARENT);
            }

            //Check if we find the headers or not
            List <Int32> idx = pos.Headers;

            foreach (Int32 it in idx)
            {
                if (it != -1 && m_assignedHeaders.BinarySearch(it) >= 0)
                {
                    return(LogAnnotParseError.ERROR_HEADER_ALREADY_PRESENT);
                }
            }

            m_positions.Add(pos, new List <Vector3>(pos)); //Parse the positions and store the values once and for all

            //Set the headers as already assigned
            foreach (Int32 it in idx)
            {
                if (it != -1)
                {
                    int p = ~m_assignedHeaders.BinarySearch(it);
                    m_assignedHeaders.Insert(p, it);
                }
            }
            pos.AddListener(this);

            return(LogAnnotParseError.NO_ERROR);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get a map of all the registered annotation position and the associated read position.
        /// </summary>
        /// <param name="pos">the view to look after</param>
        /// <returns>the associated 3D positions. NULL if pos was not found</returns>
        public List <Vector3> GetPositionsFromView(LogAnnotationPosition pos)
        {
            if (m_positions.ContainsKey(pos))
            {
                return(m_positions[pos]);
            }

            return(null);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="container">Container which has loaded the values</param>
 /// <param name="pos">The position data model</param>
 /// <param name="sd">The subdaatset owning this instance</param>
 /// <param name="instanceID">The ID of this object to link it to its attached object</param>
 public LogAnnotationPositionInstance(LogAnnotationContainer container, LogAnnotationPosition pos, SubDataset sd, Int32 instanceID) : base(pos, sd, instanceID)
 {
     m_container = container;
     m_data      = pos;
 }