private void drawCircle(DrawContext dc, DrawPen pen) { if (PointList.Count == 0) { return; } if (PointList.Count == 1) { dc.Drawing.DrawCross(pen, PointList[0].vector, 2); if (PointList[0].Selected) { dc.Drawing.DrawSelectedPoint(PointList[0].vector, dc.GetPen(DrawTools.PEN_SELECT_POINT)); } return; } Vector3d normal = CadMath.Normal(PointList[0].vector, PointList[2].vector, PointList[1].vector); CircleExpander.Draw(PointList[0], PointList[1], PointList[2], 32, dc, pen); double size = dc.DevSizeToWoldSize(4); dc.Drawing.DrawCross(pen, PointList[0].vector, size); }
public void DrawPolyLines(DrawContext dc, DrawPen pen) { if (mStoreList != null) { DrawLines(dc, dc.GetPen(DrawTools.PEN_OLD_FIGURE), mStoreList); } DrawLines(dc, pen, mPointList); if (SettingsHolder.Settings.DrawNormal && !Normal.IsZero()) { Vector3d np0 = PointList[0].vector; Vector3d np1 = np0 + (Normal * 10); dc.Drawing.DrawArrow(dc.GetPen(DrawTools.PEN_NORMAL), np0, np1, ArrowTypes.CROSS, ArrowPos.END, 3, 3); } }
private void drawSelected_Point(DrawContext dc) { if (PointList.Count > 0) { if (PointList[0].Selected) { dc.Drawing.DrawSelectedPoint(PointList[0].vector, dc.GetPen(DrawTools.PEN_SELECT_POINT)); } } }
public override void DrawSelected(DrawContext dc) { foreach (CadVertex p in PointList) { if (p.Selected) { dc.Drawing.DrawSelectedPoint(p.vector, dc.GetPen(DrawTools.PEN_SELECT_POINT)); } } }
public override void Draw(DrawContext dc) { DrawParams dp = default; if (SettingsHolder.Settings.DrawMeshEdge) { dp.LinePen = dc.GetPen(DrawTools.PEN_MESH_LINE); dp.EdgePen = dc.GetPen(DrawTools.PEN_DEFAULT_FIGURE); } else { dp.LinePen = DrawPen.NullPen; dp.EdgePen = DrawPen.NullPen; } dp.FillBrush = dc.GetBrush(DrawTools.BRUSH_DEFAULT_MESH_FILL); Draw(dc, dp); }
public override void DrawSelected(DrawContext dc) { for (int i = 0; i < mPointList.Count; i++) { ref CadVertex p0 = ref mPointList.Ref(i); if (p0.Selected) { dc.Drawing.DrawSelectedPoint(p0.vector, dc.GetPen(DrawTools.PEN_SELECT_POINT)); } }
private void drawSelected_Circle(DrawContext dc) { for (int i = 0; i < PointList.Count; i++) { if (PointList[i].Selected) { dc.Drawing.DrawSelectedPoint( PointList[i].vector, dc.GetPen(DrawTools.PEN_SELECT_POINT)); } } }
private void DrawNurbs(DrawContext dc, DrawPen pen) { if (PointList.Count < 2) { return; } DrawSurfaces(dc, pen); DrawControlPoints(dc, dc.GetPen(DrawTools.PEN_NURBS_CTRL_LINE)); }
private void DrawNurbs(DrawContext dc, DrawPen pen) { if (PointList.Count < 2) { return; } CadVertex c; CadVertex n; c = PointList[0]; for (int i = 1; i < PointList.Count; i++) { n = PointList[i]; dc.Drawing.DrawLine( dc.GetPen(DrawTools.PEN_NURBS_CTRL_LINE), c.vector, n.vector); c = n; } NurbsPointList.Clear(); Nurbs.Eval(NurbsPointList); if (NurbsPointList.Count < 2) { return; } c = NurbsPointList[0]; for (int i = 1; i < NurbsPointList.Count; i++) { n = NurbsPointList[i]; dc.Drawing.DrawLine(pen, c.vector, n.vector); c = n; } }
public override void Draw(DrawContext dc) { drawPoint(dc, dc.GetPen(DrawTools.PEN_DEFAULT_FIGURE)); }
public override void Draw(DrawContext dc) { DrawDim(dc, dc.GetPen(DrawTools.PEN_DIMENTION), dc.GetBrush(DrawTools.BRUSH_TEXT)); }
public override void Draw(DrawContext dc) { DrawNurbs(dc, dc.GetPen(DrawTools.PEN_DEFAULT_FIGURE)); }
public override void DrawSelected(DrawContext dc) { dc.Drawing.DrawSelectedPoints(PointList, dc.GetPen(DrawTools.PEN_SELECT_POINT)); }
private void DrawSelectedLines(DrawContext dc) { int i; int num = PointList.Count; for (i = 0; i < num; i++) { CadVertex p = PointList[i]; if (!p.Selected) { continue; } dc.Drawing.DrawSelectedPoint(p.vector, dc.GetPen(DrawTools.PEN_SELECT_POINT)); if (p.IsHandle) { int idx = i + 1; if (idx >= num) { idx = 0; } CadVertex next = GetPointAt(idx); if (!next.IsHandle) { // Draw handle dc.Drawing.DrawLine(dc.GetPen(DrawTools.PEN_HANDLE_LINE), p.vector, next.vector); dc.Drawing.DrawSelectedPoint(next.vector, dc.GetPen(DrawTools.PEN_SELECT_POINT)); } idx = i - 1; if (idx >= 0) { CadVertex prev = GetPointAt(idx); if (!prev.IsHandle) { // Draw handle dc.Drawing.DrawLine(dc.GetPen(DrawTools.PEN_HANDLE_LINE), p.vector, prev.vector); dc.Drawing.DrawSelectedPoint(prev.vector, dc.GetPen(DrawTools.PEN_SELECT_POINT)); } } } else { int idx = i + 1; if (idx < PointCount) { CadVertex np = GetPointAt(idx); if (np.IsHandle) { dc.Drawing.DrawLine(dc.GetPen(DrawTools.PEN_MATCH_SEG), p.vector, np.vector); dc.Drawing.DrawSelectedPoint(np.vector, dc.GetPen(DrawTools.PEN_SELECT_POINT)); } } idx = i - 1; if (idx >= 0) { CadVertex np = GetPointAt(idx); if (np.IsHandle) { dc.Drawing.DrawLine(dc.GetPen(DrawTools.PEN_MATCH_SEG), p.vector, np.vector); dc.Drawing.DrawSelectedPoint(np.vector, dc.GetPen(DrawTools.PEN_SELECT_POINT)); } } } } }