home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / include / k3d / k3dsdk / bilinear_patch.h < prev    next >
C/C++ Source or Header  |  2008-11-16  |  3KB  |  90 lines

  1. #ifndef K3DSDK_BILINEAR_PATCH_H
  2. #define K3DSDK_BILINEAR_PATCH_H
  3.  
  4. // K-3D
  5. // Copyright (c) 1995-2008, Timothy M. Shead
  6. //
  7. // Contact: tshead@k-3d.com
  8. //
  9. // This program is free software; you can redistribute it and/or
  10. // modify it under the terms of the GNU General Public
  11. // License as published by the Free Software Foundation; either
  12. // version 2 of the License, or (at your option) any later version.
  13. //
  14. // This program is distributed in the hope that it will be useful,
  15. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17. // General Public License for more details.
  18. //
  19. // You should have received a copy of the GNU General Public
  20. // License along with this program; if not, write to the Free Software
  21. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  22.  
  23. #include "mesh.h"
  24.  
  25. namespace k3d
  26. {
  27.  
  28. namespace bilinear_patch
  29. {
  30.  
  31. /// Gathers the member arrays of a bilinear_patch primitive into a convenient package
  32. class const_primitive
  33. {
  34. public:
  35.     const_primitive(
  36.         const mesh::selection_t& PatchSelections,
  37.         const mesh::materials_t& PatchMaterials,
  38.         const mesh::indices_t& PatchPoints,
  39.         const mesh::attribute_arrays_t& ConstantData,
  40.         const mesh::attribute_arrays_t& UniformData,
  41.         const mesh::attribute_arrays_t& VaryingData
  42.         );
  43.  
  44.     const mesh::selection_t& patch_selections;
  45.     const mesh::materials_t& patch_materials;
  46.     const mesh::indices_t& patch_points;
  47.     const mesh::attribute_arrays_t& constant_data;
  48.     const mesh::attribute_arrays_t& uniform_data;
  49.     const mesh::attribute_arrays_t& varying_data;
  50. };
  51.  
  52. /// Gathers the member arrays of a bilinear_patch primitive into a convenient package
  53. class primitive
  54. {
  55. public:
  56.     primitive(
  57.         mesh::selection_t& PatchSelections,
  58.         mesh::materials_t& PatchMaterials,
  59.         mesh::indices_t& PatchPoints,
  60.         mesh::attribute_arrays_t& ConstantData,
  61.         mesh::attribute_arrays_t& UniformData,
  62.         mesh::attribute_arrays_t& VaryingData
  63.         );
  64.  
  65.     mesh::selection_t& patch_selections;
  66.     mesh::materials_t& patch_materials;
  67.     mesh::indices_t& patch_points;
  68.     mesh::attribute_arrays_t& constant_data;
  69.     mesh::attribute_arrays_t& uniform_data;
  70.     mesh::attribute_arrays_t& varying_data;
  71. };
  72.  
  73. /// Creates a new bilinear_patch mesh primitive, returning references to its member arrays.
  74. /// The caller is responsible for the lifetime of the returned object.
  75. primitive* create(mesh& Mesh);
  76.  
  77. /// Tests the given mesh primitive to see if it is a valid bilinear_patch primitive, returning references to its member arrays, or NULL.
  78. /// The caller is responsible for the lifetime of the returned object.
  79. const_primitive* validate(const mesh::primitive& GenericPrimitive);
  80. /// Tests the given mesh primitive to see if it is a valid bilinear_patch primitive, returning references to its member arrays, or NULL.
  81. /// The caller is responsible for the lifetime of the returned object.
  82. primitive* validate(mesh::primitive& GenericPrimitive);
  83.  
  84. } // namespace bilinear_patch
  85.  
  86. } // namespace k3d
  87.  
  88. #endif // !K3DSDK_BILINEAR_PATCH_H
  89.  
  90.