From fa942b088527dff794c956553e091fe1c170b590 Mon Sep 17 00:00:00 2001 From: Konstantin Leontev Date: Thu, 29 Feb 2024 16:16:35 +0000 Subject: [PATCH] [bos #38044][EDF] (2023-T3) Support for automatic reparation. Added menu icons from default GEOM directory. --- src/RepairGUIAdv/geomrepairadv_plugins.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/RepairGUIAdv/geomrepairadv_plugins.py b/src/RepairGUIAdv/geomrepairadv_plugins.py index ddf58bab6..2627b6d29 100644 --- a/src/RepairGUIAdv/geomrepairadv_plugins.py +++ b/src/RepairGUIAdv/geomrepairadv_plugins.py @@ -21,6 +21,9 @@ import salome_pluginsmanager +import os +from qtsalome import QIcon + # Plugins entry points # For new plugins create a function that shows related dialog, # then add it into plugin manager below. @@ -52,18 +55,29 @@ def union_edges(context): # Add plugins to a manager with a given menu titles and tooltips +def get_icon(icon_file): + """ + Creates an icon from a given file in default GEOM resource location. + """ + + icon_path = os.path.join(os.getenv('CSF_ShHealingDefaults'), icon_file) + return QIcon(icon_path) + salome_pluginsmanager.AddFunction( 'Locate Subshapes', 'Locates the sub-shapes of a compound by length, area or volume depending on whether it is an ' 'EDGE, a FACE or a SOLID', - locate_subshapes) + locate_subshapes, + get_icon('subshape.png')) salome_pluginsmanager.AddFunction( 'Merge Faces', 'Merges selected faces with a given precision', - merge_faces) + merge_faces, + get_icon('union_faces.png')) salome_pluginsmanager.AddFunction( 'Union Edges', 'Merges edges of selected face', - union_edges) + union_edges, + get_icon('fuse.png')) -- 2.39.2