0021014: EDF 1583 SMESH: Improvement of the Python Dump for the creation of groups
To create/edit SMESH_GroupOnFilter
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 33 KiB |
BIN
doc/salome/gui/SMESH/images/creategroup_on_filter.png
Normal file
After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 38 KiB |
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
\page creating_groups_page Creating groups
|
\page creating_groups_page Creating groups
|
||||||
|
|
||||||
\n In MESH you can create groups of elements of different types. To
|
\n In MESH you can create groups of elements of a certain type whose
|
||||||
create a group of elements in the \b Mesh menu select <b>Create
|
contents is defined in different ways. To create a group, in the \b
|
||||||
Group</b>.
|
Mesh menu select <b>Create Group</b> item (also available in the
|
||||||
\n To create any group you should define the following:
|
contextual menu of the mesh).<br>
|
||||||
|
To create a group of any type you should define the following:
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>Mesh</b> - the name of the mesh whose elements will form your
|
<li><b>Mesh</b> - the mesh whose elements will form your
|
||||||
group. You can select your mesh in the Objet Browser or in the 3D
|
group. You can select your mesh in the Objet Browser or in the 3D
|
||||||
viewer.</li>
|
viewer.</li>
|
||||||
<li><b>Elements Type</b> - set of radio buttons allows to select the type of
|
<li><b>Elements Type</b> - set of radio buttons allows to select the type of
|
||||||
@ -19,86 +20,122 @@ elements which will form your group:</li>
|
|||||||
<li><b>Volumes</b></li>
|
<li><b>Volumes</b></li>
|
||||||
</ul>
|
</ul>
|
||||||
<li><b>Name</b> field allows to enter the name of your new group.</li>
|
<li><b>Name</b> field allows to enter the name of your new group.</li>
|
||||||
|
<li><b>Color</b> - allows to assign to the group a certain color, for
|
||||||
|
example, defining boundary conditions. The chosen color is used to
|
||||||
|
display the elements of the group. The color attribute of the group is
|
||||||
|
not persistent, it is lost if you save and then load the study from
|
||||||
|
the file.</li>
|
||||||
</ul>
|
</ul>
|
||||||
SALOME Platform distinguishes between the two Group types:
|
SALOME Platform distinguishes between the three Group types:
|
||||||
<b>Standalone Group</b> and <b>Group on Geometry</b>.
|
<b>Standalone Group</b>, <b>Group on Geometry</b> and <b>Group on Filter</b>.
|
||||||
|
|
||||||
\anchor standalone_group <br><h2>"Standalone Group"</h2>
|
\anchor standalone_group <br><h2>"Standalone Group"</h2>
|
||||||
|
|
||||||
<b>Standalone Group</b> consists of mesh elements, which you can define in
|
<b>Standalone Group</b> contains a list of mesh elements, which you can define in
|
||||||
the following ways:
|
the following ways:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Choosing them manually with the mouse in the 3D Viewer. You can
|
<li>By adding all entities of the chosen type existing in the
|
||||||
click on an element in the 3D viewer and it will be highlighted. After
|
mesh. For this, turn on the <b>Select All</b> check box. In this mode
|
||||||
that click the \b Add button and the ID of this element will be added to
|
all controls, which allow selecting the entities in other ways are
|
||||||
the list.</li>
|
disabled.</li>
|
||||||
<li>Applying Filters. The <b>Set filter</b> button allows to apply a
|
<li>By applying the Filter. The <b>Set filter</b> button allows to
|
||||||
definite filter to selection of the elements of your group. See more
|
define the filter for selection of the elements for your group. See more
|
||||||
about filters on the
|
about filters on the
|
||||||
\ref selection_filter_library_page "Selection filter library" page.</li>
|
\ref selection_filter_library_page "Selection filter library" page.<br>
|
||||||
<li>By adding all existing entities of the chosen type to the
|
If the <b>Enable manual edition</b> check box is turned off, the defined
|
||||||
group. For this turn on the <b>Select All</b> check box. In this
|
filter defines contents of the group. In this mode, the filter is
|
||||||
mode all controls, which allow selecting the entities manually or by filters, are disabled.</li>
|
applied to all elements of the mesh. If none entity satisfies the
|
||||||
|
filter, the \b Apply button is disabled.<br>
|
||||||
|
If the <b>Enable manual edition</b> check box is turned on, the defined
|
||||||
|
filter can be used to for selection of entities composing the group.</li>
|
||||||
|
<li>By choosing entities manually with the mouse in the 3D Viewer. For
|
||||||
|
this, turn on the <b>Enable manual edition</b> check box. You can
|
||||||
|
click on an element in the 3D viewer and it will be highlighted. After
|
||||||
|
that click the \b Add button and the ID of this element will be
|
||||||
|
added to the list.</li>
|
||||||
|
<li>By adding entities from either a submesh or an existing
|
||||||
|
group. For this, turn on the <b>Enable manual edition</b> check
|
||||||
|
box. <b>Select from</b> set of fields allows to select a submesh or
|
||||||
|
a group of an appropriate type.</li>
|
||||||
|
</ul>
|
||||||
|
In the <b>manual edition</b> mode you can
|
||||||
|
<ul>
|
||||||
|
<li>click the \b Remove button to remove selected elements from the list</li>
|
||||||
|
<li>click the <b>Sort List</b> button to sort the list of IDs of
|
||||||
|
mesh elements.</li>
|
||||||
</ul>
|
</ul>
|
||||||
To remove a selected element or elements from the list click the
|
|
||||||
\b Remove button. The <b>Sort List</b> button allows to sort the list of IDs of
|
|
||||||
mesh elements.
|
|
||||||
\n <b>Select from</b> set of fields allows to choose a submesh or an existing
|
|
||||||
group whose elements of the previously defined type will be added to
|
|
||||||
the list of elements which will form the new group.
|
|
||||||
\n <b>Color</b> - allows to assign to the group a certain color, for
|
|
||||||
example, defining boundary conditions. This feature introduces a
|
|
||||||
useful element of preprocessing in Mesh module. Note that <b>Color</b> attribute defines
|
|
||||||
the colors used for the display of the elements of the group.
|
|
||||||
\n <b>Warning</b> The Med Color group interface may change in future versions of Salome.
|
|
||||||
|
|
||||||
\image html creategroup.png
|
\image html creategroup.png
|
||||||
|
|
||||||
For example, to create a new group containing all entities of the
|
|
||||||
|
For example, to create a new group containing all faces of an
|
||||||
existing group and some other faces selected in the viewer:
|
existing group and some other faces selected in the viewer:
|
||||||
<ul>
|
<ul>
|
||||||
<li> select the "Face" type of entities and input the name of the new group.</li>
|
<li> Select the \b Face type of entities and input the name of the new group.</li>
|
||||||
<li> checks "Group" checkbox in "Select From" group.</li>
|
<li> Check the \b Group checkbox in <b>Select From</b> group.</li>
|
||||||
<li> select the existing group in the object browser or in the viewer.</li>
|
<li> Select the existing group of faces in the object browser or in the viewer</li>
|
||||||
<li> click "Add" in "Content" group. "Id Elements" list will be filled
|
<li> Click \b Add in \b Content group. <b>Id Elements</b> list will be filled
|
||||||
with IDs of faces belonging to the exising group.</li>
|
with IDs of faces belonging to the exising group.</li>
|
||||||
<li> select other faces in the viewer.</li>
|
<li> Select other faces in the viewer.</li>
|
||||||
<li> click "Apply" button to create the new group.</li>
|
<li> Click \b Add in \b Content group.</li>
|
||||||
|
<li> Click \b Apply button to create the new group.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
Please note that the new group does not have references to the source
|
Please note that the new group does not have references to the source
|
||||||
group. It contains only the list of face IDs. So if the old group will
|
group. It contains only the list of face IDs. So if the source group
|
||||||
be changed, the new one will not be modified.
|
is changed, the new one is not updated accordingly.
|
||||||
|
|
||||||
|
|
||||||
\image html image130.gif
|
\image html image130.gif
|
||||||
<center>In this picture the brown cells belong to a group defined manually.</center>
|
<center>In this picture the brown cells belong to a group defined
|
||||||
|
manually.</center>
|
||||||
|
|
||||||
\image html image131.gif
|
\image html image131.gif
|
||||||
<center>In this picture the brown cells belong to the group defined by the criterion
|
<center>In this picture the brown cells belong to the group defined by
|
||||||
<b>Taper > 0</b>.</center>
|
the criterion <b>Taper > 0</b>.</center>
|
||||||
|
|
||||||
<b>See Also</b> a sample TUI Script of a
|
<b>See Also</b> a sample TUI Script of a
|
||||||
\ref tui_create_standalone_group "Create a Standalone Group"
|
\ref tui_create_standalone_group "Create a Standalone Group"
|
||||||
operation.
|
operation.
|
||||||
|
|
||||||
|
|
||||||
\anchor group_on_geom <br><h2>"Group on Geometry"</h2>
|
\anchor group_on_geom <br><h2>"Group on Geometry"</h2>
|
||||||
|
|
||||||
To create a group on geometry check <b>Group on geometry</b> in the \b Group
|
To create a group on geometry check <b>Group on geometry</b> in the \b
|
||||||
\b type field. <b>Group on geometry</b> contains the elements of a certain type
|
Group \b type field. The group on geometry contains the elements
|
||||||
belonging to the selected geometrical object. To define a group select
|
of a certain type generated on the selected geometrical object. Group
|
||||||
in the Objet Browser or in the 3D viewer a geometrical object from
|
contents is dynamically updated if the mesh is modified.<br>
|
||||||
which the elements will be taken. After confirmation of the operation
|
To define a group, select in the Objet Browser or in the 3D viewer a
|
||||||
a new group of mesh elements will be created.
|
geometrical object from which the elements will be taken. After
|
||||||
|
confirmation of the operation a new group of mesh elements will be
|
||||||
|
created.
|
||||||
|
|
||||||
\image html a-creategroup.png
|
\image html a-creategroup.png
|
||||||
|
|
||||||
\image html image132.gif
|
\image html image132.gif
|
||||||
<center>In this picture the cells which belong to a certain face are
|
<center>In this picture the cells which belong to a certain
|
||||||
selected in green.</center>
|
geometrical face are selected in green.</center>
|
||||||
|
|
||||||
<b>See Also</b> a sample TUI Script of a
|
<b>See Also</b> a sample TUI Script of a
|
||||||
\ref tui_create_group_on_geometry "Create a Group on Geometry"
|
\ref tui_create_group_on_geometry "Create a Group on Geometry"
|
||||||
operation.
|
operation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\anchor group_on_filter <br><h2>"Group on Filter"</h2>
|
||||||
|
|
||||||
|
To create a group on filter check <b>Group on filter</b> in the <b>
|
||||||
|
Group type</b> field. The group on filter contains the elements
|
||||||
|
of a certain type satisfying the defined filter. Group contents is
|
||||||
|
dynamically updated if the mesh is modified.<br> To define a group,
|
||||||
|
click the <b>Set filter</b> button and define criteria of the
|
||||||
|
filter in the opened dialog. After confirmation of the operation a
|
||||||
|
new group of mesh elements will be created. See more about filters on
|
||||||
|
the \ref selection_filter_library_page "Selection filter library" page.
|
||||||
|
|
||||||
|
\image html creategroup_on_filter.png
|
||||||
|
|
||||||
|
<b>See Also</b> a sample TUI Script of a
|
||||||
|
\ref tui_create_group_on_filter "Create a Group on Filter" operation.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -14,26 +14,29 @@ The following dialog box will appear:
|
|||||||
|
|
||||||
\image html editgroup.png
|
\image html editgroup.png
|
||||||
|
|
||||||
In this dialog box you can modify the name of your group and add or
|
In this dialog box you can modify the name and the color of your group
|
||||||
remove the elements forming it. For more information see
|
despite of it's type. You can add or remove the elements forming the
|
||||||
|
<em>standalone group</em>. You can change criteria of the filter of
|
||||||
|
the <em>group on filter</em>. For more information see
|
||||||
\ref creating_groups_page "Creating Groups" page.
|
\ref creating_groups_page "Creating Groups" page.
|
||||||
|
|
||||||
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm modification of the
|
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm
|
||||||
group.</li>
|
modification of the group.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
\anchor convert_to_standalone
|
\anchor convert_to_standalone
|
||||||
<em>To convert an existing group on geometry into standalone group
|
<em>To convert an existing group on geometry or a group on filer into
|
||||||
of elements and modify:</em>
|
a standalone group of elements and modify:</em>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Select your group on geometry in the Object Browser and in the \b Mesh menu click
|
<li>Select your group on geometry (or your group on filter) in the
|
||||||
the <b>Edit Group as Standalone</b> item.</li>
|
Object Browser and in the \b Mesh menu click the <b>Edit Group as
|
||||||
|
Standalone</b> item.</li>
|
||||||
|
|
||||||
\image html image74.gif
|
\image html image74.gif
|
||||||
<center><em>"Edit Group as Standalone" button</em></center>
|
<center><em>"Edit Group as Standalone" button</em></center>
|
||||||
|
|
||||||
The group on geometry will be converted into standalone group and can
|
The selected group will be converted into a standalone group and can
|
||||||
be modified as group of elements.
|
it's contents can be modified.
|
||||||
|
|
||||||
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm modification of the
|
<li>Click the \b Apply or <b>Apply and Close</b> button to confirm modification of the
|
||||||
group.</li>
|
group.</li>
|
||||||
|
@ -3,24 +3,29 @@
|
|||||||
\page grouping_elements_page Grouping elements
|
\page grouping_elements_page Grouping elements
|
||||||
|
|
||||||
In Mesh module it is possible to create groups of mesh elements:
|
In Mesh module it is possible to create groups of mesh elements:
|
||||||
nodes, edges, faces or volumes:
|
nodes, edges, faces or volumes. One group contains elements of only
|
||||||
|
one type. The following ways of creation are possible:
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li> by selecting the elements of the specified kind by their IDs or
|
<li> by selecting the elements using filters and/or
|
||||||
directly on the presentation in the VTK viewer - <b>Standalone
|
directly on the presentation in the VTK viewer, and/or by using
|
||||||
group</b> tab of \subpage creating_groups_page "Create group"
|
elements of other mesh objects - <b>Standalone group</b> tab of
|
||||||
dialog.</li>
|
\ref standalone_group "Create group" dialog.</li>
|
||||||
<li> by creating a group of elements of the selected type from all
|
<li> by creating a group of elements generated on the chosen
|
||||||
such elements of the chosen geometrical object - <b>Group on
|
geometrical object - <b>Group on geometry</b> tab of \ref
|
||||||
geometry</b> tab of \ref creating_groups_page "Create group" dialog.</li>
|
creating_groups_page "Create group" dialog and \ref
|
||||||
<li> by creating a group including all types of elements from an
|
create_groups_from_geometry_page "Create Groups from Geometry"
|
||||||
existing geometrical object - using \subpage create_groups_from_geometry_page "Create Groups from Geometry" dialog.</li>
|
dialog.</li>
|
||||||
<li> by creating several groups of elements (nodes,
|
<li> by creating a group of elements satisfying to certain critaria -
|
||||||
edges, faces and volumes) from the chosen submesh - using <b>Mesh -> Construct
|
<b>Group on filter</b> tab of \ref creating_groups_page
|
||||||
Group</b> Menu item. In this case groups of elements are created
|
"Create group" dialog.</li>
|
||||||
automatically.</li>
|
<li> by creating groups of nodes and elements from the chosen submesh
|
||||||
|
(type of elements depends on dimension of submesh geometry) -
|
||||||
|
using <b>Mesh -> Construct Group</b> menu item (available in contextual
|
||||||
|
menu as well).</li>
|
||||||
<li> by creating groups of entities from existing groups of superior
|
<li> by creating groups of entities from existing groups of superior
|
||||||
dimensions - using \subpage group_of_underlying_elements_page "Create Group of Underlying Elements"
|
dimensions - using \subpage group_of_underlying_elements_page
|
||||||
dialog.</li>
|
"Create Group of Underlying Elements" dialog.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ via <b>Tools / Selection filter library</b>.
|
|||||||
\image html selectionfilterlibrary.png
|
\image html selectionfilterlibrary.png
|
||||||
|
|
||||||
<b>Library file name</b> shows the path and the file name where your
|
<b>Library file name</b> shows the path and the file name where your
|
||||||
filters will be stored. By clicking the <em>Browse</em> button you can load an
|
filters will be stored. By clicking the <em>Browse</em> button you can
|
||||||
existing filter library.
|
load an existing filter library.
|
||||||
\n <b>Names of filters</b> lists the filters created or uploaded for
|
\n <b>Names of filters</b> lists the filters created or uploaded for
|
||||||
the current study. You can \b Add or \b Delete filters.
|
the current study. You can \b Add or \b Delete filters.
|
||||||
\n In <b>Filter name</b> box you can specify the name for your
|
\n In <b>Filter name</b> box you can specify the name for your
|
||||||
@ -31,18 +31,28 @@ specify logical relations between criteria using \b Binary operators
|
|||||||
Or and And.
|
Or and And.
|
||||||
\n Some criteria should have the additional parameter of \b Tolerance.
|
\n Some criteria should have the additional parameter of \b Tolerance.
|
||||||
|
|
||||||
When we create a <b>Standalone Group</b> using filters (for this click
|
When we create a group using filters (for this click
|
||||||
<b>Set Filters</b> button in the <b>Create Group</b> menu), the menu
|
<b>Set Filters</b> button in the <b>Create Group</b> dialog), the menu
|
||||||
for setting filters looks a bit differently. Toggling <b>Insert filter
|
for setting filters looks a bit differently (see below). Switching
|
||||||
in viewer</b> checkbox enables to preview the group selected with your
|
on <b>Insert filter in viewer</b> checkbox limits selection of elements
|
||||||
current filter in the viewer.
|
in the Viewer using your current filter.
|
||||||
\n In the \b Source field you choose if the filter will be applied to
|
<br>
|
||||||
the whole \b Mesh, the <b>Initial Selection</b> or the <b>Current Group</b>.
|
In the \b Source field you choose if the filter will be applied to
|
||||||
\n <b>Copy from...</b> button gives you a possibility to load an
|
the whole \b Mesh, the <b>Initial Selection</b> or the <b>Current
|
||||||
|
Group</b>. If \b Mesh is chosen, the elements satisfying the filter
|
||||||
|
will be selected in the 3D Viewer. If <b> Initial Selection</b> is
|
||||||
|
chosen, the filter will be applied to the selected elements and the
|
||||||
|
elements rejected by the filter will be deseleced. If <b>Current
|
||||||
|
Group</b> is chosen, the filter will be applied to the list of
|
||||||
|
elements in the <em>Greate Croup</em> dialog and the elements rejected
|
||||||
|
by the filter will be removed from the list.
|
||||||
|
<br>
|
||||||
|
<b>Copy from...</b> button gives you a possibility to load an
|
||||||
existing filter from <b>Selection filter library</b> and <b>Add
|
existing filter from <b>Selection filter library</b> and <b>Add
|
||||||
to...</b> button gives you a possibility to save your current filter
|
to...</b> button gives you a possibility to save your current filter
|
||||||
in the Library.
|
in the Library.
|
||||||
\n <b>Note:</b> If the button <b>Apply and Close</b> is disabled, there
|
<br>
|
||||||
|
<b>Note:</b> If the button <b>Apply and Close</b> is disabled, there
|
||||||
is no selected mesh in the Object Browser and the filter can not be
|
is no selected mesh in the Object Browser and the filter can not be
|
||||||
created. You have to select the mesh and the button will be enabled.
|
created. You have to select the mesh and the button will be enabled.
|
||||||
|
|
||||||
|
@ -74,6 +74,51 @@ aSmeshGroup2 = quadra.GroupOnGeom(aGeomGroupE)
|
|||||||
salome.sg.updateObjBrowser(1)
|
salome.sg.updateObjBrowser(1)
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
|
<br>
|
||||||
|
\anchor tui_create_group_on_filter
|
||||||
|
|
||||||
|
<h2>Create a Group on Filter</h2>
|
||||||
|
|
||||||
|
\code
|
||||||
|
from smesh import *
|
||||||
|
SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
|
box = geompy.MakeBoxDXDYDZ(10,10,10)
|
||||||
|
|
||||||
|
# make a mesh with quadrangles of different area in range [1,16]
|
||||||
|
mesh = Mesh(box,"Quad mesh")
|
||||||
|
hyp1D = mesh.Segment().StartEndLength( 1, 4 )
|
||||||
|
mesh.Quadrangle()
|
||||||
|
mesh.Compute()
|
||||||
|
|
||||||
|
# create a group on filter selecting faces of medium size
|
||||||
|
critaria = [ \
|
||||||
|
GetCriterion(FACE, FT_Area, ">", 1.1, BinaryOp=FT_LogicalAND ),
|
||||||
|
GetCriterion(FACE, FT_Area, "<", 15.0 )
|
||||||
|
]
|
||||||
|
filt = GetFilterFromCriteria( critaria )
|
||||||
|
filtGroup = mesh.GroupOnFilter( FACE, "group on filter", filt )
|
||||||
|
print "Group on filter conatains %s elemens" % filtGroup.Size()
|
||||||
|
|
||||||
|
# group on filter is updated if the mesh is modified
|
||||||
|
hyp1D.SetStartLength( 2.5 )
|
||||||
|
hyp1D.SetEndLength( 2.5 )
|
||||||
|
mesh.Compute()
|
||||||
|
print "After mesh change, group on filter conatains %s elemens" % filtGroup.Size()
|
||||||
|
|
||||||
|
# set a new filter defining the group
|
||||||
|
filt2 = GetFilter( FACE, FT_RangeOfIds, "1-50" )
|
||||||
|
filtGroup.SetFilter( filt2 )
|
||||||
|
print "With a new filter, group on filter conatains %s elemens" % filtGroup.Size()
|
||||||
|
|
||||||
|
# group is updated at modification of the filter
|
||||||
|
filt2.SetCriteria( [ GetCriterion( FACE, FT_RangeOfIds, "1-70" )])
|
||||||
|
filtIDs3 = filtGroup.GetIDs()
|
||||||
|
print "After filter modification, group on filter conatains %s elemens" % filtGroup.Size()
|
||||||
|
|
||||||
|
salome.sg.updateObjBrowser(1)
|
||||||
|
\endcode
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
\anchor tui_edit_group
|
\anchor tui_edit_group
|
||||||
<h2>Edit a Group</h2>
|
<h2>Edit a Group</h2>
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include <SMESH_TypeFilter.hxx>
|
#include <SMESH_TypeFilter.hxx>
|
||||||
#include <SMESH_Actor.h>
|
#include <SMESH_Actor.h>
|
||||||
#include <SMESH_ActorUtils.h>
|
#include <SMESH_ActorUtils.h>
|
||||||
|
#include <SMESH_LogicalFilter.hxx>
|
||||||
|
|
||||||
// SALOME GEOM includes
|
// SALOME GEOM includes
|
||||||
#include <GEOMBase.h>
|
#include <GEOMBase.h>
|
||||||
@ -124,7 +125,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
|
|||||||
mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
|
mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
|
||||||
myIsBusy( false ),
|
myIsBusy( false ),
|
||||||
myNameChanged( false ),
|
myNameChanged( false ),
|
||||||
myIsApplyAndClose( false )
|
myIsApplyAndClose( false ),
|
||||||
|
myNbChangesOfContents(0)
|
||||||
{
|
{
|
||||||
initDialog( true );
|
initDialog( true );
|
||||||
if ( !theMesh->_is_nil() )
|
if ( !theMesh->_is_nil() )
|
||||||
@ -150,7 +152,8 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
|
|||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
|
mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
|
||||||
myIsBusy( false ),
|
myIsBusy( false ),
|
||||||
myNameChanged( false )
|
myNameChanged( false ),
|
||||||
|
myNbChangesOfContents(0) // just not to use uninitialized variable
|
||||||
{
|
{
|
||||||
initDialog( false );
|
initDialog( false );
|
||||||
if ( !theGroup->_is_nil() )
|
if ( !theGroup->_is_nil() )
|
||||||
@ -237,10 +240,13 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
|
|||||||
|
|
||||||
QRadioButton* rb1 = new QRadioButton( tr( "SMESH_GROUP_STANDALONE" ), aGrpTypeBox );
|
QRadioButton* rb1 = new QRadioButton( tr( "SMESH_GROUP_STANDALONE" ), aGrpTypeBox );
|
||||||
QRadioButton* rb2 = new QRadioButton( tr( "SMESH_GROUP_GEOMETRY" ), aGrpTypeBox );
|
QRadioButton* rb2 = new QRadioButton( tr( "SMESH_GROUP_GEOMETRY" ), aGrpTypeBox );
|
||||||
|
QRadioButton* rb3 = new QRadioButton( tr( "SMESH_GROUP_FILTER" ), aGrpTypeBox );
|
||||||
myGrpTypeGroup->addButton( rb1, 0 );
|
myGrpTypeGroup->addButton( rb1, 0 );
|
||||||
myGrpTypeGroup->addButton( rb2, 1 );
|
myGrpTypeGroup->addButton( rb2, 1 );
|
||||||
|
myGrpTypeGroup->addButton( rb3, 2 );
|
||||||
aGrpTypeBoxLayout->addWidget( rb1 );
|
aGrpTypeBoxLayout->addWidget( rb1 );
|
||||||
aGrpTypeBoxLayout->addWidget( rb2 );
|
aGrpTypeBoxLayout->addWidget( rb2 );
|
||||||
|
aGrpTypeBoxLayout->addWidget( rb3 );
|
||||||
aGrpTypeBox->setEnabled( create );
|
aGrpTypeBox->setEnabled( create );
|
||||||
myGrpTypeId = -1;
|
myGrpTypeId = -1;
|
||||||
|
|
||||||
@ -248,6 +254,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
|
|||||||
myWGStack = new QStackedWidget( this );
|
myWGStack = new QStackedWidget( this );
|
||||||
QWidget* wg1 = new QWidget( myWGStack );
|
QWidget* wg1 = new QWidget( myWGStack );
|
||||||
QWidget* wg2 = new QWidget( myWGStack );
|
QWidget* wg2 = new QWidget( myWGStack );
|
||||||
|
QWidget* wg3 = new QWidget( myWGStack );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
QGroupBox* aContentBox = new QGroupBox( tr( "SMESH_CONTENT" ), wg1 );
|
QGroupBox* aContentBox = new QGroupBox( tr( "SMESH_CONTENT" ), wg1 );
|
||||||
@ -256,23 +263,25 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
|
|||||||
aContentBoxLayout->setSpacing( SPACING );
|
aContentBoxLayout->setSpacing( SPACING );
|
||||||
|
|
||||||
mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), aContentBox );
|
mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), aContentBox );
|
||||||
|
myAllowElemsModif = new QCheckBox( tr( "ALLOW_ELEM_LIST_MODIF" ), aContentBox );
|
||||||
|
|
||||||
myElementsLab = new QLabel( tr( "SMESH_ID_ELEMENTS" ), aContentBox );
|
myElementsLab = new QLabel( tr( "SMESH_ID_ELEMENTS" ), aContentBox );
|
||||||
myElements = new QListWidget( aContentBox );
|
myElements = new QListWidget( aContentBox );
|
||||||
myElements->setSelectionMode( QListWidget::ExtendedSelection );
|
myElements->setSelectionMode( QListWidget::ExtendedSelection );
|
||||||
|
|
||||||
myFilter = new QPushButton( tr( "SMESH_BUT_FILTER" ), aContentBox );
|
myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), aContentBox );
|
||||||
myAddBtn = new QPushButton( tr( "SMESH_BUT_ADD" ), aContentBox );
|
myAddBtn = new QPushButton( tr( "SMESH_BUT_ADD" ), aContentBox );
|
||||||
myRemoveBtn = new QPushButton( tr( "SMESH_BUT_REMOVE" ), aContentBox );
|
myRemoveBtn = new QPushButton( tr( "SMESH_BUT_REMOVE" ), aContentBox );
|
||||||
mySortBtn = new QPushButton( tr( "SMESH_BUT_SORT" ), aContentBox );
|
mySortBtn = new QPushButton( tr( "SMESH_BUT_SORT" ), aContentBox );
|
||||||
|
|
||||||
aContentBoxLayout->addWidget( mySelectAll, 0, 0 );
|
aContentBoxLayout->addWidget( mySelectAll, 0, 0 );
|
||||||
aContentBoxLayout->addWidget( myElementsLab, 1, 0 );
|
aContentBoxLayout->addWidget( myAllowElemsModif, 1, 0 );
|
||||||
aContentBoxLayout->addWidget( myElements, 2, 0, 6, 1 );
|
aContentBoxLayout->addWidget( myFilterBtn, 1, 1 );
|
||||||
aContentBoxLayout->addWidget( myFilter, 2, 1 );
|
aContentBoxLayout->addWidget( myElementsLab, 2, 0 );
|
||||||
aContentBoxLayout->addWidget( myAddBtn, 4, 1 );
|
aContentBoxLayout->addWidget( myElements, 3, 0, 6, 1 );
|
||||||
aContentBoxLayout->addWidget( myRemoveBtn, 5, 1 );
|
aContentBoxLayout->addWidget( myAddBtn, 3, 1 );
|
||||||
aContentBoxLayout->addWidget( mySortBtn, 7, 1 );
|
aContentBoxLayout->addWidget( myRemoveBtn, 4, 1 );
|
||||||
|
aContentBoxLayout->addWidget( mySortBtn, 8, 1 );
|
||||||
|
|
||||||
aContentBoxLayout->setColumnStretch( 0, 1 );
|
aContentBoxLayout->setColumnStretch( 0, 1 );
|
||||||
aContentBoxLayout->setRowStretch( 3, 1 );
|
aContentBoxLayout->setRowStretch( 3, 1 );
|
||||||
@ -328,15 +337,24 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
QGridLayout* wg2Layout = new QGridLayout( wg2 );
|
QGridLayout* wg2Layout = new QGridLayout( wg2 );
|
||||||
wg2Layout->setMargin( 0 );
|
wg2Layout->setMargin( 0 );
|
||||||
wg1Layout->setSpacing( SPACING );
|
wg2Layout->setSpacing( SPACING );
|
||||||
wg2Layout->addWidget( geomObject, 0, 0 );
|
wg2Layout->addWidget( geomObject, 0, 0 );
|
||||||
wg2Layout->addWidget( myGeomGroupBtn, 0, 1 );
|
wg2Layout->addWidget( myGeomGroupBtn, 0, 1 );
|
||||||
wg2Layout->addWidget( myGeomGroupLine,0, 2 );
|
wg2Layout->addWidget( myGeomGroupLine,0, 2 );
|
||||||
wg2Layout->setRowStretch( 1, 5 );
|
wg2Layout->setRowStretch( 1, 5 );
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
QPushButton * aFilter2 = new QPushButton( tr( "SMESH_BUT_FILTER" ), wg3 );
|
||||||
|
QGridLayout* wg3Layout = new QGridLayout( wg3 );
|
||||||
|
wg3Layout->setMargin( 0 );
|
||||||
|
wg3Layout->setSpacing( SPACING );
|
||||||
|
wg3Layout->addWidget( aFilter2, 0, 0 );
|
||||||
|
wg3Layout->setRowStretch( 1, 5 );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
myWGStack->insertWidget( 0, wg1 );
|
myWGStack->insertWidget( 0, wg1 );
|
||||||
myWGStack->insertWidget( 1, wg2 );
|
myWGStack->insertWidget( 1, wg2 );
|
||||||
|
myWGStack->insertWidget( 2, wg3 );
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
QGroupBox* aColorBox = new QGroupBox(tr( "SMESH_SET_COLOR" ), this);
|
QGroupBox* aColorBox = new QGroupBox(tr( "SMESH_SET_COLOR" ), this);
|
||||||
@ -398,8 +416,10 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
|
|||||||
connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
|
connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
|
||||||
connect(myElements, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
|
connect(myElements, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
|
||||||
|
|
||||||
connect(myFilter, SIGNAL(clicked()), this, SLOT(setFilters()));
|
connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
|
||||||
|
connect(aFilter2, SIGNAL(clicked()), this, SLOT(setFilters()));
|
||||||
connect(mySelectAll, SIGNAL(toggled(bool)), this, SLOT(onSelectAll()));
|
connect(mySelectAll, SIGNAL(toggled(bool)), this, SLOT(onSelectAll()));
|
||||||
|
connect(myAllowElemsModif,SIGNAL(toggled(bool)), this, SLOT(onSelectAll()));
|
||||||
connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAdd()));
|
connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAdd()));
|
||||||
connect(myRemoveBtn, SIGNAL(clicked()), this, SLOT(onRemove()));
|
connect(myRemoveBtn, SIGNAL(clicked()), this, SLOT(onRemove()));
|
||||||
connect(mySortBtn, SIGNAL(clicked()), this, SLOT(onSort()));
|
connect(mySortBtn, SIGNAL(clicked()), this, SLOT(onSort()));
|
||||||
@ -423,8 +443,12 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
|
|||||||
|
|
||||||
mySelectionMode = grpNoSelection;
|
mySelectionMode = grpNoSelection;
|
||||||
myMeshFilter = new SMESH_TypeFilter(MESH);
|
myMeshFilter = new SMESH_TypeFilter(MESH);
|
||||||
mySubMeshFilter = new SMESH_TypeFilter(SUBMESH);
|
mySubMeshFilter = new SMESH_LogicalFilter(QList<SUIT_SelectionFilter*>(),
|
||||||
myGroupFilter = new SMESH_TypeFilter(GROUP);
|
SMESH_LogicalFilter::LO_OR,
|
||||||
|
/*takeOwnership=*/true);
|
||||||
|
myGroupFilter = new SMESH_LogicalFilter(QList<SUIT_SelectionFilter*>(),
|
||||||
|
SMESH_LogicalFilter::LO_OR,
|
||||||
|
/*takeOwnership=*/true);
|
||||||
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( mySMESHGUI->application()->activeStudy() );
|
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( mySMESHGUI->application()->activeStudy() );
|
||||||
myGeomFilter = new GEOM_SelectionFilter( aStudy, true );
|
myGeomFilter = new GEOM_SelectionFilter( aStudy, true );
|
||||||
|
|
||||||
@ -439,8 +463,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
|
|||||||
if (myMesh->_is_nil() )
|
if (myMesh->_is_nil() )
|
||||||
myTypeGroup->button(0)->setChecked(true);
|
myTypeGroup->button(0)->setChecked(true);
|
||||||
|
|
||||||
updateButtons();
|
onSelectAll(); //updateButtons();
|
||||||
//myName->setText(GetDefaultName(tr( "SMESH_GROUP" )));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -454,6 +477,10 @@ SMESHGUI_GroupDlg::~SMESHGUI_GroupDlg()
|
|||||||
myFilterDlg->setParent( 0 );
|
myFilterDlg->setParent( 0 );
|
||||||
delete myFilterDlg;
|
delete myFilterDlg;
|
||||||
}
|
}
|
||||||
|
if ( myMeshFilter ) delete myMeshFilter;
|
||||||
|
if ( mySubMeshFilter ) delete mySubMeshFilter;
|
||||||
|
if ( myGroupFilter ) delete myGroupFilter;
|
||||||
|
if ( myGeomFilter ) delete myGeomFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -506,6 +533,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
|
|||||||
setShowEntityMode();
|
setShowEntityMode();
|
||||||
myGroup = SMESH::SMESH_Group::_nil();
|
myGroup = SMESH::SMESH_Group::_nil();
|
||||||
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
||||||
|
myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil();
|
||||||
|
|
||||||
// NPAL19389: create a group with a selection in another group
|
// NPAL19389: create a group with a selection in another group
|
||||||
// set actor of myMesh, if it is visible, else try
|
// set actor of myMesh, if it is visible, else try
|
||||||
@ -562,8 +590,10 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
|
|||||||
|
|
||||||
myGroup = SMESH::SMESH_Group::_narrow( theGroup );
|
myGroup = SMESH::SMESH_Group::_narrow( theGroup );
|
||||||
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( theGroup );
|
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( theGroup );
|
||||||
|
myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_narrow( theGroup );
|
||||||
|
myFilter = SMESH::Filter::_nil();
|
||||||
|
|
||||||
if (myGroup->_is_nil() && myGroupOnGeom->_is_nil())
|
if (myGroup->_is_nil() && myGroupOnGeom->_is_nil() && myGroupOnFilter->_is_nil() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// NPAL19389: create a group with a selection in another group
|
// NPAL19389: create a group with a selection in another group
|
||||||
@ -578,14 +608,16 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
|
|||||||
anActor = SMESH::FindActorByObject(theGroup);
|
anActor = SMESH::FindActorByObject(theGroup);
|
||||||
SMESH::SetPickable(anActor);*/
|
SMESH::SetPickable(anActor);*/
|
||||||
|
|
||||||
int grpType = (!myGroup->_is_nil() ? 0 : (theIsConvert ? 0 : 1));
|
int grpType = (!myGroup->_is_nil() ? 0 : (theIsConvert ? 0 : myGroupOnGeom->_is_nil() ? 2 : 1));
|
||||||
myGrpTypeGroup->button(grpType)->setChecked(true);
|
myGrpTypeGroup->button(grpType)->setChecked(true);
|
||||||
onGrpTypeChanged(grpType);
|
onGrpTypeChanged(grpType);
|
||||||
|
|
||||||
myTypeId = aType;
|
myTypeId = aType;
|
||||||
if ( grpType == 0 ) {
|
if ( grpType == 0 ) { // standalone group
|
||||||
myCurrentLineEdit = 0;
|
myCurrentLineEdit = 0;
|
||||||
myElements->clear();
|
myElements->clear();
|
||||||
|
myAllowElemsModif->setChecked( true );
|
||||||
|
|
||||||
setSelectionMode(aType);
|
setSelectionMode(aType);
|
||||||
|
|
||||||
setShowEntityMode(); // depends on myTypeId
|
setShowEntityMode(); // depends on myTypeId
|
||||||
@ -601,7 +633,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
|
|||||||
myElements->selectAll();
|
myElements->selectAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if ( grpType == 1 ) // group on geom
|
||||||
{
|
{
|
||||||
QString aShapeName( "" );
|
QString aShapeName( "" );
|
||||||
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
||||||
@ -613,12 +645,26 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
|
|||||||
aShapeName = aGroupShapeSO->GetName().c_str();
|
aShapeName = aGroupShapeSO->GetName().c_str();
|
||||||
}
|
}
|
||||||
myGeomGroupLine->setText( aShapeName );
|
myGeomGroupLine->setText( aShapeName );
|
||||||
|
}
|
||||||
|
else // group on filter
|
||||||
|
{
|
||||||
|
myFilter = myGroupOnFilter->GetFilter();
|
||||||
|
if ( !myFilter->_is_nil() ) {
|
||||||
|
SMESH::Predicate_var perdicate = myFilter->GetPredicate();
|
||||||
|
if ( perdicate->_is_nil() )
|
||||||
|
myFilter = SMESH::Filter::_nil();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( grpType != 0 )
|
||||||
|
{
|
||||||
myNameChanged = true;
|
myNameChanged = true;
|
||||||
myName->blockSignals(true);
|
myName->blockSignals(true);
|
||||||
myName->setText(theGroup->GetName());
|
myName->setText(theGroup->GetName());
|
||||||
myName->blockSignals(false);
|
myName->blockSignals(false);
|
||||||
}
|
}
|
||||||
updateButtons();
|
|
||||||
|
onSelectAll(); //updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -628,17 +674,36 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
|
|||||||
void SMESHGUI_GroupDlg::updateButtons()
|
void SMESHGUI_GroupDlg::updateButtons()
|
||||||
{
|
{
|
||||||
bool enable = !myName->text().trimmed().isEmpty();
|
bool enable = !myName->text().trimmed().isEmpty();
|
||||||
|
if ( enable )
|
||||||
if (myGrpTypeId == 0) {
|
{
|
||||||
enable = enable && (mySelectAll->isChecked() || myElements->count() > 0);
|
if (myGrpTypeId == 0) { // standalone
|
||||||
enable = enable && (!myGroup->_is_nil() || !myMesh->_is_nil());
|
if ( !mySelectAll->isChecked() )
|
||||||
}
|
{
|
||||||
else if (myGrpTypeId == 1) {
|
if ( myAllowElemsModif->isChecked() )
|
||||||
if (CORBA::is_nil(myGroupOnGeom)) { // creation mode
|
{
|
||||||
enable = enable && myGeomObjects->length() > 0 && !myMesh->_is_nil();
|
enable = ( myElements->count() > 0 );
|
||||||
|
}
|
||||||
|
else if ((enable = !myFilter->_is_nil() ))
|
||||||
|
{
|
||||||
|
SMESH::array_of_ElementType_var types = myFilter->GetTypes();
|
||||||
|
enable = types->length();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
enable = enable && (!myGroup->_is_nil() || !myMesh->_is_nil());
|
||||||
|
}
|
||||||
|
else if (myGrpTypeId == 1) // on geom
|
||||||
|
{
|
||||||
|
if (CORBA::is_nil(myGroupOnGeom)) // creation mode
|
||||||
|
enable = ( myGeomObjects->length() > 0 && !myMesh->_is_nil() );
|
||||||
|
}
|
||||||
|
else if (myGrpTypeId == 2) // on filter
|
||||||
|
{
|
||||||
|
if (( enable = !myFilter->_is_nil() ))
|
||||||
|
if (CORBA::is_nil(myGroupOnFilter) ) // creation mode
|
||||||
|
enable = !myMesh->_is_nil();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myOKBtn->setEnabled(enable);
|
myOKBtn->setEnabled(enable);
|
||||||
myApplyBtn->setEnabled(enable);
|
myApplyBtn->setEnabled(enable);
|
||||||
}
|
}
|
||||||
@ -662,9 +727,13 @@ void SMESHGUI_GroupDlg::onTypeChanged (int id)
|
|||||||
{
|
{
|
||||||
if (myTypeId != id) {
|
if (myTypeId != id) {
|
||||||
myElements->clear();
|
myElements->clear();
|
||||||
if (myCurrentLineEdit == 0)
|
|
||||||
setSelectionMode(id);
|
|
||||||
myTypeId = id;
|
myTypeId = id;
|
||||||
|
|
||||||
|
int curSelMode = mySelectionMode;
|
||||||
|
mySelectionMode = grpNoSelection;
|
||||||
|
setSelectionMode( curSelMode );
|
||||||
|
onObjectSelectionChanged();
|
||||||
|
|
||||||
setShowEntityMode();
|
setShowEntityMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -683,6 +752,7 @@ void SMESHGUI_GroupDlg::onGrpTypeChanged (int id)
|
|||||||
onSelectGeomGroup(id == 1);
|
onSelectGeomGroup(id == 1);
|
||||||
}
|
}
|
||||||
myGrpTypeId = id;
|
myGrpTypeId = id;
|
||||||
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -704,7 +774,7 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
|
|||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
return;
|
return;
|
||||||
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
|
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
|
||||||
bool isSelectAll = mySelectAll->isChecked();
|
bool isSelectAll = mySelectAll->isChecked() || !myAllowElemsModif->isChecked();
|
||||||
if (mySelectionMode != theMode) {
|
if (mySelectionMode != theMode) {
|
||||||
// [PAL10408] mySelectionMgr->clearSelected();
|
// [PAL10408] mySelectionMgr->clearSelected();
|
||||||
mySelectionMgr->clearFilters();
|
mySelectionMgr->clearFilters();
|
||||||
@ -737,14 +807,44 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
|
|||||||
case grpVolumeSelection:
|
case grpVolumeSelection:
|
||||||
if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : VolumeSelection);
|
if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : VolumeSelection);
|
||||||
break;
|
break;
|
||||||
case grpSubMeshSelection:
|
case grpSubMeshSelection: {
|
||||||
mySelectionMgr->installFilter(mySubMeshFilter);
|
|
||||||
|
SMESH_TypeFilter* f = 0;
|
||||||
|
switch (myTypeId) {
|
||||||
|
case 0: f = new SMESH_TypeFilter(SUBMESH); break;
|
||||||
|
case 1: f = new SMESH_TypeFilter(SUBMESH_EDGE); break;
|
||||||
|
case 2: f = new SMESH_TypeFilter(SUBMESH_FACE); break;
|
||||||
|
case 3: f = new SMESH_TypeFilter(SUBMESH_SOLID); break;
|
||||||
|
default:f = new SMESH_TypeFilter(SUBMESH);
|
||||||
|
}
|
||||||
|
QList<SUIT_SelectionFilter*> filtList;
|
||||||
|
filtList.append( f );
|
||||||
|
filtList.append( new SMESH_TypeFilter(SUBMESH_COMPOUND));
|
||||||
|
mySubMeshFilter->setFilters( filtList );
|
||||||
|
|
||||||
|
mySelectionMgr->installFilter( mySubMeshFilter );
|
||||||
|
|
||||||
if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
|
if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
break;
|
break;
|
||||||
case grpGroupSelection:
|
}
|
||||||
|
case grpGroupSelection: {
|
||||||
|
|
||||||
|
SMESH_TypeFilter* f = 0;
|
||||||
|
switch (myTypeId) {
|
||||||
|
case 0: f = new SMESH_TypeFilter(GROUP_NODE); break;
|
||||||
|
case 1: f = new SMESH_TypeFilter(GROUP_EDGE); break;
|
||||||
|
case 2: f = new SMESH_TypeFilter(GROUP_FACE); break;
|
||||||
|
case 3: f = new SMESH_TypeFilter(GROUP_VOLUME); break;
|
||||||
|
default:f = new SMESH_TypeFilter(GROUP);
|
||||||
|
}
|
||||||
|
QList<SUIT_SelectionFilter*> filtList;
|
||||||
|
filtList.append( f );
|
||||||
|
myGroupFilter->setFilters( filtList );
|
||||||
|
|
||||||
mySelectionMgr->installFilter(myGroupFilter);
|
mySelectionMgr->installFilter(myGroupFilter);
|
||||||
if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
|
if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case grpMeshSelection:
|
case grpMeshSelection:
|
||||||
mySelectionMgr->installFilter(myMeshFilter);
|
mySelectionMgr->installFilter(myMeshFilter);
|
||||||
if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
|
if ( aViewWindow ) aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
@ -774,22 +874,39 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
if (myName->text().trimmed().isEmpty())
|
if (myName->text().trimmed().isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
SMESH::ElementType aType = SMESH::ALL;
|
||||||
|
switch (myTypeId) {
|
||||||
|
case 0: aType = SMESH::NODE; break;
|
||||||
|
case 1: aType = SMESH::EDGE; break;
|
||||||
|
case 2: aType = SMESH::FACE; break;
|
||||||
|
case 3: aType = SMESH::VOLUME; break;
|
||||||
|
}
|
||||||
|
|
||||||
bool anIsOk = false;
|
bool anIsOk = false;
|
||||||
QStringList anEntryList;
|
QStringList anEntryList;
|
||||||
if (myGrpTypeId == 0) { // on mesh elements
|
|
||||||
if (!mySelectAll->isChecked() && !myElements->count())
|
SMESH::SMESH_GroupBase_var resultGroup;
|
||||||
|
bool isCreation;
|
||||||
|
|
||||||
|
if (myGrpTypeId == 0) // standalone
|
||||||
|
{
|
||||||
|
if (!mySelectAll->isChecked() && !myElements->count() && myAllowElemsModif->isChecked())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
mySelectionMgr->clearSelected();
|
mySelectionMgr->clearSelected();
|
||||||
|
|
||||||
if (myGroup->_is_nil()) { // creation or conversion
|
if (myGroup->_is_nil()) { // creation or conversion
|
||||||
// check if group on geometry is not null
|
// check if group on geometry is not null
|
||||||
if (!CORBA::is_nil(myGroupOnGeom)) {
|
if (!myGroupOnGeom->_is_nil() || !myGroupOnFilter->_is_nil()) {
|
||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
return false;
|
return false;
|
||||||
myGroup = myMesh->ConvertToStandalone( myGroupOnGeom );
|
if ( myGroupOnGeom->_is_nil() )
|
||||||
// nullify pointer, because object become dead
|
myGroup = myMesh->ConvertToStandalone( myGroupOnFilter );
|
||||||
|
else
|
||||||
|
myGroup = myMesh->ConvertToStandalone( myGroupOnGeom );
|
||||||
|
|
||||||
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
||||||
|
myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -797,63 +914,40 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SMESH::ElementType aType = SMESH::ALL;
|
|
||||||
switch (myTypeId) {
|
|
||||||
case 0: aType = SMESH::NODE; break;
|
|
||||||
case 1: aType = SMESH::EDGE; break;
|
|
||||||
case 2: aType = SMESH::FACE; break;
|
|
||||||
case 3: aType = SMESH::VOLUME; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
|
myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
|
||||||
|
|
||||||
|
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroup );
|
||||||
|
isCreation = true;
|
||||||
|
|
||||||
if ( mySelectAll->isChecked() ) {
|
if ( mySelectAll->isChecked() ) {
|
||||||
// select all
|
// select all
|
||||||
myGroup->AddFrom(myMesh.in());
|
myGroup->AddFrom(myMesh.in());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// select manually
|
// select manually
|
||||||
SMESH::long_array_var anIdList = new SMESH::long_array;
|
|
||||||
int i, k = myElements->count();
|
if ( !myFilter->_is_nil() &&
|
||||||
anIdList->length(k);
|
( myNbChangesOfContents == 1 || !myAllowElemsModif->isChecked()))
|
||||||
for (i = 0; i < k; i++) {
|
{
|
||||||
anIdList[i] = myElements->item(i)->text().toInt();
|
myGroup->AddFrom( myFilter );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SMESH::long_array_var anIdList = new SMESH::long_array;
|
||||||
|
int i, k = myElements->count();
|
||||||
|
anIdList->length(k);
|
||||||
|
for (i = 0; i < k; i++) {
|
||||||
|
anIdList[i] = myElements->item(i)->text().toInt();
|
||||||
|
}
|
||||||
|
myGroup->Add(anIdList.inout());
|
||||||
}
|
}
|
||||||
|
|
||||||
myGroup->Add(anIdList.inout());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SALOMEDS::Color aColor = getGroupColor();
|
|
||||||
myGroup->SetColor(aColor);
|
|
||||||
|
|
||||||
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
|
|
||||||
if( aMeshGroupSO )
|
|
||||||
anEntryList.append( aMeshGroupSO->GetID().c_str() );
|
|
||||||
|
|
||||||
//SMESH::setFileName ( aMeshGroupSO, QString::number(myColorSpinBox->value()) );
|
|
||||||
SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );
|
|
||||||
|
|
||||||
/* init for next operation */
|
|
||||||
myName->setText( "" );
|
|
||||||
myElements->clear();
|
|
||||||
myGroup = SMESH::SMESH_Group::_nil();
|
|
||||||
|
|
||||||
} else { // edition
|
} else { // edition
|
||||||
myGroup->SetName(myName->text().toLatin1().data());
|
|
||||||
|
|
||||||
SALOMEDS::Color aColor = getGroupColor();
|
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroup );
|
||||||
myGroup->SetColor(aColor);
|
isCreation = false;
|
||||||
|
|
||||||
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
|
|
||||||
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
|
|
||||||
anActor->setName(myName->text().toLatin1().data());
|
|
||||||
switch ( myTypeId ) {
|
|
||||||
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
|
|
||||||
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
|
|
||||||
case 2:
|
|
||||||
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( mySelectAll->isChecked() ) {
|
if ( mySelectAll->isChecked() ) {
|
||||||
// select all
|
// select all
|
||||||
@ -896,25 +990,14 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESHGUI::Modified();
|
|
||||||
mySMESHGUI->updateObjBrowser(true);
|
|
||||||
SMESH::UpdateView(); // asv: fix of BUG PAL5515
|
|
||||||
mySelectionMgr->clearSelected();
|
|
||||||
anIsOk = true;
|
anIsOk = true;
|
||||||
}
|
}
|
||||||
else if (myGrpTypeId == 1) { // on geom object
|
else if (myGrpTypeId == 1) // on geom object
|
||||||
|
{
|
||||||
if (CORBA::is_nil(myGroupOnGeom)) { // creation
|
if (CORBA::is_nil(myGroupOnGeom)) { // creation
|
||||||
if (myMesh->_is_nil() || !myGeomObjects->length())
|
if (myMesh->_is_nil() || !myGeomObjects->length())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SMESH::ElementType aType = SMESH::ALL;
|
|
||||||
switch (myTypeId) {
|
|
||||||
case 0: aType = SMESH::NODE; break;
|
|
||||||
case 1: aType = SMESH::EDGE; break;
|
|
||||||
case 2: aType = SMESH::FACE; break;
|
|
||||||
case 3: aType = SMESH::VOLUME; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
|
||||||
GEOM::GEOM_IGroupOperations_var aGroupOp =
|
GEOM::GEOM_IGroupOperations_var aGroupOp =
|
||||||
SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
|
SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
|
||||||
@ -971,50 +1054,87 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
myName->text().toLatin1().data(),
|
myName->text().toLatin1().data(),
|
||||||
aGroupVar);
|
aGroupVar);
|
||||||
}
|
}
|
||||||
|
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom );
|
||||||
|
isCreation = true;
|
||||||
|
|
||||||
SALOMEDS::Color aColor = getGroupColor();
|
|
||||||
myGroupOnGeom->SetColor(aColor);
|
|
||||||
|
|
||||||
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
|
|
||||||
if( aMeshGroupSO )
|
|
||||||
anEntryList.append( aMeshGroupSO->GetID().c_str() );
|
|
||||||
|
|
||||||
//SMESH::setFileName ( aMeshGroupSO, QString::number(myColorSpinBox->value()) );
|
|
||||||
SMESH::setFileType ( aMeshGroupSO,"COULEURGROUP" );
|
|
||||||
|
|
||||||
/* init for next operation */
|
|
||||||
myName->setText( "" );
|
|
||||||
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
|
||||||
}
|
}
|
||||||
else { // edition
|
else { // edition
|
||||||
myGroupOnGeom->SetName(myName->text().toLatin1().data());
|
|
||||||
|
|
||||||
SALOMEDS::Color aColor = getGroupColor();
|
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom );
|
||||||
myGroupOnGeom->SetColor(aColor);
|
isCreation = false;
|
||||||
|
}
|
||||||
|
anIsOk = true;
|
||||||
|
}
|
||||||
|
if (myGrpTypeId == 2) // group on filter
|
||||||
|
{
|
||||||
|
if ( myFilter->_is_nil() ) return false;
|
||||||
|
|
||||||
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
|
if (CORBA::is_nil(myGroupOnFilter)) { // creation
|
||||||
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
|
if (myMesh->_is_nil())
|
||||||
anActor->setName(myName->text().toLatin1().data());
|
return false;
|
||||||
switch ( myTypeId ) {
|
|
||||||
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
|
myGroupOnFilter = myMesh->CreateGroupFromFilter(aType,
|
||||||
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
|
myName->text().toLatin1().data(),
|
||||||
case 2:
|
myFilter);
|
||||||
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
|
|
||||||
}
|
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter );
|
||||||
}
|
isCreation = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
myGroupOnFilter->SetFilter( myFilter );
|
||||||
|
|
||||||
SMESHGUI::Modified();
|
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter );
|
||||||
mySMESHGUI->updateObjBrowser(true);
|
isCreation = false;
|
||||||
mySelectionMgr->clearSelected();
|
}
|
||||||
anIsOk = true;
|
anIsOk = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( anIsOk )
|
if( anIsOk )
|
||||||
|
{
|
||||||
|
SALOMEDS::Color aColor = getGroupColor();
|
||||||
|
resultGroup->SetColor(aColor);
|
||||||
|
|
||||||
|
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject( resultGroup );
|
||||||
|
if( aMeshGroupSO )
|
||||||
|
anEntryList.append( aMeshGroupSO->GetID().c_str() );
|
||||||
|
|
||||||
|
if ( isCreation )
|
||||||
|
{
|
||||||
|
SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );
|
||||||
|
|
||||||
|
/* init for the next operation */
|
||||||
|
myName->setText( "" );
|
||||||
|
myElements->clear();
|
||||||
|
myGroup = SMESH::SMESH_Group::_nil();
|
||||||
|
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
||||||
|
myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil();
|
||||||
|
myFilter = SMESH::Filter::_nil();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
myGroup->SetName(myName->text().toLatin1().data());
|
||||||
|
|
||||||
|
if ( aMeshGroupSO )
|
||||||
|
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
|
||||||
|
anActor->setName(myName->text().toLatin1().data());
|
||||||
|
switch ( myTypeId ) {
|
||||||
|
case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
|
||||||
|
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
|
||||||
|
case 2:
|
||||||
|
case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SMESHGUI::Modified();
|
||||||
|
mySMESHGUI->updateObjBrowser(true);
|
||||||
|
SMESH::UpdateView(); // asv: fix of BUG PAL5515
|
||||||
|
mySelectionMgr->clearSelected();
|
||||||
|
|
||||||
if( LightApp_Application* anApp =
|
if( LightApp_Application* anApp =
|
||||||
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
|
||||||
myObjectToSelect = anApp->browseObjects( anEntryList, isApplyAndClose() );
|
myObjectToSelect = anApp->browseObjects( anEntryList, isApplyAndClose() );
|
||||||
|
}
|
||||||
return anIsOk;
|
return anIsOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1388,19 +1508,23 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : onSelectSubMesh()
|
// function : onSelectAll()
|
||||||
// purpose : Called when selection in 3D view or ObjectBrowser is changed
|
// purpose : Called when "Select all" is checked
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_GroupDlg::onSelectAll()
|
void SMESHGUI_GroupDlg::onSelectAll()
|
||||||
{
|
{
|
||||||
myElementsLab->setEnabled( !mySelectAll->isChecked() );
|
bool noElemsModif = ( mySelectAll->isChecked() || !myAllowElemsModif->isChecked() );
|
||||||
myElements->setEnabled( !mySelectAll->isChecked() );
|
|
||||||
myFilter->setEnabled( !mySelectAll->isChecked() );
|
myElementsLab->setEnabled( !noElemsModif );
|
||||||
myAddBtn->setEnabled( !mySelectAll->isChecked() );
|
myElements->setEnabled ( !noElemsModif );
|
||||||
myRemoveBtn->setEnabled( !mySelectAll->isChecked() );
|
myFilterBtn->setEnabled ( !mySelectAll->isChecked() );
|
||||||
mySortBtn->setEnabled( !mySelectAll->isChecked() );
|
myAddBtn->setEnabled ( !noElemsModif );
|
||||||
mySelectBox->setEnabled( !mySelectAll->isChecked() );
|
myRemoveBtn->setEnabled ( !noElemsModif );
|
||||||
int selMode = mySelectionMode;
|
mySortBtn->setEnabled ( !noElemsModif );
|
||||||
|
mySelectBox->setEnabled ( !noElemsModif );
|
||||||
|
myAllowElemsModif->setEnabled( !mySelectAll->isChecked() );
|
||||||
|
|
||||||
|
int selMode = mySelectionMode;
|
||||||
mySelectionMode = grpNoSelection;
|
mySelectionMode = grpNoSelection;
|
||||||
setSelectionMode( selMode );
|
setSelectionMode( selMode );
|
||||||
updateButtons();
|
updateButtons();
|
||||||
@ -1546,6 +1670,12 @@ void SMESHGUI_GroupDlg::setFilters()
|
|||||||
else
|
else
|
||||||
myFilterDlg->Init( aType );
|
myFilterDlg->Init( aType );
|
||||||
|
|
||||||
|
if ( !myGroupOnFilter->_is_nil() )
|
||||||
|
{
|
||||||
|
myFilterDlg->SetFilter( myFilter, aType );
|
||||||
|
myFilterDlg->Init( aType );
|
||||||
|
}
|
||||||
|
|
||||||
myFilterDlg->SetSelection();
|
myFilterDlg->SetSelection();
|
||||||
myFilterDlg->SetMesh( myMesh );
|
myFilterDlg->SetMesh( myMesh );
|
||||||
myFilterDlg->SetSourceWg( myElements, false );
|
myFilterDlg->SetSourceWg( myElements, false );
|
||||||
@ -1566,6 +1696,28 @@ void SMESHGUI_GroupDlg::onFilterAccepted()
|
|||||||
mySelectSubMesh->setChecked( false );
|
mySelectSubMesh->setChecked( false );
|
||||||
mySelectGroup->setChecked( false );
|
mySelectGroup->setChecked( false );
|
||||||
}
|
}
|
||||||
|
// get a filter from myFilterDlg
|
||||||
|
myFilter = myFilterDlg->GetFilter();
|
||||||
|
if ( !myFilter->_is_nil() ) {
|
||||||
|
SMESH::Predicate_var perdicate = myFilter->GetPredicate();
|
||||||
|
if ( perdicate->_is_nil() )
|
||||||
|
myFilter = SMESH::Filter::_nil();
|
||||||
|
}
|
||||||
|
// set mesh to myFilter
|
||||||
|
if ( !myFilter->_is_nil() ) {
|
||||||
|
SMESH::SMESH_Mesh_var mesh = myMesh;
|
||||||
|
if ( mesh->_is_nil() ) {
|
||||||
|
if ( !myGroup->_is_nil() )
|
||||||
|
mesh = myGroup->GetMesh();
|
||||||
|
else if ( !myGroupOnGeom->_is_nil() )
|
||||||
|
mesh = myGroupOnGeom->GetMesh();
|
||||||
|
else if ( !myGroupOnFilter->_is_nil() )
|
||||||
|
mesh = myGroupOnFilter->GetMesh();
|
||||||
|
}
|
||||||
|
myFilter->SetMesh( mesh );
|
||||||
|
}
|
||||||
|
|
||||||
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -1582,6 +1734,7 @@ void SMESHGUI_GroupDlg::onAdd()
|
|||||||
if (aNbSel == 0 || myActorsList.count() == 0 || myMesh->_is_nil()) return;
|
if (aNbSel == 0 || myActorsList.count() == 0 || myMesh->_is_nil()) return;
|
||||||
|
|
||||||
myIsBusy = true;
|
myIsBusy = true;
|
||||||
|
int sizeBefore = myElements->count();
|
||||||
|
|
||||||
SMESH::ElementType aType = SMESH::ALL;
|
SMESH::ElementType aType = SMESH::ALL;
|
||||||
switch(myTypeId) {
|
switch(myTypeId) {
|
||||||
@ -1762,7 +1915,7 @@ void SMESHGUI_GroupDlg::onAdd()
|
|||||||
// Construct filter
|
// Construct filter
|
||||||
SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
|
SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
|
||||||
SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
|
SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
|
||||||
SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom();;
|
SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom();
|
||||||
aBelongToGeom->SetGeom(myGeomObjects[0]);
|
aBelongToGeom->SetGeom(myGeomObjects[0]);
|
||||||
aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str());
|
aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str());
|
||||||
aBelongToGeom->SetElementType(aType);
|
aBelongToGeom->SetElementType(aType);
|
||||||
@ -1799,6 +1952,8 @@ void SMESHGUI_GroupDlg::onAdd()
|
|||||||
onListSelectionChanged();
|
onListSelectionChanged();
|
||||||
}
|
}
|
||||||
myIsBusy = false;
|
myIsBusy = false;
|
||||||
|
if ( sizeBefore < myElements->count() )
|
||||||
|
++myNbChangesOfContents;
|
||||||
// mySelectionMgr->clearSelected();
|
// mySelectionMgr->clearSelected();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
@ -1810,6 +1965,8 @@ void SMESHGUI_GroupDlg::onAdd()
|
|||||||
void SMESHGUI_GroupDlg::onRemove()
|
void SMESHGUI_GroupDlg::onRemove()
|
||||||
{
|
{
|
||||||
myIsBusy = true;
|
myIsBusy = true;
|
||||||
|
int sizeBefore = myElements->count();
|
||||||
|
|
||||||
if (myCurrentLineEdit == 0) {
|
if (myCurrentLineEdit == 0) {
|
||||||
QList<QListWidgetItem*> selItems = myElements->selectedItems();
|
QList<QListWidgetItem*> selItems = myElements->selectedItems();
|
||||||
QListWidgetItem* item;
|
QListWidgetItem* item;
|
||||||
@ -1901,6 +2058,8 @@ void SMESHGUI_GroupDlg::onRemove()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
myIsBusy = false;
|
myIsBusy = false;
|
||||||
|
if ( sizeBefore > myElements->count() )
|
||||||
|
myNbChangesOfContents += 2; // it's used to detect that "Add" was only once
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include <SALOMEconfig.h>
|
#include <SALOMEconfig.h>
|
||||||
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
||||||
#include CORBA_SERVER_HEADER(SMESH_Group)
|
#include CORBA_SERVER_HEADER(SMESH_Group)
|
||||||
|
#include CORBA_SERVER_HEADER(SMESH_Filter)
|
||||||
|
|
||||||
class QGroupBox;
|
class QGroupBox;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
@ -60,6 +61,7 @@ class SUIT_Operation;
|
|||||||
class SVTK_Selector;
|
class SVTK_Selector;
|
||||||
class SUIT_SelectionFilter;
|
class SUIT_SelectionFilter;
|
||||||
class LightApp_SelectionMgr;
|
class LightApp_SelectionMgr;
|
||||||
|
class SMESH_LogicalFilter;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : SMESHGUI_GroupDlg
|
// class : SMESHGUI_GroupDlg
|
||||||
@ -144,7 +146,9 @@ private:
|
|||||||
|
|
||||||
void setIsApplyAndClose( const bool theFlag );
|
void setIsApplyAndClose( const bool theFlag );
|
||||||
bool isApplyAndClose() const;
|
bool isApplyAndClose() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
||||||
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
||||||
int myGrpTypeId; /* Current group type id : standalone or group on geometry */
|
int myGrpTypeId; /* Current group type id : standalone or group on geometry */
|
||||||
@ -164,9 +168,10 @@ private:
|
|||||||
|
|
||||||
QStackedWidget* myWGStack;
|
QStackedWidget* myWGStack;
|
||||||
QCheckBox* mySelectAll;
|
QCheckBox* mySelectAll;
|
||||||
|
QCheckBox* myAllowElemsModif;
|
||||||
QLabel* myElementsLab;
|
QLabel* myElementsLab;
|
||||||
QListWidget* myElements;
|
QListWidget* myElements;
|
||||||
QPushButton* myFilter;
|
QPushButton* myFilterBtn;
|
||||||
QPushButton* myAddBtn;
|
QPushButton* myAddBtn;
|
||||||
QPushButton* myRemoveBtn;
|
QPushButton* myRemoveBtn;
|
||||||
QPushButton* mySortBtn;
|
QPushButton* mySortBtn;
|
||||||
@ -197,6 +202,8 @@ private:
|
|||||||
QList<SMESH_Actor*> myActorsList;
|
QList<SMESH_Actor*> myActorsList;
|
||||||
SMESH::SMESH_Group_var myGroup;
|
SMESH::SMESH_Group_var myGroup;
|
||||||
SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
|
SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
|
||||||
|
SMESH::SMESH_GroupOnFilter_var myGroupOnFilter;
|
||||||
|
SMESH::Filter_var myFilter;
|
||||||
QList<int> myIdList;
|
QList<int> myIdList;
|
||||||
GEOM::ListOfGO_var myGeomObjects;
|
GEOM::ListOfGO_var myGeomObjects;
|
||||||
|
|
||||||
@ -205,8 +212,8 @@ private:
|
|||||||
//Handle(SMESH_TypeFilter) mySubMeshFilter;
|
//Handle(SMESH_TypeFilter) mySubMeshFilter;
|
||||||
//Handle(SMESH_TypeFilter) myGroupFilter;
|
//Handle(SMESH_TypeFilter) myGroupFilter;
|
||||||
SUIT_SelectionFilter* myMeshFilter;
|
SUIT_SelectionFilter* myMeshFilter;
|
||||||
SUIT_SelectionFilter* mySubMeshFilter;
|
SMESH_LogicalFilter* mySubMeshFilter;
|
||||||
SUIT_SelectionFilter* myGroupFilter;
|
SMESH_LogicalFilter* myGroupFilter;
|
||||||
SUIT_SelectionFilter* myGeomFilter;
|
SUIT_SelectionFilter* myGeomFilter;
|
||||||
|
|
||||||
SMESHGUI_FilterDlg* myFilterDlg;
|
SMESHGUI_FilterDlg* myFilterDlg;
|
||||||
@ -218,6 +225,7 @@ private:
|
|||||||
QMap<QAction*, int> myActions;
|
QMap<QAction*, int> myActions;
|
||||||
|
|
||||||
bool myNameChanged; //added by skl for IPAL19574
|
bool myNameChanged; //added by skl for IPAL19574
|
||||||
|
int myNbChangesOfContents; // nb add's and remove's
|
||||||
|
|
||||||
QString myObjectToSelect;
|
QString myObjectToSelect;
|
||||||
bool myIsApplyAndClose;
|
bool myIsApplyAndClose;
|
||||||
|
@ -1106,7 +1106,7 @@ Please enter correct values and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_BUT_FILTER</source>
|
<source>SMESH_BUT_FILTER</source>
|
||||||
<translation>Set &Filters</translation>
|
<translation>Set &Filter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_BUT_HELP</source>
|
<source>SMESH_BUT_HELP</source>
|
||||||
@ -1445,6 +1445,10 @@ add the exported data to its contents?</translation>
|
|||||||
<source>SMESH_GROUP_GEOMETRY</source>
|
<source>SMESH_GROUP_GEOMETRY</source>
|
||||||
<translation>Group on geometry</translation>
|
<translation>Group on geometry</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_GROUP_FILTER</source>
|
||||||
|
<translation>Group on filter</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_GROUP_SELECTED</source>
|
<source>SMESH_GROUP_SELECTED</source>
|
||||||
<translation>%1 Groups</translation>
|
<translation>%1 Groups</translation>
|
||||||
@ -3482,6 +3486,13 @@ Input value precision can be adjusted using
|
|||||||
<translation>SMESH plugins</translation>
|
<translation>SMESH plugins</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>SMESHGUI_GroupDlg</name>
|
||||||
|
<message>
|
||||||
|
<source>ALLOW_ELEM_LIST_MODIF</source>
|
||||||
|
<translation>Enable manual edition</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SMESHGUI</name>
|
<name>SMESHGUI</name>
|
||||||
<message>
|
<message>
|
||||||
|