+
+void XGUI_Workshop::changeIsoLines(const QObjectPtrList& theObjects)
+{
+ if (theObjects.isEmpty())
+ return;
+
+ std::vector<int> aValues;
+ if (theObjects.size() == 1) {
+ ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(theObjects.first());
+ if (aRes.get())
+ ModelAPI_Tools::getIsoLines(aRes, aValues);
+ else
+ return;
+ }
+ if (aValues.size() == 0) {
+ aValues.push_back(1);
+ aValues.push_back(1);
+ }
+
+ if (!abortAllOperations())
+ return;
+
+ QDialog aDlg;
+ aDlg.setWindowTitle(tr("Number of Iso-lines"));
+ QFormLayout* aLayout = new QFormLayout(&aDlg);
+
+ QSpinBox* aUNb = new QSpinBox(&aDlg);
+ aUNb->setValue(aValues[0]);
+ aLayout->addRow("U:", aUNb);
+
+ QSpinBox* aVNb = new QSpinBox(&aDlg);
+ aVNb->setValue(aValues[1]);
+ aLayout->addRow("V:", aVNb);
+
+ QDialogButtonBox* aButtons =
+ new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &aDlg);
+ connect(aButtons, SIGNAL(accepted()), &aDlg, SLOT(accept()));
+ connect(aButtons, SIGNAL(rejected()), &aDlg, SLOT(reject()));
+ aLayout->addRow(aButtons);
+
+ if (aDlg.exec() == QDialog::Accepted) {
+ SessionPtr aMgr = ModelAPI_Session::get();
+ QString aDescription = contextMenuMgr()->action("ISOLINES_CMD")->text();
+ aMgr->startOperation(aDescription.toStdString());
+
+ aValues[0] = aUNb->value();
+ aValues[1] = aVNb->value();
+ ResultPtr aRes;
+ foreach(ObjectPtr aObj, theObjects) {
+ aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
+ if (aRes.get()) {
+ ModelAPI_Tools::setIsoLines(aRes, aValues);
+ }
+ }
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
+ aMgr->finishOperation();
+ updateCommandStatus();
+ }
+}
\ No newline at end of file