Line3D.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. using System.Drawing;
  2. namespace PaintDotNet.Data.SurfacePlot
  3. {
  4. class Line3D
  5. {
  6. /**
  7. * Creates a new lines3D object. No parameters are set.
  8. *
  9. */
  10. public Line3D() { }
  11. /**
  12. * Creates a new lines3D object with start point, end point and color of the line
  13. *
  14. * @param x1 - x coordinate of start point
  15. * @param y1 - y coordinate of start point
  16. * @param z1 - z coordinate of start point
  17. * @param x2 - x coordinate of end point
  18. * @param y2 - y coordinate of end point
  19. * @param z2 - z coordinate of end point
  20. * @param rgb - color of line (hex)
  21. */
  22. public Line3D(int x1, int y1, int z1, int x2, int y2, int z2, int rgb)
  23. {
  24. this.x1 = x1;
  25. this.y1 = y1;
  26. this.z1 = z1;
  27. // end coordinates
  28. this.x2 = x2;
  29. this.y2 = y2;
  30. this.z2 = z2;
  31. this.color = rgb;
  32. }
  33. /**
  34. * Creates a new lines3D object with start point, end point and color of the line
  35. *
  36. * @param x1 - x coordinate of start point
  37. * @param y1 - y coordinate of start point
  38. * @param z1 - z coordinate of start point
  39. * @param x2 - x coordinate of end point
  40. * @param y2 - y coordinate of end point
  41. * @param z2 - z coordinate of end point
  42. * @param color - color of line
  43. */
  44. public Line3D(int x1, int y1, int z1, int x2, int y2, int z2, Color color)
  45. {
  46. this.x1 = x1;
  47. this.y1 = y1;
  48. this.z1 = z1;
  49. // end coordinates
  50. this.x2 = x2;
  51. this.y2 = y2;
  52. this.z2 = z2;
  53. this.color = color.ToArgb();
  54. }
  55. public Line3D(double x1, double y1, double z1, double x2, double y2, double z2, Color color)
  56. {
  57. this.x1 = x1;
  58. this.y1 = y1;
  59. this.z1 = z1;
  60. // end coordinates
  61. this.x2 = x2;
  62. this.y2 = y2;
  63. this.z2 = z2;
  64. this.color = color.ToArgb();
  65. }
  66. public Line3D(double x1, double y1, double z1, double x2, double y2, double z2, Color color, bool isPair)
  67. {
  68. this.x1 = x1;
  69. this.y1 = y1;
  70. this.z1 = z1;
  71. // end coordinates
  72. this.x2 = x2;
  73. this.y2 = y2;
  74. this.z2 = z2;
  75. this.color = color.ToArgb();
  76. this.isPair = isPair;
  77. }
  78. /**
  79. * Creates a new lines3D object with start point, end point and color of the line
  80. *
  81. * @param p1 start point int[3]
  82. * @param p2 start point int[3]
  83. * @param rgb color of the line (int)
  84. */
  85. public Line3D(int[] p1, int[] p2, int rgb)
  86. {
  87. this.x1 = p1[0];
  88. this.y1 = p1[1];
  89. this.z1 = p1[2];
  90. // end coordinates
  91. this.x2 = p2[0];
  92. this.y2 = p2[1];
  93. this.z2 = p2[2];
  94. this.color = rgb;
  95. }
  96. /**
  97. * Creates a new lines3D object with start point, end point and color of the line
  98. *
  99. * @param p1 start point int[3]
  100. * @param p2 start point int[3]
  101. * @param color color of the line
  102. */
  103. public Line3D(int[] p1, int[] p2, Color color)
  104. {
  105. this.x1 = p1[0];
  106. this.y1 = p1[1];
  107. this.z1 = p1[2];
  108. // end coordinates
  109. this.x2 = p2[0];
  110. this.y2 = p2[1];
  111. this.z2 = p2[2];
  112. this.color = color.ToArgb();
  113. }
  114. /**
  115. * x coordinate of start point
  116. */
  117. public double x1;
  118. /**
  119. * y coordinate of start point
  120. */
  121. public double y1;
  122. /**
  123. * z coordinate of start point
  124. */
  125. public double z1;
  126. // end coordinates
  127. /**
  128. * x coordinate of end point
  129. */
  130. public double x2;
  131. /**
  132. * y coordinate of end point
  133. */
  134. public double y2;
  135. /**
  136. * z coordinate of end point
  137. */
  138. public double z2;
  139. /**
  140. * color of line (hex)
  141. */
  142. public int color;
  143. public bool isPair;
  144. }
  145. }