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