///// <summary>
        ///// Executes this operation.
        ///// </summary>
        ///// <param name="wantsplit">True if line should be split at the intersection.</param>
        ///// <param name="pointType">The entity type to assign to the intersection point.</param>
        ///// <param name="dirEnt">The entity type for any line that should be added along the direction
        ///// line. Specify null if you don't want a line.</param>
        //internal void Execute(bool wantsplit, IEntity pointType, IEntity dirEnt)
        //{
        //    // Calculate the position of the point of intersection.
        //    IPosition xsect;
        //    PointFeature closest;
        //    if (!m_Direction.Intersect(m_Line, m_CloseTo, out xsect, out closest))
        //        throw new Exception("Cannot calculate intersection point");

        //    // Add the intersection point
        //    m_Intersection = AddIntersection(xsect, pointType);

        //    // Are we splitting the input line? If so, do it.
        //    m_IsSplit = wantsplit;
        //    if (m_IsSplit)
        //        SplitLine(m_Intersection, m_Line, out m_LineA, out m_LineB);

        //    // If we have a defined entity type for the direction line, add a line too.
        //    CadastralMapModel map = MapModel;
        //    if (dirEnt != null)
        //        m_DirLine = map.AddLine(m_Direction.From, m_Intersection, dirEnt, this);

        //    // Peform standard completion steps
        //    Complete();
        //}

        /// <summary>
        /// Obtains update items for a revised version of this edit
        /// (for later use with <see cref="ExchangeData"/>).
        /// </summary>
        /// <param name="dir">The direction to intersect.</param>
        /// <param name="line">The line to intersect.</param>
        /// <param name="closeTo">The point the intersection has to be close to. Used if
        /// there is more than one intersection to choose from. If null is specified, a
        /// default point will be selected.</param>
        /// <returns>The items representing the change (may be subsequently supplied to
        /// the <see cref="ExchangeUpdateItems"/> method).</returns>
        internal UpdateItemCollection GetUpdateItems(Direction dir, LineFeature line,
                                                     PointFeature closeTo)
        {
            UpdateItemCollection result = new UpdateItemCollection();

            result.AddObservation <Direction>(DataField.Direction, m_Direction, dir);
            result.AddFeature <LineFeature>(DataField.Line, m_Line, line);
            result.AddFeature <PointFeature>(DataField.CloseTo, m_CloseTo, closeTo);
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Obtains update items for a revised version of this edit
        /// (for later use with <see cref="ExchangeData"/>).
        /// </summary>
        /// <param name="dist1">1st distance observation.</param>
        /// <param name="from1">The point the 1st distance was observed from.</param>
        /// <param name="dist2">2nd distance observation.</param>
        /// <param name="from2">The point the 2nd distance was observed from.</param>
        /// <param name="isdefault">True if the default intersection is required (the one that has the
        /// lowest bearing with respect to the 2 from points). False for the other one (if any).</param>
        /// <returns>The items representing the change (may be subsequently supplied to
        /// the <see cref="ExchangeUpdateItems"/> method).</returns>
        internal UpdateItemCollection GetUpdateItems(Observation dist1, PointFeature from1,
                                                     Observation dist2, PointFeature from2, bool isdefault)
        {
            UpdateItemCollection result = new UpdateItemCollection();

            result.AddObservation <Observation>(DataField.Distance1, m_Distance1, dist1);
            result.AddFeature <PointFeature>(DataField.From1, m_From1, from1);
            result.AddObservation <Observation>(DataField.Distance2, m_Distance2, dist2);
            result.AddFeature <PointFeature>(DataField.From2, m_From2, from2);
            result.AddItem <bool>(DataField.Default, m_Default, isdefault);
            return(result);
        }
예제 #3
0
        /// <summary>
        /// Obtains update items for a revised version of this edit
        /// (for later use with <see cref="ExchangeData"/>).
        /// </summary>
        /// <param name="refline">The reference line.</param>
        /// <param name="offset">The observed offset (either a <c>Distance</c> or an <c>OffsetPoint</c>).</param>
        /// <param name="term1">A line that the parallel should start on.</param>
        /// <param name="term2">A line that the parallel should end on.</param>
        /// <param name="isArcReversed">Should circular arc be reversed?</param>
        /// <returns>The items representing the change (may be subsequently supplied to
        /// the <see cref="ExchangeUpdateItems"/> method).</returns>
        internal UpdateItemCollection GetUpdateItems(LineFeature refline, Observation offset,
                                                     LineFeature term1, LineFeature term2, bool isArcReversed)
        {
            UpdateItemCollection result = new UpdateItemCollection();

            result.AddFeature <LineFeature>(DataField.RefLine, m_RefLine, refline);
            result.AddObservation <Observation>(DataField.Offset, m_Offset, offset);
            result.AddFeature <LineFeature>(DataField.Term1, m_Term1, term1);
            result.AddFeature <LineFeature>(DataField.Term2, m_Term2, term2);
            result.AddItem <bool>(DataField.ReverseArc, this.IsArcReversed, isArcReversed);

            return(result);
        }
        /// <summary>
        /// Obtains update items for a revised version of this edit
        /// (for later use with <see cref="ExchangeData"/>).
        /// </summary>
        /// <param name="dist1">1st distance observation.</param>
        /// <param name="from1">The point the 1st distance was observed from.</param>
        /// <param name="dist2">2nd distance observation.</param>
        /// <param name="from2">The point the 2nd distance was observed from.</param>
        /// <param name="isdefault">True if the default intersection is required (the one that has the
        /// lowest bearing with respect to the 2 from points). False for the other one (if any).</param>
        /// <returns>The items representing the change (may be subsequently supplied to
        /// the <see cref="ExchangeUpdateItems"/> method).</returns>
        internal UpdateItemCollection GetUpdateItems(Direction dir, Observation distance,
                                                     PointFeature from, bool isdefault)
        {
            UpdateItemCollection result = new UpdateItemCollection();

            result.AddObservation <Direction>(DataField.Direction, m_Direction, dir);
            result.AddObservation <Observation>(DataField.Distance, m_Distance, distance);
            result.AddFeature <PointFeature>(DataField.From, m_From, from);
            result.AddItem <bool>(DataField.Default, m_Default, isdefault);
            return(result);
        }
예제 #5
0
        /// <summary>
        /// Obtains update items for a revised version of this edit
        /// (for later use with <see cref="ExchangeData"/>).
        /// </summary>
        /// <param name="p">The control point that was modified</param>
        /// <param name="newPosition">The revised position</param>
        /// <returns>The items representing the change (may be subsequently supplied to
        /// the <see cref="ExchangeUpdateItems"/> method).</returns>
        internal UpdateItemCollection GetUpdateItems(PointFeature p, Position newPosition)
        {
            UpdateItemCollection result = new UpdateItemCollection();

            // Unconditionally add an item that identifies the feature involved. This
            // is kind of klunky, covering the fact that this dialog for updating control
            // only deals with one point at a time.
            result.AddFeature <PointFeature>(DataField.UpdatedPoint, p);

            result.AddItem <double>(DataField.X, p.PointGeometry.Easting.Meters, newPosition.X);
            result.AddItem <double>(DataField.Y, p.PointGeometry.Northing.Meters, newPosition.Y);
            return(result);
        }
 /// <summary>
 /// Obtains update items for a revised version of this edit
 /// (for later use with <see cref="ExchangeData"/>).
 /// </summary>
 /// <param name="dist1">1st distance observation.</param>
 /// <param name="from1">The point the 1st distance was observed from.</param>
 /// <param name="dist2">2nd distance observation.</param>
 /// <param name="from2">The point the 2nd distance was observed from.</param>
 /// <param name="isdefault">True if the default intersection is required (the one that has the
 /// lowest bearing with respect to the 2 from points). False for the other one (if any).</param>
 /// <returns>The items representing the change (may be subsequently supplied to
 /// the <see cref="ExchangeUpdateItems"/> method).</returns>
 internal UpdateItemCollection GetUpdateItems(Direction dir, Observation distance,
     PointFeature from, bool isdefault)
 {
     UpdateItemCollection result = new UpdateItemCollection();
     result.AddObservation<Direction>(DataField.Direction, m_Direction, dir);
     result.AddObservation<Observation>(DataField.Distance, m_Distance, distance);
     result.AddFeature<PointFeature>(DataField.From, m_From, from);
     result.AddItem<bool>(DataField.Default, m_Default, isdefault);
     return result;
 }
 /// <summary>
 /// Obtains update items for a revised version of this edit
 /// (for later use with <see cref="ExchangeData"/>).
 /// </summary>
 /// <param name="dist1">1st distance observation.</param>
 /// <param name="from1">The point the 1st distance was observed from.</param>
 /// <param name="dist2">2nd distance observation.</param>
 /// <param name="from2">The point the 2nd distance was observed from.</param>
 /// <param name="isdefault">True if the default intersection is required (the one that has the
 /// lowest bearing with respect to the 2 from points). False for the other one (if any).</param>
 /// <returns>The items representing the change (may be subsequently supplied to
 /// the <see cref="ExchangeUpdateItems"/> method).</returns>
 internal UpdateItemCollection GetUpdateItems(Observation dist1, PointFeature from1,
     Observation dist2, PointFeature from2, bool isdefault)
 {
     UpdateItemCollection result = new UpdateItemCollection();
     result.AddObservation<Observation>(DataField.Distance1, m_Distance1, dist1);
     result.AddFeature<PointFeature>(DataField.From1, m_From1, from1);
     result.AddObservation<Observation>(DataField.Distance2, m_Distance2, dist2);
     result.AddFeature<PointFeature>(DataField.From2, m_From2, from2);
     result.AddItem<bool>(DataField.Default, m_Default, isdefault);
     return result;
 }
        /// <summary>
        /// Obtains update items for a revised version of this edit
        /// (for later use with <see cref="ExchangeData"/>).
        /// </summary>
        /// <param name="p">The control point that was modified</param>
        /// <param name="newPosition">The revised position</param>
        /// <returns>The items representing the change (may be subsequently supplied to
        /// the <see cref="ExchangeUpdateItems"/> method).</returns>
        internal UpdateItemCollection GetUpdateItems(PointFeature p, Position newPosition)
        {
            UpdateItemCollection result = new UpdateItemCollection();

            // Unconditionally add an item that identifies the feature involved. This
            // is kind of klunky, covering the fact that this dialog for updating control
            // only deals with one point at a time.
            result.AddFeature<PointFeature>(DataField.UpdatedPoint, p);

            result.AddItem<double>(DataField.X, p.PointGeometry.Easting.Meters, newPosition.X);
            result.AddItem<double>(DataField.Y, p.PointGeometry.Northing.Meters, newPosition.Y);
            return result;
        }
 ///// <summary>
 ///// Executes this operation.
 ///// </summary>
 ///// <param name="wantsplit">True if line should be split at the intersection.</param>
 ///// <param name="pointType">The entity type to assign to the intersection point.</param>
 ///// <param name="dirEnt">The entity type for any line that should be added along the direction
 ///// line. Specify null if you don't want a line.</param>
 //internal void Execute(bool wantsplit, IEntity pointType, IEntity dirEnt)
 //{
 //    // Calculate the position of the point of intersection.
 //    IPosition xsect;
 //    PointFeature closest;
 //    if (!m_Direction.Intersect(m_Line, m_CloseTo, out xsect, out closest))
 //        throw new Exception("Cannot calculate intersection point");
 //    // Add the intersection point
 //    m_Intersection = AddIntersection(xsect, pointType);
 //    // Are we splitting the input line? If so, do it.
 //    m_IsSplit = wantsplit;
 //    if (m_IsSplit)
 //        SplitLine(m_Intersection, m_Line, out m_LineA, out m_LineB);
 //    // If we have a defined entity type for the direction line, add a line too.
 //    CadastralMapModel map = MapModel;
 //    if (dirEnt != null)
 //        m_DirLine = map.AddLine(m_Direction.From, m_Intersection, dirEnt, this);
 //    // Peform standard completion steps
 //    Complete();
 //}
 /// <summary>
 /// Obtains update items for a revised version of this edit
 /// (for later use with <see cref="ExchangeData"/>).
 /// </summary>
 /// <param name="dir">The direction to intersect.</param>
 /// <param name="line">The line to intersect.</param>
 /// <param name="closeTo">The point the intersection has to be close to. Used if
 /// there is more than one intersection to choose from. If null is specified, a
 /// default point will be selected.</param>
 /// <returns>The items representing the change (may be subsequently supplied to
 /// the <see cref="ExchangeUpdateItems"/> method).</returns>
 internal UpdateItemCollection GetUpdateItems(Direction dir, LineFeature line,
     PointFeature closeTo)
 {
     UpdateItemCollection result = new UpdateItemCollection();
     result.AddObservation<Direction>(DataField.Direction, m_Direction, dir);
     result.AddFeature<LineFeature>(DataField.Line, m_Line, line);
     result.AddFeature<PointFeature>(DataField.CloseTo, m_CloseTo, closeTo);
     return result;
 }