| 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 | |
| 21 | #include "Articulation.h" |
| 22 | #include "Graphics.h" |
| 23 | |
| 24 | #include "Artword_def.h" |
| 25 | |
| 26 | autoArtword Artword_create (double totalTime); |
| 27 | |
| 28 | void Artword_setDefault (Artword me, kArt_muscle muscle); |
| 29 | /* |
| 30 | Postconditions: |
| 31 | my data [(int) muscle]. numberOfTargets == 2; |
| 32 | my data [(int) muscle]. times [1] == 0.0; |
| 33 | my data [(int) muscle]. times [2] == self -> totalTime; |
| 34 | my data [(int) muscle]. targets [1] == 0.0; |
| 35 | my data [(int) muscle]. targets [2] == 0.0; |
| 36 | rest unchanged; |
| 37 | */ |
| 38 | |
| 39 | void Artword_setTarget (Artword me, kArt_muscle muscle, double time, double value); |
| 40 | |
| 41 | double Artword_getTarget (Artword me, kArt_muscle muscle, double time); |
| 42 | |
| 43 | void Artword_removeTarget (Artword me, kArt_muscle muscle, int16 targetNumber); |
| 44 | /* |
| 45 | Function: |
| 46 | remove one target from the target list of "muscle". |
| 47 | If "iTarget" is the first or the last target in the list, |
| 48 | only set the target to zero (begin and end targets remain). |
| 49 | Preconditions: |
| 50 | self != nullptr; |
| 51 | muscle in enum class Art_MUSCLE; |
| 52 | iTarget >= 1; |
| 53 | iTarget <= self -> data [(int) muscle]. numberOfTargets; |
| 54 | Postconditions: |
| 55 | if (iTarget == 1) |
| 56 | self -> data [(int) muscle]. targets [1] == 0.0; |
| 57 | else if (iTarget == self -> data [(int) muscle]. numberOfTargets) |
| 58 | self -> data [(int) muscle]. targets [iTarget] == 0.0; |
| 59 | else |
| 60 | self -> data [(int) muscle]. numberOfTargets == old self -> data [(int) muscle]. numberOfTargets - 1; |
| 61 | for (i == iTarget..self -> data [(int) muscle]. numberOfTargets) |
| 62 | self -> data [(int) muscle]. times [i] == old self -> data [(int) muscle]. times [i + 1]; |
| 63 | self -> data [(int) muscle]. targets [i] == old self -> data [(int) muscle]. targets [i + 1]; |
| 64 | */ |
| 65 | |
| 66 | void Artword_intoArt (Artword me, Art art, double time); |
| 67 | /* |
| 68 | Function: |
| 69 | Linear interpolation between targets, into an existing Art. |
| 70 | Preconditions: |
| 71 | me != nullptr; |
| 72 | art != nullptr; |
| 73 | */ |
| 74 | |
| 75 | void Artword_draw (Artword me, Graphics graphics, kArt_muscle muscle, bool garnish); |
| 76 | |
| 77 | /* End of file Artword.h */ |
| 78 | #endif |