public virtual IDrawObject Clone() { Arc3Point a = new Arc3Point(m_type); a.Copy(this); return(a); }
public virtual void Finish() { m_endPoints[0] = m_clone.P1; m_endPoints[1] = m_clone.P2; m_endPoints[2] = m_clone.P3; m_owner.Copy(m_clone); m_owner.Selected = true; m_clone = null; }
public NodePointArc3PointPoint(Arc3Point owner, Arc3Point.eCurrentPoint curpoint) { m_owner = owner; m_clone = m_owner.Clone() as Arc3Point; m_owner.Selected = false; m_clone.Selected = true; m_originalPoints[0] = m_owner.P1; m_originalPoints[1] = m_owner.P2; m_originalPoints[2] = m_owner.P3; m_curPoint = curpoint; }
/// <summary> /// 拷贝or复制 /// </summary> /// <param name="acopy"></param> public void Copy(Arc3Point acopy) { base.Copy(acopy); m_p1 = acopy.m_p1; m_p2 = acopy.m_p2; m_p3 = acopy.m_p3; m_center = acopy.m_center; m_radius = acopy.m_radius; m_startAngle = acopy.m_startAngle; m_endAngle = acopy.m_endAngle; m_direction = acopy.m_direction; m_curPoint = acopy.m_curPoint; }
public virtual void Finish() { try { m_endPoints[0] = m_clone.P1; m_endPoints[1] = m_clone.P2; m_endPoints[2] = m_clone.P3; m_owner.Copy(m_clone); m_owner.Selected = true; m_clone = null; } catch (Exception ex) { throw ex; } }
/* * UnitPoint GetPoint() * { * if (m_curPoint == Arc3Point.eCurrentPoint.p1) * return m_clone.P1; * if (m_curPoint == Arc3Point.eCurrentPoint.p2) * return m_clone.P2; * if (m_curPoint == Arc3Point.eCurrentPoint.p3) * return m_clone.P3; * if (m_curPoint == Arc3Point.eCurrentPoint.startangle) * return m_clone.P1; * if (m_curPoint == Arc3Point.eCurrentPoint.endangle) * return m_clone.P3; * if (m_curPoint == Arc3Point.eCurrentPoint.radius) * return m_clone.P2; * return UnitPoint.Empty; * } * */ void SetPoint(Arc3Point arc, UnitPoint pos) { if (m_curPoint == Arc3Point.eCurrentPoint.p1) { arc.P1 = pos; } if (m_curPoint == Arc3Point.eCurrentPoint.p2) { arc.P2 = pos; } if (m_curPoint == Arc3Point.eCurrentPoint.p3) { arc.P3 = pos; } double angleToRound = 0; if (Control.ModifierKeys == Keys.Control) { angleToRound = HitUtil.DegressToRadians(45); } double angleR = HitUtil.LineAngleR(arc.Center, pos, angleToRound); if (m_curPoint == Arc3Point.eCurrentPoint.startangle) { arc.P1 = HitUtil.PointOncircle(arc.Center, arc.Radius, angleR); } if (m_curPoint == Arc3Point.eCurrentPoint.endangle) { arc.P3 = HitUtil.PointOncircle(arc.Center, arc.Radius, angleR); } if (m_curPoint == Arc3Point.eCurrentPoint.radius) { double radius = HitUtil.Distance(arc.Center, pos); arc.P1 = HitUtil.PointOncircle(arc.Center, radius, HitUtil.DegressToRadians(arc.StartAngle)); arc.P2 = pos; arc.P3 = HitUtil.PointOncircle(arc.Center, radius, HitUtil.DegressToRadians(arc.EndAngle)); } arc.UpdateArcFrom3Points(); if ((m_curPoint == Arc3Point.eCurrentPoint.startangle) || (m_curPoint == Arc3Point.eCurrentPoint.endangle)) { arc.UpdateCenterNodeFromAngles(); } }
public void Copy(Arc3Point acopy) { try { base.Copy(acopy); m_p1 = acopy.m_p1; m_p2 = acopy.m_p2; m_p3 = acopy.m_p3; m_center = acopy.m_center; m_radius = acopy.m_radius; m_startAngle = acopy.m_startAngle; m_endAngle = acopy.m_endAngle; m_direction = acopy.m_direction; //m_curPoint = acopy.m_curPoint; } catch (Exception ex) { throw ex; } }
/* UnitPoint GetPoint() { if (m_curPoint == Arc3Point.eCurrentPoint.p1) return m_clone.P1; if (m_curPoint == Arc3Point.eCurrentPoint.p2) return m_clone.P2; if (m_curPoint == Arc3Point.eCurrentPoint.p3) return m_clone.P3; if (m_curPoint == Arc3Point.eCurrentPoint.startangle) return m_clone.P1; if (m_curPoint == Arc3Point.eCurrentPoint.endangle) return m_clone.P3; if (m_curPoint == Arc3Point.eCurrentPoint.radius) return m_clone.P2; return UnitPoint.Empty; } * */ void SetPoint(Arc3Point arc, UnitPoint pos) { if (m_curPoint == Arc3Point.eCurrentPoint.p1) arc.P1 = pos; if (m_curPoint == Arc3Point.eCurrentPoint.p2) arc.P2 = pos; if (m_curPoint == Arc3Point.eCurrentPoint.p3) arc.P3 = pos; double angleToRound = 0; if (Control.ModifierKeys == Keys.Control) angleToRound = HitUtil.DegressToRadians(45); double angleR = HitUtil.LineAngleR(arc.Center, pos, angleToRound); if (m_curPoint == Arc3Point.eCurrentPoint.startangle) arc.P1 = HitUtil.PointOncircle(arc.Center, arc.Radius, angleR); if (m_curPoint == Arc3Point.eCurrentPoint.endangle) arc.P3 = HitUtil.PointOncircle(arc.Center, arc.Radius, angleR); if (m_curPoint == Arc3Point.eCurrentPoint.radius) { double radius = HitUtil.Distance(arc.Center, pos); arc.P1 = HitUtil.PointOncircle(arc.Center, radius, HitUtil.DegressToRadians(arc.StartAngle)); arc.P2 = pos; arc.P3 = HitUtil.PointOncircle(arc.Center, radius, HitUtil.DegressToRadians(arc.EndAngle)); } arc.UpdateArcFrom3Points(); if ((m_curPoint == Arc3Point.eCurrentPoint.startangle) || (m_curPoint == Arc3Point.eCurrentPoint.endangle)) arc.UpdateCenterNodeFromAngles(); }
public void Copy(Arc3Point acopy) { base.Copy(acopy); m_p1 = acopy.m_p1; m_p2 = acopy.m_p2; m_p3 = acopy.m_p3; m_center = acopy.m_center; m_radius = acopy.m_radius; m_startAngle = acopy.m_startAngle; m_endAngle = acopy.m_endAngle; m_direction = acopy.m_direction; m_curPoint = acopy.m_curPoint; }
public virtual IDrawObject Clone() { Arc3Point a = new Arc3Point(m_type); a.Copy(this); return a; }