/// <summary> /// ReadCE3のストリームから、startWordで始まるMbeObjを読み取る /// </summary> /// <param name="readMb3"></param> /// <param name="startWord"></param> /// <param name="obj"></param> /// <returns></returns> public static ReadCE3.RdStatus ReadMbeObj(ReadCE3 readMb3, string startWord, out MbeObj obj) { ReadCE3.RdStatus result = ReadCE3.RdStatus.NoError; obj = null; if (startWord == "+MBE_HOLE") { obj = new MbeObjHole(); } else if (startWord == "+MBE_PTH") { obj = new MbeObjPTH(); } else if (startWord == "+MBE_PINSMD") { obj = new MbeObjPinSMD(true); } else if (startWord == "+MBE_FLASHMARK") { obj = new MbeObjPinSMD(false); } else if (startWord == "+MBE_LINE") { obj = new MbeObjLine(); } else if (startWord == "+MBE_POLYGON") { obj = new MbeObjPolygon(); } else if (startWord == "+MBE_TEXT") { obj = new MbeObjText(); } else if (startWord == "+MBE_ARC") { obj = new MbeObjArc(); } else if (startWord == "+MBE_COMPONENT") { obj = new MbeObjComponent(); } else { string strSkipTo = "-" + startWord.Substring(1); readMb3.SkipTo(strSkipTo); } if (obj != null) { result = obj.RdMb3(readMb3); if (result != ReadCE3.RdStatus.NoError) { obj = null; } } return(result); }
/// <summary> /// Lineのプロパティ編集ダイアログの起動 /// </summary> /// <param name="obj">編集対象MbeObjLine</param> /// <returns></returns> private bool EditPropertyLine(MbeObjLine obj) { SetLineForm dlg = new SetLineForm(); dlg.LineWidth = obj.LineWidth; DialogResult retv = dlg.ShowDialog(); if (retv == DialogResult.OK) { obj.LineWidth = dlg.LineWidth; return(true); } return(false); }
/// <summary> /// Lineのプロパティ編集ダイアログの起動 /// </summary> /// <param name="obj">編集対象MbeObjLine</param> /// <returns></returns> private bool EditPropertyLineStyle(MbeObjLine obj) { SetLinePropForm dlg = new SetLinePropForm(); dlg.LineWidth = obj.LineWidth; dlg.LineStyle = obj.LineStyle; dlg.P0 = obj.GetPos(0); dlg.P1 = obj.GetPos(1); DialogResult retv = dlg.ShowDialog(); if (retv == DialogResult.OK) { obj.LineWidth = dlg.LineWidth; obj.LineStyle = dlg.LineStyle; return(true); } return(false); }
/// <summary> /// コピーコンストラクタ /// </summary> /// <param name="mbeObjPin"></param> public MbeObjLine(MbeObjLine mbeObjLine) : base(mbeObjLine) { lineStyle = mbeObjLine.lineStyle; lineWidth = mbeObjLine.lineWidth; }
/// <summary> /// 複製を行う /// </summary> /// <returns></returns> public override MbeObj Duplicate() { MbeObj newObj = new MbeObjLine(this); return(newObj); }