Blender  V2.59
KX_VertexProxy.h
Go to the documentation of this file.
00001 /*
00002  * $Id: KX_VertexProxy.h 35063 2011-02-22 10:33:14Z jesterking $
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 __KX_VERTEXPROXY
00035 #define __KX_VERTEXPROXY
00036 
00037 #ifdef WITH_PYTHON
00038 
00039 #include "SCA_IObject.h"
00040 
00041 class KX_VertexProxy    : public CValue
00042 {
00043         Py_Header;
00044 protected:
00045 
00046         class RAS_TexVert*      m_vertex;
00047         class KX_MeshProxy*     m_mesh;
00048 public:
00049         KX_VertexProxy(class KX_MeshProxy*mesh, class RAS_TexVert* vertex);
00050         virtual ~KX_VertexProxy();
00051 
00052         // stuff for cvalue related things
00053         CValue*         Calc(VALUE_OPERATOR op, CValue *val) ;
00054         CValue*         CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val);
00055         const STR_String &      GetText();
00056         double          GetNumber();
00057         STR_String&     GetName();
00058         void            SetName(const char *name);                                                              // Set the name of the value
00059         CValue*         GetReplica();
00060 
00061 
00062 // stuff for python integration
00063 
00064         static PyObject* pyattr_get_x(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00065         static PyObject* pyattr_get_y(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00066         static PyObject* pyattr_get_z(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00067         static PyObject* pyattr_get_r(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00068         static PyObject* pyattr_get_g(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00069         static PyObject* pyattr_get_b(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00070         static PyObject* pyattr_get_a(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00071         static PyObject* pyattr_get_u(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00072         static PyObject* pyattr_get_v(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00073         static PyObject* pyattr_get_u2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00074         static PyObject* pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00075         static PyObject* pyattr_get_XYZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00076         static PyObject* pyattr_get_UV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00077         static PyObject* pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00078         static PyObject* pyattr_get_normal(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
00079         static int pyattr_set_x(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00080         static int pyattr_set_y(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00081         static int pyattr_set_z(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00082         static int pyattr_set_u(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00083         static int pyattr_set_v(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00084         static int pyattr_set_u2(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00085         static int pyattr_set_v2(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00086         static int pyattr_set_r(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00087         static int pyattr_set_g(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00088         static int pyattr_set_b(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00089         static int pyattr_set_a(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00090         static int pyattr_set_XYZ(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00091         static int pyattr_set_UV(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00092         static int pyattr_set_color(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00093         static int pyattr_set_normal(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
00094 
00095         KX_PYMETHOD_NOARGS(KX_VertexProxy,GetXYZ);
00096         KX_PYMETHOD_O(KX_VertexProxy,SetXYZ);
00097         KX_PYMETHOD_NOARGS(KX_VertexProxy,GetUV);
00098         KX_PYMETHOD_O(KX_VertexProxy,SetUV);
00099         
00100         KX_PYMETHOD_NOARGS(KX_VertexProxy,GetUV2);
00101         KX_PYMETHOD_VARARGS(KX_VertexProxy,SetUV2);
00102 
00103         KX_PYMETHOD_NOARGS(KX_VertexProxy,GetRGBA);
00104         KX_PYMETHOD_O(KX_VertexProxy,SetRGBA);
00105         KX_PYMETHOD_NOARGS(KX_VertexProxy,GetNormal);
00106         KX_PYMETHOD_O(KX_VertexProxy,SetNormal);
00107 
00108 };
00109 
00110 #endif // WITH_PYTHON
00111 
00112 #endif //__KX_VERTEXPROXY
00113