home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / include / k3d / k3dsdk / paraboloid.h < prev    next >
C/C++ Source or Header  |  2009-01-24  |  3KB  |  104 lines

  1. #ifndef K3DSDK_PARABOLOID_H
  2. #define K3DSDK_PARABOLOID_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 paraboloid
  29. {
  30.  
  31. /// Gathers the member arrays of a paraboloid primitive into a convenient package
  32. class const_primitive
  33. {
  34. public:
  35.     const_primitive(
  36.         const mesh::matrices_t& Matrices,
  37.         const mesh::materials_t& Materials,
  38.         const mesh::doubles_t& Radii,
  39.         const mesh::doubles_t& ZMin,
  40.         const mesh::doubles_t& ZMax,
  41.         const mesh::doubles_t& SweepAngles,
  42.         const mesh::selection_t& Selections,
  43.         const mesh::attribute_arrays_t& ConstantData,
  44.         const mesh::attribute_arrays_t& UniformData,
  45.         const mesh::attribute_arrays_t& VaryingData);
  46.  
  47.     const mesh::matrices_t& matrices;
  48.     const mesh::materials_t& materials;
  49.     const mesh::doubles_t& radii;
  50.     const mesh::doubles_t& z_min;
  51.     const mesh::doubles_t& z_max;
  52.     const mesh::doubles_t& sweep_angles;
  53.     const mesh::selection_t& selections;
  54.     const mesh::attribute_arrays_t& constant_data;
  55.     const mesh::attribute_arrays_t& uniform_data;
  56.     const mesh::attribute_arrays_t& varying_data;
  57. };
  58.  
  59. /// Gathers the member arrays of a paraboloid primitive into a convenient package
  60. class primitive
  61. {
  62. public:
  63.     primitive(
  64.         mesh::matrices_t& Matrices,
  65.         mesh::materials_t& Materials,
  66.         mesh::doubles_t& Radii,
  67.         mesh::doubles_t& ZMin,
  68.         mesh::doubles_t& ZMax,
  69.         mesh::doubles_t& SweepAngles,
  70.         mesh::selection_t& Selections,
  71.         mesh::attribute_arrays_t& ConstantData,
  72.         mesh::attribute_arrays_t& UniformData,
  73.         mesh::attribute_arrays_t& VaryingData);
  74.  
  75.     mesh::matrices_t& matrices;
  76.     mesh::materials_t& materials;
  77.     mesh::doubles_t& radii;
  78.     mesh::doubles_t& z_min;
  79.     mesh::doubles_t& z_max;
  80.     mesh::doubles_t& sweep_angles;
  81.     mesh::selection_t& selections;
  82.     mesh::attribute_arrays_t& constant_data;
  83.     mesh::attribute_arrays_t& uniform_data;
  84.     mesh::attribute_arrays_t& varying_data;
  85. };
  86.  
  87. /// Creates a new paraboloid mesh primitive, returning references to its member arrays.
  88. /// The caller is responsible for the lifetime of the returned object.
  89. primitive* create(mesh& Mesh);
  90.  
  91. /// Tests the given mesh primitive to see if it is a valid paraboloid primitive, returning references to its member arrays, or NULL.
  92. /// The caller is responsible for the lifetime of the returned object.
  93. const_primitive* validate(const mesh::primitive& GenericPrimitive);
  94. /// Tests the given mesh primitive to see if it is a valid paraboloid primitive, returning references to its member arrays, or NULL.
  95. /// The caller is responsible for the lifetime of the returned object.
  96. primitive* validate(mesh::primitive& GenericPrimitive);
  97.  
  98. } // namespace paraboloid
  99.  
  100. } // namespace k3d
  101.  
  102. #endif // !K3DSDK_PARABOLOID_H
  103.  
  104.