|
Blender
V2.59
|
00001 /* 00002 * $Id: KX_PolyProxy.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_POLYROXY 00035 #define __KX_POLYPROXY 00036 00037 #ifdef WITH_PYTHON 00038 00039 #include "SCA_IObject.h" 00040 00041 class KX_PolyProxy : public CValue 00042 { 00043 Py_Header; 00044 protected: 00045 class RAS_Polygon* m_polygon; 00046 class RAS_MeshObject* m_mesh; 00047 public: 00048 KX_PolyProxy(const class RAS_MeshObject*mesh, class RAS_Polygon* polygon); 00049 virtual ~KX_PolyProxy(); 00050 00051 // stuff for cvalue related things 00052 CValue* Calc(VALUE_OPERATOR op, CValue *val) ; 00053 CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); 00054 const STR_String & GetText(); 00055 double GetNumber(); 00056 STR_String& GetName(); 00057 void SetName(const char *name); // Set the name of the value 00058 CValue* GetReplica(); 00059 00060 00061 // stuff for python integration 00062 static PyObject* pyattr_get_material_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00063 static PyObject* pyattr_get_texture_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00064 static PyObject* pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00065 static PyObject* pyattr_get_material_id(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00066 static PyObject* pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00067 static PyObject* pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00068 static PyObject* pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00069 static PyObject* pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00070 static PyObject* pyattr_get_visible(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00071 static PyObject* pyattr_get_collide(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00072 00073 KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterialIndex) 00074 KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getNumVertex) 00075 KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,isVisible) 00076 KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,isCollider) 00077 KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterialName) 00078 KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getTextureName) 00079 KX_PYMETHOD_DOC(KX_PolyProxy,getVertexIndex) 00080 KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMesh) 00081 KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterial) 00082 00083 }; 00084 00085 #endif // WITH_PYTHON 00086 00087 #endif //__KX_POLYPROXY 00088