private void buttonX1_Click(object sender, EventArgs e) { if (ValidateNameMethod != null) { if (!ValidateNameMethod(txtName.Text)) { return; } } double dx, dy, dz; if (double.TryParse(txtx.Text, out dx) && double.TryParse(txty.Text, out dy) && double.TryParse(txtz.Text, out dz)) { MPoint = new ModelPoint(txtName.Text); MPoint.x = dx; MPoint.y = dy; MPoint.z = dz; MPoint.Type = 0; DialogResult = DialogResult.OK; } }
private void ShowModelPointInfo(ModelPoint pt) { if (pt == null) { return; } txtMx.Text = pt.x.ToString(); txtMy.Text = pt.y.ToString(); txtMz.Text = pt.z.ToString(); }
private void CreatePoint(ModelPoint pt, double radius) { vdInsert vdi = new vdInsert(vDraw.ActiveDocument, GetSphereBlk(), new gPoint(pt.x, pt.y, pt.z), 0, radius, radius, radius); vDraw.ActiveDocument.ActiveLayOut.Entities.Add(vdi); vdXProperty vdx = new vdXProperty(); vdx.Name = "#PointName"; vdx.PropValue = pt.Name; vdi.XProperties.Add(vdx); vDraw.ActiveDocument.Redraw(false); }
private void btnSelectBackVisionPoint_Click(object sender, EventArgs e) { this.Visible = false; if (BackVisionPointSelectHandler != null) { var pt = BackVisionPointSelectHandler(); if (pt != null) { txtVisionPoint.Text = pt.Name; BackVisionPoint = pt; } } this.Visible = true; }
private void btnSelectControlPoint_Click(object sender, EventArgs e) { this.Visible = false; if (ControlPointSelectHandler != null) { var pt = ControlPointSelectHandler(); if (pt != null) { txtControlPoint.Text = pt.Name; ControlPoint = pt; } } this.Visible = true; }
public static ProjectInfo LoadPrjInfo(string prjName) { try { ProjectInfo prjInfo = new ProjectInfo(prjName); var doc = new XmlDocument(); doc.Load(prjInfo.ProjectFilePathName); var rootElem = doc.DocumentElement; if (rootElem == null) { return(null); } prjInfo.ModelPoints.Clear(); var pointsNode = rootElem.GetElementsByTagName("Point"); foreach (XmlNode ptNode in pointsNode) { var ptElem = ptNode as XmlElement; if (ptElem == null) { continue; } var point = new ModelPoint(ptElem.InnerText) { x = double.Parse(ptElem.GetAttribute("x")), y = double.Parse(ptElem.GetAttribute("y")), z = double.Parse(ptElem.GetAttribute("z")), x1 = double.Parse(ptElem.GetAttribute("x1")), y1 = double.Parse(ptElem.GetAttribute("y1")), z1 = double.Parse(ptElem.GetAttribute("z1")), Type = int.Parse(ptElem.GetAttribute("Type")) }; prjInfo.ModelPoints.Add(point); } return(prjInfo); } catch (Exception ex) { MessageBox.Show("读取项目信息失败! \n" + ex.Message); return(null); } }
private void FormMakeStation_Load(object sender, EventArgs e) { BackVisionPoint = null; ControlPoint = null; }