41 #include "vpTmstack.h" 47 #include <visp3/core/vpConfig.h> 49 #ifndef DOXYGEN_SHOULD_SKIP_THIS 53 static Matrix stack[STACKSIZE] ;
54 static Matrix *sp = stack;
62 Matrix *get_tmstack(
void) {
return (sp); }
70 void load_tmstack(Matrix m)
73 memmove((
char *)*sp, (
char *)m,
sizeof(Matrix));
80 void pop_tmstack(
void)
83 static char proc_name[] =
"pop_tmstack";
84 fprintf(stderr,
"%s: stack underflow\n", proc_name);
94 void push_tmstack(
void)
96 if (sp == stack + STACKSIZE - 1) {
97 static char proc_name[] =
"push_tmstack";
98 fprintf(stderr,
"%s: stack overflow\n", proc_name);
103 memmove((
char *)sp, (
char *)(sp - 1),
sizeof(Matrix));
110 void swap_tmstack(
void)
114 mp = (sp == stack) ? sp + 1 : sp - 1;
118 memmove((
char *)tmp, (
char *)*sp,
sizeof(Matrix));
119 memmove((
char *)*sp, (
char *)*mp,
sizeof(Matrix));
120 memmove((
char *)*mp, (
char *)tmp,
sizeof(Matrix));
129 void postmult_tmstack(Matrix m) { postmult_matrix(*sp, m); }
137 void postrotate_tmstack(Vector *
vp)
141 Rotate_to_Matrix(vp, m);
142 postmult3_matrix(*sp, m);
151 void postscale_tmstack(Vector *
vp) { postscale_matrix(*sp, vp); }
159 void posttranslate_tmstack(Vector *
vp) { posttrans_matrix(*sp, vp); }
167 void premult_tmstack(Matrix m) { premult_matrix(*sp, m); }
175 void prerotate_tmstack(Vector *
vp)
179 Rotate_to_Matrix(vp, m);
180 premult3_matrix(*sp, m);
189 void prescale_tmstack(Vector *
vp) { prescale_matrix(*sp, vp); }
197 void pretranslate_tmstack(Vector *
vp) { pretrans_matrix(*sp, vp); }