Shape.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace HTEXLib
  5. {
  6. public class Shape : Item
  7. {
  8. public string shapeType;
  9. public List<Paragraph> paragraph { get; set; }
  10. public HTEXLib.Models.HTEX.ShapeStyle style { get; set; } = new Models.HTEX.ShapeStyle();
  11. //public List<ShapeGuide> ShapeGuides { get; set; }
  12. //public List<Path> Paths { get; set; }
  13. //public string BorderSha { get; set; }
  14. //public string FillSha { get; set; }
  15. }
  16. public class Svg {
  17. public string id { get; set; }
  18. //public string Width { get; set; }
  19. //public string Height { get; set; }
  20. //public string Top { get; set; }
  21. //public string Left { get; set; }
  22. //public string Style { get; set; }
  23. public List<SvgShape> svgShape { get; set; }
  24. //public string Defs { get; set; }
  25. // public string Transform { get; set; }
  26. // public string SvgData { get; set; }
  27. }
  28. public abstract class SvgShape {
  29. // rect ,circle ,ellipse ,line ,polygon ,polyline ,path
  30. public string type { get; set; }
  31. // public string Style { get; set; }
  32. // public string Stroke { get; set; }
  33. //描边的不透明度
  34. // public string StrokeOpacity { get; set; } = "1";
  35. // public string StrokeWidth { get; set; }
  36. // 虚线类型描边
  37. // public string StrokeDasharray { get; set; }
  38. // public string Fill { get; set; }
  39. public string transform { get; set; }
  40. public string start { get; set; }
  41. public string end { get; set; }
  42. /// <summary>
  43. /// 头部宽度 lg Large ,med Medium ,sm Small
  44. /// </summary>
  45. public string start_w { get; set; }
  46. /// <summary>
  47. /// 结束宽度
  48. /// </summary>
  49. public string end_w { get; set; }
  50. /// <summary>
  51. /// 头部长度 lg Large ,med Medium ,sm Small
  52. /// </summary>
  53. public string start_len { get; set; }
  54. /// <summary>
  55. /// 结束长度
  56. /// </summary>
  57. public string end_len { get; set; }
  58. //填充色的不透明度
  59. // public string FillOpacity { get; set; } = "1";
  60. }
  61. public class Rect : SvgShape
  62. {
  63. //矩形左上角的x位置
  64. public string x { get; set; }
  65. //矩形左上角的y位置
  66. public string y { get; set; }
  67. //矩形的宽度
  68. public string width { get; set; }
  69. //矩形的高度
  70. public string height { get; set; }
  71. // 圆角的x方位的半径
  72. public string rx { get; set; }
  73. // 圆角的y方位的半径
  74. public string ry { get; set; }
  75. }
  76. public class Circle : SvgShape
  77. {
  78. //圆的半径
  79. public string r { get; set; }
  80. //圆心的x位置
  81. public string cx { get; set; }
  82. //圆心的y位置
  83. public string cy { get; set; }
  84. }
  85. public class Ellipse : SvgShape
  86. {
  87. // 椭圆的x方位的半径
  88. public string rx { get; set; }
  89. // 椭圆的y方位的半径
  90. public string ry { get; set; }
  91. //椭圆的x位置
  92. public string cx { get; set; }
  93. //椭圆的y位置
  94. public string cy { get; set; }
  95. }
  96. public class Line : SvgShape
  97. {
  98. //起点的x位置
  99. public string x1 { get; set; }
  100. //起点的Y位置
  101. public string y1 { get; set; }
  102. //终点的X位置
  103. public string x2 { get; set; }
  104. //终点的Y位置
  105. public string y2 { get; set; }
  106. }
  107. public class Polyline : SvgShape
  108. {
  109. /// <summary>
  110. /// 点集数列。每个数字用空白、逗号、终止命令符或者换行符分隔开。每个点必须包含2个数字,一个是x坐标,一个是y坐标。所以点列表 (0,0), (1,1) 和(2,2)可以写成这样:“0 0, 1 1, 2 2”。
  111. /// </summary>
  112. public string points { get; set; }
  113. }
  114. public class Polygon : SvgShape
  115. {
  116. /// <summary>
  117. /// 点集数列。每个数字用空白符、逗号、终止命令或者换行符分隔开。每个点必须包含2个数字,一个是x坐标,一个是y坐标。
  118. /// 所以点列表 (0,0), (1,1) 和(2,2)可以写成这样:“0 0, 1 1, 2 2”。路径绘制完后闭合图形,所以最终的直线将从位置(2,2)连接到位置(0,0)。
  119. /// </summary>
  120. public string points { get; set; }
  121. }
  122. public class SvgPath : SvgShape
  123. {
  124. public string d { get; set; }
  125. }
  126. }