bool nuiSimpleContainer::Load(const nuiXMLNode* pNode) { bool res=true; res &= LoadAttributes(pNode); res &= LoadChildren(pNode); return res; }
QModelIndex model::DbContainerModel::AddElement(dbc::ElementType type, const QString& name, const QModelIndex& parent) { assert(!name.isEmpty() && type != dbc::ElementTypeUnknown && parent.isValid()); if (name.isEmpty() || type == dbc::ElementTypeUnknown || !parent.isValid()) { return QModelIndex(); } TreeNode* parentNode = Index2Node(parent); dbc::Folder* folder = parentNode->GetElement()->AsFolder(); assert(folder != nullptr); if (folder == nullptr) { return QModelIndex(); } LoadChildren(parent); dbc::ElementGuard element = folder->CreateChild(utils::QString2StdString(name), type); DBC_MODEL_TRY(tr("Element adding")); int insertedRow = parentNode->GetChildrenCount(); beginInsertRows(parent, insertedRow, insertedRow); TreeNode* insertedNode = parentNode->AddChild(element); assert(insertedRow + 1 == parentNode->GetChildrenCount()); endInsertRows(); return createIndex(insertedRow, 0, insertedNode); DBC_MODEL_CATCH; element->Remove(); return QModelIndex(); }
void LoadChildren(ccMaxNodeContainer& container, INode* node) { container.push_back(node); int number = node->NumberOfChildren(); for(int i = 0; i <number; i++) { INode* child = node->GetChildNode(i); LoadChildren(container, child); } }
void wxGxDiscConnection::Refresh(void) { #ifdef __WXGTK__ m_pWatcher->RemoveAll(); #endif DestroyChildren(); m_bIsChildrenLoaded = false; LoadChildren(); wxGIS_GXCATALOG_EVENT(ObjectRefreshed); }
void CContainerChunk::Read(Framework::CStream& inputStream) { CBaseChunk::Read(inputStream); m_childrenCount = inputStream.Read32_MSBF(); m_unknown1 = inputStream.Read32_MSBF(); m_unknown2 = inputStream.Read32_MSBF(); m_unknown3 = inputStream.Read32_MSBF(); LoadChildren(inputStream); }
BOOL CDuiListBox::Load(pugi::xml_node xmlNode) { __super::Load(xmlNode); CDuiStringT strChildSrc = DUI_CA2T(xmlNode.attribute("itemsrc").value(),CP_UTF8); if (strChildSrc.IsEmpty()) return TRUE; pugi::xml_document xmlDoc; if(!DuiSystem::getSingleton().LoadXmlDocment(xmlDoc,strChildSrc,DUIRES_XML_TYPE)) return FALSE; return LoadChildren(xmlDoc.first_child()); }
inline void LocalServiceLocatorDataStore::Delete( const DirectoryEntry& entry) { std::vector<DirectoryEntry> children = LoadChildren(entry); if(!children.empty()) { BOOST_THROW_EXCEPTION(ServiceLocatorDataStoreException( "Directory entry is not empty.")); } auto permissionsIterator = m_permissions.begin(); while(permissionsIterator != m_permissions.end()) { const auto& permissionsPair = permissionsIterator->first; if(boost::get<0>(permissionsPair) == entry || boost::get<1>(permissionsPair) == entry) { permissionsIterator = m_permissions.erase(permissionsIterator); } else { ++permissionsIterator; } } auto parentsIterator = m_parents.find(entry); if(parentsIterator != m_parents.end()) { std::vector<DirectoryEntry> parents = parentsIterator->second; for(const DirectoryEntry& parent : parents) { Detach(entry, parent); } m_parents.erase(parentsIterator); } if(entry.m_type == DirectoryEntry::Type::ACCOUNT) { for(auto i = m_accounts.begin(); i != m_accounts.end(); ++i) { if(*i == entry) { m_accounts.erase(i); m_passwords.erase(entry); break; } } } else { for(auto i = m_directories.begin(); i != m_directories.end(); ++i) { if(*i == entry) { m_directories.erase(i); break; } } } }
void Camera::Load(const pugi::xml_node& node) { name_ = node.attribute("name").as_string(); Vertex3 position = ToVertex3(node.attribute("position").as_string()); SetPosition(position); fovy_ = node.attribute("fovy").as_float(); zNear_ = node.attribute("zNear").as_float(); zFar_ = node.attribute("zFar").as_float(); isOrtho_ = node.attribute("isOrtho").as_bool(); orthoScale_ = node.attribute("orthoScale").as_float(); sensorFit_ = (CameraSensorFit)node.attribute("sensorFit").as_int(); Quaternion orientation = ToQuaternion(node.attribute("orientation").as_string()); SetOrientation(orientation); LoadChildren(node); isDirty_ = true; SetUniformsNeedUpdate(); }
void CCameraSceneNode::Load( const CXMLNode& a_XMLNode ) { LoadCommonValues( a_XMLNode ); LoadChildren( a_XMLNode ); // Do own stuff m_Camera = new CCamera(); float FOV, screenHeight, screenWidth, aspectRatio, nearPlaneDist, farPlaneDist; CXMLAttribute attribute = a_XMLNode.GetAttribute( "Active" ); m_Active = (bool)atoi( attribute.GetValue( "0" ) ); attribute = a_XMLNode.GetAttribute( "FOV" ); FOV = (float)atof( attribute.GetValue( "60" ) ); attribute = a_XMLNode.GetAttribute( "ScrHeight" ); screenHeight = (float)atof( attribute.GetValue( "3" ) ); attribute = a_XMLNode.GetAttribute( "ScrWidth" ); screenWidth = (float)atof( attribute.GetValue( "4" ) ); attribute = a_XMLNode.GetAttribute( "Near" ); nearPlaneDist = (float)atof( attribute.GetValue( "0.1" ) ); attribute = a_XMLNode.GetAttribute( "Far" ); farPlaneDist = (float)atof( attribute.GetValue( "100.0" ) ); aspectRatio = screenWidth / screenHeight; printf( "Loaded camera %s, FOV %.1f, Aspect %.4f, Near %.5f, Far %.3f, Active %i\n", m_Name.c_str(), FOV, aspectRatio, nearPlaneDist, farPlaneDist, m_Active ); glm::mat4 perspectiveMatrix = glm::perspective( FOV, aspectRatio, nearPlaneDist, farPlaneDist ); perspectiveMatrix[1].y *= -1.0f; m_Camera->SetProjectionMatrix( perspectiveMatrix ); m_Camera->SetTransformationMatrix( m_WorldMatrix ); m_Camera->SetPosition( m_Position ); m_Camera->SetRotation( m_Rotation ); m_Camera->SetFarPlaneDistance( farPlaneDist ); m_Camera->SetNearPlaneDistance( nearPlaneDist ); }
void wxGxFolder::Refresh(void) { EmptyChildren(); LoadChildren(); }
// Instantiates the children that haven't been fully loaded yet. void ElementDataGridRow::LoadChildren(float time_slice) { float start_time = Core::GetSystemInterface()->GetElapsedTime(); int data_query_offset = -1; int data_query_limit = -1; // Iterate through the list of children and find the holes of unloaded // rows. // - If we find an unloaded element, and we haven't set the offset // (beginning of the hole), then we've hit a new hole. We set the offset // to the current index and the limit (size of the hole) to 1. If we've // found a hole already and we find an unloaded element, then we // increase the size of the hole. // - The end of a hole is either a loaded element or the end of the list. // In either case, we check if we have a hole that's unfilled, and if // so, we fill it. bool any_dirty_children = false; for (size_t i = 0; i < children.size() && (Core::GetSystemInterface()->GetElapsedTime() - start_time) < time_slice; i++) { if (children[i]->dirty_cells) { any_dirty_children = true; if (data_query_offset == -1) { data_query_offset = (int)i; data_query_limit = 1; } else { data_query_limit++; } } else if (children[i]->dirty_children) { any_dirty_children = true; } bool end_of_list = i == children.size() - 1; bool unfilled_hole = data_query_offset != -1; bool end_of_hole_found = !children[i]->dirty_cells; // If this is the last element and we've found no holes (or filled them // all in) then all our children are loaded. if (end_of_list && !unfilled_hole) { if (!any_dirty_children) { dirty_children = false; } } // Otherwise, if we have a hole outstanding and we've either hit the // end of the list or the end of the hole, fill the hole. else if (unfilled_hole && (end_of_list || end_of_hole_found)) { float load_time_slice = time_slice - (Core::GetSystemInterface()->GetElapsedTime() - start_time); LoadChildren(data_query_offset, data_query_limit, load_time_slice); data_query_offset = -1; data_query_limit = -1; } } if (children.empty()) { dirty_children = false; } }
bool wxGxOpenFileGDB::HasChildren(void) { LoadChildren(); return wxGxDatasetContainer::HasChildren(); }
void MxPhysXObjectRegsiter::loadMaxNodes() { clear(); INode* cur = GetCOREInterface()->GetRootNode(); LoadChildren(maxNodes, cur); }
void model::DbContainerModel::OnItemExpanded(const QModelIndex& index) { DBC_MODEL_TRY(tr("Loading children elements")); LoadChildren(index); DBC_MODEL_CATCH; }