}
return aResult;
}
+
+void XGUI_Workshop::synchronizeViewer()
+{
+ SessionPtr aMgr = ModelAPI_Session::get();
+ DocumentPtr aDoc = aMgr->activeDocument();
+
+ synchronizeGroupInViewer(aDoc, ModelAPI_ResultConstruction::group(), false);
+ synchronizeGroupInViewer(aDoc, ModelAPI_ResultBody::group(), false);
+ synchronizeGroupInViewer(aDoc, ModelAPI_ResultPart::group(), false);
+ synchronizeGroupInViewer(aDoc, ModelAPI_ResultGroup::group(), false);
+}
+
+void XGUI_Workshop::synchronizeGroupInViewer(const DocumentPtr& theDoc,
+ const std::string& theGroup,
+ bool theUpdateViewer)
+{
+ ObjectPtr aObj;
+ int aSize = theDoc->size(theGroup);
+ for (int i = 0; i < aSize; i++) {
+ aObj = theDoc->object(theGroup, i);
+ if (aObj->isDisplayed())
+ myDisplayer->display(aObj, false);
+ }
+ if (theUpdateViewer)
+ myDisplayer->updateViewer();
+}
/// \param theFeature a feature
bool isFeatureOfNested(const FeaturePtr& theFeature);
+ /// Has to be called in order to display objects with visibility status = true
+ void synchronizeViewer();
+
+ /// Has to be called in order to display objects from a cpecifed group with visibility status = true
+ /// \param theDoc the document for objects synchronisation
+ /// \param theGroup the group name
+ /// \param theUpdateViewer update viewer flag
+ void synchronizeGroupInViewer(const DocumentPtr& theDoc, const std::string& theGroup, bool theUpdateViewer);
+
signals:
/// Emitted when selection happens in Salome viewer
void salomeViewerSelection();