From aa633c2d5c52bbbf824280fe0e3e1a620da6390f Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 23 Nov 2020 17:43:49 +0300 Subject: [PATCH] Add InfoPanel --- resources/SalomeApp.xml.in | 5 ++- src/SMESHGUI/SMESHGUI.cxx | 58 +++++++++++++++++++---------- src/SMESHGUI/SMESH_msg_en.ts | 68 ++++++++++++++++++++++++++++++++++ src/SMESHGUI/SMESH_msg_fr.ts | 72 ++++++++++++++++++++++++++++++++++++ src/SMESHGUI/SMESH_msg_ja.ts | 72 ++++++++++++++++++++++++++++++++++++ 5 files changed, 254 insertions(+), 21 deletions(-) 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 01e721e61..875e3f828 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -5119,28 +5119,48 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) setMenuShown( true ); setToolShown( true ); - //InfoPanel + // 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()->setTitle(tr("Welcome to SMESH")); - - int gb1 = app->infoPanel()->addGroup(tr("Create a mesh")); - QString lbl1 = wrap("Define mesh algorithms", "li") + wrap("Define mesh hypotheses", "li") + wrap("Compute", "li") + wrap("Add some refinements:", "li"); - QString lbl2 = wrap("via local sizes with some hypotheses", "li") + wrap("or via sub-meshes", "li"); - lbl2 = lbl1 + wrap(lbl2, "ul"); - lbl1 = wrap(lbl2, "ul"); - app->infoPanel()->addLabel(lbl1, Qt::AlignLeft, gb1); - - int gb2 = app->infoPanel()->addGroup(tr("Import a mesh")); - lbl1 = wrap("unv", "li") + wrap("med", "li") + wrap("stl", "li") + wrap("cgns", "li") + wrap("sauv", "li") +wrap("gmf", "li"); - lbl1 = tr("Available formats:") + wrap(lbl1, "ul"); - app->infoPanel()->addLabel(lbl1, Qt::AlignLeft, gb2); + app->infoPanel()->addLabel(lab, gb); - int gb3 = app->infoPanel()->addGroup(tr("Check the mesh")); - lbl1 = wrap("area", "li") + wrap("volume", "li") + wrap("aspect ration...", "li"); - lbl1 = wrap("Display the mesh", "li") + wrap("Display some quality criteria:","li") + wrap(lbl1, "ul") + wrap("Add some clipping planes", "li"); - lbl1 = wrap(lbl1, "ul"); - app->infoPanel()->addLabel(lbl1, Qt::AlignLeft, gb3); + 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(); 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 -- 2.39.2