本文整理汇总了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;
}
示例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);
}
}
示例3: getAtoms
void getAtoms(std::vector<Formula> atoms){
_op->getAtoms(atoms);
}