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.3 KiB

  1. #ifndef __gluglsurfeval_h_
  2. #define __gluglsurfeval_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. * glsurfeval.h
  16. *
  17. * $Revision: 1.2 $
  18. */
  19. #ifndef NT
  20. #pragma once
  21. #endif
  22. #include "basicsur.h"
  23. class SurfaceMap;
  24. class OpenGLSurfaceEvaluator;
  25. class StoredVertex;
  26. #define TYPECOORD 1
  27. #define TYPEPOINT 2
  28. /* Cache up to 3 vertices from tmeshes */
  29. #define VERTEX_CACHE_SIZE 3
  30. class StoredVertex {
  31. public:
  32. StoredVertex() { type = 0; }
  33. ~StoredVertex(void) {}
  34. void saveEvalCoord(REAL x, REAL y)
  35. {coord[0] = x; coord[1] = y; type = TYPECOORD; }
  36. void saveEvalPoint(long x, long y)
  37. {point[0] = x; point[1] = y; type = TYPEPOINT; }
  38. void invoke(OpenGLSurfaceEvaluator *eval);
  39. private:
  40. int type;
  41. REAL coord[2];
  42. long point[2];
  43. };
  44. class OpenGLSurfaceEvaluator : public BasicSurfaceEvaluator {
  45. public:
  46. OpenGLSurfaceEvaluator();
  47. ~OpenGLSurfaceEvaluator( void );
  48. void polymode( long style );
  49. void range2f( long, REAL *, REAL * );
  50. void domain2f( REAL, REAL, REAL, REAL );
  51. void addMap( SurfaceMap * ) { }
  52. void enable( long );
  53. void disable( long );
  54. void bgnmap2f( long );
  55. void map2f( long, REAL, REAL, long, long,
  56. REAL, REAL, long, long, REAL * );
  57. void mapgrid2f( long, REAL, REAL, long, REAL, REAL );
  58. void mapmesh2f( long, long, long, long, long );
  59. void evalcoord2f( long, REAL, REAL );
  60. void evalpoint2i( long, long );
  61. void endmap2f( void );
  62. void bgnline( void );
  63. void endline( void );
  64. void bgnclosedline( void );
  65. void endclosedline( void );
  66. void bgntmesh( void );
  67. void swaptmesh( void );
  68. void endtmesh( void );
  69. void bgnqstrip( void );
  70. void endqstrip( void );
  71. void bgntfan( void );
  72. void endtfan( void );
  73. void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val,
  74. int n_lower, REAL v_lower, REAL* lower_val);
  75. void evalVStrip(int n_left, REAL u_left, REAL* left_val,
  76. int n_right, REAL u_right, REAL* right_val);
  77. void coord2f( REAL, REAL );
  78. void point2i( long, long );
  79. void newtmeshvert( REAL, REAL );
  80. void newtmeshvert( long, long );
  81. private:
  82. StoredVertex *vertexCache[VERTEX_CACHE_SIZE];
  83. int tmeshing;
  84. int which;
  85. int vcount;
  86. };
  87. inline void StoredVertex::invoke(OpenGLSurfaceEvaluator *eval)
  88. {
  89. switch(type) {
  90. case TYPECOORD:
  91. eval->coord2f(coord[0], coord[1]);
  92. break;
  93. case TYPEPOINT:
  94. eval->point2i(point[0], point[1]);
  95. break;
  96. default:
  97. break;
  98. }
  99. }
  100. #endif /* __gluglsurfeval_h_ */