当前位置: 首页>>代码示例>>C++>>正文


C++ Formula::getAtoms方法代码示例

本文整理汇总了C++中Formula::getAtoms方法的典型用法代码示例。如果您正苦于以下问题:C++ Formula::getAtoms方法的具体用法?C++ Formula::getAtoms怎么用?C++ Formula::getAtoms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Formula的用法示例。


在下文中一共展示了Formula::getAtoms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: buttonClicked

void MainWindow::buttonClicked()
{
    ui->dodajDete->setDisabled(true);
    ui->lineEdit->setDisabled(true);
    if(depth == 0 ){
        std::string formula = ui->lineEdit->text().toUtf8().constData();
        formula += " ;";
        std::ostringstream stream;
        qDebug() << QString::fromStdString(formula);
       YY_BUFFER_STATE buffer = yy_scan_string(formula.c_str());

                if(yyparse() == 1){
            qDebug() << "Pa to ti ne radi";
        }

        qreal rect_width = formula.length()*PARAMETER;
        qreal rect_height = 20;
        int rect_x = 85;
        int rect_y = 180;
        std::vector<Formula> tmp_vec = std::vector<Formula>();
        parsed_formula->getAtoms(tmp_vec);
        QVector<Formula> assumptions = QVector<Formula>::fromStdVector(tmp_vec);
        Node* item = new Node( parsed_formula, rect_width, rect_height, rect_x, rect_y, nullptr, assumptions);
        scene->addNode(item);
   }

    depth += 15;
}
开发者ID:Shoocky,项目名称:Interaktivni-dokazivac,代码行数:28,代码来源:mainwindow.cpp

示例2: chooseFileClicked

void MainWindow::chooseFileClicked()
{
    ui->dodajDete->setDisabled(true);
    ui->lineEdit->setDisabled(true);

    std::ostringstream stream;
    if(depth == 0 ){
        QString file_name = QFileDialog::getOpenFileName(this, tr("Učitaj iz fajla"), QDir::currentPath(), tr("*.for"));
        qDebug() << file_name;
        QFile f(file_name);
            if (!f.open(QFile::ReadOnly | QFile::Text)){
                QMessageBox msgBox;
                 msgBox.setWindowTitle("Error!");
                 msgBox.setText("Can`t open file");
                 msgBox.setDetailedText("Unable to open file for reading");
                 msgBox.exec();
            }
            QTextStream in(&f);
            stream << in.readAll().toUtf8().constData();



        std::string formula = stream.str();
        formula += " ;";
        qDebug() << QString::fromStdString(formula);
       YY_BUFFER_STATE buffer = yy_scan_string(formula.c_str());

                if(yyparse() == 1){
            qDebug() << "Pa to ti ne radi";
        }

        qreal rect_width = formula.length()*PARAMETER;
        qreal rect_height = 20;
        int rect_x = 85;
        int rect_y = 180;
        std::vector<Formula> tmp_vec = std::vector<Formula>();
        parsed_formula->getAtoms(tmp_vec);
        QVector<Formula> assumptions = QVector<Formula>::fromStdVector(tmp_vec);
        Node* item = new Node( parsed_formula, rect_width, rect_height, rect_x, rect_y, nullptr, assumptions);
        scene->addNode(item);
   }

}
开发者ID:Shoocky,项目名称:Interaktivni-dokazivac,代码行数:43,代码来源:mainwindow.cpp

示例3: getAtoms

 void getAtoms(std::vector<Formula> atoms){
    _op->getAtoms(atoms);
 }
开发者ID:Shoocky,项目名称:Interaktivni-dokazivac,代码行数:3,代码来源:fol.hpp


注:本文中的Formula::getAtoms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。