Config_Prop::Color, ModelAPI_ResultBody::DEFAULT_COLOR());
Config_PropManager::registerProp("Visualization", "result_group_color", "Group color",
Config_Prop::Color, ModelAPI_ResultGroup::DEFAULT_COLOR());
- Config_PropManager::registerProp("Visualization", "result_construction_color", "Construction color",
- Config_Prop::Color, ModelAPI_ResultConstruction::DEFAULT_COLOR());
+ Config_PropManager::registerProp("Visualization", "result_construction_color",
+ "Construction color",
+ Config_Prop::Color,
+ ModelAPI_ResultConstruction::DEFAULT_COLOR());
Config_PropManager::registerProp("Visualization", "result_part_color", "Part color",
Config_Prop::Color, ModelAPI_ResultPart::DEFAULT_COLOR());
- Config_PropManager::registerProp("Visualization", "body_deflection", "Body deflection coefficient",
- Config_Prop::Double, ModelAPI_ResultBody::DEFAULT_DEFLECTION());//"0.001");
+ Config_PropManager::registerProp("Visualization", "body_deflection",
+ "Body deflection coefficient",
+ Config_Prop::Double,
+ ModelAPI_ResultBody::DEFAULT_DEFLECTION());//"0.001");
- Config_PropManager::registerProp("Visualization", "construction_deflection", "Construction deflection coefficient",
- Config_Prop::Double, ModelAPI_ResultConstruction::DEFAULT_DEFLECTION());//"0.0001");
+ Config_PropManager::registerProp("Visualization", "construction_deflection",
+ "Construction deflection coefficient",
+ Config_Prop::Double,
+ ModelAPI_ResultConstruction::DEFAULT_DEFLECTION());//"0.0001");
if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "face-selection", true))
myViewerSelMode.append(TopAbs_FACE);
QAction* aAction = salomeConnector()->addDesktopCommand("UNDO_CMD", tr("Undo"),
tr("Undo last command"),
QIcon(":pictures/undo.png"),
- QKeySequence::Undo, false, "MEN_DESK_EDIT");
+ QKeySequence::Undo, false,
+ "MEN_DESK_EDIT");
QString aToolBarTitle = tr( "INF_DESK_TOOLBAR_STANDARD" );
salomeConnector()->addActionInToolbar( aAction,aToolBarTitle );
addHistoryMenu(aAction, SIGNAL(updateRedoHistory(const QList<ActionInfo>&)), SLOT(onRedo(int)));
salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT");
- //aAction = salomeConnector()->addDesktopCommand("REBUILD_CMD", tr("Rebuild"), tr("Rebuild data objects"),
+ //aAction = salomeConnector()->addDesktopCommand("REBUILD_CMD", tr("Rebuild"),
+ // tr("Rebuild data objects"),
// QIcon(":pictures/rebuild.png"), QKeySequence(),
// false, "MEN_DESK_EDIT");
//salomeConnector()->addActionInToolbar( aAction, aToolBarTitle );
//connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onRebuild()));
//salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT");
- aAction = salomeConnector()->addDesktopCommand("SAVEAS_CMD", tr("Export native..."), tr("Export the current document into a native file"),
+ aAction = salomeConnector()->addDesktopCommand("SAVEAS_CMD", tr("Export native..."),
+ tr("Export the current document into a native file"),
QIcon(), QKeySequence(),
false, "MEN_DESK_FILE");
connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onSaveAs()));
- aAction = salomeConnector()->addDesktopCommand("OPEN_CMD", tr("Import native..."), tr("Import native file"),
+ aAction = salomeConnector()->addDesktopCommand("OPEN_CMD", tr("Import native..."),
+ tr("Import native file"),
QIcon(), QKeySequence(),
false, "MEN_DESK_FILE");
connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onOpen()));
void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation* theOperation)
{
- ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+ ModuleBase_OperationFeature* aFOperation =
+ dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
if (!aFOperation)
return;
if (!aWidget->attributeID().empty() && !aFeature->attribute(aWidget->attributeID()).get()) {
std::string anErrorMsg = "The feature '%1' has no attribute '%2' used by widget '%3'.";
Events_InfoMessage("XGUI_Workshop", anErrorMsg)
- .arg(aFeatureKind).arg(aWidget->attributeID()).arg(aWidget->metaObject()->className()).send();
+ .arg(aFeatureKind).arg(aWidget->attributeID())
+ .arg(aWidget->metaObject()->className()).send();
myPropertyPanel->cleanContent();
return;
}
// update visible state of Preview button
#ifdef HAVE_SALOME
- bool anIsAutoPreview = mySalomeConnector->featureInfo(aFeatureKind.c_str())->isAutoPreview();
+ bool anIsAutoPreview =
+ mySalomeConnector->featureInfo(aFeatureKind.c_str())->isAutoPreview();
#else
AppElements_MainMenu* aMenuBar = mainWindow()->menuObject();
AppElements_Command* aCommand = aMenuBar->feature(aFeatureKind.c_str());
myPropertyPanel->setWindowTitle(theOperation->getDescription()->description());
#else
std::string aFeatureName = aFeature->name();
- myPropertyPanel->setWindowTitle(QString("%1: %2").arg(theOperation->getDescription()->description())
- .arg(aFeatureName.c_str()));
+ myPropertyPanel->setWindowTitle(QString("%1: %2")
+ .arg(theOperation->getDescription()->description())
+ .arg(aFeatureName.c_str()));
#endif
myErrorMgr->setPropertyPanel(myPropertyPanel);
void XGUI_Workshop::setGrantedFeatures(ModuleBase_Operation* theOperation)
{
- ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+ ModuleBase_OperationFeature* aFOperation =
+ dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
if (!aFOperation)
return;
aSession->load(myCurrentDir.toLatin1().constData());
myObjectBrowser->rebuildDataTree();
updateCommandStatus();
+#ifndef HAVE_SALOME
+ myMainWindow->setCurrentDir(myCurrentDir, true);
+#endif
QApplication::restoreOverrideCursor();
}
if (aDir.exists() && !aDir.entryInfoList(QDir::NoDotAndDotDot | QDir::AllEntries).isEmpty()) {
int answer = QMessageBox::question(
desktop(),
- //: Title of the dialog which asks user if he wants to save study in existing non-empty folder
+ // Title of the dialog which asks user if he wants to save study
+ // in existing non-empty folder
tr("Save"),
tr("The directory already contains some files, save anyway?"),
QMessageBox::Save | QMessageBox::Cancel);
{
// the viewer update should be blocked in order to avoid the features blinking. For the created
// feature a results are created, the flush of the created signal caused the viewer redisplay for
- // each created result. After a redisplay signal is flushed. So, the viewer update is blocked until
- // redo of all possible objects happens
+ // each created result. After a redisplay signal is flushed. So, the viewer update is blocked
+ // until redo of all possible objects happens
bool isUpdateEnabled = myDisplayer->enableUpdateViewer(false);
objectBrowser()->treeView()->setCurrentIndex(QModelIndex());
QDockWidget* XGUI_Workshop::createObjectBrowser(QWidget* theParent)
{
QDockWidget* aObjDock = new QDockWidget(theParent);
- aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea);
+ aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea |
+ Qt::RightDockWidgetArea |
+ Qt::BottomDockWidgetArea);
aObjDock->setWindowTitle(tr("Object browser"));
aObjDock->setStyleSheet(
"::title { position: relative; padding-left: 5px; text-align: left center }");
aDesktop->addDockWidget(Qt::LeftDockWidgetArea, aObjDock);
myPropertyPanel = new XGUI_PropertyPanel(aDesktop, myOperationMgr);
myPropertyPanel->setupActions(myActionsMgr);
- myPropertyPanel->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea);
+ myPropertyPanel->setAllowedAreas(Qt::LeftDockWidgetArea |
+ Qt::RightDockWidgetArea |
+ Qt::BottomDockWidgetArea);
aDesktop->addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanel);
hidePropertyPanel(); ///<! Invisible by default
hideObjectBrowser();
anInfo.append(aFeature->name().c_str());
}
QString anInfoStr = anInfo.join(";\t");
- qDebug(QString("cleanHistory for: [%1] - %2").arg(aFeatures.size()).arg(anInfoStr).toStdString().c_str());
+ qDebug(QString("cleanHistory for: [%1] - %2").
+ arg(aFeatures.size()).arg(anInfoStr).toStdString().c_str());
#endif
std::map<FeaturePtr, std::set<FeaturePtr> > aReferences;
ModelAPI_Tools::findAllReferences(aFeatures, aReferences, true, false);
- // find for each object whether all reference values are in the map as key, that means that there is
- // no other reference in the model to this object, so it might be removed by cleaning history
+ // find for each object whether all reference values are in the map as key, that means that there
+ // is no other reference in the model to this object, so it might be removed by cleaning history
// sk_1(ext_1, vertex_1) + (sk_3, bool_1) - cann't be deleted, dependency to bool_1
// ext_1(bool_1, sk_3) - cann't be deleted, dependency to bool_1
// vertex_1()
for (; aMainIt != aMainLast; aMainIt++) {
FeaturePtr aMainListFeature = aMainIt->first;
std::set<FeaturePtr> aMainRefList = aMainIt->second;
- std::set<FeaturePtr>::const_iterator aRefIt = aMainRefList.begin(), aRefLast = aMainRefList.end();
+ std::set<FeaturePtr>::const_iterator aRefIt = aMainRefList.begin(),
+ aRefLast = aMainRefList.end();
bool aFeatureOutOfTheList = false;
for (; aRefIt != aRefLast && !aFeatureOutOfTheList; aRefIt++) {
FeaturePtr aRefFeature = *aRefIt;
FeaturePtr aFeature = *aFIt;
anInfo.append(aFeature->name().c_str());
}
- qDebug(QString("unused objects: [%1] - %2").arg(anInfo.size()).arg(anInfo.join(";\t")).toStdString().c_str());
+ qDebug(QString("unused objects: [%1] - %2").
+ arg(anInfo.size()).arg(anInfo.join(";\t")).toStdString().c_str());
#endif
// warn about the references remove, break the delete operation if the user chose it
aMessageBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
aMessageBox.setDefaultButton(QMessageBox::No);
- QString aText = QString(tr("Unused features are the following: %1.\nThese features will be deleted.\nWould you like to continue?")
- .arg(anUnusedNames));
+ QString aText = QString(tr("Unused features are the following: \
+%1.\nThese features will be deleted.\nWould you like to continue?").arg(anUnusedNames));
aMessageBox.setText(aText);
if (aMessageBox.exec() == QMessageBox::No)
return;
// 1. start operation
- aDescription += "by deleting of " + aDescription.arg(XGUI_Tools::unionOfObjectNames(anObjects, ", "));
+ aDescription += "by deleting of " +
+ aDescription.arg(XGUI_Tools::unionOfObjectNames(anObjects, ", "));
ModuleBase_OperationAction* anOpAction = new ModuleBase_OperationAction(aDescription, module());
operationMgr()->startOperation(anOpAction);
DocumentPtr aDocument = theObject->document();
std::list<FeaturePtr> anAllFeatures = allFeatures(aDocument);
// find the object iterator
- std::list<FeaturePtr>::iterator aObjectIt = std::find(anAllFeatures.begin(), anAllFeatures.end(), theObject);
+ std::list<FeaturePtr>::iterator aObjectIt =
+ std::find(anAllFeatures.begin(), anAllFeatures.end(), theObject);
if (aObjectIt == anAllFeatures.end())
return aResult;
// find the current feature iterator
- std::list<FeaturePtr>::iterator aCurrentIt = std::find(anAllFeatures.begin(), anAllFeatures.end(), aDocument->currentFeature(true));
+ std::list<FeaturePtr>::iterator aCurrentIt =
+ std::find(anAllFeatures.begin(), anAllFeatures.end(), aDocument->currentFeature(true));
if (aCurrentIt == anAllFeatures.end())
return aResult;
// check the right order
- if (std::distance(aObjectIt, anAllFeatures.end()) <= std::distance(aCurrentIt, anAllFeatures.end()))
+ if (std::distance(aObjectIt, anAllFeatures.end()) <=
+ std::distance(aCurrentIt, anAllFeatures.end()))
return aResult;
// exclude the object
std::advance(aObjectIt, 1);
foreach(ObjectPtr anObj, theObjects) {
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObj);
if (aResult.get() != NULL) {
- ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aResult);
+ ResultCompSolidPtr aCompsolidResult =
+ std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aResult);
if (aCompsolidResult.get() != NULL) { // change colors for all sub-solids
for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) {
- setColor(aCompsolidResult->subResult(i), !isRandomColor ? aColorResult : aDlg->getRandomColor());
+ setColor(aCompsolidResult->subResult(i), !isRandomColor ? aColorResult :
+ aDlg->getRandomColor());
}
}
setColor(aResult, !isRandomColor ? aColorResult : aDlg->getRandomColor());
foreach(ObjectPtr anObj, theObjects) {
ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObj);
if (aResult.get() != NULL) {
- ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aResult);
+ ResultCompSolidPtr aCompsolidResult =
+ std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aResult);
if (aCompsolidResult.get() != NULL) { // change colors for all sub-solids
for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) {
setDeflection(aCompsolidResult->subResult(i), aDeflection);
{
FeaturePtr aFeature;
QObjectPtrList aSelList = theObjects;
- std::list<ResultPtr> aResList;
bool aHasHidden = false;
foreach(ObjectPtr aObj, theObjects) {
aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
std::list<ResultPtr> aResults;
ModelAPI_Tools::allResults(aFeature, aResults);
std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aIt;
- for(aIt = aResList.cbegin(); aIt != aResList.cend(); aIt++) {
+ for(aIt = aResults.cbegin(); aIt != aResults.cend(); aIt++) {
aHasHidden |= (*aIt)->isConcealed();
aSelList.append(*aIt);
}