|
GRASS 8 Programmer's Manual 8.5.0(2026)-8d6ceba290
|
OGSF library - setting and manipulating keyframes animation. More...
#include <stdlib.h>#include <grass/gis.h>#include <grass/glocale.h>#include <grass/ogsf.h>
Go to the source code of this file.
Functions | |
| int | GK_set_interpmode (int mode) |
| Set interpolation mode. | |
| void | GK_set_tension (float tens) |
| Set value for tension when interpmode is KF_SPLINE. | |
| void | GK_showtension_start (void) |
| void | GK_showtension_stop (void) |
| Show tension stop ? | |
| void | GK_update_tension (void) |
| Update tension. | |
| void | GK_print_keys (const char *name) |
| Print keyframe info. | |
| void | GK_update_frames (void) |
| Recalculate path using the current number of frames requested. | |
| void | GK_set_numsteps (int newsteps) |
| Set the number of frames to be interpolated from keyframes. | |
| void | GK_clear_keys (void) |
| Deletes all keyframes, resets field masks. | |
| int | GK_move_key (float oldpos, float precis, float newpos) |
| Move keyframe. | |
| int | GK_delete_key (float pos, float precis, int justone) |
| int | GK_add_key (float pos, unsigned long fmask, int force_replace, float precis) |
| Add keyframe. | |
| void | GK_do_framestep (int step, int render) |
| Moves the animation to frame number "step". | |
| void | GK_show_path (int flag) |
| Draw the current path. | |
| void | GK_show_vect (int flag) |
| Show vector sets. | |
| void | GK_show_site (int flag) |
| Show point sets. | |
| void | GK_show_vol (int flag) |
| Show volumes. | |
| void | GK_show_list (int flag) |
| Show list. | |
OGSF library - setting and manipulating keyframes animation.
GRASS OpenGL gsurf OGSF Library
(C) 1999-2008 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file gk2.c.
| int GK_add_key | ( | float | pos, |
| unsigned long | fmask, | ||
| int | force_replace, | ||
| float | precis ) |
Add keyframe.
The pos value is the relative position in the animation for this particular keyframe - used to compare relative distance to neighboring keyframes, it can be any floating point value.
The fmask value can be any of the following or'd together:
Other fields will be added later.
The value precis and the boolean force_replace are used to determine if a keyframe should be considered to be at the same position as a pre-existing keyframe. e.g., if anykey.pos - newkey.pos <= precis, GK_add_key() will fail unless force_replace is TRUE.
| pos | position |
| fmask | |
| force_replace | |
| precis | precision value |
Definition at line 431 of file gk2.c.
References G_debug(), GK_add_key(), GK_update_frames(), GS_get_fov(), GS_get_from(), GS_get_twist(), GS_get_viewdir(), NULL, X, and Y.
Referenced by GK_add_key().
| void GK_clear_keys | ( | void | ) |
Deletes all keyframes, resets field masks.
Doesn't change number of frames requested.
Definition at line 312 of file gk2.c.
References GK_clear_keys(), gk_free_key(), and NULL.
Referenced by GK_clear_keys().
| int GK_delete_key | ( | float | pos, |
| float | precis, | ||
| int | justone ) |
Delete keyframe
The values pos and precis are used to determine which keyframes to delete. Any keyframes with their position within precis of pos will be deleted if justone is zero. If justone is non-zero, only the first (lowest pos) keyframe in the range will be deleted.
| pos | position |
| precis | precision |
| justone | delete only one keyframe |
Definition at line 369 of file gk2.c.
References GK_delete_key(), and GK_update_frames().
Referenced by GK_delete_key().
| void GK_do_framestep | ( | int | step, |
| int | render ) |
Moves the animation to frame number "step".
Step should be a value between 1 and the number of frames. If render is non-zero, calls draw_all.
| step | step value |
| render |
Definition at line 487 of file gk2.c.
References GK_do_framestep(), and gk_follow_frames().
Referenced by GK_do_framestep().
| int GK_move_key | ( | float | oldpos, |
| float | precis, | ||
| float | newpos ) |
Move keyframe.
Precis works as in other functions - to identify keyframe to move. Only the first keyframe in the precis range will be moved.
| oldpos | old position |
| precis | precision value |
| newpos | new position |
Definition at line 338 of file gk2.c.
References GK_move_key(), and GK_update_frames().
Referenced by GK_move_key().
| void GK_print_keys | ( | const char * | name | ) |
Print keyframe info.
| name | filename |
Definition at line 209 of file gk2.c.
References G_fatal_error(), GK_print_keys(), and NULL.
Referenced by GK_print_keys().
| int GK_set_interpmode | ( | int | mode | ) |
Set interpolation mode.
| mode | interpolation mode (KF_LINEAR or KF_SPLINE) |
Definition at line 140 of file gk2.c.
References GK_set_interpmode().
Referenced by GK_set_interpmode().
| void GK_set_numsteps | ( | int | newsteps | ) |
Set the number of frames to be interpolated from keyframes.
| newsteps | number of frames |
Definition at line 299 of file gk2.c.
References GK_set_numsteps(), and GK_update_frames().
Referenced by GK_set_numsteps().
| void GK_set_tension | ( | float | tens | ) |
Set value for tension when interpmode is KF_SPLINE.
| tens | value tens should be between 0.0; 1.0. |
Definition at line 155 of file gk2.c.
References gk_draw_path(), GK_set_tension(), GK_update_frames(), GS_alldraw_wire(), GS_background_color(), GS_clear(), GS_done_draw(), GS_ready_draw(), and GS_set_draw().
Referenced by GK_set_tension().
| void GK_show_list | ( | int | flag | ) |
Show list.
| flag |
Definition at line 609 of file gk2.c.
References GK_show_list(), and GS_draw_all_list().
Referenced by GK_show_list().
| void GK_show_path | ( | int | flag | ) |
Draw the current path.
| flag |
Definition at line 503 of file gk2.c.
References gk_draw_path(), GK_show_path(), GS_done_draw(), GS_ready_draw(), and GS_set_draw().
Referenced by GK_show_path().
| void GK_show_site | ( | int | flag | ) |
Show point sets.
| flag |
Definition at line 555 of file gk2.c.
References GK_show_site(), GP_alldraw_site(), GS_done_draw(), GS_ready_draw(), and GS_set_draw().
Referenced by GK_show_site().
| void GK_show_vect | ( | int | flag | ) |
Show vector sets.
| flag |
Definition at line 529 of file gk2.c.
References GK_show_vect(), GS_done_draw(), GS_ready_draw(), GS_set_draw(), and GV_alldraw_vect().
Referenced by GK_show_vect().
| void GK_show_vol | ( | int | flag | ) |
Show volumes.
| flag |
Definition at line 582 of file gk2.c.
References GK_show_vol(), GS_done_draw(), GS_ready_draw(), GS_set_draw(), and GVL_alldraw_vol().
Referenced by GK_show_vol().
| void GK_showtension_start | ( | void | ) |
Definition at line 175 of file gk2.c.
References GK_showtension_start().
Referenced by GK_showtension_start().
| void GK_showtension_stop | ( | void | ) |
Show tension stop ?
Use GK_showtension_start/GK_update_tension/GK_showtension_stop to initialize and stop multi-view display of path when changing tension.
Definition at line 187 of file gk2.c.
References GK_showtension_stop().
Referenced by GK_showtension_stop().
| void GK_update_frames | ( | void | ) |
Recalculate path using the current number of frames requested.
Call after changing number of frames or when Keyframes change.
Definition at line 245 of file gk2.c.
References G_warning(), gk_make_framesfromkeys(), gk_make_linear_framesfromkeys(), GK_update_frames(), and NULL.
Referenced by GK_add_key(), GK_delete_key(), GK_move_key(), GK_set_numsteps(), GK_set_tension(), GK_update_frames(), and GK_update_tension().
| void GK_update_tension | ( | void | ) |
Update tension.
Definition at line 195 of file gk2.c.
References GK_update_frames(), and GK_update_tension().
Referenced by GK_update_tension().