From: Viktor UZLOV Date: Fri, 20 Nov 2020 12:12:49 +0000 (+0300) Subject: bos #20215 Help panels into SALOME for new users X-Git-Tag: V9_7_0a1~39^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3da6be1c995651bc9b75c5cfc0d9e344d22ae8f7;p=modules%2Fsmesh.git bos #20215 Help panels into SALOME for new users --- diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 392bdc291..c69c4b578 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -4,6 +4,7 @@ + @@ -119,9 +120,9 @@
- +
- +
diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 2a6b89a3d..cc66cba2e 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -113,6 +113,7 @@ #include #include #include +#include #include #include #include @@ -5105,6 +5106,12 @@ bool SMESHGUI::reusableOperation( const int id ) return ( id == SMESHOp::OpCompute || id == SMESHOp::OpPreCompute || id == SMESHOp::OpEvaluate || id == SMESHOp::OpRecompute ) ? false : SalomeApp_Module::reusableOperation( id ); } +namespace +{ + QString wrap(const QString& text, const QString& tag) + { return QString("<%1>%2").arg(tag).arg(text).arg(tag);} +} + bool SMESHGUI::activateModule( SUIT_Study* study ) { bool res = SalomeApp_Module::activateModule( study ); @@ -5112,6 +5119,49 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) setMenuShown( true ); setToolShown( true ); + // Fill in Help Panel + SalomeApp_Application* app = dynamic_cast( application() ); + app->infoPanel()->setTitle(tr("INFO_WELCOME_TO_SMESH")); + + int gb = app->infoPanel()->addGroup(tr("INFO_GRP_CREATE_MESH")); + QString lab; + QStringList items; + lab = tr("INFO_DEFINE_ALGOS") + "
"; + lab = lab + tr("INFO_DEFINE_HYPOS") + "
"; + lab = lab + tr("INFO_COMPUTE") + "
"; + lab = lab + tr("INFO_REFINE") + ":"; + items << wrap(tr("INFO_REFINE_LOCAL_SIZE"), "li") + << wrap(tr("INFO_REFINE_SUBMESH"), "li"); + lab = lab + wrap(items.join(""), "ul"); + items.clear(); + + app->infoPanel()->addLabel(lab, gb); + + gb = app->infoPanel()->addGroup(tr("INFO_GRP_IMPORT_MESH")); + items << wrap("UNV", "li") + << wrap("MED", "li") + << wrap("STL", "li") + << wrap("CGNS", "li") + << wrap("SAUV", "li") + << wrap("GMF", "li"); + lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul"); + items.clear(); + + app->infoPanel()->addLabel(lab, gb); + + gb = app->infoPanel()->addGroup(tr("INFO_GRP_CHECK_MESH")); + lab = tr("INFO_DISPLAY") + "
"; + items << wrap(tr("INFO_QUALITY_AREA"), "li") + << wrap(tr("INFO_QUALITY_VOLUME"), "li") + << wrap(tr("INFO_QUALITY_ASPECT_RATION"), "li") + << wrap("...", "li"); + lab = lab + tr("INFO_QUALITY_INFO") + ":" + wrap(items.join(""), "ul"); + items.clear(); + lab = lab + tr("INFO_CLIPPING"); + + app->infoPanel()->addLabel(lab, gb); + // << Help Panel + // import Python module that manages SMESH plugins (need to be here because SalomePyQt API uses active module) PyGILState_STATE gstate = PyGILState_Ensure(); PyObject* pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager"); @@ -5230,6 +5280,7 @@ void SMESHGUI::windows( QMap& aMap ) const { aMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea ); aMap.insert( SalomeApp_Application::WT_NoteBook, Qt::LeftDockWidgetArea ); + aMap.insert( SalomeApp_Application::WT_InfoPanel, Qt::RightDockWidgetArea); #ifndef DISABLE_PYCONSOLE aMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea ); #endif diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index ccad8714f..56715d47a 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -5029,6 +5029,74 @@ Please, create VTK viewer and try again PREF_PREVIEW_CHUNK_SIZE Sub-shapes preview chunk size + + INFO_WELCOME_TO_SMESH + Welcome to Mesh + + + INFO_GRP_CREATE_MESH + Create mesh + + + INFO_DEFINE_ALGOS + Choose algorithms + + + INFO_DEFINE_HYPOS + Define hypotheses + + + INFO_COMPUTE + Compute + + + INFO_REFINE + Add refinements + + + INFO_REFINE_LOCAL_SIZE + via local sizes with some hypotheses + + + INFO_REFINE_SUBMESH + via sub-meshes + + + INFO_GRP_IMPORT_MESH + Import mesh + + + INFO_AVAILABLE_FORMATS + Available formats + + + INFO_GRP_CHECK_MESH + Check mesh quality + + + INFO_DISPLAY + Display mesh + + + INFO_QUALITY_INFO + Display some quality criteria + + + INFO_QUALITY_AREA + area + + + INFO_QUALITY_VOLUME + volume + + + INFO_QUALITY_ASPECT_RATION + aspect ration + + + INFO_CLIPPING + Add clipping planes + SMESHGUI_GroupDlg diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index e0b412da3..a16b3e56d 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -4558,6 +4558,10 @@ Il ne peut pas être supprimé. SMESH_HEX_PRISM Prisme hexagonal + + Generate mesh from CAD model or import mesh + Generate mesh from CAD model or import mesh + SMESHGUI_FieldSelectorWdg @@ -5006,6 +5010,74 @@ Ouvrez une fenêtre VTK et essayez de nouveau PREF_PREVIEW_CHUNK_SIZE Taille des blocs pour la prévisualisation des sous-shapes + + INFO_WELCOME_TO_SMESH + Welcome to Mesh + + + INFO_GRP_CREATE_MESH + Create mesh + + + INFO_DEFINE_ALGOS + Choose algorithms + + + INFO_DEFINE_HYPOS + Define hypotheses + + + INFO_COMPUTE + Compute + + + INFO_REFINE + Add refinements + + + INFO_REFINE_LOCAL_SIZE + via local sizes with some hypotheses + + + INFO_REFINE_SUBMESH + via sub-meshes + + + INFO_GRP_IMPORT_MESH + Import mesh + + + INFO_AVAILABLE_FORMATS + Available formats + + + INFO_GRP_CHECK_MESH + Check mesh quality + + + INFO_DISPLAY + Display mesh + + + INFO_QUALITY_INFO + Display some quality criteria + + + INFO_QUALITY_AREA + area + + + INFO_QUALITY_VOLUME + volume + + + INFO_QUALITY_ASPECT_RATION + aspect ration + + + INFO_CLIPPING + Add clipping planes + SMESHGUI_GroupDlg diff --git a/src/SMESHGUI/SMESH_msg_ja.ts b/src/SMESHGUI/SMESH_msg_ja.ts index ca15aebf9..c1c0ae8c4 100644 --- a/src/SMESHGUI/SMESH_msg_ja.ts +++ b/src/SMESHGUI/SMESH_msg_ja.ts @@ -4431,6 +4431,10 @@ SMESH_HEX_PRISM 六角形プリズム + + Generate mesh from CAD model or import mesh + Generate mesh from CAD model or import mesh + SMESHGUI_FieldSelectorWdg @@ -4827,6 +4831,74 @@ PREF_PREVIEW_CHUNK_SIZE Under-shapes のブロックのサイズ + + INFO_WELCOME_TO_SMESH + Welcome to Mesh + + + INFO_GRP_CREATE_MESH + Create mesh + + + INFO_DEFINE_ALGOS + Choose algorithms + + + INFO_DEFINE_HYPOS + Define hypotheses + + + INFO_COMPUTE + Compute + + + INFO_REFINE + Add refinements + + + INFO_REFINE_LOCAL_SIZE + via local sizes with some hypotheses + + + INFO_REFINE_SUBMESH + via sub-meshes + + + INFO_GRP_IMPORT_MESH + Import mesh + + + INFO_AVAILABLE_FORMATS + Available formats + + + INFO_GRP_CHECK_MESH + Check mesh quality + + + INFO_DISPLAY + Display mesh + + + INFO_QUALITY_INFO + Display some quality criteria + + + INFO_QUALITY_AREA + area + + + INFO_QUALITY_VOLUME + volume + + + INFO_QUALITY_ASPECT_RATION + aspect ration + + + INFO_CLIPPING + Add clipping planes + SMESHGUI_GroupDlg