home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / lib / geometry / transform3 / tm3stack.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-26  |  994 b   |  39 lines

  1. /* Copyright (c) 1992 The Geometry Center; University of Minnesota
  2.    1300 South Second Street;  Minneapolis, MN  55454, USA;
  3.    
  4. This file is part of geomview/OOGL. geomview/OOGL is free software;
  5. you can redistribute it and/or modify it only under the terms given in
  6. the file COPYING, which you should have received along with this file.
  7. This and other related software may be obtained via anonymous ftp from
  8. geom.umn.edu; email: software@geom.umn.edu. */
  9.  
  10. /* Authors: Charlie Gunn, Pat Hanrahan, Stuart Levy, Tamara Munzner, Mark Phillips */
  11.  
  12. #include "stdio.h"
  13. #include "transform3.h"
  14.  
  15. # define MAXSTACK 32
  16. static int maxstack = 0;
  17. static Transform3 stack[MAXSTACK];
  18.  
  19. void
  20. Tm3Push( T )
  21.     Transform3 T;
  22. {
  23.     if( maxstack < MAXSTACK )
  24.         Tm3Copy( T, stack[maxstack++] );
  25.     else
  26.     fprintf( stderr, "Stack Overflow at 32\n" );
  27. }
  28.  
  29. void
  30. Tm3Pop( T )
  31.     Transform3 T;
  32. {
  33.     if( maxstack > 0 ) 
  34.         Tm3Copy( stack[--maxstack], T );
  35.     else
  36.     fprintf( stderr, "Stack Underflow\n" );
  37. }
  38.  
  39.