From: mpv Date: Tue, 24 Nov 2020 11:46:37 +0000 (+0300) Subject: Porting to OCCT 7.5.0 and minor improvements/bugfixes. X-Git-Tag: V9_7_0a1~83 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=eedc671e8a6e5dda61a69236f1029877e6ed02ef;p=modules%2Fshaper.git Porting to OCCT 7.5.0 and minor improvements/bugfixes. --- diff --git a/src/FeaturesPlugin/doc/images/Split_panel.png b/src/FeaturesPlugin/doc/images/Split_panel.png new file mode 100644 index 000000000..7673ef4a3 Binary files /dev/null and b/src/FeaturesPlugin/doc/images/Split_panel.png differ diff --git a/src/FeaturesPlugin/doc/splitFeature.rst b/src/FeaturesPlugin/doc/splitFeature.rst index 61970dcd5..d31bee857 100644 --- a/src/FeaturesPlugin/doc/splitFeature.rst +++ b/src/FeaturesPlugin/doc/splitFeature.rst @@ -15,7 +15,7 @@ To perform Split in the active part: The following property panel will be opened: -.. figure:: images/Split.png +.. figure:: images/Split_panel.png :align: center **Split operation** diff --git a/src/Model/Model_AttributeRefList.cpp b/src/Model/Model_AttributeRefList.cpp index 6fb763a02..44f7e44ab 100644 --- a/src/Model/Model_AttributeRefList.cpp +++ b/src/Model/Model_AttributeRefList.cpp @@ -182,7 +182,9 @@ ObjectPtr Model_AttributeRefList::iteratedObject(TDF_ListIteratorOfLabelList& th } theExtIter.Next(); } else { // internal document object - anObj = theDoc->objects()->object(theLIter.Value()); + TDF_Label aLab = theLIter.Value(); + if (!aLab.IsNull()) + anObj = theDoc->objects()->object(theLIter.Value()); } } return anObj; diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 6046533ab..03d5a423b 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -317,6 +317,8 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum std::shared_ptr aSession = std::dynamic_pointer_cast(Model_Session::get()); if (isOk) { + // keep handle to avoid destruction of the document until myObjs works on it + Handle(TDocStd_Document) anOldDoc = myDoc; myDoc = aLoaded; myDoc->SetUndoLimit(UNDO_LIMIT); @@ -325,6 +327,7 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum aSession->setCheckTransactions(false); if (myObjs) delete myObjs; + anOldDoc.Nullify(); myObjs = new Model_Objects(myDoc->Main()); // synchronization is inside myObjs->setOwner(theThis); // update the current features status @@ -2309,6 +2312,8 @@ void Model_Document::appendTransactionToPrevious() { Transaction anAppended = myTransactions.back(); myTransactions.pop_back(); + if (!myNestedNum.empty()) + (*myNestedNum.rbegin())--; if (!myTransactions.empty()) { // if it is empty, just forget the appended myTransactions.back().myOCAFNum += anAppended.myOCAFNum; } diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 9127a9915..79751881e 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -346,18 +346,6 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag if (anUpdated.get()) { if (addModified(anUpdated, FeaturePtr())) aSomeModified = true; - if (myUpdateBlocked) { // execute this feature anyway to show the current result - /*if (!anUpdated->isStable() && anUpdated->results().size() && ( - anUpdated->firstResult()->groupName() == ModelAPI_ResultBody::group() || - anUpdated->firstResult()->groupName() == ModelAPI_ResultPart::group())) { - if (aFactory->validate(anUpdated)) { - executeFeature(anUpdated); - redisplayWithResults(anUpdated, ModelAPI_StateNothing, false); - static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); - aLoop->flush(EVENT_DISP); - } - }*/ - } } else { // process the updated result as update of features that refers to this result const std::set >& @@ -735,7 +723,8 @@ bool Model_Update::processFeature(FeaturePtr theFeature) if (!isPostponedMain) { bool aDoExecute = true; if (myUpdateBlocked) { - if (!theFeature->isStable()) { + if (!theFeature->isStable() || (theFeature->getKind().size() > 6 && + theFeature->getKind().substr(0, 6) == "Sketch")) { // automatic update sketch elements aDoExecute = true; } else if (theFeature->results().size()) { // execute only not persistent results features aDoExecute = !theFeature->isPersistentResult(); diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index d5b9bf15a..03fc180a8 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -97,6 +97,7 @@ void XGUI_ContextMenuMgr::createActions() aAction->setShortcut(Qt::Key_F2); addAction("RENAME_CMD", aAction); +#ifdef HAVE_SALOME aAction = ModuleBase_Tools::createAction(QIcon(":pictures/move_to_end.png"), XGUI_Workshop::MOVE_TO_END_COMMAND, this); addAction("MOVE_CMD", aAction); @@ -104,6 +105,7 @@ void XGUI_ContextMenuMgr::createActions() aAction = ModuleBase_Tools::createAction(QIcon(":pictures/move_to_end_split.png"), XGUI_Workshop::MOVE_TO_END_SPLIT_COMMAND, this); addAction("MOVE_SPLIT_CMD", aAction); +#endif aAction = ModuleBase_Tools::createAction(QIcon(":pictures/clean_history.png"), tr("Clean history"), aDesktop); @@ -344,10 +346,12 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu() if (!(hasParameter || hasFeature)) action("SHOW_ONLY_CMD")->setEnabled(true); } +#ifdef HAVE_SALOME else if (hasFeature && myWorkshop->canMoveFeature()) { action("MOVE_CMD")->setEnabled(true); action("MOVE_SPLIT_CMD")->setEnabled(true); } +#endif if( aMgr->activeDocument() == aObject->document() ) {