+//**************************************************************
+void XGUI_Workshop::toggleEdgesDirection(const QObjectPtrList& theList)
+{
+ foreach(ObjectPtr anObj, theList) {
+ ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObj);
+ if (aResult.get() != NULL)
+ {
+ bool aToShow = !ModelAPI_Tools::isShowEdgesDirection(aResult);
+ ResultBodyPtr aBodyResult = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aResult);
+ if (aBodyResult.get() != NULL) { // change property for all sub-solids
+ std::list<ResultPtr> allRes;
+ ModelAPI_Tools::allSubs(aBodyResult, allRes);
+ std::list<ResultPtr>::iterator aRes;
+ for (aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
+ ModelAPI_Tools::showEdgesDirection(*aRes, aToShow);
+ myDisplayer->redisplay(*aRes, false);
+ }
+ }
+ ModelAPI_Tools::showEdgesDirection(aResult, aToShow);
+ myDisplayer->redisplay(anObj, false);
+ }
+ }
+ if (theList.size() > 0)
+ myDisplayer->updateViewer();
+}
+
+//**************************************************************
+void XGUI_Workshop::toggleBringToFront(const QObjectPtrList& theList)
+{
+ // Toggle the "BringToFront" state of all objects in the list
+ foreach(ObjectPtr anObj, theList) {
+ ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObj);
+ if (aResult.get() != NULL)
+ {
+ bool aBringToFront = !ModelAPI_Tools::isBringToFront(aResult);
+ ModelAPI_Tools::bringToFront(aResult, aBringToFront);
+ myDisplayer->redisplay(anObj, false);
+ }
+ }
+ if (theList.size() > 0)
+ myDisplayer->updateViewer();
+}
+