/// <summary> /// Initialize for an update (or recall) /// </summary> /// <param name="op">The edit that is being updated or recalled</param> /// <param name="lineNum">The sequence number of the distance involved (relevant only for /// a <see cref="IntersectTwoLinesOperation"/>)</param> internal void ShowUpdate(IntersectOperation op, int lineNum) { // Return if no update object (and no recall op). if (op == null) { return; } // Populate the dialog, depending on what sort of operation we have. if (op.EditId == EditingActionId.LineIntersect) { /* * CeIntersectLine* pOper = dynamic_cast<CeIntersectLine*>(pop); * * if ( linenum==1 ) * this->Show( pOper->GetpArc1() * , pOper->IsSplit1() ); * else * this->Show( pOper->GetpArc2() * , pOper->IsSplit2() ); */ } else if (op.EditId == EditingActionId.DirLineIntersect) { IntersectDirectionAndLineOperation oper = (IntersectDirectionAndLineOperation)op; ShowLine(oper.Line, oper.IsSplit); } else { MessageBox.Show("GetLineControl.ShowUpdate - Unexpected editing operation"); } }
internal void Resolve(CadastralMapModel model) { IFeatureRef fr = m_LineRef.ReferenceFrom; Debug.Assert(fr is Operation); Feature f = model.Find <Feature>(m_LineRef.InternalId); if (f == null) { throw new ApplicationException("Cannot locate forward reference " + m_LineRef.InternalId); } // Only IntersectDirectionAndLineOperation has forward splits, so follow that logic LineFeature line = (LineFeature)f; var dff = new DeserializationFactory(fr as Operation); dff.AddLineSplit(line, DataField.SplitBefore, m_SplitBeforeId); dff.AddLineSplit(line, DataField.SplitAfter, m_SplitAfterId); IntersectOperation xop = (IntersectOperation)fr; LineFeature lineBefore, lineAfter; dff.MakeSections(line, DataField.SplitBefore, xop.IntersectionPoint, DataField.SplitAfter, out lineBefore, out lineAfter); }
internal void InitializeControl(IntersectForm parent, int lineNum) { SetWantSplit(false); // If we are updating a feature that was previously created, // load the original info. For line-line intersections, // we need to know which page this is, to determine whether we // should display info for the 1st or 2nd line. IntersectOperation op = parent.GetUpdateOp(); ShowUpdate(op, lineNum); /* * // Check the appropriate check boxes for the split stuff. * if (m_Line!=null) * { * if (m_WantSplit==1) * yesCheckBox.Checked = true; * else * noCheckBox.Checked = true; * * } * * // Make sure everything is drawn on top. * OnDraw(); */ }
internal void InitializeControl(IntersectForm parent) { // Ask the enclosing property sheet whether we are updating // an existing feature or not. // If we are updating a previously existing point, select // the previously defined entity type. IntersectOperation op = parent.GetUpdateOp(); if (op == null) { // Load the entity combo box with a list for point features. IEntity ent = pointTypeComboBox.Load(SpatialType.Point); // Load the ID combo (reserving the first available ID). IdHelper.LoadIdCombo(pointIdComboBox, ent, m_PointId); // If we are auto-numbering, disable the ID combo. EditingController controller = EditingController.Current; if (controller.IsAutoNumber) { pointIdComboBox.Enabled = false; } } else { pointTypeComboBox.SelectedValueChanged -= pointTypeComboBox_SelectedValueChanged; pointIdComboBox.SelectedValueChanged -= pointIdComboBox_SelectedValueChanged; pointTypeComboBox.Enabled = false; pointIdComboBox.Enabled = false; // Load the entity combo box with a list for point features and disable it. ILayer layer = EditingController.Current.ActiveLayer; pointTypeComboBox.Load(SpatialType.Point, layer); // Scroll the entity combo to the previously defined // entity type for the intersection point. PointFeature feat = op.IntersectionPoint; IEntity curEnt = feat.EntityType; if (curEnt != null) { pointTypeComboBox.SelectEntity(curEnt); } // Display the point key (if any) pointIdComboBox.DropDownStyle = ComboBoxStyle.DropDown; pointIdComboBox.Text = feat.FormattedKey; // Intersects involving line features... m_CloseTo = op.ClosePoint; ShowCloseTo(); } }
internal void InitializeControl(IntersectForm parent, int distNum) { // Initialize combo box with a list of all line entity types // for the currently active editing layer. lineTypeComboBox.Load(SpatialType.Line); // If we are updating a feature that was previously created, // load the original info. For distance-distance intersections, // we need to know which page this is, to determine whether we // should display info for the 1st or 2nd distance. IntersectOperation op = parent.GetUpdateOp(); if (op == null) { op = parent.GetRecall(); } ShowUpdate(op, distNum); // Go to the first text box fromPointTextBox.Focus(); }
/// <summary> /// Handles the Finish button. /// </summary> /// <returns>The point created at the intersection (null if an error was reported). /// The caller is responsible for disposing of the dialog and telling the controller /// the command is done)</returns> internal override PointFeature Finish() { // The intersection SHOULD be defined (the Finish button should have // been disabled if it wasn't) IPosition x = intersectInfo.Intersection; if (x == null) { MessageBox.Show("No intersection. Nothing to save"); return(null); } // Save the intersect point if we're not updating IntersectOperation upd = GetUpdateOp(); if (upd == null) { return(SaveLineLine()); } // Unlike other intersect edits, line-line intersects are not revisable throw new NotSupportedException("Updates not supported for line-line intersections"); }
/// <summary> /// Initialize for an update (or recall) /// </summary> /// <param name="op">The edit that is being updated or recalled</param> /// <param name="distNum">The sequence number of the distance involved (relevant only for /// a <see cref="IntersectTwoDistancesOperation"/>)</param> internal void ShowUpdate(IntersectOperation op, int distNum) { // Return if no update object (and no recall op). if (op == null) { return; } // Populate the dialog, depending on what sort of operation we have. if (op.EditId == EditingActionId.DistIntersect) { Debug.Assert(distNum == 1 || distNum == 2); IntersectTwoDistancesOperation oper = (IntersectTwoDistancesOperation)op; if (distNum == 1) { ShowDistance(oper.Distance1FromPoint, oper.Distance1, oper.CreatedLine1); } else { ShowDistance(oper.Distance2FromPoint, oper.Distance2, oper.CreatedLine2); } } else if (op.EditId == EditingActionId.DirDistIntersect) { IntersectDirectionAndDistanceOperation oper = (IntersectDirectionAndDistanceOperation)op; ShowDistance(oper.DistanceFromPoint, oper.Distance, oper.CreatedDistanceLine); } else { MessageBox.Show("GetDistanceControl.ShowUpdate - Unexpected editing operation"); } // Disallow change of line type (you cannot add or delete lines via update). lineTypeGroupBox.Enabled = false; }