Source code of Windows XP (NT5)
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.

60 lines
2.0 KiB

  1. #ifndef __eval_h__
  2. #define __eval_h__
  3. #include "sscommon.h"
  4. #include "xc.h"
  5. #define MAX_UORDER 5 // this is per section
  6. #define MAX_VORDER 5
  7. #define MAX_USECTIONS 4
  8. #define MAX_XC_PTS (MAX_UORDER * MAX_USECTIONS)
  9. #define TEX_ORDER 2
  10. #define EVAL_ARC_ORDER 4
  11. #define EVAL_CYLINDER_ORDER 2
  12. #define EVAL_ELBOW_ORDER 4
  13. // # of components (eg. arcs) to form a complete cross-section
  14. #define EVAL_XC_CIRC_SECTION_COUNT 4
  15. #define EVAL_XC_POINT_COUNT ( (EVAL_ARC_ORDER-1)*4 + 1 )
  16. #define EVAL_CIRC_ARC_CONTROL 0.56f // for r=1
  17. /**************************************************************************\
  18. *
  19. * EVAL class
  20. *
  21. * - Evaluator composed of one or more sections that are evaluated
  22. * separately with OpenGL evaluators
  23. *
  24. \**************************************************************************/
  25. class EVAL {
  26. public:
  27. EVAL( BOOL bTexture );
  28. ~EVAL();
  29. int numSections; // number of cross-sectional sections
  30. int uOrder, vOrder;
  31. // assumed: all sections same order - uOrder is per
  32. // section; sections share vertex and texture control points
  33. int uDiv, vDiv; // figured out one level up ?
  34. POINT3D *pts; // vertex control points
  35. // - texture always order 2 for s and t (linear mapping)
  36. BOOL bTexture;
  37. TEX_POINT2D *texPts; // texture control points
  38. void Evaluate(); // evaluate/render the object
  39. void SetVertexCtrlPtsXCTranslate( POINT3D *pts, float length,
  40. XC *xcStart, XC *xcEnd );
  41. void SetTextureControlPoints( float s_start, float s_end,
  42. float t_start, float t_end );
  43. void ProcessXCPrimLinear( XC *xcStart, XC *xcEnd, float length );
  44. void ProcessXCPrimBendSimple( XC *xcCur, int dir, float radius );
  45. void ProcessXCPrimSingularity( XC *xcCur, float length,
  46. BOOL bOpening );
  47. };
  48. extern void ResetEvaluator( BOOL bTexture );
  49. #endif // __eval_h__