public void Project(CProjection projection) { var oppositize = (projection.HasFlag(CProjection.C0C1) && C2 < 0) || (projection.HasFlag(CProjection.C0C2) && C1 < 0) || (projection.HasFlag(CProjection.C1C2) && C0 < 0); if (oppositize) { ToOpposite(); } }
public static IEnumerable <KeyValuePair <CPoint, RGPoint> > GetArcPositive(double h1, double h2, double acc, CProjection proj) { var sgn = proj.HasFlag(CProjection.Down) ? -1 : 1; if (proj.HasFlag(CProjection.C0C1)) { return(GetC0C1ArcPositive(h1, h2, acc, sgn)); } if (proj.HasFlag(CProjection.C1C2)) { return(GetC1C2ArcPositive(h1, h2, acc, sgn)); } throw new NotSupportedException(); }
public static Image GetBg(int width, int height, CProjection proj) { if (proj.HasFlag(CProjection.C0C1)) { return(GetBgC0C1(width, height)); } if (proj.HasFlag(CProjection.C1C2)) { return(GetBgC1C2(width, height)); } if (proj.HasFlag(CProjection.C0C2)) { return(GetBgC0C2(width, height)); } throw new NotSupportedException(); }
public RGPoint RG(CProjection projection) { if (projection.HasFlag(CProjection.C0C1)) { return(RGProjC0C1()); } if (projection.HasFlag(CProjection.C0C2)) { return(RGProjC0C2()); } if (projection.HasFlag(CProjection.C1C2)) { return(RGProjC1C2()); } throw new NotSupportedException(); }
public static void FillArea(double x, double y, double xsz, double ysz, double sz, Color clr, IEnumerable <CPoint> cpts, Bitmap bmp, CProjection projection) { if (projection.HasFlag(CProjection.C0C1)) { FillAreaC0C1(x, y, xsz, ysz, sz, clr, cpts, bmp); } else if (projection.HasFlag(CProjection.C1C2)) { FillAreaC1C2(x, y, xsz, ysz, sz, clr, cpts, bmp); } else if (projection.HasFlag(CProjection.C0C2)) { FillAreaC0C2(x, y, xsz, ysz, sz, clr, cpts, bmp); } else { throw new NotSupportedException(); } }
public static void SetPixel(double x, double y, double xsz, double ysz, double sz, Color clr, CPoint cp1, Bitmap bmp, CProjection projection) { if (projection.HasFlag(CProjection.C0C1)) { SetPixelC0C1(x, y, xsz, ysz, sz, clr, cp1, bmp); } else if (projection.HasFlag(CProjection.C1C2)) { SetPixelC1C2(x, y, xsz, ysz, sz, clr, cp1, bmp); } else if (projection.HasFlag(CProjection.C0C2)) { SetPixelC0C2(x, y, xsz, ysz, sz, clr, cp1, bmp); } else { throw new NotSupportedException(); } }
public static void FillPoint(double x, double y, double xsz, double ysz, double sz, Color clr, CPoint cp1, Graphics gr, CProjection projection, int radius = 3) { if (projection.HasFlag(CProjection.C0C1)) { FillPointC0C1(x, y, xsz, ysz, sz, clr, cp1, gr, radius); } else if (projection.HasFlag(CProjection.C1C2)) { FillPointC1C2(x, y, xsz, ysz, sz, clr, cp1, gr, radius); } else if (projection.HasFlag(CProjection.C0C2)) { FillPointC0C2(x, y, xsz, ysz, sz, clr, cp1, gr, radius); } else { throw new NotSupportedException(); } }
public static void DrawLine(double x, double y, double xsz, double ysz, double sz, Pen pen, CPoint cp1, CPoint cp2, Graphics gr, CProjection projection, bool verify = true) { if (projection.HasFlag(CProjection.C0C1)) { DrawLineC0C1(x, y, xsz, ysz, sz, pen, cp1, cp2, gr, verify); } else if (projection.HasFlag(CProjection.C1C2)) { DrawLineC1C2(x, y, xsz, ysz, sz, pen, cp1, cp2, gr, verify); } else if (projection.HasFlag(CProjection.C0C2)) { DrawLineC0C2(x, y, xsz, ysz, sz, pen, cp1, cp2, gr, verify); } else { throw new NotSupportedException(); } }
public void Project(CProjection projection) { var sign = 1; if (projection.HasFlag(CProjection.Down)) { sign = -1; } var oppositize = false; oppositize = (projection.HasFlag(CProjection.C0C1) && C2 * sign < 0) || (projection.HasFlag(CProjection.C0C2) && C1 * sign < 0) || (projection.HasFlag(CProjection.C1C2) && C0 * sign < 0); if (oppositize) { ToOpposite(); } }