#include <ExManagerModele.h>
Inheritance diagram for ExManagerModel:
Public Methods | |
ExCAction | InputCommand (ExCCommand Command) |
ExCAction | InputAction (ExCAction Action) |
void | SetManagerTexture (ExManagerTexture *Texture) |
void | SetManagerVertexArrays (ExManagerVertexArrays *VertexArrays) |
void | Reset (void) |
void | Init (void) |
void | List (void) |
void | Draw (void) |
ExNihilo::ExId | Load (std::string FileName) |
ExNihilo::ExId | Load (std::string FileName, std::string ObjectName) |
void | NextFrame (void) |
void | PreviousFrame (void) |
void | SetCurrentFrame (int frame) |
ExCModel * | GetObject (ExNihilo::ExId id) |
ExCModel * | GetCurrentObject (void) |
Static Public Methods | |
ExManagerModel * | CreateSingleton (void) |
Private Methods | |
ExNihilo::ExId | LoadMD2 (std::string FileName) |
ExNihilo::ExId | LoadMD2 (std::string FileName, std::string ObjectName) |
ExNihilo::ExId | LoadMD3 (std::string FileName) |
ExNihilo::ExId | LoadMD3 (std::string FileName, std::string ObjectName) |
ExNihilo::ExId | LoadASC (std::string FileName) |
ExNihilo::ExId | LoadASC (std::string FileName, std::string ObjectName) |
ExNihilo::ExId | Load3DS (std::string FileName) |
ExNihilo::ExId | Load3DS (std::string FileName, std::string ObjectName) |
ExNihilo::ExId | LoadOBJ (std::string FileName) |
ExNihilo::ExId | LoadOBJ (std::string FileName, std::string ObjectName) |
ExNihilo::ExId | LoadASE (std::string FileName) |
ExNihilo::ExId | LoadASE (std::string FileName, std::string ObjectName) |
ExManagerModel (void) | |
~ExManagerModel (void) | |
Private Attributes | |
ExManagerTexture * | ManagerTexture |
ExManagerVertexArrays * | ManagerVertexArrays |
std::vector< ExCModelMD2 > | m_VecMD2 |
std::vector< ExCModelMD3 > | m_VecMD3 |
std::vector< ExCModelASC > | m_VecASC |
std::vector< ExCModel3DS > | m_Vec3DS |
std::vector< ExCModelOBJ > | m_VecOBJ |
Static Private Attributes | |
bool | m_flag = false |
ExManagerModel * | m_instance = NULL |
|
Definition at line 41 of file ExManagerModele.cpp. References ExManager::SetAskForCommand(), and ExManager::SetAskForExclusifCommand().
00042 { 00043 SetAskForCommand(true); 00044 SetAskForExclusifCommand(false); 00045 } |
|
Definition at line 47 of file ExManagerModele.cpp.
00048 { 00049 } |
|
Definition at line 27 of file ExManagerModele.cpp. References CreateSingleton(), Guard, m_flag, and m_instance. Referenced by CreateSingleton(), and main().
00027 { 00028 Guard(ExManagerModel* ExManagerModel::CreateSingleton(void)) 00029 if(!m_flag) 00030 { 00031 m_flag = true; // We are creating the error log now, so set flag to true 00032 m_instance = new ExManagerModel; // Create the error log 00033 }else 00034 { 00035 std::cout<<"Error singleton already created"<<std::endl; 00036 } 00037 return m_instance; 00038 UnGuard 00039 } |
|
Reimplemented from ExManagerObject< ExCModel * >. Definition at line 69 of file ExManagerModele.cpp. References Draw(), Guard, m_Vec3DS, m_VecASC, m_VecMD2, m_VecMD3, and m_VecOBJ. Referenced by Draw(), and ExManagerOutput::DrawScene().
00070 { 00071 Guard(void ExManagerModel::Draw(void)) 00072 try 00073 { 00074 unsigned int i; 00075 for(i =0;i<m_VecMD2.size();++i){m_VecMD2.at(i).Draw();} 00076 for(i =0;i<m_VecMD3.size();++i){m_VecMD3.at(i).Draw();} 00077 for(i =0;i<m_VecASC.size();++i){m_VecASC.at(i).Draw();} 00078 for(i =0;i<m_Vec3DS.size();++i){m_Vec3DS.at(i).Draw();} 00079 for(i =0;i<m_VecOBJ.size();++i){m_VecOBJ.at(i).Draw();} 00080 //for(i =0;i<m_VecASE.size();++i){m_VecASE.at(i).Draw();} 00081 }catch(...) 00082 { 00083 00084 } 00085 UnGuard 00086 } |
|
Reimplemented from ExManagerObject< ExCModel * >. Definition at line 419 of file ExManagerModele.cpp. References GetCurrentObject(), GetObject(), Guard, and ExManagerObject< ExCModel * >::m_CurrentObjectId. Referenced by ExCCameraChase::Draw(), and GetCurrentObject().
00420 { 00421 Guard(ExCModel* ExManagerModel::GetCurrentObject(void)) 00422 return GetObject(m_CurrentObjectId); 00423 UnGuard 00424 } |
|
Reimplemented from ExManagerObject< ExCModel * >. Definition at line 391 of file ExManagerModele.cpp. References GetObject(), Guard, m_Vec3DS, m_VecASC, m_VecMD2, m_VecMD3, and m_VecOBJ. Referenced by GetCurrentObject(), GetObject(), and InputAction().
00392 { 00393 Guard(ExCModel *ExManagerModel::GetObject(ExNihilo::ExId id)) 00394 unsigned int i; 00395 for(i =0;i<m_VecMD2.size();++i) 00396 { 00397 if(m_VecMD2.at(i).GetId()==id)return &m_VecMD2.at(i); 00398 } 00399 for(i =0;i<m_VecASC.size();++i) 00400 { 00401 if(m_VecASC.at(i).GetId()==id)return &m_VecASC.at(i); 00402 } 00403 for(i =0;i<m_VecMD3.size();++i) 00404 { 00405 if(m_VecMD3.at(i).GetId()==id)return &m_VecMD3.at(i); 00406 } 00407 for(i =0;i<m_Vec3DS.size();++i) 00408 { 00409 if(m_Vec3DS.at(i).GetId()==id)return &m_Vec3DS.at(i); 00410 } 00411 for(i =0;i<m_VecOBJ.size();++i) 00412 { 00413 if(m_VecOBJ.at(i).GetId()==id)return &m_VecOBJ.at(i); 00414 } 00415 return NULL; 00416 UnGuard 00417 } |
|
Reimplemented from ExManagerObject< ExCModel * >. Definition at line 62 of file ExManagerModele.cpp. References Guard, ExManagerObject::Init(), and Init(). Referenced by ExManagerParticuleSystem::Init(), Init(), InitManager(), and Reset().
00063 { 00064 Guard(void ExManagerModel::Init(void)) 00065 ExManagerObject<ExCModel *>::Init(); 00066 UnGuard 00067 } |
|
|
Reimplemented from ExManager. Definition at line 283 of file ExManagerModele.cpp. References Guard, InputCommand(), and ExCCommand::m_Command. Referenced by InputCommand().
00284 { 00285 Guard(ExCAction ExManagerModel::InputCommand(ExCCommand Command)) 00286 switch(Command.m_Command) 00287 { 00288 case KEYBOARD_UP_ARROW_DOWN: 00289 return NOTHING; 00290 case KEYBOARD_UP_ARROW_UP: 00291 return NOTHING; 00292 case KEYBOARD_UP_ARROW_LEFT: 00293 return NOTHING; 00294 case KEYBOARD_UP_ARROW_RIGHT: 00295 return NOTHING; 00296 case KEYBOARD_DOWN_ARROW_DOWN: 00297 return NOTHING; 00298 case KEYBOARD_DOWN_ARROW_UP: 00299 return NOTHING; 00300 case KEYBOARD_DOWN_ARROW_LEFT: 00301 return NOTHING; 00302 case KEYBOARD_DOWN_ARROW_RIGHT: 00303 return NOTHING; 00304 default :return NOTHING; 00305 } 00306 UnGuard 00307 } |
|
Reimplemented from ExManagerObject< ExCModel * >. Definition at line 88 of file ExManagerModele.cpp. References ExManager::Consol, Guard, List(), ExManagerObject< ExCModel * >::m_CurrentObjectId, ExManagerObject< ExCModel * >::m_Map, m_Vec3DS, m_VecASC, m_VecMD2, m_VecMD3, and m_VecOBJ. Referenced by InputAction(), and List().
00089 { 00090 Guard(void ExManagerModel::List(void)) 00091 unsigned int i; 00092 *Consol<<"---------------List of Model--------------"<<std::endl; 00093 for(i =0;i<m_VecASC.size();++i) 00094 { 00095 m_VecASC.at(i).Draw(); 00096 *Consol<<" Id:"<<m_VecASC.at(i).GetId()<<" Name :"<<m_VecASC.at(i).GetName()<<" Type :"<<typeid(&m_VecASC.at(i)).name()<<std::endl; 00097 } 00098 for(i =0;i<m_VecMD2.size();++i) 00099 { 00100 m_VecMD2.at(i).Draw(); 00101 *Consol<<" Id:"<<m_VecMD2.at(i).GetId()<<" Name :"<<m_VecMD2.at(i).GetName()<<" Type :"<<typeid(&m_VecMD2.at(i)).name()<<std::endl; 00102 } 00103 for(i =0;i<m_Vec3DS.size();++i) 00104 { 00105 m_Vec3DS.at(i).Draw(); 00106 *Consol<<" Id:"<<m_Vec3DS.at(i).GetId()<<" Name :"<<m_Vec3DS.at(i).GetName()<<" Type :"<<typeid(&m_Vec3DS.at(i)).name()<<std::endl; 00107 } 00108 for(i =0;i<m_VecOBJ.size();++i) 00109 { 00110 m_VecOBJ.at(i).Draw(); 00111 *Consol<<" Id:"<<m_VecOBJ.at(i).GetId()<<" Name :"<<m_VecOBJ.at(i).GetName()<<" Type :"<<typeid(&m_VecOBJ.at(i)).name()<<std::endl; 00112 } 00113 for(i =0;i<m_VecMD3.size();++i) 00114 { 00115 m_VecMD3.at(i).Draw(); 00116 *Consol<<" Id:"<<m_VecMD3.at(i).GetId()<<" Name :"<<m_VecMD3.at(i).GetName()<<" Type :"<<typeid(&m_VecMD3.at(i)).name()<<std::endl; 00117 } 00118 *Consol<<"-----------------------------------------------------------------"<<std::endl; 00119 *Consol<<" Number Total of Object : "<<m_Map->size()<<std::endl; 00120 *Consol<<" Current Object Id : "<<m_CurrentObjectId<<std::endl; 00121 *Consol<<"-----------------------------------------------------------------"<<std::endl; 00122 00123 UnGuard 00124 } |
|
Definition at line 161 of file ExManagerModele.cpp. References ExManager::Consol, Guard, Load(), Load3DS(), LoadASC(), LoadASE(), LoadMD2(), LoadMD3(), and LoadOBJ().
00162 { 00163 Guard(ExNihilo::ExId ExManagerModel::Load(std::string FileName,std::string ObjectName)) 00164 FileName="../Data/Modeles/"+FileName; 00165 try 00166 { 00167 if(FileName.find(".md2")==(FileName.length()-4)) 00168 return LoadMD2(FileName,ObjectName); 00169 if(FileName.find(".md3")==(FileName.length()-4)) 00170 return LoadMD3(FileName); 00171 if(FileName.find(".asc")==(FileName.length()-4)) 00172 return LoadASC(FileName); 00173 if(FileName.find(".ase")==(FileName.length()-4)) 00174 return LoadASE(FileName); 00175 if(FileName.find(".3ds")==(FileName.length()-4)) 00176 return Load3DS(FileName,ObjectName); 00177 if(FileName.find(".obj")==(FileName.length()-4)) 00178 return LoadOBJ(FileName); 00179 } 00180 catch(ExCExpFileNotFound) 00181 { 00182 *Consol<<"ExManagerModel::ExCeption =>"<<FileName<<" File not found"<<std::endl; 00183 } 00184 catch(ExCExpFileReadError) 00185 { 00186 *Consol<<"ExManagerModel::ExCeption =>"<<FileName<<" Read file error"<<std::endl; 00187 } 00188 catch(...) 00189 { 00190 *Consol<<"ExManagerModel::ExCeption =>"<<FileName<<" Unknow exception"<<std::endl; 00191 } 00192 return -1; 00193 UnGuard 00194 } |
|
Reimplemented from ExManagerObject< ExCModel * >. Definition at line 126 of file ExManagerModele.cpp. References ExManager::Consol, Guard, Load(), Load3DS(), LoadASC(), LoadASE(), LoadMD2(), LoadMD3(), and LoadOBJ(). Referenced by InputAction(), ExManagerCommand::InputAction(), Load(), and ExManagerCommand::LoadSetOfFile().
00127 { 00128 Guard(ExNihilo::ExId ExManagerModel::Load(std::string FileName)) 00129 FileName="../Data/Modeles/"+FileName; 00130 try 00131 { 00132 if(FileName.find(".md2")==(FileName.length()-4)) 00133 return LoadMD2(FileName); 00134 if(FileName.find(".md3")==(FileName.length()-4)) 00135 return LoadMD3(FileName); 00136 if(FileName.find(".asc")==(FileName.length()-4)) 00137 return LoadASC(FileName); 00138 if(FileName.find(".ase")==(FileName.length()-4)) 00139 return LoadASE(FileName); 00140 if(FileName.find(".3ds")==(FileName.length()-4)) 00141 return Load3DS(FileName); 00142 if(FileName.find(".obj")==(FileName.length()-4)) 00143 return LoadOBJ(FileName); 00144 } 00145 catch(ExCExpFileNotFound) 00146 { 00147 *Consol<<"ExManagerModel::ExCeption =>"<<FileName<<" File not found"<<std::endl; 00148 } 00149 catch(ExCExpFileReadError) 00150 { 00151 *Consol<<"ExManagerModel::ExCeption =>"<<FileName<<" Read file error"<<std::endl; 00152 } 00153 catch(...) 00154 { 00155 *Consol<<"ExManagerModel::ExCeption =>"<<FileName<<" Unknow exception"<<std::endl; 00156 } 00157 return -1; 00158 UnGuard 00159 } |
|
Definition at line 235 of file ExManagerModele.cpp. References ExManagerObject::Add(), Guard, ExCModel3DS::Load(), Load3DS(), m_Vec3DS, ManagerTexture, ExCModel::SetManagerTexture(), and ExCObject::SetName().
00236 { 00237 Guard(ExNihilo::ExId ExManagerModel::Load3DS(std::string FileName,std::string ObjectName)) 00238 ExCModel3DS Model3DS; 00239 Model3DS.SetManagerTexture(ManagerTexture); 00240 Model3DS.Load(FileName); 00241 Model3DS.SetName(ObjectName); 00242 m_Vec3DS.push_back(Model3DS); 00243 ExManagerObject<ExCModel *>::Add(&m_Vec3DS.at(m_Vec3DS.size()-1)); 00244 return m_Vec3DS.at(m_Vec3DS.size()-1).GetId(); 00245 UnGuard 00246 } |
|
Definition at line 222 of file ExManagerModele.cpp. References ExManagerObject::Add(), Guard, ExCModel3DS::Load(), Load3DS(), m_Vec3DS, ManagerTexture, and ExCModel::SetManagerTexture(). Referenced by Load(), and Load3DS().
00223 { 00224 Guard(ExNihilo::ExId ExManagerModel::Load3DS(std::string FileName)) 00225 ExCModel3DS Model3DS; 00226 Model3DS.SetManagerTexture(ManagerTexture); 00227 Model3DS.Load(FileName); 00228 m_Vec3DS.push_back(Model3DS); 00229 ExManagerObject<ExCModel *>::Add(&m_Vec3DS.at(m_Vec3DS.size()-1)); 00230 return m_Vec3DS.at(m_Vec3DS.size()-1).GetId(); 00231 00232 UnGuard 00233 } |
|
|
|
Definition at line 255 of file ExManagerModele.cpp. References ExManagerObject::Add(), Guard, LoadASC(), ExCModelASC::LoadFile(), m_VecASC, ManagerTexture, and ExCModel::SetManagerTexture(). Referenced by Load(), and LoadASC().
00256 { 00257 Guard(ExNihilo::ExId ExManagerModel::LoadASC(std::string FileName)) 00258 ExCModelASC ModelASC; 00259 ModelASC.LoadFile(FileName); 00260 ModelASC.SetManagerTexture(ManagerTexture); 00261 m_VecASC.push_back(ModelASC); 00262 ExManagerObject<ExCModel *>::Add(&m_VecASC.at(m_VecASC.size()-1)); 00263 return m_VecASC.at(m_VecASC.size()-1).GetId(); 00264 UnGuard 00265 } |
|
|
|
Definition at line 276 of file ExManagerModele.cpp. References Guard, and LoadASE(). Referenced by Load(), and LoadASE().
00277 { 00278 Guard(ExNihilo::ExId ExManagerModel::LoadASE(std::string FileName)) 00279 return -1; 00280 UnGuard 00281 } |
|
Definition at line 209 of file ExManagerModele.cpp. References ExManagerObject::Add(), Guard, ExCModelMD2::Load(), LoadMD2(), m_VecMD2, ManagerTexture, ExCModel::SetManagerTexture(), and ExCObject::SetName().
00210 { 00211 Guard(ExNihilo::ExId ExManagerModel::LoadMD2(std::string FileName,std::string ObjectName)) 00212 ExCModelMD2 ModelMD2B; 00213 ModelMD2B.SetManagerTexture(ManagerTexture); 00214 ModelMD2B.Load(FileName); 00215 ModelMD2B.SetName(ObjectName); 00216 m_VecMD2.push_back(ModelMD2B); 00217 ExManagerObject<ExCModel *>::Add(&m_VecMD2.at(m_VecMD2.size()-1)); 00218 return m_VecMD2.at(m_VecMD2.size()-1).GetId(); 00219 UnGuard 00220 } |
|
Definition at line 198 of file ExManagerModele.cpp. References ExManagerObject::Add(), Guard, ExCModelMD2::Load(), LoadMD2(), m_VecMD2, ManagerTexture, and ExCModel::SetManagerTexture(). Referenced by Load(), and LoadMD2().
00199 { 00200 Guard(ExNihilo::ExId ExManagerModel::LoadMD2(std::string FileName)) 00201 ExCModelMD2 ModelMD2B; 00202 ModelMD2B.SetManagerTexture(ManagerTexture); 00203 ModelMD2B.Load(FileName); 00204 m_VecMD2.push_back(ModelMD2B); 00205 return ExManagerObject<ExCModel *>::Add(&m_VecMD2.at(m_VecMD2.size()-1)); 00206 UnGuard 00207 } |
|
|
|
Definition at line 248 of file ExManagerModele.cpp. References Guard, and LoadMD3(). Referenced by Load(), and LoadMD3().
00249 { 00250 Guard(ExNihilo::ExId ExManagerModel::LoadMD3(std::string FileName)) 00251 return -1; 00252 UnGuard 00253 } |
|
|
|
Definition at line 269 of file ExManagerModele.cpp. References Guard, and LoadOBJ(). Referenced by Load(), and LoadOBJ().
00270 { 00271 Guard(ExNihilo::ExId ExManagerModel::LoadOBJ(std::string FileName)) 00272 return -1; 00273 UnGuard 00274 } |
|
Definition at line 426 of file ExManagerModele.cpp. References Guard, and NextFrame(). Referenced by NextFrame().
00427 { 00428 Guard(void ExManagerModel::NextFrame(void)) 00429 00430 UnGuard 00431 } |
|
Definition at line 432 of file ExManagerModele.cpp. References Guard, and PreviousFrame(). Referenced by PreviousFrame().
00433 { 00434 Guard(void ExManagerModel::PreviousFrame(void)) 00435 00436 UnGuard 00437 } |
|
Reimplemented from ExManagerObject< ExCModel * >. Definition at line 51 of file ExManagerModele.cpp. References Init(), m_Vec3DS, m_VecASC, m_VecMD2, m_VecMD3, m_VecOBJ, and ExManagerObject::Reset(). Referenced by ExManagerCommand::ProcesExCAction().
|
|
Definition at line 439 of file ExManagerModele.cpp. References Guard, and SetCurrentFrame(). Referenced by SetCurrentFrame().
00440 { 00441 Guard(void ExManagerModel::SetCurrentFrame(int frame)) 00442 00443 UnGuard 00444 } |
|
Definition at line 114 of file ExManagerModele.h. Referenced by SetManagerLink().
00115 {ManagerTexture = Texture;} |
|
Definition at line 115 of file ExManagerModele.h. References ManagerTexture. Referenced by SetManagerLink().
00115 {ManagerTexture = Texture;} |
|
Definition at line 24 of file ExManagerModele.cpp. Referenced by CreateSingleton(). |
|
Definition at line 25 of file ExManagerModele.cpp. Referenced by CreateSingleton(). |
|
Definition at line 81 of file ExManagerModele.h. Referenced by Draw(), GetObject(), List(), Load3DS(), and Reset(). |
|
Definition at line 80 of file ExManagerModele.h. Referenced by Draw(), GetObject(), List(), LoadASC(), and Reset(). |
|
Definition at line 78 of file ExManagerModele.h. Referenced by Draw(), GetObject(), List(), LoadMD2(), and Reset(). |
|
Definition at line 79 of file ExManagerModele.h. Referenced by Draw(), GetObject(), List(), and Reset(). |
|
Definition at line 82 of file ExManagerModele.h. Referenced by Draw(), GetObject(), List(), and Reset(). |
|
Definition at line 76 of file ExManagerModele.h. |
|
Definition at line 77 of file ExManagerModele.h. |