BL_ArmatureChannel.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 BL_ArmatureChannel.h
  28. * \ingroup bgeconv
  29. */
  30. #ifndef __BL_ARMATURECHANNEL_H__
  31. #define __BL_ARMATURECHANNEL_H__
  32. #include "DNA_action_types.h"
  33. #include "CTR_HashedPtr.h"
  34. #include "CTR_Map.h"
  35. #include "EXP_PyObjectPlus.h"
  36. class SCA_IObject;
  37. class KX_GameObject;
  38. class BL_ArmatureObject;
  39. struct bConstraint;
  40. struct bPoseChannel;
  41. struct Object;
  42. struct bPose;
  43. class BL_ArmatureChannel : public PyObjectPlus
  44. {
  45. // use Py_HeaderPtr since we use generic pointer in proxy
  46. Py_HeaderPtr;
  47. private:
  48. friend class BL_ArmatureObject;
  49. struct bPoseChannel* m_posechannel;
  50. BL_ArmatureObject* m_armature;
  51. public:
  52. BL_ArmatureChannel(class BL_ArmatureObject *armature,
  53. struct bPoseChannel *posechannel);
  54. virtual ~BL_ArmatureChannel();
  55. inline const char *GetName()
  56. {
  57. return m_posechannel->name;
  58. }
  59. #ifdef WITH_PYTHON
  60. // Python access
  61. virtual PyObject *py_repr(void);
  62. static PyObject *py_attr_getattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
  63. static int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
  64. static PyObject *py_attr_get_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
  65. static int py_attr_set_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
  66. #endif /* WITH_PYTHON */
  67. };
  68. /* this is a factory class to access bBone data field in the GE.
  69. * It's not supposed to be instantiated, we only need it for the Attributes and Method array.
  70. * The actual proxy object will be manually created using NewProxyPtr */
  71. class BL_ArmatureBone : public PyObjectPlus
  72. {
  73. // use Py_HeaderPtr since we use generic pointer in proxy
  74. Py_HeaderPtr;
  75. private:
  76. // make constructor private to make sure no one tries to instantiate this class
  77. BL_ArmatureBone() {}
  78. virtual ~BL_ArmatureBone() {}
  79. public:
  80. #ifdef WITH_PYTHON
  81. static PyObject *py_bone_repr(PyObject *self);
  82. static PyObject *py_bone_get_parent(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
  83. static PyObject *py_bone_get_children(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
  84. #endif
  85. };
  86. #endif /* __BL_ARMATURECHANNEL_H__ */