From: nds Date: Wed, 4 Oct 2017 04:39:24 +0000 (+0300) Subject: Merge branch 'Dev_2.8.0' X-Git-Tag: V_2.9.0~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=08f1aef6629e6a63cc4671d271ded4de6e826948;p=modules%2Fshaper.git Merge branch 'Dev_2.8.0' Conflicts: src/XGUI/XGUI_DataModel.h src/XGUI/XGUI_OperationMgr.cpp --- 08f1aef6629e6a63cc4671d271ded4de6e826948 diff --cc src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp index 443437126,7fcdc7a0e..04ae892e3 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp @@@ -48,11 -48,10 +49,12 @@@ #include #include #include +#include #include +#include #include #include + #include #include #include #include @@@ -871,20 -915,3 +918,20 @@@ std::shared_ptr GeomAlgo return aResultShape; } + +//================================================================================================== +std::shared_ptr GeomAlgoAPI_ShapeTools::buildDirFromAxisAndShape( + const std::shared_ptr theBaseShape, + const std::shared_ptr theAxis) +{ + gp_Pnt aCentreOfMassPoint = + GeomAlgoAPI_ShapeTools::centreOfMass(theBaseShape)->impl(); + Handle(Geom_Line) aLine = new Geom_Line(theAxis->impl()); + GeomAPI_ProjectPointOnCurve aPrjTool(aCentreOfMassPoint, aLine); + gp_Pnt aPoint = aPrjTool.NearestPoint(); + + std::shared_ptr aDir(new GeomAPI_Dir(aCentreOfMassPoint.X()-aPoint.X(), + aCentreOfMassPoint.Y()-aPoint.Y(), + aCentreOfMassPoint.Z()-aPoint.Z())); + return aDir; - } ++} diff --cc src/ModuleBase/ModuleBase_WidgetEditor.h index 809ccd4ec,c8177d56a..757165744 --- a/src/ModuleBase/ModuleBase_WidgetEditor.h +++ b/src/ModuleBase/ModuleBase_WidgetEditor.h @@@ -71,11 -71,10 +71,13 @@@ Q_OBJEC /// Returns true if the event is processed. virtual bool processEnter(); + /// Reject the current editor dialog if it is shown and returns true. + virtual bool processEscape(); + private: /// Show editor + /// \param theSpinMinValue a minimal value of popup menu spin box + /// \param theSpinMaxValue a maximum value of popup menu spin box /// \param theOutValue a result value /// \param theOutText a result text /// \return true if the editor value is accepted diff --cc src/XGUI/XGUI_DataModel.h index 9052260aa,cbcb030da..53e910980 --- a/src/XGUI/XGUI_DataModel.h +++ b/src/XGUI/XGUI_DataModel.h @@@ -176,33 -182,11 +182,36 @@@ private /// \param fromRoot - root document flag QStringList listOfShowNotEmptyFolders(bool fromRoot = true) const; + VisibilityState getVisibilityState(const QModelIndex& theIndex) const; + + void addShownFolder(DocumentPtr theDoc, QString theFolder) + { + if (!myShownFolders.contains(theDoc)) { + myShownFolders[theDoc] = QStringList(); + } + myShownFolders[theDoc].append(theFolder); + } + + void removeShownFolder(DocumentPtr theDoc, QString theFolder) + { + if (myShownFolders.contains(theDoc)) { + myShownFolders[theDoc].removeAll(theFolder); + if (myShownFolders[theDoc].isEmpty()) + myShownFolders.remove(theDoc); + } + } + + bool hasShownFolder(DocumentPtr theDoc, QString theFolder) const + { + if (myShownFolders.contains(theDoc)) + return myShownFolders[theDoc].contains(theFolder); + return false; + } + Config_DataModelReader* myXMLReader; + XGUI_Workshop* myWorkshop; + QMap myShownFolders; //bool myIsEventsProcessingBlocked; };