void SceneTreeItemParticleInnerEmmiter::DoSync(QStandardItem *rootItem, DAVA::ParticleEmitter *emitter) { if(NULL != rootItem && NULL != emitter) { DAVA::Set<DAVA::ParticleLayer *> layerSet; size_t itemsCount = emitter->GetLayers().size(); for (size_t i=0; i<itemsCount; i++) { layerSet.insert(emitter->GetLayers()[i]); } for(int i = 0; i < rootItem->rowCount(); ++i) { DVASSERT(((SceneTreeItem*)rootItem->child(i))->ItemType() == SceneTreeItem::EIT_Layer); SceneTreeItemParticleLayer *childItem = (SceneTreeItemParticleLayer *) rootItem->child(i); DAVA::Set<DAVA::ParticleLayer *>::iterator it = layerSet.find(childItem->layer); if (it!=layerSet.end()) { layerSet.erase(it); childItem->DoSync(childItem, childItem->layer); } else { rootItem->removeRow(i); i--; } } for (DAVA::Set<DAVA::ParticleLayer *>::iterator it = layerSet.begin(), e=layerSet.end(); it!=e; ++it) { rootItem->appendRow(new SceneTreeItemParticleLayer(emitter, *it)); } } }
void SceneHelper::CollectDescriptors(DAVA::Set<DAVA::FilePath> &descriptors, const DAVA::FilePath &pathname) { if(pathname.GetType() == FilePath::PATH_EMPTY) return; DVASSERT(pathname.IsEqualToExtension(TextureDescriptor::GetDescriptorExtension())); if(!pathname.IsEmpty() && SceneValidator::Instance()->IsPathCorrectForProject(pathname)) { descriptors.insert(pathname); } }
void SceneUtils::PrepareDestination(DAVA::Set<DAVA::String> &errorLog) { DAVA::Set<DAVA::FilePath> folders; DAVA::Map<DAVA::FilePath, DAVA::FilePath>::const_iterator endMapIt = filesForCopy.end(); for(DAVA::Map<DAVA::FilePath, DAVA::FilePath>::const_iterator it = filesForCopy.begin(); it != endMapIt; ++it) { folders.insert(it->second.GetDirectory()); } DAVA::Set<DAVA::FilePath>::const_iterator endSetIt = folders.end(); for(DAVA::Set<DAVA::FilePath>::const_iterator it = folders.begin(); it != endSetIt; ++it) { if(!(*it).Exists()) { FileSystem::eCreateDirectoryResult retCreate = FileSystem::Instance()->CreateDirectory((*it), true); if(FileSystem::DIRECTORY_CANT_CREATE == retCreate) { errorLog.insert(String(Format("Can't create folder %s", (*it).GetAbsolutePathname().c_str()))); } } } }