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