Beispiel #1
0
        /// <summary>
        /// Creates spatial features (points and lines) for this leg. The created
        /// features don't have any geometry.
        /// </summary>
        /// <param name="ff">The factory for creating new spatial features</param>
        /// <param name="startPoint">The point (if any) at the start of this leg. May be
        /// null in a situation where the preceding leg ended with an "omit point" directive.</param>
        /// <param name="lastPoint">The point that should be used for the very end
        /// of the leg (specify null if a point should be created at the end of the leg).</param>
        internal void CreateFeatures(FeatureFactory ff, PointFeature startPoint, PointFeature lastPoint)
        {
            // If we're dealing with a circular arc, create the underlying circle (and a
            // center point). The radius of the circle is undefined at this stage, but the
            // circle must be present so that created arcs can be cross-referenced to it.

            // Note that it is conceivable that the center point will end up coinciding with
            // another point in the map (it could even coincide with another circular leg in
            // the same connection path).

            CircularLeg cLeg = (this as CircularLeg);

            if (cLeg != null)
            {
                cLeg.CreateCircle(ff, this.ItemSequence.ToString());
            }

            m_FirstSide.CreateFeatures(ff, startPoint, lastPoint);

            // Should the end of an alternate face share the end point of the primary face??
            if (m_OtherSide != null)
            {
                // If the leg is right at the end of a connection path, the alternate face needs to
                // end at the specified point. Otherwise use the point that was created at the end
                // of the primary face (in unusual cases, it's possible that no point was created
                // there - in that case, the alternate face will create the end point).

                PointFeature endLegPoint = lastPoint;
                if (endLegPoint == null)
                {
                    endLegPoint = m_FirstSide.GetEndPoint(ff.Creator);
                }

                m_OtherSide.CreateFeatures(ff, startPoint, endLegPoint);
            }
        }