Exemplo n.º 1
0
void ModelTreeElement::update(ModelTreeUpdateArgs& args) {
    args._totalElements++;
    // update our contained models
    QList<ModelItem>::iterator modelItr = _modelItems->begin();
    while(modelItr != _modelItems->end()) {
        ModelItem& model = (*modelItr);
        args._totalItems++;
        
        // TODO: this _lastChanged isn't actually changing because we're not marking this element as changed.
        // how do we want to handle this??? We really only want to consider an element changed when it is
        // edited... not just animated...
        model.update(_lastChanged);

        // If the model wants to die, or if it's left our bounding box, then move it
        // into the arguments moving models. These will be added back or deleted completely
        if (model.getShouldDie() || !bestFitModelBounds(model)) {
            args._movingModels.push_back(model);

            // erase this model
            modelItr = _modelItems->erase(modelItr);

            args._movingItems++;
            
            // this element has changed so mark it...
            markWithChangedTime();
        } else {
            ++modelItr;
        }
    }
}
Exemplo n.º 2
0
void ModelTreeElement::update(ModelTreeUpdateArgs& args) {
    // update our contained models
    QList<ModelItem>::iterator modelItr = _modelItems->begin();
    while(modelItr != _modelItems->end()) {
        ModelItem& model = (*modelItr);
        model.update(_lastChanged);

        // If the model wants to die, or if it's left our bounding box, then move it
        // into the arguments moving models. These will be added back or deleted completely
        if (model.getShouldDie() || !bestFitModelBounds(model)) {
            args._movingModels.push_back(model);

            // erase this model
            modelItr = _modelItems->erase(modelItr);
            
            // this element has changed so mark it...
            markWithChangedTime();
        } else {
            ++modelItr;
        }
    }
}