Exemple #1
0
void Particles::on_particlesDelete_clicked() {
    if (ui->particlesType->isChecked()) {
        widget->getPainter()->getGrid()->getVelocityField()->remove(stringList.at(ui->particles->selectionModel()->currentIndex().row()).toInt());
    } else {
        PassiveScalarSingleton::getInstance()->remove(stringList.at(ui->particles->selectionModel()->currentIndex().row()).toInt());
        widget->getPainter()->updateCellsList();
    }
    stringList.removeAt(ui->particles->selectionModel()->currentIndex().row());
    stringListModel->setStringList(stringList);
    updateNextId();
    controls(false);
}
Exemple #2
0
void Particles::on_deleteAll_clicked() {
    if (ui->particlesType->isChecked()) {
        widget->getPainter()->getGrid()->getVelocityField()->removeAll();
    } else {
        PassiveScalarSingleton::getInstance()->removeAll();
        widget->getPainter()->updateCellsList();
    }
    stringList.clear();
    stringListModel->setStringList(stringList);
    updateNextId();
    controls(false);
}
Exemple #3
0
void Particles::load() {
    stringList.clear();
    if (ui->particlesType->isChecked()) {
        std::list<StartingParticle*> *particles = widget->getPainter()->getGrid()->getVelocityField()->getStartingPathLines();
        for (std::list<StartingParticle*>::iterator particle(particles->begin()); particle != particles->end(); particle++) {
            stringList << QString::number((*particle)->getId());
        }
        ui->velocity->setText(QString::number(widget->getPainter()->getGrid()->getVelocityField()->getAcceleration()));
        ui->diffusionEffect->setText(QString::number(widget->getPainter()->getGrid()->getVelocityField()->getDiffusionEffect()));
        ui->gridSpacing->setText(QString::number(widget->getPainter()->getGrid()->getVelocityField()->getGridSpacing()));
        ui->injectionPeriod->setText(QString::number(widget->getPainter()->getGrid()->getVelocityField()->getInjectionPeriod()));
    } else {
        std::list<Configuration*> pss = PassiveScalarSingleton::getInstance()->listPSS();
        for (std::list<Configuration*>::iterator ps = pss.begin(); ps != pss.end(); ps++) {
            stringList << QString::number((*ps)->getId());
        }
        ui->diffusionEffect->setText(QString::number(PassiveScalarSingleton::getInstance()->getEpsilon(0)));
        ui->injectionPeriod->setText(QString::number(PassiveScalarSingleton::getInstance()->getInjectionPeriod()));
        ui->injectionTime->setText(QString::number(PassiveScalarSingleton::getInstance()->getInjectionTime()));
        ui->passiveScalarMomentPropagation->setCurrentIndex(PassiveScalarSingleton::getInstance()->getLastType() - 1);
    }
    stringListModel->setStringList(stringList);
    updateNextId();
}
Exemple #4
0
/**
 * Add a new ODE scene node
 */
void CIrrOdeWorld::addOdeSceneNode(CIrrOdeSceneNode *pNode) {
    updateNextId(pNode->getID());
    m_pSceneNodes.push_back(pNode);
}