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

  1. #ifndef K3DSDK_CUBIC_CURVE_H
  2. #define K3DSDK_CUBIC_CURVE_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 cubic_curve
  29. {
  30.  
  31. /// Gathers the member arrays of a cubic_curve primitive into a convenient package
  32. class const_primitive
  33. {
  34. public:
  35.     const_primitive(
  36.         const mesh::bools_t& Periodic,
  37.         const mesh::materials_t& Material,
  38.         const mesh::indices_t& CurveFirstPoints,
  39.         const mesh::counts_t& CurvePointCounts,
  40.         const mesh::selection_t& CurveSelections,
  41.         const mesh::indices_t& CurvePoints,
  42.         const mesh::attribute_arrays_t& ConstantData,
  43.         const mesh::attribute_arrays_t& UniformData,
  44.         const mesh::attribute_arrays_t& VaryingData
  45.         );
  46.  
  47.     const mesh::bools_t& periodic;
  48.     const mesh::materials_t& material;
  49.     const mesh::indices_t& curve_first_points;
  50.     const mesh::counts_t& curve_point_counts;
  51.     const mesh::selection_t& curve_selections;
  52.     const mesh::indices_t& curve_points;
  53.     const mesh::attribute_arrays_t& constant_data;
  54.     const mesh::attribute_arrays_t& uniform_data;
  55.     const mesh::attribute_arrays_t& varying_data;
  56. };
  57.  
  58. /// Gathers the member arrays of a cubic_curve primitive into a convenient package
  59. class primitive
  60. {
  61. public:
  62.     primitive(
  63.         mesh::bools_t& Periodic,
  64.         mesh::materials_t& Material,
  65.         mesh::indices_t& CurveFirstPoints,
  66.         mesh::counts_t& CurvePointCounts,
  67.         mesh::selection_t& CurveSelections,
  68.         mesh::indices_t& CurvePoints,
  69.         mesh::attribute_arrays_t& ConstantData,
  70.         mesh::attribute_arrays_t& UniformData,
  71.         mesh::attribute_arrays_t& VaryingData
  72.         );
  73.  
  74.     mesh::bools_t& periodic;
  75.     mesh::materials_t& material;
  76.     mesh::indices_t& curve_first_points;
  77.     mesh::counts_t& curve_point_counts;
  78.     mesh::selection_t& curve_selections;
  79.     mesh::indices_t& curve_points;
  80.     mesh::attribute_arrays_t& constant_data;
  81.     mesh::attribute_arrays_t& uniform_data;
  82.     mesh::attribute_arrays_t& varying_data;
  83. };
  84.  
  85. /// Creates a new cubic_curve mesh primitive, returning references to its member arrays.
  86. /// The caller is responsible for the lifetime of the returned object.
  87. primitive* create(mesh& Mesh);
  88.  
  89. /// Tests the given mesh primitive to see if it is a valid cubic_curve primitive, returning references to its member arrays, or NULL.
  90. /// The caller is responsible for the lifetime of the returned object.
  91. const_primitive* validate(const mesh::primitive& GenericPrimitive);
  92. /// Tests the given mesh primitive to see if it is a valid cubic_curve primitive, returning references to its member arrays, or NULL.
  93. /// The caller is responsible for the lifetime of the returned object.
  94. primitive* validate(mesh::primitive& GenericPrimitive);
  95.  
  96. } // namespace cubic_curve
  97.  
  98. } // namespace k3d
  99.  
  100. #endif // !K3DSDK_CUBIC_CURVE_H
  101.  
  102.