Blender V2.61 - r43446

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