home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 3 / RISC_DISC_3.iso / resources / etexts / gems / gemsv / ch7_4 / basic.h next >
Encoding:
C/C++ Source or Header  |  1994-11-22  |  790 b   |  46 lines

  1. // -*- C++ -*-
  2. // basic.h by George Vanecek, Jr. June 1994
  3.  
  4. #ifndef _BASIC_H_
  5. #define _BASIC_H_
  6.  
  7. #ifndef _IOSTREAM_H
  8. #include <ostream.h>
  9. #endif
  10.  
  11. #ifndef __MATH_H__
  12. #include <math.h>
  13. #endif
  14.  
  15. #ifndef _ASSERT_H_
  16. #include <assert.h>
  17. #endif
  18.  
  19. typedef int     Counter;    // 0,1,2,...
  20. typedef int     Index;        // Array Index: 0,1,2,...
  21. enum Boolean { FALSE, TRUE };
  22. enum Where   {            // Point/Plane Classification
  23.   NOWHERE,
  24.   ABOVE      = 0x01,
  25.   ON         = 0x02,
  26.   ONABOVE    = 0x03,        // ON    | ABOVE
  27.   BELOW      = 0x04,
  28.   ABOVEBELOW = 0x05,        // ABOVE | BELOW
  29.   ONBELOW    = 0x06,        // ON    | BELOW
  30.   CROSS      = 0x07        // ABOVE | ON    | BELOW
  31. };
  32.  
  33. template<class Type>
  34. inline void swap( Type& a, Type& b )
  35. {
  36.   const Type c = a;
  37.   a = b;
  38.   b = c;
  39. }
  40.  
  41. #ifndef NULL
  42.   #define NULL 0
  43. #endif
  44.  
  45. #endif
  46.