Beispiel #1
0
void EBox::SetVerticalPolicy(VerticalPolicy policy) {
	if (policy == _vPolicy)
		return;

	_vPolicy = policy;
	UpdateChild();
}
Beispiel #2
0
void EBox::SetHorisontalPolicy(HorisontalPolicy policy) {
	if (policy == _hPolicy)
		return;

	_hPolicy = policy;

	UpdateChild();
}
Beispiel #3
0
void EBox::SetWidth(float width) {
	_wHint = width;
	_w = GetMinWidth();
	_h = GetMinHeight();

	if (IsCentered())
		SetBoxCenter(_center);
	UpdateChild();
}
Beispiel #4
0
void EBox::SetHeight(float height) {
	_hHint = height;
	_h = GetMinHeight();
	_w = GetMinWidth();

	if (IsCentered())
		SetBoxCenter(_center);
	UpdateChild();
}
Beispiel #5
0
void EBox::SetMargin(float left, float right, float up, float down) {
	_marginLeft = left;
	_marginRight = right;
	_marginUp = up;
	_marginDown = down;

	SetMinWidth();
	SetMinHeight();
	UpdateGeometry();
	UpdateChild();
}
Beispiel #6
0
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();
}
Beispiel #7
0
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));
    }
}
Beispiel #8
0
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();
}
Beispiel #9
0
// 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);
}
Beispiel #11
0
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();
};
Beispiel #12
0
void Alignment::HandleAlignmentChange( const sf::Vector2f& /*old_alignment*/ ) {
	UpdateChild();
}
Beispiel #13
0
void Alignment::HandleAllocationChange( const sf::FloatRect& /*old_allocation*/ ) {
	UpdateChild();
}
Beispiel #14
0
void CamFree::Gauche()
{
	position +=left*keyboard_sensibilite;
	UpdateChild();
}
Beispiel #15
0
void CamFree::Reculer()
{
	position -= forward*keyboard_sensibilite;
	UpdateChild();
}
Beispiel #16
0
void EBox::UpdateUI() {
	UpdateGeometry();
	UpdateChild();
}
Beispiel #17
0
void CamFree::Avancer()
{
	position += forward*keyboard_sensibilite;
	UpdateChild();
}
void CTransformDecorator::Update(float deltaTime)
{
    UpdateChild(deltaTime);
}
Beispiel #19
0
void CamFree::Droite()
{
	position -=left*keyboard_sensibilite;
	UpdateChild();
}
Beispiel #20
0
void Alignment::SetScale( const sf::Vector2f& scale ) {
	m_scale = scale;
	UpdateChild();
}
Beispiel #21
0
void CUIBase::Update(float fDeltaTime, ULONG ElapsedTime)
{
    OnUpdate(fDeltaTime, ElapsedTime);
    UpdateChild(fDeltaTime, ElapsedTime);
}
Beispiel #22
0
void Alignment::HandleSizeChange() {
	UpdateChild();
}