void EBox::SetVerticalPolicy(VerticalPolicy policy) { if (policy == _vPolicy) return; _vPolicy = policy; UpdateChild(); }
void EBox::SetHorisontalPolicy(HorisontalPolicy policy) { if (policy == _hPolicy) return; _hPolicy = policy; UpdateChild(); }
void EBox::SetWidth(float width) { _wHint = width; _w = GetMinWidth(); _h = GetMinHeight(); if (IsCentered()) SetBoxCenter(_center); UpdateChild(); }
void EBox::SetHeight(float height) { _hHint = height; _h = GetMinHeight(); _w = GetMinWidth(); if (IsCentered()) SetBoxCenter(_center); UpdateChild(); }
void EBox::SetMargin(float left, float right, float up, float down) { _marginLeft = left; _marginRight = right; _marginUp = up; _marginDown = down; SetMinWidth(); SetMinHeight(); UpdateGeometry(); UpdateChild(); }
void EBox::AddChild(EBox *child) { if (IsChild(child) || child == NULL || child == this) return; _vChilds.push_back(child); child->SetParent(this); if (child->_sizePolicy == MAXIMIZE) _nNumMaximizeChild++; UpdateGeometry(); UpdateChild(); }
void CTxMemPool::UpdateAncestorsOf(bool add, txiter it, setEntries &setAncestors) { setEntries parentIters = GetMemPoolParents(it); // add or remove this tx as a child of each parent for (txiter piter : parentIters) { UpdateChild(piter, it, add); } const int64_t updateCount = (add ? 1 : -1); const int64_t updateSize = updateCount * it->GetTxSize(); const CAmount updateFee = updateCount * it->GetModifiedFee(); for (txiter ancestorIt : setAncestors) { mapTx.modify(ancestorIt, update_descendant_state(updateSize, updateFee, updateCount)); } }
void CamFree::VectorsFromAngles() { static const Vector3D up(0,1,0); if (angle_horizontal > 30) angle_horizontal = 30; else if (angle_horizontal < -30) angle_horizontal = -30; double r_temp = cos(angle_vertical*M_PI/180); forward.Z = sin(angle_vertical*M_PI/180); forward.X = r_temp*cos(angle_horizontal*M_PI/180); forward.Y = r_temp*sin(angle_horizontal*M_PI/180); left = up.crossProduct(forward); left.normalize(); UpdateChild(); }
// vHashesToUpdate is the set of transaction hashes from a disconnected block // which has been re-added to the mempool. // for each entry, look for descendants that are outside vHashesToUpdate, and // add fee/size information for such descendants to the parent. // for each such descendant, also update the ancestor state to include the parent. void CTxMemPool::UpdateTransactionsFromBlock(const std::vector<uint256> &vHashesToUpdate) { LOCK(cs); // For each entry in vHashesToUpdate, store the set of in-mempool, but not // in-vHashesToUpdate transactions, so that we don't have to recalculate // descendants when we come across a previously seen entry. cacheMap mapMemPoolDescendantsToUpdate; // Use a set for lookups into vHashesToUpdate (these entries are already // accounted for in the state of their ancestors) std::set<uint256> setAlreadyIncluded(vHashesToUpdate.begin(), vHashesToUpdate.end()); // Iterate in reverse, so that whenever we are looking at a transaction // we are sure that all in-mempool descendants have already been processed. // This maximizes the benefit of the descendant cache and guarantees that // setMemPoolChildren will be updated, an assumption made in // UpdateForDescendants. for (const uint256 &hash : reverse_iterate(vHashesToUpdate)) { // we cache the in-mempool children to avoid duplicate updates setEntries setChildren; // calculate children from mapNextTx txiter it = mapTx.find(hash); if (it == mapTx.end()) { continue; } auto iter = mapNextTx.lower_bound(COutPoint(hash, 0)); // First calculate the children, and update setMemPoolChildren to // include them, and update their setMemPoolParents to include this tx. for (; iter != mapNextTx.end() && iter->first->hash == hash; ++iter) { const uint256 &childHash = iter->second->GetHash(); txiter childIter = mapTx.find(childHash); assert(childIter != mapTx.end()); // We can skip updating entries we've encountered before or that // are in the block (which are already accounted for). if (setChildren.insert(childIter).second && !setAlreadyIncluded.count(childHash)) { UpdateChild(it, childIter, true); UpdateParent(childIter, it, true); } } UpdateForDescendants(it, mapMemPoolDescendantsToUpdate, setAlreadyIncluded); } }
void CAnimatedDecorator::Update(float deltaTime) { // Вычисляем фазу анимации по времени на отрезке [0..1]. m_animationPhase += (deltaTime / ANIMATION_STEP_SECONDS); if (m_animationPhase >= 1) { m_animationPhase = 0; switch (m_animation) { case Rotating: m_animation = Pulse; break; case Pulse: m_animation = Bounce; break; case Bounce: m_animation = Rotating; break; } } UpdateChild(deltaTime); }
void EBox::RemoveChild(EBox *child) { if (!IsChild(child) || child == NULL || child == this) return; if (child->_sizePolicy == MAXIMIZE) _nNumMaximizeChild--; EBox *tmp; for (int i=0; i < _vChilds.size(); i++) { if (_vChilds[i] == child) { tmp = _vChilds[i]; for (int j=i+1; j < _vChilds.size(); j++) { _vChilds[j-1] = _vChilds[j]; } _vChilds.pop_back(); if (tmp->GetParent() == this) tmp->SetParent(NULL); break; } } UpdateGeometry(); UpdateChild(); };
void Alignment::HandleAlignmentChange( const sf::Vector2f& /*old_alignment*/ ) { UpdateChild(); }
void Alignment::HandleAllocationChange( const sf::FloatRect& /*old_allocation*/ ) { UpdateChild(); }
void CamFree::Gauche() { position +=left*keyboard_sensibilite; UpdateChild(); }
void CamFree::Reculer() { position -= forward*keyboard_sensibilite; UpdateChild(); }
void EBox::UpdateUI() { UpdateGeometry(); UpdateChild(); }
void CamFree::Avancer() { position += forward*keyboard_sensibilite; UpdateChild(); }
void CTransformDecorator::Update(float deltaTime) { UpdateChild(deltaTime); }
void CamFree::Droite() { position -=left*keyboard_sensibilite; UpdateChild(); }
void Alignment::SetScale( const sf::Vector2f& scale ) { m_scale = scale; UpdateChild(); }
void CUIBase::Update(float fDeltaTime, ULONG ElapsedTime) { OnUpdate(fDeltaTime, ElapsedTime); UpdateChild(fDeltaTime, ElapsedTime); }
void Alignment::HandleSizeChange() { UpdateChild(); }