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.

117 lines
3.8 KiB

  1. #ifndef __gluarc_h_
  2. #define __gluarc_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. * arc.h - $Revision: 1.1 $
  16. */
  17. #include "myassert.h"
  18. #include "bufpool.h"
  19. #include "mystdio.h"
  20. #include "types.h"
  21. #include "pwlarc.h"
  22. #include "trimvert.h"
  23. class Bin;
  24. class Arc;
  25. class BezierArc;
  26. typedef Arc *Arc_ptr;
  27. enum arc_side { arc_none = 0, arc_right, arc_top, arc_left, arc_bottom };
  28. #ifdef NT
  29. class Arc : public PooledObj { /* an arc, in two list, the trim list and bin */
  30. public:
  31. #else
  32. struct Arc : public PooledObj { /* an arc, in two list, the trim list and bin */
  33. #endif
  34. static const int bezier_tag;
  35. static const int arc_tag;
  36. static const int tail_tag;
  37. Arc_ptr prev; /* trim list pointer */
  38. Arc_ptr next; /* trim list pointer */
  39. Arc_ptr link; /* bin pointers */
  40. BezierArc * bezierArc; /* associated bezier arc */
  41. PwlArc * pwlArc; /* associated pwl arc */
  42. long type; /* curve type */
  43. long nuid;
  44. inline Arc( Arc *, PwlArc * );
  45. inline Arc( arc_side, long );
  46. Arc_ptr append( Arc_ptr );
  47. int check( void );
  48. int isMonotone( void );
  49. int isDisconnected( void );
  50. int numpts( void );
  51. void markverts( void );
  52. void getextrema( Arc_ptr[4] );
  53. void print( void );
  54. void show( void );
  55. void makeSide( PwlArc *, arc_side );
  56. inline int isTessellated() { return pwlArc ? 1 : 0; }
  57. inline long isbezier() { return type & bezier_tag; }
  58. inline void setbezier() { type |= bezier_tag; }
  59. inline void clearbezier() { type &= ~bezier_tag; }
  60. inline long npts() { return pwlArc->npts; }
  61. inline TrimVertex * pts() { return pwlArc->pts; }
  62. inline REAL * tail() { return pwlArc->pts[0].param; }
  63. inline REAL * head() { return next->pwlArc->pts[0].param; }
  64. inline REAL * rhead() { return pwlArc->pts[pwlArc->npts-1].param; }
  65. inline long ismarked() { return type & arc_tag; }
  66. inline void setmark() { type |= arc_tag; }
  67. inline void clearmark() { type &= (~arc_tag); }
  68. inline void clearside() { type &= ~(0x7 << 8); }
  69. inline void setside( arc_side s ) { clearside(); type |= (((long)s)<<8); }
  70. inline arc_side getside() { return (arc_side) ((type>>8) & 0x7); }
  71. inline int getitail() { return type & tail_tag; }
  72. inline void setitail() { type |= tail_tag; }
  73. inline void clearitail() { type &= (~tail_tag); }
  74. };
  75. /*--------------------------------------------------------------------------
  76. * Arc - initialize a new Arc with the same type and uid of
  77. * a given Arc and a given pwl arc
  78. *--------------------------------------------------------------------------
  79. */
  80. inline
  81. Arc::Arc( Arc *j, PwlArc *p )
  82. {
  83. bezierArc = NULL;
  84. pwlArc = p;
  85. type = j->type;
  86. nuid = j->nuid;
  87. }
  88. /*--------------------------------------------------------------------------
  89. * Arc - initialize a new Arc with the same type and uid of
  90. * a given Arc and a given pwl arc
  91. *--------------------------------------------------------------------------
  92. */
  93. inline
  94. Arc::Arc( arc_side side, long _nuid )
  95. {
  96. bezierArc = NULL;
  97. pwlArc = NULL;
  98. type = 0;
  99. setside( side );
  100. nuid = _nuid;
  101. }
  102. #endif /* __gluarc_h_ */