Blender V2.61 - r43446

SG_Controller.h

Go to the documentation of this file.
00001 /*
00002  * Implementationclass to derive controllers from
00003  *
00004  *
00005  * ***** BEGIN GPL LICENSE BLOCK *****
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software Foundation,
00019  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00022  * All rights reserved.
00023  *
00024  * The Original Code is: all of this file.
00025  *
00026  * Contributor(s): none yet.
00027  *
00028  * ***** END GPL LICENSE BLOCK *****
00029  */
00030 
00035 #ifndef __SG_CONTROLLER_H
00036 #define __SG_CONTROLLER_H
00037 
00038 #include "SG_IObject.h"
00039 
00043 class SG_Controller 
00044 {
00045 public:
00046 
00047 #ifdef WITH_CXX_GUARDEDALLOC
00048     void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "SG_Controller"); }
00049     void operator delete( void *mem ) { MEM_freeN(mem); }
00050 #endif
00051 
00052     SG_Controller(
00053     ) :
00054         m_pObject(NULL) {
00055     }
00056 
00057     virtual 
00058     ~SG_Controller(
00059     ) {};
00060 
00061     virtual 
00062         bool    
00063     Update(
00064         double time
00065     )=0;
00066 
00067     virtual 
00068         void 
00069     SetObject (
00070         SG_IObject* object
00071     );
00072 
00073         void
00074     ClearObject(
00075     );
00076 
00077     virtual 
00078         void    
00079     SetSimulatedTime(
00080         double time
00081     )=0;
00082 
00083     virtual 
00084         SG_Controller*  
00085     GetReplica(
00086         class SG_Node* destnode
00087     )=0;
00088 
00098     virtual
00099         void
00100     SetOption(
00101         int option,
00102         int value
00103     )=0;
00104 
00110     enum SG_Controller_option {
00111         SG_CONTR_NODEF = 0,
00112         SG_CONTR_IPO_IPO_AS_FORCE,
00113         SG_CONTR_IPO_IPO_ADD,
00114         SG_CONTR_IPO_LOCAL,
00115         SG_CONTR_IPO_RESET,
00116         SG_CONTR_CAMIPO_LENS,
00117         SG_CONTR_CAMIPO_CLIPEND,
00118         SG_CONTR_CAMIPO_CLIPSTART,
00119         SG_CONTR_MAX
00120     };
00121 
00122 protected:
00123     SG_IObject*     m_pObject;
00124 
00125 };
00126 
00127 #endif //__SG_CONTROLLER_H
00128