RAS_Deformer.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * ***** BEGIN GPL LICENSE BLOCK *****
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software Foundation,
  16. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. *
  18. * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
  19. * All rights reserved.
  20. *
  21. * The Original Code is: all of this file.
  22. *
  23. * Contributor(s): none yet.
  24. *
  25. * ***** END GPL LICENSE BLOCK *****
  26. */
  27. /** \file RAS_Deformer.h
  28. * \ingroup bgerast
  29. */
  30. #ifndef __RAS_DEFORMER_H__
  31. #define __RAS_DEFORMER_H__
  32. #ifdef _MSC_VER
  33. # pragma warning (disable:4786) /* get rid of stupid stl-visual compiler debug warning */
  34. #endif
  35. #include <stdlib.h>
  36. #include "CTR_Map.h"
  37. #ifdef WITH_CXX_GUARDEDALLOC
  38. #include "MEM_guardedalloc.h"
  39. #endif
  40. struct DerivedMesh;
  41. class RAS_MeshObject;
  42. class RAS_Deformer
  43. {
  44. public:
  45. RAS_Deformer() : m_pMesh(NULL), m_bDynamic(false) {}
  46. virtual ~RAS_Deformer() {}
  47. virtual void Relink(CTR_Map<class CTR_HashedPtr, void*>*map)=0;
  48. virtual bool Apply(class RAS_IPolyMaterial *polymat)=0;
  49. virtual bool Update(void)=0;
  50. virtual bool UpdateBuckets(void)=0;
  51. virtual RAS_Deformer *GetReplica()=0;
  52. virtual void ProcessReplica()=0;
  53. virtual bool SkipVertexTransform()
  54. {
  55. return false;
  56. }
  57. virtual bool ShareVertexArray()
  58. {
  59. return true;
  60. }
  61. virtual bool UseVertexArray()
  62. {
  63. return true;
  64. }
  65. // true when deformer produces varying vertex (shape or armature)
  66. bool IsDynamic()
  67. {
  68. return m_bDynamic;
  69. }
  70. virtual struct DerivedMesh* GetFinalMesh()
  71. {
  72. return NULL;
  73. }
  74. virtual struct DerivedMesh* GetPhysicsMesh()
  75. {
  76. return NULL;
  77. }
  78. virtual class RAS_MeshObject* GetRasMesh()
  79. {
  80. /* m_pMesh does not seem to be being used?? */
  81. return NULL;
  82. }
  83. virtual float (* GetTransVerts(int *tot))[3] { *tot= 0; return NULL; }
  84. protected:
  85. class RAS_MeshObject *m_pMesh;
  86. bool m_bDynamic;
  87. #ifdef WITH_CXX_GUARDEDALLOC
  88. MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_Deformer")
  89. #endif
  90. };
  91. #endif