コード例 #1
0
ファイル: Line.cs プロジェクト: SOFAgh/CADability
 /// <summary>
 /// Overrides <see cref="CADability.GeoObject.IGeoObjectImpl.PaintTo3D (IPaintTo3D)"/>
 /// </summary>
 /// <param name="paintTo3D"></param>
 public override void PaintTo3D(IPaintTo3D paintTo3D)
 {
     if (OnPaintTo3D != null && OnPaintTo3D(this, paintTo3D))
     {
         return;
     }
     if (!paintTo3D.SelectMode)
     {
         if (colorDef != null)
         {
             paintTo3D.SetColor(colorDef.Color);
         }
     }
     if (lineWidth != null)
     {
         paintTo3D.SetLineWidth(lineWidth);
     }
     if (linePattern != null)
     {
         paintTo3D.SetLinePattern(linePattern);
     }
     else
     {
         paintTo3D.SetLinePattern(null);
     }
     paintTo3D.Polyline(new GeoPoint[] { startPoint, endPoint });
 }
コード例 #2
0
 public static void PaintHandle(IPaintTo3D paintTo3D, PointF pf, int width, Color color)
 {
     paintTo3D.SetColor(color);
     paintTo3D.SetLineWidth(null);
     paintTo3D.SetLinePattern(null);
     paintTo3D.Line2D((int)pf.X - width, (int)pf.Y - width, (int)pf.X - width, (int)pf.Y + width);
     paintTo3D.Line2D((int)pf.X - width, (int)pf.Y + width, (int)pf.X + width, (int)pf.Y + width);
     paintTo3D.Line2D((int)pf.X + width, (int)pf.Y + width, (int)pf.X + width, (int)pf.Y - width);
     paintTo3D.Line2D((int)pf.X + width, (int)pf.Y - width, (int)pf.X - width, (int)pf.Y - width);
     //paintTo3D.Point2D((int)pf.X + width, (int)pf.Y + width);
     //paintTo3D.Point2D((int)pf.X + width, (int)pf.Y - width);
     //paintTo3D.Point2D((int)pf.X - width, (int)pf.Y + width);
     //paintTo3D.Point2D((int)pf.X - width, (int)pf.Y - width);
 }
コード例 #3
0
 public static void PaintHandle(IPaintTo3D paintTo3D, int x, int y, int width, Color color)
 {
     paintTo3D.SetLineWidth(null); // dünnstmöglich
     paintTo3D.SetLinePattern(null);
     paintTo3D.SetColor(color);
     paintTo3D.Line2D(x - width, y - width, x - width, y + width);
     paintTo3D.Line2D(x - width, y + width, x + width, y + width);
     paintTo3D.Line2D(x + width, y + width, x + width, y - width);
     paintTo3D.Line2D(x + width, y - width, x - width, y - width);
     // ohne die folgenden Aufrufe fehlt meist ein Punkt im Quadrat
     // hängt vom OpenGl Treiber ab: manchmal sind diese Punkte versetzt
     //paintTo3D.Point2D(x - width, y - width);
     //paintTo3D.Point2D(x - width, y + width);
     //paintTo3D.Point2D(x + width, y + width);
     //paintTo3D.Point2D(x + width, y - width);
 }