From 11d685c8992e6524dd730f6572a7c389db806462 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 24 Nov 2020 14:46:37 +0300 Subject: [PATCH] Porting to OCCT 7.5.0 and minor improvements/bugfixes. --- src/FeaturesPlugin/doc/images/Split_panel.png | Bin 0 -> 10886 bytes src/FeaturesPlugin/doc/splitFeature.rst | 2 +- src/Model/Model_AttributeRefList.cpp | 4 +++- src/Model/Model_Document.cpp | 5 +++++ src/Model/Model_Update.cpp | 15 ++------------- src/XGUI/XGUI_ContextMenuMgr.cpp | 4 ++++ 6 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 src/FeaturesPlugin/doc/images/Split_panel.png diff --git a/src/FeaturesPlugin/doc/images/Split_panel.png b/src/FeaturesPlugin/doc/images/Split_panel.png new file mode 100644 index 0000000000000000000000000000000000000000..7673ef4a3000d58972f4becabda5b5120d7b0b3a GIT binary patch literal 10886 zcmeI2bx>SS*XKz>fCRVT5ZocSyCisUmmq^nkl+$DI3#FrcL?rGaCdhI?hXSCGw;ps z*{!XueRgZNYX5m_cdBNlZr^*m@9jQ)`g6Xg!#^s&M}JNH8UXvyn<8J_;!iKw0C$3 zw1d9zZ%WwD0|R#w*Y}*frdplb`HWA0U_C#vml1fjzqIdG&%^(EqBnd43*qex1aky& zl=gOBa|a8Thu~NXc2rXJ{kKKR8Op;0R)U7w`j250AfKi06oYR$nY>m*qdBTSi{Rn+ z`|Y)iOiStMwJ3=Yrs+Rq3WU7NZYTa|Ssg6;P0BGWQ_xNCUD=I-pZP}(eQmzaml}J1 z%C9)EJGEbIZ<|*cp*rlG_Q{I&OHnKt>dE$HcLpKG?qNXiU(<&-+%iBIrClRnuGep>M&x^gCI14;`5^AKT%DW}wXK+O=Qh6vY z;W%CC&>dq;;aWzw#8`R>7yRvS9=3*I|7lPOY=>olOsr&WkA#DRGynW4GD3h_HfECN z-L1i{rq=BlW|}sOabZbLPA90!VAE|7{(21Ewe(1Q8b{9|pzb`dB-2PGiy9365QB;S zN_l+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M>mArM4efyHNIW6Qjb8k(Av!Bz)EE$k_0-lsmQ9R0Hvb$69y(6Hna!j^qQJu+9qs|o25$%ZG1eu)5T`rj$i#l$U-z!&L>{KDk|)KeILP-OF8QSTm2X$ z#DuQRMFFnW1ng=TvPZjI#SD*iJoR40h{!JqNgA*EuP3FYD*=~+O$03Em_(wN7u~I^ zY4-^j<^d9u+H6dMAjklR%ihRgAo}lqu#(T5kf8MmJaodpVSY@7hQ(XAM^@yli=G(V zJ!6WL1uYyaubaUjF2a`d5S9;C-g~+dr1qJ^&r;sIV6bLnB#n5(xo^H+ZxxKCW?+z? zn=4;5{mO^{eoQ^IrP?baGsVft|ArMU0@$qL_VWpwG8jni#wEnDunhR?Yld)L-{%+P z=UbRB93JxHjT)m{;pG6t(m4^Ii!G_jG06dBobjects()->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() ) { -- 2.39.2