Blender V2.61 - r43446

BL_ArmatureChannel.h

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