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.

87 lines
2.1 KiB

  1. //-----------------------------------------------------------------------------
  2. // File: xc.h
  3. //
  4. // Desc: Cross_section (xc) class
  5. //
  6. // Copyright (c) 1994-2000 Microsoft Corporation
  7. //-----------------------------------------------------------------------------
  8. #ifndef __XC_H__
  9. #define __XC_H__
  10. // useful for xc-coords
  11. enum
  12. {
  13. RIGHT = 0,
  14. TOP,
  15. LEFT,
  16. BOTTOM
  17. };
  18. //-----------------------------------------------------------------------------
  19. // Name:
  20. // Desc: Cross_section (xc) class
  21. //-----------------------------------------------------------------------------
  22. class XC
  23. {
  24. public:
  25. float m_xLeft, m_xRight; // bounding box
  26. float m_yTop, m_yBottom;
  27. int m_numPts;
  28. D3DXVECTOR2* m_pts; // CW points around the xc, from +x
  29. XC( int numPts );
  30. XC( const XC& xc );
  31. XC( XC *xc );
  32. ~XC();
  33. void Scale( float scale );
  34. float MaxExtent();
  35. float MinTurnRadius( int relDir );
  36. void CalcArcACValues90( int dir, float r, float *acPts );
  37. void CalcArcACValuesByDistance( float *acPts );
  38. void ConvertPtsZ( D3DXVECTOR3 *pts, float z );
  39. protected:
  40. void CalcBoundingBox();
  41. };
  42. //-----------------------------------------------------------------------------
  43. // Name:
  44. // Desc: Specific xc's derived from base xc class
  45. //-----------------------------------------------------------------------------
  46. class ELLIPTICAL_XC : public XC
  47. {
  48. public:
  49. ELLIPTICAL_XC( float r1, float r2 );
  50. ~ELLIPTICAL_XC();
  51. private:
  52. void SetControlPoints( float r1, float r2 );
  53. };
  54. //-----------------------------------------------------------------------------
  55. // Name:
  56. // Desc: Specific xc's derived from base xc class
  57. //-----------------------------------------------------------------------------
  58. class RANDOM4ARC_XC : public XC
  59. {
  60. public:
  61. RANDOM4ARC_XC( float r );
  62. ~RANDOM4ARC_XC();
  63. private:
  64. void SetControlPoints( float radius );
  65. };
  66. #endif __XC_H__