41 #include "vpTmstack.h"
47 #include <visp3/core/vpConfig.h>
49 #ifndef DOXYGEN_SHOULD_SKIP_THIS
54 static Matrix stack[STACKSIZE] ;
55 static Matrix *sp = stack;
63 Matrix *get_tmstack(
void) {
return (sp); }
71 void load_tmstack(Matrix m)
74 memmove((
char *)*sp, (
char *)m,
sizeof(Matrix));
81 void pop_tmstack(
void)
84 static char proc_name[] =
"pop_tmstack";
85 fprintf(stderr,
"%s: stack underflow\n", proc_name);
96 void push_tmstack(
void)
98 if (sp == stack + STACKSIZE - 1) {
99 static char proc_name[] =
"push_tmstack";
100 fprintf(stderr,
"%s: stack overflow\n", proc_name);
105 memmove((
char *)sp, (
char *)(sp - 1),
sizeof(Matrix));
112 void swap_tmstack(
void)
116 mp = (sp == stack) ? sp + 1 : sp - 1;
120 memmove((
char *)tmp, (
char *)*sp,
sizeof(Matrix));
121 memmove((
char *)*sp, (
char *)*mp,
sizeof(Matrix));
122 memmove((
char *)*mp, (
char *)tmp,
sizeof(Matrix));
131 void postmult_tmstack(Matrix m) { postmult_matrix(*sp, m); }
139 void postrotate_tmstack(Vector *vp)
143 Rotate_to_Matrix(vp, m);
144 postmult3_matrix(*sp, m);
153 void postscale_tmstack(Vector *vp) { postscale_matrix(*sp, vp); }
161 void posttranslate_tmstack(Vector *vp) { posttrans_matrix(*sp, vp); }
169 void premult_tmstack(Matrix m) { premult_matrix(*sp, m); }
177 void prerotate_tmstack(Vector *vp)
181 Rotate_to_Matrix(vp, m);
182 premult3_matrix(*sp, m);
191 void prescale_tmstack(Vector *vp) { prescale_matrix(*sp, vp); }
199 void pretranslate_tmstack(Vector *vp) { pretrans_matrix(*sp, vp); }