Point3D.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. using System.Drawing;
  2. namespace PaintDotNet.Data.SurfacePlot
  3. {
  4. public class Point3D
  5. {
  6. /**
  7. * Draws a point as a dot. Size information has no effect.
  8. */
  9. public static int DOT = 0;
  10. /**
  11. * Draws a point as a (2D) circle.
  12. */
  13. public static int CIRCLE = 1;
  14. /**
  15. * Draws a point as a sphere (slowest).
  16. */
  17. public static int SPHERE = 2;
  18. /**
  19. * x-coordinate
  20. */
  21. public double x;
  22. /**
  23. * y-coordinate
  24. */
  25. public double y;
  26. /**
  27. * z-coordinate
  28. */
  29. public double z;
  30. /**
  31. * color of point
  32. */
  33. public int rgb;
  34. /**
  35. * size of point
  36. */
  37. public double size = 1;
  38. public int drawMode = DOT;
  39. public Point3D()
  40. {
  41. }
  42. /**
  43. * Creates a new Point3D object. No parameters except of size (set to 1) are set.
  44. *
  45. */
  46. public Point3D(double x, double y, double z, int c)
  47. {
  48. this.x = x;
  49. this.y = y;
  50. this.z = z;
  51. this.rgb = c;
  52. }
  53. public Point3D(double x, double y, double z, Color c)
  54. {
  55. this.x = x;
  56. this.y = y;
  57. this.z = z;
  58. this.rgb = c.ToArgb();
  59. }
  60. /**
  61. * Creates a new Point3D object with given x, y, and z coordinates, size and color.
  62. *
  63. * @param x the x-coordinate
  64. * @param y the y-coordinate
  65. * @param z the z-coordinate
  66. * @param size the size of the point
  67. * @param rgb the rgb-value of the point (like 0xFF00FFFF)
  68. */
  69. public Point3D(double x, double y, double z, double size, int rgb)
  70. {
  71. this.x = x;
  72. this.y = y;
  73. this.z = z;
  74. this.rgb = rgb;
  75. this.size = size;
  76. }
  77. /**
  78. * Creates a new Point3D object with given x, y, and z coordinates, size and color.
  79. *
  80. * @param x the x-coordinate
  81. * @param y the y-coordinate
  82. * @param z the z-coordinate
  83. * @param size the size of the point
  84. * @param rgb the rgb-value of the point (like 0xFF00FFFF)
  85. * @param drawMode mode of drawing the point
  86. */
  87. public Point3D(double x, double y, double z, double size, int rgb, int drawMode)
  88. {
  89. this.x = x;
  90. this.y = y;
  91. this.z = z;
  92. this.rgb = rgb;
  93. this.size = size;
  94. this.drawMode = drawMode;
  95. }
  96. /**
  97. * Creates a new Point3D object with given x, y, and z coordinates, size and color.
  98. *
  99. * @param x the x-coordinate
  100. * @param y the y-coordinate
  101. * @param z the z-coordinate
  102. * @param size the size of the point
  103. * @param color the color of the point (like Color.RED)
  104. */
  105. public Point3D(double x, double y, double z, double size, Color color)
  106. {
  107. this.x = x;
  108. this.y = y;
  109. this.z = z;
  110. this.rgb = color.ToArgb();
  111. this.size = size;
  112. }
  113. /**
  114. * Creates a new Point3D object with given x, y, and z coordinates, size and color.
  115. *
  116. * @param x the x-coordinate
  117. * @param y the y-coordinate
  118. * @param z the z-coordinate
  119. * @param size the size of the point
  120. * @param color the color of the point (like Color.RED)
  121. * @param drawMode mode of drawing the point
  122. */
  123. public Point3D(double x, double y, double z, double size, Color color, int drawMode)
  124. {
  125. this.x = x;
  126. this.y = y;
  127. this.z = z;
  128. this.rgb = color.ToArgb();
  129. this.size = size;
  130. this.drawMode = drawMode;
  131. }
  132. }
  133. }