Blender  V2.59
BL_ArmatureChannel.h
Go to the documentation of this file.
00001 /*
00002  * $Id: BL_ArmatureChannel.h 36523 2011-05-06 20:18:42Z blendix $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00034 #ifndef __BL_ARMATURECHANNEL
00035 #define __BL_ARMATURECHANNEL
00036 
00037 #include "DNA_action_types.h"
00038 #include "CTR_HashedPtr.h"
00039 #include "CTR_Map.h"
00040 #include "PyObjectPlus.h"
00041 
00042 class SCA_IObject;
00043 class KX_GameObject;
00044 class BL_ArmatureObject;
00045 struct bConstraint;
00046 struct bPoseChannel;
00047 struct Object;
00048 struct bPose;
00049 
00050 class BL_ArmatureChannel : public PyObjectPlus
00051 {
00052         // use Py_HeaderPtr since we use generic pointer in proxy
00053         Py_HeaderPtr;
00054 
00055 private:
00056         friend class BL_ArmatureObject;
00057         struct bPoseChannel* m_posechannel;
00058         BL_ArmatureObject* m_armature;
00059 
00060 public:
00061         BL_ArmatureChannel(class BL_ArmatureObject *armature, 
00062                                                 struct bPoseChannel *posechannel);
00063         virtual ~BL_ArmatureChannel();
00064 
00065 #ifdef WITH_PYTHON
00066         // Python access
00067         virtual PyObject* py_repr(void);
00068 
00069         static PyObject* py_attr_getattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
00070         static int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00071         static PyObject* py_attr_get_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
00072         static int py_attr_set_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00073 #endif // WITH_PYTHON
00074 };
00075 
00076 /* this is a factory class to access bBone data field in the GE.
00077    It's not supposed to be instantiated, we only need it for the Attributes and Method array.
00078    The actual proxy object will be manually created using NewProxyPtr */
00079 class BL_ArmatureBone : public PyObjectPlus
00080 {
00081         // use Py_HeaderPtr since we use generic pointer in proxy
00082         Py_HeaderPtr;
00083 private:
00084         // make constructor private to make sure no one tries to instantiate this class
00085         BL_ArmatureBone() {}
00086         virtual ~BL_ArmatureBone() {}
00087 
00088 public:
00089 
00090 #ifdef WITH_PYTHON
00091         static PyObject *py_bone_repr(PyObject *self);
00092         static PyObject *py_bone_get_parent(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
00093         static PyObject *py_bone_get_children(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
00094 #endif
00095 
00096 };
00097 
00098 
00099 #endif //__BL_ARMATURECHANNEL
00100