XGUI_SelectionMgr* aSelMgr = myWorkshop->selector();
QList<ObjectPtr> aObjects = aSelMgr->selection()->selectedObjects();
if (aObjects.size() > 0) {
- if (aObjects.size() == 1)
- theMenu->addAction(action("EDIT_CMD"));
+ //if (aObjects.size() == 1)
+ // theMenu->addAction(action("EDIT_CMD"));
bool isVisible = false;
foreach(ObjectPtr aObject, aObjects) {
ResultPtr aRes = boost::dynamic_pointer_cast<ModelAPI_Result>(aObject);
theMenu->addAction(action("HIDE_CMD"));
else
theMenu->addAction(action("SHOW_CMD"));
- theMenu->addAction(action("DELETE_CMD"));
+ //theMenu->addAction(action("DELETE_CMD"));
}
if (!myWorkshop->isSalomeMode()) {
QMdiArea* aMDI = myWorkshop->mainWindow()->mdiArea();
#include <ModelAPI_AttributeDocRef.h>
#include <ModelAPI_Object.h>
#include <ModelAPI_Validator.h>
-#include <ModelAPI_ResultPart.h>
+#include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_ResultBody.h>
#include <PartSetPlugin_Part.h>
}
QApplication::setOverrideCursor(Qt::WaitCursor);
aDoc->load(myCurrentDir.toLatin1().constData());
- updateCommandStatus();
myObjectBrowser->rebuildDataTree();
+ displayAllResults();
+ updateCommandStatus();
QApplication::restoreOverrideCursor();
}
aFactory->registerValidator("ModuleBase_ResulLineValidator", new ModuleBase_ResulLineValidator);
aFactory->registerValidator("ModuleBase_ResulArcValidator", new ModuleBase_ResulArcValidator);
}
+
+
+//**************************************************************
+void XGUI_Workshop::displayAllResults()
+{
+ PluginManagerPtr aMgr = ModelAPI_PluginManager::get();
+ DocumentPtr aRootDoc = aMgr->rootDocument();
+ displayDocumentResults(aRootDoc);
+ for (int i = 0; i < aRootDoc->size(ModelAPI_ResultPart::group()); i++) {
+ ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultPart::group(), i);
+ ResultPartPtr aPart = boost::dynamic_pointer_cast<ModelAPI_ResultPart>(aObject);
+ displayDocumentResults(aPart->partDoc());
+ }
+ myDisplayer->updateViewer();
+}
+
+//**************************************************************
+void XGUI_Workshop::displayDocumentResults(DocumentPtr theDoc)
+{
+ displayGroupResults(theDoc, ModelAPI_ResultConstruction::group());
+ displayGroupResults(theDoc, ModelAPI_ResultBody::group());
+}
+
+//**************************************************************
+void XGUI_Workshop::displayGroupResults(DocumentPtr theDoc, std::string theGroup)
+{
+ for (int i = 0; i < theDoc->size(theGroup); i++)
+ myDisplayer->display(theDoc->object(theGroup, i), false);
+}
\ No newline at end of file
#include <Events_Listener.h>
#include <ModuleBase_Definitions.h>
#include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Document.h>
#include <QObject>
#include <QMap>
QList<QAction*> getModuleCommands() const;
+ void displayAllResults();
+ void displayDocumentResults(DocumentPtr theDoc);
+ void displayGroupResults(DocumentPtr theDoc, std::string theGroup);
+
protected slots:
/// SLOT, that is called after the operation is started. Update workshop state according to
/// the started operation, e.g. visualizes the property panel and connect to it.