MLRIndexedTriangleCloud.hpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //===========================================================================//
  2. // Copyright (C) Microsoft Corporation. All rights reserved. //
  3. //===========================================================================//
  4. #pragma once
  5. #define MLR_MLRINDEXEDTRIANGLECLOUD_HPP
  6. #if !defined(MLR_MLR_HPP)
  7. #include <MLR\MLR.hpp>
  8. #endif
  9. #if !defined(MLR_MLRTRIANGLECLOUD_HPP)
  10. #include <MLR\MLRTriangleCloud.hpp>
  11. #endif
  12. namespace MidLevelRenderer {
  13. //##########################################################################
  14. //################## MLRIndexedTriangleCloud #########################
  15. //##########################################################################
  16. class MLRIndexedTriangleCloud:
  17. public MLRTriangleCloud
  18. {
  19. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  20. // Initialization
  21. //
  22. public:
  23. static void
  24. InitializeClass();
  25. static void
  26. TerminateClass();
  27. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  28. // Constructors/Destructors
  29. //
  30. public:
  31. MLRIndexedTriangleCloud(int);
  32. ~MLRIndexedTriangleCloud();
  33. void
  34. SetData(
  35. const int *tri_count,
  36. const int *point_count,
  37. const unsigned short *index_data,
  38. const Stuff::Point3D *point_data,
  39. const Stuff::RGBAColor *color_data,
  40. const Vector2DScalar *uv_data
  41. );
  42. void Draw (DrawEffectInformation*, GOSVertexPool*, MLRSorter*);
  43. int Clip(MLRClippingState, GOSVertexPool*);
  44. virtual unsigned short*
  45. GetGOSIndices(int=0)
  46. { Check_Object(this); return gos_indices; }
  47. int
  48. GetNumGOSIndices()
  49. { Check_Object(this); return numGOSIndices; }
  50. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  51. // Class Data Support
  52. //
  53. public:
  54. static ClassData
  55. *DefaultData;
  56. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  57. // Testing
  58. //
  59. public:
  60. void
  61. TestInstance() const;
  62. protected:
  63. const int *usedNrOfPoints;
  64. const unsigned short *index;
  65. const Vector2DScalar *texCoords;
  66. static Stuff::DynamicArrayOf<Vector2DScalar> *clipExtraTexCoords; // , Max_Number_Vertices_Per_Mesh
  67. static Stuff::DynamicArrayOf<unsigned short> *clipExtraIndex; // , Max_Number_Vertices_Per_Mesh
  68. static Stuff::DynamicArrayOf<unsigned char> *visibleIndexedVertices;
  69. unsigned short *gos_indices;
  70. unsigned short numGOSIndices;
  71. };
  72. }