PorosityDrawObject.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using PaintDotNet.Annotation.Enum;
  2. using PaintDotNet.Base.DedicatedAnalysis.Porosity.Model;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace PaintDotNet.Annotation.DedicatedAnalysis
  10. {
  11. public class PorosityDrawObject : DedicatedAnalysisDrawObject
  12. {
  13. public Porositys porositys;
  14. public PorosityDrawObject(ISurfaceBox surfaceBox, Porositys porositys) : base(surfaceBox)
  15. {
  16. this.drawToolType = DrawToolType.PorositySelect;
  17. this.porositys = porositys;
  18. }
  19. public override void Draw(Graphics g)
  20. {
  21. Drawing(g);
  22. }
  23. public override DrawObject Clone()
  24. {
  25. return new PorosityDrawObject(this.ISurfaceBox, this.porositys);
  26. }
  27. public override RectangleF GetBoundingBox()
  28. {
  29. throw new NotImplementedException();
  30. }
  31. public override void DrawTracker(Graphics g)
  32. {
  33. Drawing(g);
  34. }
  35. private void Drawing(Graphics g)
  36. {
  37. //foreach (Particle particle in this.porositys.particles)
  38. //{
  39. // g.DrawRectangle(new Pen(Color.Red), particle.rectProfile.X, particle.rectProfile.Y, particle.rectProfile.Width, particle.rectProfile.Height);
  40. // // 填充夹杂物
  41. // g.FillPolygon(new SolidBrush(Color.FromArgb(this.porositys.type.showColor)), particle.points2);
  42. //}
  43. //g.DrawRectangle(new Pen(Color.Blue, Selected ? 10 : 1), this.porositys.rectProfile.X, this.porositys.rectProfile.Y, this.porositys.rectProfile.Width, this.porositys.rectProfile.Height);
  44. //g.DrawEllipse(new Pen(Color.Green), this.porositys.rectProfile.X, this.porositys.rectProfile.Y, this.porositys.rectProfile.Width, this.porositys.rectProfile.Height);
  45. //Font type = new Font(System.Drawing.SystemFonts.DefaultFont.FontFamily, (float)(this.porositys.pixelLength / 10), System.Drawing.SystemFonts.DefaultFont.Style);
  46. //Font chemicalCharacteristics = new Font(type.FontFamily, type.Size / 2);
  47. //g.DrawString("", type, new SolidBrush(Color.Blue), this.porositys.rectProfile.Right, this.porositys.rectProfile.Bottom - type.Size);
  48. //g.DrawString(this.porositys.chemicalCharacteristics, chemicalCharacteristics, new SolidBrush(Color.Blue), this.porositys.rectProfile.Right + (this.porositys.type.type.Length * type.Size), this.porositys.rectProfile.Bottom - chemicalCharacteristics.Size);
  49. }
  50. }
  51. }