#include <ExManagerEntite.h>
|
Definition at line 26 of file ExManagerEntite.cpp. References ExManagerEntite(), Guard, m_CurrentEntite, m_VecComposed, m_VecEntite, m_VecPObject, and m_VecSkeleton. Referenced by ExManagerEntite(), and ~ExManagerEntite().
00027 { 00028 Guard(ExManagerEntite::ExManagerEntite(void)) 00029 m_VecPObject = new std::vector<ExCEntite *>; 00030 m_VecEntite = new std::vector<ExCEntite>; 00031 m_VecComposed = new std::vector<ExCComposed>; 00032 m_VecSkeleton = new std::vector<ExSkeleton>; 00033 m_CurrentEntite=-1; 00034 UnGuard 00035 } |
|
Definition at line 38 of file ExManagerEntite.cpp. References ExManagerEntite(), and Guard.
00039 { 00040 Guard(ExManagerEntite::~ExManagerEntite(void)) 00041 UnGuard 00042 } |
|
|
|
Definition at line 182 of file ExManagerEntite.cpp. References Add(), CreateVecPobject(), ExCObject::GetId(), Guard, m_CurrentEntite, m_VecComposed, ManagerId, ManagerTexture, ExManagerId::RecordObject(), ExCObject3D::SetCurrentState(), and ExCComposed::SetManagerTexture().
00183 { 00184 Guard(ExNihilo::ExId ExManagerEntite::Add(ExCComposed Object)) 00185 ManagerId->RecordObject(Object); 00186 Object.SetManagerTexture(ManagerTexture); 00187 Object.SetCurrentState(true); 00188 m_VecComposed->push_back(Object); 00189 m_CurrentEntite=Object.GetId(); 00190 CreateVecPobject(); 00191 return m_CurrentEntite; 00192 UnGuard 00193 } |
|
Definition at line 169 of file ExManagerEntite.cpp. References Add(), CreateVecPobject(), ExCObject::GetId(), Guard, m_CurrentEntite, m_VecEntite, ManagerId, ManagerTexture, ExManagerId::RecordObject(), ExCObject3D::SetCurrentState(), and ExCEntite::SetManagerTexture(). Referenced by Add(), and LoadAsc().
00170 { 00171 Guard(ExNihilo::ExId ExManagerEntite::Add(ExCEntite Object)) 00172 ManagerId->RecordObject(Object); 00173 Object.SetManagerTexture(ManagerTexture); 00174 Object.SetCurrentState(true); 00175 m_VecEntite->push_back(Object); 00176 m_CurrentEntite=Object.GetId(); 00177 CreateVecPobject(); 00178 return m_CurrentEntite; 00179 UnGuard 00180 } |
|
Definition at line 195 of file ExManagerEntite.cpp. References Consol, m_ItVecComposed, m_ItVecEntite, m_VecComposed, m_VecEntite, and m_VecPObject. Referenced by Add().
00196 { 00197 m_VecPObject->clear(); 00198 00199 int i=0; 00200 for(m_ItVecEntite=m_VecEntite->begin();m_ItVecEntite!=m_VecEntite->end();m_ItVecEntite++,i++) 00201 { 00202 m_VecPObject->push_back(&m_VecEntite->at(i)); 00203 } 00204 i=0; 00205 for(m_ItVecComposed=m_VecComposed->begin();m_ItVecComposed!=m_VecComposed->end();m_ItVecComposed++,i++) 00206 { 00207 m_VecPObject->push_back(&m_VecComposed->at(i)); 00208 } 00209 *Consol<<"Nuber of Entite :"<<m_VecPObject->size()<<std::endl; 00210 } |
|
Definition at line 231 of file ExManagerEntite.cpp. References Get(), Guard, m_ItVecPObject, and m_VecPObject.
00232 { 00233 Guard(ExCEntite * ExManagerEntite::Get(ExNihilo::ExId Id)) 00234 int i=0; 00235 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00236 { 00237 if(m_VecPObject->at(i)->GetId()==Id) 00238 { 00239 return m_VecPObject->at(i); 00240 } 00241 } 00242 return NULL; 00243 UnGuard 00244 } |
|
Definition at line 215 of file ExManagerEntite.cpp. References Get(), Guard, m_ItVecPObject, and m_VecPObject. Referenced by Get(), and NewObject().
00216 { 00217 Guard(ExCEntite * ExManagerEntite::Get(char * Name)) 00218 int i=0; 00219 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00220 { 00221 if(m_VecPObject->at(i)->GetName()==Name) 00222 { 00223 return m_VecPObject->at(i); 00224 } 00225 } 00226 return NULL; 00227 UnGuard 00228 } |
|
Definition at line 269 of file ExManagerEntite.cpp. References GetCurrentEntite(), Guard, m_CurrentEntite, m_ItVecPObject, and m_VecPObject. Referenced by GetCurrentEntite().
00270 { 00271 Guard(ExCEntite * ExManagerEntite::GetCurrentEntite(void)) 00272 int i=0; 00273 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00274 { 00275 if(m_VecPObject->at(i)->GetId()==m_CurrentEntite) 00276 { 00277 return m_VecPObject->at(i); 00278 } 00279 } 00280 UnGuard 00281 return NULL; 00282 } |
|
Definition at line 131 of file ExManagerEntite.h. References m_VecPObject.
00132 {return m_VecPObject->size();} |
|
Definition at line 142 of file ExManagerEntite.cpp.
00143 { 00144 Guard(bool ExManagerEntite::Init(char * FileName)) 00145 //openf file and load object 00146 return true; 00147 UnGuard 00148 } |
|
Definition at line 103 of file ExManagerEntite.cpp. References Guard, Init(), and RecordToManagerPVS(). Referenced by Init().
00104 { 00105 Guard(void ExManagerEntite::Init(void)) 00106 RecordToManagerPVS(); 00107 UnGuard 00108 } |
|
Definition at line 84 of file ExManagerEntite.cpp. References Consol, Guard, ListEntite(), m_CurrentEntite, m_ItVecPObject, and m_VecPObject. Referenced by ListEntite().
00085 { 00086 Guard(void ExManagerEntite::ListEntite(void)) 00087 int i=0; 00088 *Consol<<"**********************"<<std::endl; 00089 *Consol<<"*List of all entites *"<<std::endl; 00090 *Consol<<"**********************"<<std::endl; 00091 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00092 { 00093 *Consol<<"Object ID:"<<m_VecPObject->at(i)->GetId()<<" Name:"<<m_VecPObject->at(i)->GetName(); 00094 *Consol<<" Postion X:"<<m_VecPObject->at(i)->GetPosition().GetX()<<" Y:"<<m_VecPObject->at(i)->GetPosition().GetY(); 00095 *Consol<<" Z:"<<m_VecPObject->at(i)->GetPosition().GetZ()<<std::endl; 00096 } 00097 *Consol<<"**********************"<<std::endl; 00098 *Consol<<"Current Entite Id :"<<m_CurrentEntite<<std::endl; 00099 *Consol<<"**********************"<<std::endl; 00100 UnGuard 00101 } |
|
Definition at line 111 of file ExManagerEntite.cpp. References Add(), Consol, Guard, ExCComposed::LoadAsc(), LoadAsc(), ManagerTexture, PREFIX, and ExCComposed::SetManagerTexture(). Referenced by LoadAsc().
00112 { 00113 Guard(void ExManagerEntite::LoadAsc(const char *FileName)) 00114 char *Buffer; 00115 ExCComposed Entite; 00116 Entite.SetManagerTexture(ManagerTexture); 00117 Buffer= new char[strlen(FileName)+40]; 00118 #ifdef UNIX_SRC 00119 sprintf(Buffer, PREFIX "/ExNihilo/Data/Modeles/%s",FileName); 00120 #else 00121 sprintf(Buffer, "../Data/Modeles/%s",FileName); 00122 #endif 00123 if(Entite.LoadAsc(Buffer)) 00124 { 00125 Add(Entite); 00126 }else 00127 { 00128 *Consol<<"File not found"<<std::endl; 00129 } 00130 UnGuard 00131 } |
|
Definition at line 45 of file ExManagerEntite.cpp. References Consol, Guard, and LoadModel(). Referenced by LoadModel().
00046 { 00047 Guard(bool ExManagerEntite::LoadModel(const char *FileName)) 00048 std::string SFileName(FileName); 00049 //cheking file extension to know model type 00050 if(SFileName.find(".md2")==(SFileName.length()-4)) 00051 { 00052 } 00053 if(SFileName.find(".md3")==(SFileName.length()-4)) 00054 { 00055 } 00056 if(SFileName.find(".asc")==(SFileName.length()-4)) 00057 { 00058 } 00059 if(SFileName.find(".ase")==(SFileName.length()-4)) 00060 { 00061 } 00062 if(SFileName.find(".3ds")==(SFileName.length()-4)) 00063 { 00064 } 00065 if(SFileName.find(".obj")==(SFileName.length()-4)) 00066 { 00067 } 00068 *Consol<<SFileName.data()<<std::endl; 00069 return true; 00070 UnGuard 00071 } |
|
Definition at line 133 of file ExManagerEntite.cpp. References m_ItVecPObject, and m_VecPObject.
00134 { 00135 int i=0; 00136 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00137 { 00138 m_VecPObject->at(i)->MakeList(); 00139 } 00140 } |
|
Definition at line 151 of file ExManagerEntite.cpp. References Get(), ExCObject::GetId(), Guard, m_CurrentEntite, m_VecEntite, m_VecPObject, ManagerId, ManagerTexture, NewObject(), ExManagerId::RecordObject(), ExCObject3D::SetCurrentState(), and ExCEntite::SetManagerTexture(). Referenced by NewObject().
00152 { 00153 Guard(ExNihilo::ExId ExManagerEntite::NewObject(void)) 00154 char *Name; 00155 ExCEntite Entite1; 00156 Name= new char[strlen("ENTITE ")+3]; 00157 sprintf(Name,"ENTITE %d",m_VecEntite->size()+1); 00158 ManagerId->RecordObject(Entite1); 00159 Entite1.SetManagerTexture(ManagerTexture); 00160 Entite1.SetCurrentState(true); 00161 m_VecEntite->push_back(Entite1); 00162 m_VecPObject->push_back(&m_VecEntite->at(m_VecEntite->size()-1)); 00163 Get(m_CurrentEntite)->SetCurrentState(false); 00164 m_CurrentEntite=Entite1.GetId(); 00165 return m_CurrentEntite; 00166 UnGuard 00167 } |
|
Definition at line 284 of file ExManagerEntite.cpp. References Consol, Guard, m_CurrentEntite, m_ItVecPObject, m_VecPObject, and NextEntite(). Referenced by NextEntite().
00285 { 00286 Guard(void ExManagerEntite::NextEntite(void)) 00287 int i=0; 00288 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00289 { 00290 m_VecPObject->at(i)->SetCurrentState(false); 00291 } 00292 i=0; 00293 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00294 { 00295 if(m_VecPObject->at(i)->GetId()==m_CurrentEntite) 00296 { 00297 m_ItVecPObject++; 00298 if(m_ItVecPObject==m_VecPObject->end())//this is the last 00299 { 00300 m_ItVecPObject=m_VecPObject->begin(); 00301 m_CurrentEntite=m_VecPObject->at(0)->GetId(); 00302 m_VecPObject->at(0)->SetCurrentState(true); 00303 break; 00304 }else 00305 { 00306 m_CurrentEntite=m_VecPObject->at(i+1)->GetId(); 00307 m_VecPObject->at(i+1)->SetCurrentState(true); 00308 break; 00309 } 00310 m_ItVecPObject--; 00311 } 00312 } 00313 *Consol<<"Current Entite :"<<m_CurrentEntite<<std::endl; 00314 UnGuard 00315 } |
|
Definition at line 317 of file ExManagerEntite.cpp. References Consol, Guard, m_CurrentEntite, m_ItVecPObject, m_VecPObject, and PrevEntite(). Referenced by PrevEntite().
00318 { 00319 Guard(void ExManagerEntite::PrevEntite(void)) 00320 int i=0; 00321 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00322 { 00323 m_VecPObject->at(i)->SetCurrentState(false); 00324 } 00325 i=0; 00326 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00327 { 00328 if(m_VecPObject->at(i)->GetId()==m_CurrentEntite) 00329 { 00330 if(m_ItVecPObject==m_VecPObject->begin()) 00331 { 00332 m_ItVecPObject=m_VecPObject->end()-1; 00333 }else 00334 { 00335 m_ItVecPObject--; 00336 } 00337 m_CurrentEntite=m_VecPObject->at(i)->GetId(); 00338 m_VecPObject->at(i)->SetCurrentState(true); 00339 } 00340 } 00341 *Consol<<"Current Entite :"<<m_CurrentEntite<<std::endl; 00342 UnGuard 00343 } |
|
Definition at line 133 of file ExManagerEntite.h. References m_VecPObject. Referenced by Init(), and Reset().
00134 {ManagerPVS->SetVecEntite(m_VecPObject);} |
|
Definition at line 250 of file ExManagerEntite.cpp. References Guard, m_ItVecPObject, m_VecPObject, and Remove(). Referenced by Remove().
00251 { 00252 Guard(bool ExManagerEntite::Remove(ExNihilo::ExId Id)) 00253 int i=0; 00254 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00255 { 00256 if(m_VecPObject->at(i)->GetId()==Id) 00257 { 00258 00259 //m_VecPObject->at(i)->erase(m_ItVecEntite); 00260 00261 return true; 00262 } 00263 } 00264 return false; 00265 UnGuard 00266 } |
|
Definition at line 73 of file ExManagerEntite.cpp. References Guard, m_VecComposed, m_VecEntite, m_VecPObject, m_VecSkeleton, RecordToManagerPVS(), and Reset(). Referenced by Reset().
00074 { 00075 Guard(void ExManagerEntite::Reset(void)) 00076 m_VecPObject->clear(); 00077 m_VecEntite->clear(); 00078 m_VecComposed->clear(); 00079 m_VecSkeleton->clear(); 00080 RecordToManagerPVS(); 00081 UnGuard 00082 } |
|
Definition at line 345 of file ExManagerEntite.cpp. References Consol, Guard, m_CurrentEntite, m_ItVecPObject, m_VecPObject, and SetCurrentEntite(). Referenced by SetCurrentEntite().
00346 { 00347 Guard(void ExManagerEntite::SetCurrentEntite(ExNihilo::ExId Id)) 00348 //checking if id exist before !!! 00349 int i=0; 00350 for(m_ItVecPObject=m_VecPObject->begin();m_ItVecPObject!=m_VecPObject->end();m_ItVecPObject++,i++) 00351 { 00352 if(m_VecPObject->at(i)->GetId()==Id) 00353 { 00354 m_CurrentEntite=Id; 00355 *Consol<<"Current Entite :"<<m_CurrentEntite<<std::endl; 00356 return true; 00357 } 00358 } 00359 *Consol<<"MESSAGE FROM MANAGER ENTITE :: Entite Id :"<<Id<<"not found"<<std::endl; 00360 return false; 00361 UnGuard 00362 } |
|
Definition at line 364 of file ExManagerEntite.cpp. References Guard, and SetCurrentEntiteName(). Referenced by SetCurrentEntiteName().
00365 { 00366 Guard(void ExManagerEntite::SetCurrentEntiteName(const char *Name)) 00367 /* if(ManagerId->isNameAviable((char *)Name) ) 00368 { 00369 ManagerId->RemoveIdName((char *)Name); 00370 if(ManagerId->RecordIdName(GetCurrentEntite()->GetId(),(char *)Name)) 00371 { 00372 GetCurrentEntite()->SetName(Name); 00373 *Consol<<"MESSAGE FROM MANAGER ENTITE ::Name changed for Entite Id :"<<GetCurrentEntite()->GetId()<<" new name:"<<GetCurrentEntite()->GetName()<<std::endl; 00374 return true; 00375 } 00376 } 00377 *Consol<<"MESSAGE FROM MANAGER ENTITE ::Name already take by Entite Id :"<<ManagerId->GetObjectIdByName((char *)Name)<<std::endl;*/ 00378 return false; 00379 UnGuard 00380 } |
|
Definition at line 102 of file ExManagerEntite.h.
00102 {ManagerPVS = PVS;} |
|
Definition at line 103 of file ExManagerEntite.h. References ManagerCollision.
00103 {ManagerCollision = Collision;} |
|
Definition at line 101 of file ExManagerEntite.h. References ManagerTexture.
00101 {ManagerTexture = Texture;} |
|
Definition at line 100 of file ExManagerEntite.h.
00101 {ManagerTexture = Texture;} |
|
Definition at line 98 of file ExManagerEntite.h. Referenced by CreateVecPobject(), ListEntite(), LoadAsc(), LoadModel(), NextEntite(), PrevEntite(), and SetCurrentEntite(). |
|
Definition at line 86 of file ExManagerEntite.h. Referenced by Add(), ExManagerEntite(), GetCurrentEntite(), ListEntite(), NewObject(), NextEntite(), PrevEntite(), and SetCurrentEntite(). |
|
Definition at line 81 of file ExManagerEntite.h. Referenced by CreateVecPobject(). |
|
Definition at line 78 of file ExManagerEntite.h. Referenced by CreateVecPobject(). |
|
Definition at line 70 of file ExManagerEntite.h. |
|
Definition at line 68 of file ExManagerEntite.h. |
|
Definition at line 66 of file ExManagerEntite.h. |
|
Definition at line 62 of file ExManagerEntite.h. |
|
Definition at line 64 of file ExManagerEntite.h. |
|
Definition at line 72 of file ExManagerEntite.h. |
|
Definition at line 60 of file ExManagerEntite.h. |
|
Definition at line 75 of file ExManagerEntite.h. Referenced by Get(), GetCurrentEntite(), ListEntite(), MakeGlListForAll(), NextEntite(), PrevEntite(), Remove(), and SetCurrentEntite(). |
|
Definition at line 84 of file ExManagerEntite.h. |
|
Definition at line 80 of file ExManagerEntite.h. Referenced by Add(), CreateVecPobject(), ExManagerEntite(), and Reset(). |
|
Definition at line 77 of file ExManagerEntite.h. Referenced by Add(), CreateVecPobject(), ExManagerEntite(), NewObject(), and Reset(). |
|
Definition at line 69 of file ExManagerEntite.h. |
|
Definition at line 67 of file ExManagerEntite.h. |
|
Definition at line 65 of file ExManagerEntite.h. |
|
Definition at line 61 of file ExManagerEntite.h. |
|
Definition at line 63 of file ExManagerEntite.h. |
|
Definition at line 71 of file ExManagerEntite.h. |
|
Definition at line 59 of file ExManagerEntite.h. |
|
Definition at line 74 of file ExManagerEntite.h. Referenced by CreateVecPobject(), ExManagerEntite(), Get(), GetCurrentEntite(), GetNumberEntite(), ListEntite(), MakeGlListForAll(), NewObject(), NextEntite(), PrevEntite(), RecordToManagerPVS(), Remove(), Reset(), and SetCurrentEntite(). |
|
Definition at line 83 of file ExManagerEntite.h. Referenced by ExManagerEntite(), and Reset(). |
|
Definition at line 56 of file ExManagerEntite.h. |
|
Definition at line 57 of file ExManagerEntite.h. Referenced by Add(), and NewObject(). |
|
Definition at line 55 of file ExManagerEntite.h. |
|
Definition at line 54 of file ExManagerEntite.h. Referenced by Add(), LoadAsc(), and NewObject(). |