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.

105 lines
2.8 KiB

  1. #ifndef __glubin_h_
  2. #define __glubin_h_
  3. /**************************************************************************
  4. * *
  5. * Copyright (C) 1992, 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. * bin.h - $Revision: 1.2 $
  16. */
  17. #include "myassert.h"
  18. #include "arc.h"
  19. #include "defines.h"
  20. #ifdef NT
  21. class Bin { /* a linked list of jordan arcs */
  22. #else
  23. struct Bin { /* a linked list of jordan arcs */
  24. #endif
  25. private:
  26. Arc * head; /* first arc on list */
  27. Arc * current; /* current arc on list */
  28. public:
  29. Bin();
  30. ~Bin();
  31. inline Arc * firstarc( void );
  32. inline Arc * nextarc( void );
  33. inline Arc * removearc( void );
  34. inline int isnonempty( void ) { return (head ? 1 : 0); }
  35. inline void addarc( Arc * );
  36. void remove_this_arc( Arc * );
  37. int numarcs( void );
  38. void adopt( void );
  39. void markall( void );
  40. void show( char * );
  41. void listBezier( void );
  42. };
  43. /*----------------------------------------------------------------------------
  44. * Bin::addarc - add an Arc * to head of linked list of Arc *s
  45. *----------------------------------------------------------------------------
  46. */
  47. inline void
  48. Bin::addarc( Arc *jarc )
  49. {
  50. jarc->link = head;
  51. head = jarc;
  52. }
  53. /*----------------------------------------------------------------------------
  54. * Bin::removearc - remove first Arc * from bin
  55. *----------------------------------------------------------------------------
  56. */
  57. inline Arc *
  58. Bin::removearc( void )
  59. {
  60. Arc * jarc = head;
  61. if( jarc ) head = jarc->link;
  62. return jarc;
  63. }
  64. /*----------------------------------------------------------------------------
  65. * BinIter::nextarc - return current arc in bin and advance pointer to next arc
  66. *----------------------------------------------------------------------------
  67. */
  68. inline Arc *
  69. Bin::nextarc( void )
  70. {
  71. Arc * jarc = current;
  72. #ifdef DEBUG
  73. assert( jarc->check() != 0 );
  74. #endif
  75. if( jarc ) current = jarc->link;
  76. return jarc;
  77. }
  78. /*----------------------------------------------------------------------------
  79. * BinIter::firstarc - set current arc to first arc of bin advance to next arc
  80. *----------------------------------------------------------------------------
  81. */
  82. inline Arc *
  83. Bin::firstarc( void )
  84. {
  85. current = head;
  86. return nextarc( );
  87. }
  88. #endif /* __glubin_h_ */