Artword.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef _Artword_h_
  2. #define _Artword_h_
  3. /* Artword.h
  4. *
  5. * Copyright (C) 1992-2005,2007,2009,2011,2015-2017 Paul Boersma
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "Articulation.h"
  21. #include "Graphics.h"
  22. #include "Artword_def.h"
  23. autoArtword Artword_create (double totalTime);
  24. void Artword_setDefault (Artword me, kArt_muscle muscle);
  25. /*
  26. Postconditions:
  27. my data [(int) muscle]. numberOfTargets == 2;
  28. my data [(int) muscle]. times [1] == 0.0;
  29. my data [(int) muscle]. times [2] == self -> totalTime;
  30. my data [(int) muscle]. targets [1] == 0.0;
  31. my data [(int) muscle]. targets [2] == 0.0;
  32. rest unchanged;
  33. */
  34. void Artword_setTarget (Artword me, kArt_muscle muscle, double time, double value);
  35. double Artword_getTarget (Artword me, kArt_muscle muscle, double time);
  36. void Artword_removeTarget (Artword me, kArt_muscle muscle, int16 targetNumber);
  37. /*
  38. Function:
  39. remove one target from the target list of "muscle".
  40. If "iTarget" is the first or the last target in the list,
  41. only set the target to zero (begin and end targets remain).
  42. Preconditions:
  43. self != nullptr;
  44. muscle in enum class Art_MUSCLE;
  45. iTarget >= 1;
  46. iTarget <= self -> data [(int) muscle]. numberOfTargets;
  47. Postconditions:
  48. if (iTarget == 1)
  49. self -> data [(int) muscle]. targets [1] == 0.0;
  50. else if (iTarget == self -> data [(int) muscle]. numberOfTargets)
  51. self -> data [(int) muscle]. targets [iTarget] == 0.0;
  52. else
  53. self -> data [(int) muscle]. numberOfTargets == old self -> data [(int) muscle]. numberOfTargets - 1;
  54. for (i == iTarget..self -> data [(int) muscle]. numberOfTargets)
  55. self -> data [(int) muscle]. times [i] == old self -> data [(int) muscle]. times [i + 1];
  56. self -> data [(int) muscle]. targets [i] == old self -> data [(int) muscle]. targets [i + 1];
  57. */
  58. void Artword_intoArt (Artword me, Art art, double time);
  59. /*
  60. Function:
  61. Linear interpolation between targets, into an existing Art.
  62. Preconditions:
  63. me != nullptr;
  64. art != nullptr;
  65. */
  66. void Artword_draw (Artword me, Graphics graphics, kArt_muscle muscle, bool garnish);
  67. /* End of file Artword.h */
  68. #endif