Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LegFace"/> class that has undefined spans, and
        /// no sequence number.
        /// </summary>
        internal LegFace(Leg leg, int nspan)
        {
            this.Leg = leg;

            // Allocate an array of spans (always at least ONE).
            m_Spans = new SpanInfo[Math.Max(1, nspan)];
            for (int i = 0; i < m_Spans.Length; i++)
                m_Spans[i] = new SpanInfo();
        }
Exemple #2
0
        /// <summary>
        /// Creates a new <c>PathInfo</c> object
        /// </summary>
        /// <param name="from">The point where the path starts.</param>
        /// <param name="to">The point where the path ends.</param>
        internal PathInfo(PointFeature from, PointFeature to, Leg[] legs)
        {
            m_From = from;
            m_To = to;
            m_Legs = legs;

            m_IsAdjusted = false;
            m_Rotation = 0.0;
            m_ScaleFactor = 0.0;
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LegFace"/> class.
        /// <param name="leg">The leg this face relates to.</param>
        /// <param name="dists">The observed distances for this face.</param>
        /// </summary>
        internal LegFace(Leg leg, Distance[] dists)
        {
            this.Leg = leg;

            m_Spans = new SpanInfo[dists.Length];
            for (int i=0; i<m_Spans.Length; i++)
            {
                m_Spans[i] = new SpanInfo();
                m_Spans[i].ObservedDistance = dists[i];
            }
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LegFace"/> class.
        /// </summary>
        /// <param name="leg">The leg this face relates to.</param>
        /// <param name="copy">The face to copy from.</param>
        /// <param name="startIndex">The start index of the first span to copy</param>
        internal LegFace(Leg leg, LegFace copy, int startIndex)
        {
            this.Leg = leg;

            int nSpan = copy.m_Spans.Length - startIndex;

            if (nSpan <= 0)
            {
                throw new IndexOutOfRangeException();
            }

            // Perform shallow copy
            m_Spans = new SpanInfo[nSpan];
            Array.Copy(copy.m_Spans, startIndex, m_Spans, 0, nSpan);
        }
Exemple #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LegFace"/> class.
        /// </summary>
        /// <param name="leg">The leg this face relates to.</param>
        /// <param name="copy">The face to copy from.</param>
        /// <param name="startIndex">The start index of the first span to copy</param>
        internal LegFace(Leg leg, LegFace copy, int startIndex)
        {
            this.Leg = leg;

            int nSpan = copy.m_Spans.Length - startIndex;
            if (nSpan <= 0)
                throw new IndexOutOfRangeException();

            // Perform shallow copy
            m_Spans = new SpanInfo[nSpan];
            Array.Copy(copy.m_Spans, startIndex, m_Spans, 0, nSpan);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PathEditor"/> class.
 /// </summary>
 /// <param name="legs">A working copy of the legs that may be modified.</param>
 internal PathEditor(Leg[] legs)
 {
     m_Legs = new List<Leg>(legs);
     m_Changes = new List<LegEdit>();
 }