Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.5 KiB

  1. #ifndef __gluchecker_h_
  2. #define __gluchecker_h_
  3. /**************************************************************************
  4. * *
  5. * Copyright (C) 1991, Silicon Graphics, Inc. *
  6. * *
  7. * These coded instructions, statements, and computer programs contain *
  8. * unpublished proprietary information of Silicon Graphics, Inc., and *
  9. * are protected by Federal copyright law. They may not be disclosed *
  10. * to third parties or copied or duplicated in any form, in whole or *
  11. * in part, without the prior written consent of Silicon Graphics, Inc. *
  12. * *
  13. **************************************************************************/
  14. /*
  15. * checker.h - $Revision: 1.1 $
  16. */
  17. #include "types.h"
  18. #include "bufpool.h"
  19. /* local type definitions */
  20. struct Edge : PooledObj {
  21. Edge( REAL *, REAL *, char * );
  22. REAL v1[3];
  23. REAL v2[3];
  24. char * name;
  25. int count;
  26. Edge * next;
  27. };
  28. class Hashtable {
  29. private:
  30. #define NENTRIES 5997
  31. Pool edgepool;
  32. int slot;
  33. Edge * curentry;
  34. Edge * hashtable[NENTRIES];
  35. public:
  36. Hashtable( void );
  37. void init( void );
  38. void clear( void );
  39. Edge * find( REAL *, REAL * );
  40. void insert( REAL *, REAL *, char * );
  41. long hashval( REAL *, REAL * );
  42. Edge * firstentry( void );
  43. Edge * nextentry( void );
  44. static inline int equal( REAL *, REAL * );
  45. };
  46. class Checker {
  47. private:
  48. Hashtable hashtable;
  49. long graphwin;
  50. int initialized;
  51. REAL ulo, uhi, vlo, vhi;
  52. REAL us, vs, dus, dvs;
  53. int npts;
  54. REAL cache[3][3];
  55. int index;
  56. char * curname;
  57. REAL tempa[3], tempb[3];
  58. inline void add_edgei( long, long, long, long );
  59. void add_edge( REAL *, REAL * );
  60. void add_tri( REAL *, REAL *, REAL * );
  61. void dump( Edge * );
  62. void reference( Edge * );
  63. public:
  64. inline void * operator new( size_t ){ return ::malloc( sizeof( Checker ) ); }
  65. inline void operator delete( void *p ) { if( p ) ::free( p ); }
  66. Checker( void ) { graphwin = 0; initialized = 0; }
  67. void init( void );
  68. void graph( void );
  69. void range( REAL, REAL, REAL, REAL );
  70. void grid( REAL, REAL, REAL, REAL );
  71. void add_mesh( long, long, long, long );
  72. void bgntmesh( char *);
  73. void swaptmesh( void );
  74. void s2ftmesh( REAL * );
  75. void g2ltmesh( long * );
  76. void endtmesh( void );
  77. void bgnoutline( char * );
  78. void s2foutline( REAL * );
  79. void g2loutline( long * );
  80. void endoutline( void );
  81. };
  82. #endif /* __gluchecker_h_ */