TimeNode.cs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using static HTEXLib.Animations.MotionPathAnimation;
  5. namespace HTEXLib.Models
  6. {
  7. public abstract class TimeNode
  8. {
  9. public string type { get; set; }
  10. }
  11. /// <summary>
  12. /// TODO
  13. /// TimeListTimeConditionalListType:
  14. /// EndConditionList
  15. /// NextConditionList
  16. /// PreviousConditionList
  17. /// StartConditionList
  18. /// NextConditionList nextCondLst PreviousConditionList prevCondLst
  19. /// </summary>
  20. public class Sequence : TimeNode {
  21. /// <summary>
  22. /// 默认禁用 同时进行
  23. /// </summary>
  24. public bool concurrent { get; set; } = false;
  25. /// <summary>
  26. /// None 0 none , SkipTimed 1 skipTimed
  27. /// </summary>
  28. public string previousAction { get; set; }
  29. /// <summary>
  30. /// None 0 none , Seek 1 seek 按顺序进行
  31. /// </summary>
  32. public string nextAction { get; set; }
  33. }
  34. /// <summary>
  35. /// CommonTimeNode qualified name is p:excl 出现这个节点 则表述 排他节点,暂停其他时间线的元素动画
  36. /// </summary>
  37. public class Exclusive : TimeNode {
  38. public bool suspend { get; set; } = false;
  39. }
  40. /// <summary>
  41. /// TODO TimeAnimateValueList CommonBehavior p:cBhvr ///更多信息
  42. /// </summary>
  43. public class Anim : TimeNode {
  44. public string by { get; set; }
  45. public string from { get; set; }
  46. public string to { get; set; }
  47. /// <summary>
  48. /// CalculationMode
  49. /// Discrete 0 discrete,Linear 1 lin, Formula 2 fmla
  50. /// </summary>
  51. public string calcmode { get; set; }
  52. /// <summary>
  53. /// String 0 str,Number 1 num, Color 2 clr
  54. /// </summary>
  55. public string valueType { get; set; }
  56. /// <summary>
  57. /// 2010,2013,2016 p14:bounceEnd
  58. /// </summary>
  59. public int bounceEnd { get; set; }
  60. public Behavior behavior { get; set; }
  61. public List<TimeAnimate> timeAnimate { get; set; }
  62. }
  63. public class TimeAnimate {
  64. public string time { get; set; }
  65. /// <summary>
  66. /// 19.5.79
  67. /// JavaScript Expression Evaluator zip 下载
  68. /// https://github.com/silentmatt/expr-eval
  69. ///
  70. /// https://github.com/mparlak/Flee
  71. ///
  72. /// </summary>
  73. public string fomula { get; set; }
  74. public Val variantValue { get; set; }
  75. }
  76. public class Val {
  77. public bool boolVal { get; set; }
  78. public int intVal { get; set; }
  79. public float fltVal { get; set; }
  80. public string strVal { get; set; }
  81. /// <summary>
  82. /// ColorType
  83. /// </summary>
  84. public string clrVal { get; set; }
  85. }
  86. public class Behavior {
  87. public string additive { get; set; }
  88. public string transformType { get; set; }
  89. public string accumulate { get; set; }
  90. public string from { get; set; }
  91. public string to { get; set; }
  92. public string by { get; set; }
  93. public string runtimeContext { get; set; }
  94. public string @override { get; set; }
  95. /// <summary>
  96. ///style.opacity, style.rotation, style.visibility, style.color, style.fontSize, style.fontWeight,
  97. ///style.fontStyle, style.fontFamily, style.textEffectEmboss, style.textShadow, style.textTransform,
  98. ///style.textDecorationUnderline, style.textEffectOutline, style.textDecorationLineThrough, style.sRotation,
  99. ///imageData.cropTop, imageData.cropBottom, imageData.cropLeft, imageData.cropRight, imageData.cropRight,
  100. ///imageData.gain, imageData.blacklevel, imageData.gamma, imageData.grayscale, imageData.chromakey,
  101. ///fill.on, fill.type, fill.color, fill.opacity, fill.color2, fill.method, fill.opacity2, fill.angle,
  102. ///fill.focus, fill.focusposition.x, fill.focusposition.y, fill.focussize.x, fill.focussize.y,
  103. ///stroke.on, stroke.color, stroke.weight, stroke.opacity, stroke.linestyle, stroke.dashstyle,
  104. ///stroke.filltype, stroke.src, stroke.color2, stroke.imagesize.x, stroke.imagesize.y,
  105. ///stroke.startArrow, stroke.endArrow, stroke.startArrowWidth, stroke.startArrowLength, stroke.endArrowWidth, stroke.endArrowLength,
  106. ///shadow.on, shadow.type, shadow.color, shadow.color2, shadow.opacity, shadow.offset.x, shadow.offset.y,
  107. ///shadow.offset2.x, shadow.offset2.y, shadow.origin.x, shadow.origin.y, shadow.matrix.xtox, shadow.matrix.ytox,
  108. ///shadow.matrix.xtox, shadow.matrix.ytoy, shadow.matrix.perspectiveX, shadow.matrix.perspectiveY,
  109. ///skew.on, skew.offset.x, skew.offset.y, skew.origin.x, skew.origin.y, skew.matrix.xtox, skew.matrix.ytox,
  110. ///skew.matrix.xtox, skew.matrix.ytoy, skew.matrix.perspectiveX, skew.matrix.perspectiveY,
  111. ///extrusion.on, extrusion.type, extrusion.render, extrusion.viewpointorigin.x, extrusion.viewpointorigin.y,
  112. ///extrusion.viewpoint.x, extrusion.viewpoint.y, extrusion.viewpoint.z, extrusion.plane, extrusion.skewangle,
  113. ///extrusion.skewamt, extrusion.backdepth, extrusion.foredepth, extrusion.orientation.x, extrusion.orientation.y,
  114. ///extrusion.orientation.z, extrusion.orientationangle, extrusion.color, extrusion.rotationangle.x, extrusion.rotationangle.y,
  115. ///extrusion.lockrotationcenter, extrusion.autorotationcenter, extrusion.rotationcenter.x,
  116. ///extrusion.rotationcenter.y, extrusion.rotationcenter.z, and extrusion.colormode.
  117. /// </summary>
  118. public List<string> attrNames { get; set; }
  119. public TargetElement targetElement { get; set; }
  120. public Ctn ctn { get; set; }
  121. }
  122. public class Ctn {
  123. public long id { get; set; }
  124. public string dur { get; set; }
  125. public string fill { get; set; }
  126. public int delay { get; set; }
  127. public int accel { get; set; }
  128. public int decel { get; set; }
  129. public string tmFilter { get; set; }
  130. public bool autoRev { get; set; }
  131. }
  132. /// <summary>
  133. /// TODO CommonBehavior p:cBhvr ///更多信息
  134. /// </summary>
  135. public class AnimClr : TimeNode
  136. {
  137. /// <summary>
  138. /// AnimateColorSpaceValues Rgb 0 rgb, Hsl 1 hsl
  139. /// </summary>
  140. public string colorSpace { get; set; }
  141. /// <summary>
  142. /// AnimateColorDirectionValues Clockwise cw 0 , CounterClockwise ccw 1
  143. /// </summary>
  144. public string direction { get; set; }
  145. /// <summary>
  146. /// RgbColor == HslColor===>> #FF00FF
  147. /// </summary>
  148. public string byColor { get; set; }
  149. /// <summary>
  150. /// Color3Type ===>> #FF00FF
  151. /// RgbColorModelPercentage
  152. /// RgbColorModelHex
  153. /// HslColor
  154. /// SystemColor
  155. /// SchemeColor
  156. /// PresetColor
  157. /// </summary>
  158. public string fromColor { get; set; }
  159. /// <summary>
  160. /// Color3Type ===>> #FF00FF
  161. /// RgbColorModelPercentage
  162. /// RgbColorModelHex
  163. /// HslColor
  164. /// SystemColor
  165. /// SchemeColor
  166. /// PresetColor
  167. /// </summary>
  168. public string toColor { get; set; }
  169. public Behavior behavior { get; set; }
  170. }
  171. public class AnimEffect : TimeNode
  172. {
  173. //In 0 in,Out 1 out,None 2 none
  174. public string transition { get; set; }
  175. public Behavior behavior { get; set; }
  176. public string filter { get; set; }
  177. public string prLst { get; set; }
  178. }
  179. /// <summary>
  180. ///
  181. /// </summary>
  182. public class AnimMotion : TimeNode {
  183. public string origin { get; set; }
  184. public string path { get; set; }
  185. public string pathEditMode { get; set; }
  186. public int relativeAngle { get; set; }
  187. public string pointTypes { get; set; }
  188. public int bounceEnd { get; set; }
  189. public PathPoint byPosition{ get; set; }
  190. public PathPoint fromPosition { get; set; }
  191. public PathPoint toPosition { get; set; }
  192. public PathPoint rotationCenter { get; set; }
  193. public Behavior behavior { get; set; }
  194. }
  195. /// <summary>
  196. /// §20.1.10.3
  197. /// </summary>
  198. public class AnimRot :TimeNode{
  199. public int by { get; set; }
  200. public int from { get; set; }
  201. public int to { get; set; }
  202. /// <summary>
  203. /// 弹跳
  204. /// </summary>
  205. public int bounceEnd { get; set; }
  206. public Behavior behavior { get; set; }
  207. }
  208. public class AnimScale : TimeNode {
  209. /// <summary>
  210. /// 弹跳
  211. /// </summary>
  212. public int bounceEnd { get; set; }
  213. public PathPoint byPosition { get; set; }
  214. public PathPoint fromPosition { get; set; }
  215. public PathPoint toPosition { get; set; }
  216. public Behavior behavior { get; set; }
  217. public bool zoomContents { get; set; }
  218. }
  219. public class Set : TimeNode {
  220. public Behavior behavior { get; set; }
  221. public Val toVariantValue { get; set; }
  222. }
  223. public class Audio : TimeNode
  224. {
  225. public bool isNarration { get; set; }
  226. public MediaNode commonMediaNode { get; set; }
  227. }
  228. public class Video : TimeNode
  229. {
  230. public bool fullScreen { get; set; }
  231. public MediaNode commonMediaNode { get; set; }
  232. }
  233. public class MediaNode {
  234. public int volume { get; set; }
  235. public bool mute { get; set; }
  236. public UInt32 slideCount { get; set; }
  237. public bool showWhenStopped { get; set; }
  238. public TargetElement targetElement { get; set; }
  239. }
  240. }