#include <QtxActionMenuMgr.h>
#include <QtxActionToolMgr.h>
#include <QtxResourceMgr.h>
+#include <QtxInfoPanel.h>
#include <Config_PropManager.h>
#include <Config_ModuleReader.h>
void SHAPERGUI::windows(QMap<int, int>& theWndMap) const
{
theWndMap.insert(LightApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea);
+ theWndMap.insert(LightApp_Application::WT_InfoPanel, Qt::RightDockWidgetArea);
}
//******************************************************
this, SLOT(onSaveDocByShaper()));
connect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
this, SLOT(onSaveAsDocByShaper()));
-
+ updateInfoPanel();
return isDone;
}
void SHAPERGUI::onUpdateCommandStatus()
{
getApp()->updateActions();
+
+ LightApp_Application* aApp = dynamic_cast<LightApp_Application*>(application());
+ QtxInfoPanel* aInfoPanel = aApp->infoPanel();
+ if (aInfoPanel->isVisible())
+ updateInfoPanel();
}
//******************************************************
getApp()->updatePresentations("SHAPERSTUDY", aVMList);
}
}
+
+void SHAPERGUI::fillPartSetInfoPanel(QtxInfoPanel* theInfoPanel)
+{
+ QIntList aShaperActions = shaperActions();
+ theInfoPanel->addLabel(tr("Current mode: Part set mode"));
+
+ addActionsToInfoGroup(theInfoPanel, tr("Parts management"),
+ { "Part", "Duplicate", "Remove" });
+ addActionsToInfoGroup(theInfoPanel, tr("Import operations"),
+ { "OPEN_CMD", "IMPORT_PART_CMD", "IMPORT_SHAPE_CMD" });
+ addActionsToInfoGroup(theInfoPanel, tr("Export operations"),
+ { "SAVEAS_CMD", "EXPORT_PART_CMD", "EXPORT_SHAPE_CMD" });
+ addActionsToInfoGroup(theInfoPanel, tr("Arrangement of parts"),
+ { "Placement", "Translation", "Rotation" });
+}
+
+void SHAPERGUI::fillPartInfoPanel(QtxInfoPanel* theInfoPanel)
+{
+ QIntList aShaperActions = shaperActions();
+ theInfoPanel->addLabel(tr("Current mode: Part mode"));
+
+ addActionsToInfoGroup(theInfoPanel, tr("Primitives"),
+ { "Box", "Cylinder", "Sphere" });
+ addActionsToInfoGroup(theInfoPanel, tr("Geometry"),
+ { "Vertex", "Edge", "Wire", "Face" });
+ addActionsToInfoGroup(theInfoPanel, tr("Features"),
+ { "Extrusion", "Revolution", "Cut", "Fuse", "Fillet" });
+}
+
+void SHAPERGUI::fillSketcherInfoPanel(QtxInfoPanel* theInfoPanel)
+{
+ QIntList aShaperActions = shaperActions();
+ theInfoPanel->addLabel(tr("Current mode: Sketcher mode"));
+
+ addActionsToInfoGroup(theInfoPanel, tr("Primitives"),
+ { "SketchPoint", "SketchLine", "SketchCircle", "SketchRectangle" });
+ addActionsToInfoGroup(theInfoPanel, tr("Dimensions"),
+ { "SketchConstraintLength", "SketchConstraintRadius", "SketchConstraintAngle" });
+ addActionsToInfoGroup(theInfoPanel, tr("Constraints"),
+ { "SketchConstraintParallel", "SketchConstraintPerpendicular",
+ "SketchConstraintEqual", "SketchConstraintCoincidence" });
+}
+
+void SHAPERGUI::addActionsToInfoGroup(QtxInfoPanel* theInfoPanel,
+ const QString& theGroup, const QSet<QString>& theActions)
+{
+ QIntList aShaperActions = shaperActions();
+
+ int aGroup = theInfoPanel->addGroup(theGroup);
+ int aCount = 0;
+ foreach(int aCmd, aShaperActions) {
+ QAction* aAction = action(aCmd);
+ if (theActions.contains(aAction->data().toString()))
+ {
+ theInfoPanel->addAction(aAction, aGroup);
+ aCount++;
+ }
+ if (aCount >= theActions.size())
+ break;
+ }
+}
+
+void SHAPERGUI::updateInfoPanel()
+{
+ LightApp_Application* aApp = dynamic_cast<LightApp_Application*>(application());
+ QtxInfoPanel* aInfoPanel = aApp->infoPanel();
+ aInfoPanel->clear();
+ aInfoPanel->setTitle(tr("Welcome to SHAPER"));
+
+ SessionPtr aMgr = ModelAPI_Session::get();
+ QList<DocumentPtr> aDocs;
+ DocumentPtr aActiveDoc = aMgr->activeDocument();
+ DocumentPtr aModuleDoc = aMgr->moduleDocument();
+
+ XGUI_OperationMgr* aOpMgr = myWorkshop->operationMgr();
+ QStringList aOpList = aOpMgr->operationList();
+ bool isSketcher = false;
+ if (aOpList.size() > 0)
+ isSketcher = (aOpList.first() == "Sketch");
+
+ if (isSketcher) // Sketcher mode
+ fillSketcherInfoPanel(aInfoPanel);
+ else if (aActiveDoc == aModuleDoc) // Part set mode
+ fillPartSetInfoPanel(aInfoPanel);
+ else
+ fillPartInfoPanel(aInfoPanel);
+}
</message>
<message>
<source>Information</source>
- <translation>Information</translation>
+ <translation type="vanished">Information</translation>
</message>
<message>
<source>Show inspection window</source>
<source>MEN_DESK_EDIT</source>
<translation>MEN_DESK_EDIT</translation>
</message>
+ <message>
+ <source>Parts management</source>
+ <translation>Gestion des pièces</translation>
+ </message>
+ <message>
+ <source>Import operations</source>
+ <translation>Opérations d'importation</translation>
+ </message>
+ <message>
+ <source>Export operations</source>
+ <translation>Opérations d'exportation</translation>
+ </message>
+ <message>
+ <source>Arrangement of parts</source>
+ <translation>Disposition des pièces</translation>
+ </message>
+ <message>
+ <source>Primitives</source>
+ <translation>Primitives</translation>
+ </message>
+ <message>
+ <source>Geometry</source>
+ <translation>Géométrie</translation>
+ </message>
+ <message>
+ <source>Features</source>
+ <translation>Fonctionnalités</translation>
+ </message>
+ <message>
+ <source>Dimensions</source>
+ <translation>Dimensions</translation>
+ </message>
+ <message>
+ <source>Constraints</source>
+ <translation>Contraintes</translation>
+ </message>
+ <message>
+ <source>Welcome to SHAPER</source>
+ <translation>Bienvenue à SHAPER</translation>
+ </message>
+ <message>
+ <source>Current mode: Part set mode</source>
+ <translation>Mode actuel : Mode de réglage des pièces</translation>
+ </message>
+ <message>
+ <source>Current mode: Part mode</source>
+ <translation>Mode actuel : Mode partiel</translation>
+ </message>
+ <message>
+ <source>Current mode: Sketcher mode</source>
+ <translation>Mode actuel : Mode esquisseur</translation>
+ </message>
<message>
<source>Group names display</source>
<translation>Affichage des noms de groupe</translation>