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.

67 lines
1.7 KiB

  1. #ifndef __glujarcloc_h_
  2. #define __glujarcloc_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. * jarcloc.h - $Revision: 1.1 $
  16. */
  17. #include "arc.h"
  18. class Jarcloc {
  19. private:
  20. Arc * arc;
  21. TrimVertex *p;
  22. TrimVertex *plast;
  23. public:
  24. inline void init( Arc_ptr a, long first, long last ) { arc = a; p=&a->pwlArc->pts[first]; plast = &a->pwlArc->pts[last]; }
  25. inline TrimVertex * getnextpt( void );
  26. inline TrimVertex * getprevpt( void );
  27. inline void reverse();
  28. };
  29. inline void
  30. Jarcloc::reverse()
  31. {
  32. if( plast == &arc->pwlArc->pts[0] )
  33. plast = &arc->pwlArc->pts[arc->pwlArc->npts - 1];
  34. else
  35. plast = &arc->pwlArc->pts[0];
  36. }
  37. inline TrimVertex *
  38. Jarcloc::getnextpt()
  39. {
  40. assert( p <= plast );
  41. if( p == plast ) {
  42. arc = arc->next;
  43. p = &arc->pwlArc->pts[0];
  44. plast = &arc->pwlArc->pts[arc->pwlArc->npts - 1];
  45. assert( p < plast );
  46. }
  47. return p++;
  48. }
  49. inline TrimVertex *
  50. Jarcloc::getprevpt()
  51. {
  52. assert( p >= plast );
  53. if( p == plast ) {
  54. arc = arc->prev;
  55. p = &arc->pwlArc->pts[arc->pwlArc->npts - 1];
  56. plast = &arc->pwlArc->pts[0];
  57. assert( p > plast );
  58. }
  59. return p--;
  60. }
  61. #endif /* __glujarcloc_h_ */