Blender V2.61 - r43446

RAS_Deformer.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 RAS_DEFORMER
00033 #define RAS_DEFORMER
00034 
00035 #if defined(WIN32) && !defined(FREE_WINDOWS)
00036 #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
00037 #endif //WIN32
00038 
00039 #include <stdlib.h>
00040 #include "CTR_Map.h"
00041 
00042 #ifdef WITH_CXX_GUARDEDALLOC
00043 #include "MEM_guardedalloc.h"
00044 #endif
00045 
00046 struct DerivedMesh;
00047 class RAS_MeshObject;
00048 
00049 class RAS_Deformer
00050 {
00051 public:
00052     RAS_Deformer() : m_pMesh(NULL), m_bDynamic(false) {};
00053     virtual ~RAS_Deformer(){};
00054     virtual void Relink(CTR_Map<class CTR_HashedPtr, void*>*map)=0;
00055     virtual bool Apply(class RAS_IPolyMaterial *polymat)=0;
00056     virtual bool Update(void)=0;
00057     virtual bool UpdateBuckets(void)=0;
00058     virtual RAS_Deformer *GetReplica()=0;
00059     virtual void ProcessReplica()=0;
00060     virtual bool SkipVertexTransform()
00061     {
00062         return false;
00063     }
00064     virtual bool ShareVertexArray()
00065     {
00066         return true;
00067     }
00068     virtual bool UseVertexArray()
00069     {
00070         return true;
00071     }
00072     // true when deformer produces varying vertex (shape or armature)
00073     bool IsDynamic()
00074     {
00075         return m_bDynamic;
00076     }
00077     virtual struct DerivedMesh* GetFinalMesh()
00078     {
00079         return NULL;
00080     }
00081     virtual struct DerivedMesh* GetPhysicsMesh()
00082     {
00083         return NULL;
00084     }
00085     virtual class RAS_MeshObject* GetRasMesh()
00086     {
00087         /* m_pMesh does not seem to be being used?? */
00088         return NULL;
00089     }
00090     virtual float (* GetTransVerts(int *tot))[3]    {   *tot= 0; return NULL; }
00091 
00092 protected:
00093     class RAS_MeshObject    *m_pMesh;
00094     bool  m_bDynamic;   
00095 
00096 #ifdef WITH_CXX_GUARDEDALLOC
00097 public:
00098     void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Deformer"); }
00099     void operator delete( void *mem ) { MEM_freeN(mem); }
00100 #endif
00101 };
00102 
00103 #endif
00104