123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- #include "Model3DList.h"
- #include "Model3D.h"
- #include "Text.h"
- using namespace Framework;
- const char* Standart3DTypes::cube = "f_würfel";
- const char* Standart3DTypes::texturModel = "f_texturModel";
- Model3DList::Model3DList()
- : ReferenceCounter()
- {
- models = new RCArray<Model3DData>();
- names = new RCArray<Text>();
- }
- Model3DList::~Model3DList()
- {
- models->release();
- names->release();
- }
- bool Model3DList::addModel(Model3DData* mdl, const char* name)
- {
- for (auto i : *names)
- {
- if (i->istGleich(name))
- {
- mdl->release();
- return 0;
- }
- }
- models->add(mdl);
- names->add(new Text(name));
- return 1;
- }
- void Model3DList::removeModel(const char* name)
- {
- int index = 0;
- for (auto i : *names)
- {
- if (i->istGleich(name))
- {
- names->remove(index);
- models->remove(index);
- return;
- }
- index++;
- }
- }
- bool Model3DList::hatModel(const char* name) const
- {
- for (auto i : *names)
- {
- if (i->istGleich(name))
- {
- return 1;
- }
- }
- return 0;
- }
- Model3DData* Model3DList::getModel(const char* name) const
- {
- int index = 0;
- for (auto i : *names)
- {
- if (i->istGleich(name))
- {
- return models->get(index);
- }
- index++;
- }
- return 0;
- }
- Model3DData* Model3DList::zModel(const char* name) const
- {
- int index = 0;
- for (auto i : *names)
- {
- if (i->istGleich(name))
- {
- return models->z(index);
- }
- index++;
- }
- return 0;
- }
- DLLEXPORT void Model3DList::removeAll()
- {
- models->leeren();
- names->leeren();
- }
|