IMP 22792: EDF 8159 SMESH: Multi-dimensional extrusion/extrusion along a path/revolution
+ Pre-open MED file to speed-up reading/writing (following 22349) + Clock-cursor in Display Entity dlg + In Filter dlg, do not perform filtering if it's not needed + In Group dlg, store a user-given name of a new group + Clock-cursor after hypothesis modif as mesh clearing can be long + Treat selected object right at opening of Measure dlgs + Allow removal of elements in a not shown mesh + Make filter work on a not shown mesh + Don't leave orphan nodes at RemoveGroupWithContents + Avoid crash when exporting a group + fields
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 39 KiB |
BIN
doc/salome/gui/SMESH/images/revolution1.png
Executable file → Normal file
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 45 KiB |
@ -3,12 +3,12 @@
|
|||||||
\page extrusion_page Extrusion
|
\page extrusion_page Extrusion
|
||||||
|
|
||||||
\n Extrusion is used to build mesh elements of plus one
|
\n Extrusion is used to build mesh elements of plus one
|
||||||
dimension than the input ones. Boundary elements around elements of
|
dimension than the input ones. Boundary elements around generated
|
||||||
plus one dimension are additionally created. All created elements
|
mesh of plus one dimension are additionally created. All created
|
||||||
can be automatically grouped. Extrusion can be used to create a
|
elements can be automatically grouped. Extrusion can be used to create
|
||||||
\ref extrusion_struct "structured mesh from scratch".
|
a \ref extrusion_struct "structured mesh from scratch".
|
||||||
|
|
||||||
\image html extrusion_box.png "If you extruded e.g. several quadrangles, you get exactly same mesh as if you meshed a geometrical box (except that the initial quadrangles can be incorrectly oriented)"
|
\image html extrusion_box.png "If you extrude several quadrangles, you get exactly same mesh as if you meshed a geometrical box (except that the initial quadrangles can be incorrectly oriented): quadrangles and segments on boundary of generated mesh are created"
|
||||||
|
|
||||||
<p>Any node, segment or 2D element can be extruded. Each type of
|
<p>Any node, segment or 2D element can be extruded. Each type of
|
||||||
elements is extruded into a corresponding type of result elements:
|
elements is extruded into a corresponding type of result elements:
|
||||||
@ -32,7 +32,8 @@ elements is extruded into a corresponding type of result elements:
|
|||||||
<em>"Extrusion" button</em>
|
<em>"Extrusion" button</em>
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
The following dialog common for node, segments and faces will appear:
|
The following dialog, looking different depending on selected options,
|
||||||
|
will appear:
|
||||||
|
|
||||||
\image html extrusionalongaline1.png
|
\image html extrusionalongaline1.png
|
||||||
|
|
||||||
@ -44,65 +45,72 @@ The following dialog common for node, segments and faces will appear:
|
|||||||
|
|
||||||
<li>In this dialog:
|
<li>In this dialog:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Select the type of elements which will be extruded (nodes, 1D or
|
<li>Specify \b Nodes, \b Edges and \b Faces, which will be extruded, by one
|
||||||
2D elements).</li>
|
of following means:
|
||||||
<li>Specify the IDs of the elements which will be extruded by one
|
|
||||||
following means:
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>Select the whole mesh, sub-mesh or group</b> activating this
|
<li><b>Select the whole mesh, sub-mesh or group</b> activating this
|
||||||
checkbox.</li>
|
checkbox.</li>
|
||||||
<li>Choose mesh elements with the mouse in the 3D Viewer. It is
|
<li>Choose mesh elements with the mouse in the 3D Viewer. It is
|
||||||
possible to select a whole area with a mouse frame.</li>
|
possible to select a whole area with a mouse frame.</li>
|
||||||
<li>Input the element IDs directly in <b>ID Elements</b>
|
<li>Input the element IDs directly in <b>Node IDs</b>, <b>Edge
|
||||||
field. The selected elements will be highlighted in the viewer.</li>
|
IDs</b> and <b>Face IDs</b> fields. The selected elements will
|
||||||
|
be highlighted in the viewer, if the mesh is shown there.</li>
|
||||||
<li>Apply Filters. <b>Set filter</b> button allows to apply a
|
<li>Apply Filters. <b>Set filter</b> button allows to apply a
|
||||||
filter to the selection of elements. See more about filters in
|
filter to the selection of elements. See more about filters in
|
||||||
the \ref filtering_elements "Selection filters" page.</li>
|
the \ref filtering_elements "Selection filters" page.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>If the <b>Extrusion to Distance</b> radio button is selected</li>
|
<li>If the <b>Extrusion to Distance</b> radio button is selected
|
||||||
<ul>
|
- specify the translation vector by which the elements will be extruded.
|
||||||
<li>specify the translation vector by which the elements will be extruded.</li>
|
</li>
|
||||||
</ul>
|
<li>If the <b>Extrusion Along Vector</b> radio button is selected
|
||||||
<li>If the <b>Extrusion Along Vector</b> radio button is selected</li>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>specify the coordinates of the \b Vector along which the elements
|
<li>specify the coordinates of the \b Vector along which the elements
|
||||||
will be extruded, or select the face (the normal to the face will
|
will be extruded, either directly or by selecting the mesh face (the
|
||||||
define the vector),</li>
|
normal to the face will define the vector),</li>
|
||||||
<li>specify the \b Distance of extrusion along the vector (it can
|
<li>specify the \b Distance of extrusion along the vector (it can
|
||||||
be negative).</li>
|
be negative).</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</li>
|
||||||
<li>If the <b>Extrusion By Normal</b> radio button is selected,
|
<li>If the <b>Extrusion By Normal</b> radio button is selected,
|
||||||
which is visible in \b 2D mode only, every node of selected
|
every node of selected faces is extruded along the \a average
|
||||||
elements is extruded along the \a average of the \a normal vectors to
|
of the \a normal vectors to the faces sharing the node. (Nodes and
|
||||||
the faces sharing the node.</li>
|
edges can't be extruded in this mode.)
|
||||||
<ul>
|
<ul>
|
||||||
<li>Specify the \b Distance of extrusion (it can be negative),</li>
|
<li>Specify the \b Distance of extrusion (it can be negative),</li>
|
||||||
<li>Use <b>Along average normal</b> check-box to specify along
|
<li>Use <b>Along average normal</b> check-box to specify along
|
||||||
what vector the distance is measured. If it is \a activated the
|
what vector the distance is measured.
|
||||||
distance is measured along the average normal mentioned
|
<ul>
|
||||||
above. If it is \a deactivated every node is extruded along the
|
<li>If it is \a activated the distance is measured along the
|
||||||
|
average normal mentioned above. </li>
|
||||||
|
<li>If it is \a deactivated every node is extruded along the
|
||||||
average normal till its intersection with the virtual plane got
|
average normal till its intersection with the virtual plane got
|
||||||
by translation of the face sharing the node along its own normal
|
by translation of the face sharing the node along its own normal
|
||||||
by the distance. <br>
|
by the \b Distance.</li>
|
||||||
|
</ul>
|
||||||
The picture below shows a cross-section of a 2D mesh extruded
|
The picture below shows a cross-section of a 2D mesh extruded
|
||||||
with <b>Along average normal</b> activated (to the left) and
|
with <b>Along average normal</b> activated (to the left) and
|
||||||
deactivated (to the right).
|
deactivated (to the right).
|
||||||
|
|
||||||
\image html extrusionbynormal_alongavgnorm.png
|
\image html extrusionbynormal_alongavgnorm.png "'Along average normal' activated (to the left) and deactivated (to the right)"
|
||||||
<p></li>
|
<p></li>
|
||||||
<li>Using <b>Use only input elements</b> check-box to specify what
|
|
||||||
elements to use to compute the average normal. If it is \a
|
<li>Using <b>Use only input elements</b> check-box specify what
|
||||||
activated only selected faces, among faces sharing the node,
|
elements to use to compute the average normal.<ul>
|
||||||
are used to compute the average normal at the node. Else all
|
<li> If it is \a activated only selected faces, among faces
|
||||||
faces sharing the node are used. <br>
|
sharing the node, are used to compute the average normal at
|
||||||
|
the node. </li>
|
||||||
|
<li>Else all faces sharing the node are used.</li></ul>
|
||||||
|
|
||||||
The picture below shows a cross-section of a 2D mesh the upper
|
The picture below shows a cross-section of a 2D mesh the upper
|
||||||
plane of which is extruded with <b>Use only input elements</b>
|
plane of which is extruded with <b>Use only input elements</b>
|
||||||
activated (to the left) and deactivated (to the right).
|
activated (to the left) and deactivated (to the right).
|
||||||
|
|
||||||
\image html extrusionbynormal_useonly.png
|
\image html extrusionbynormal_useonly.png "'Use only input elements' activated (to the left) and deactivated (to the right)"
|
||||||
<p></li>
|
<p></li>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<li>Specify the <b>Number of steps</b>.</li>
|
<li>Specify the <b>Number of steps</b>.</li>
|
||||||
<li>If you activate <b>Generate Groups</b> check-box, the <em>result elements</em>
|
<li>If you activate <b>Generate Groups</b> check-box, the <em>result elements</em>
|
||||||
created from <em>selected elements</em> contained in groups will be
|
created from <em>selected elements</em> contained in groups will be
|
||||||
@ -120,6 +128,8 @@ The following dialog common for node, segments and faces will appear:
|
|||||||
|
|
||||||
<li>Click \b Apply or <b> Apply and Close</b> button to confirm the operation.</li>
|
<li>Click \b Apply or <b> Apply and Close</b> button to confirm the operation.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
<p>
|
||||||
|
|
||||||
\anchor extrusion_struct
|
\anchor extrusion_struct
|
||||||
<h2>Example: creation of a structured mesh from scratch</h2>
|
<h2>Example: creation of a structured mesh from scratch</h2>
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
\page extrusion_along_path_page Extrusion along Path
|
\page extrusion_along_path_page Extrusion along Path
|
||||||
|
|
||||||
\n In principle, <b>Extrusion along Path</b> works in the same way
|
\n In principle, <b>Extrusion along Path</b> works in the same way
|
||||||
as \b Extrusion, the main difference is that we define not a vector,
|
as \ref extrusion_page "Extrusion", the main difference is that we define not a vector,
|
||||||
but a path of extrusion which must be a 1D mesh or 1D sub-mesh.
|
but a path of extrusion which must be a 1D mesh or 1D sub-mesh.
|
||||||
To get an idea of how this algorithm works, examine several examples,
|
To get an idea of how this algorithm works, examine several examples,
|
||||||
starting from the most simple case of extrusion along a straight edge.
|
starting from the most simple case of extrusion along a straight edge.
|
||||||
@ -77,75 +77,93 @@ path</b> item or click <em>"Extrusion along a path"</em> button in the toolbar.
|
|||||||
\image html image101.png
|
\image html image101.png
|
||||||
<center><em>"Extrusion along a path" button</em></center>
|
<center><em>"Extrusion along a path" button</em></center>
|
||||||
|
|
||||||
The following dialog common for line and planar elements will appear:
|
The following dialog will appear:
|
||||||
|
|
||||||
\image html extrusion_along_path_dlg.png
|
\image html extrusion_along_path_dlg.png
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>In this dialog:
|
<li>In this dialog:
|
||||||
<ul>
|
<ul>
|
||||||
<li>select the type of elements which will be extruded (1D or 2D),</li>
|
<li>Use \a Selection button to specify what you are going to
|
||||||
<li>specify the <b>IDs of the elements</b> which will be extruded
|
select at a given moment, \b Nodes, \b Edges or \b Faces.
|
||||||
|
\image html image120.png
|
||||||
<ul>
|
<center><em>"Selection" button</em></center>
|
||||||
<li><b>Select the whole mesh, sub-mesh or group</b> activating the corresponding check-box; or</li>
|
</li>
|
||||||
<li>Choose mesh elements with the mouse in the 3D Viewer. It is
|
<li>Specify \b Nodes, \b Edges and \b Faces, which will be extruded, by one
|
||||||
possible to select a whole area with a mouse frame; or</li>
|
of following means:
|
||||||
<li>Input the element IDs directly in <b>ID Elements</b> field. The selected elements will be highlighted in the
|
<ul>
|
||||||
viewer; or</li>
|
<li><b>Select the whole mesh, sub-mesh or group</b> activating this
|
||||||
<li>apply Filters. <b>Set filter</b> button allows to apply a filter to the selection of elements. See more
|
checkbox.</li>
|
||||||
about filters in the \ref selection_filter_library_page "Selection filter library" page.</li>
|
<li>Choose mesh elements with the mouse in the 3D Viewer. It is
|
||||||
</ul>
|
possible to select a whole area with a mouse frame.</li>
|
||||||
|
<li>Input the element IDs directly in <b>Node IDs</b>, <b>Edge
|
||||||
</li>
|
IDs</b> and <b>Face IDs</b> fields. The selected elements will
|
||||||
<li>Define the \b Path along which the elements will be extruded.<br>
|
be highlighted in the viewer, if the mesh is shown there.</li>
|
||||||
|
<li>Apply Filters. <b>Set filter</b> button allows to apply a
|
||||||
|
filter to the selection of elements. See more about filters in
|
||||||
|
the \ref filtering_elements "Selection filters" page.</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Define the \b Path along which the elements will be extruded.<br>
|
||||||
Path definition consists of several elements:
|
Path definition consists of several elements:
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>Mesh or submesh</b> - 1D mesh or sub-mesh, along which proceeds the extrusion</li>
|
<li><b>Mesh or submesh</b> - 1D mesh or sub-mesh, along which
|
||||||
<li><b>Start node</b> - the start node. It is used to define the direction of extrusion </li>
|
proceeds the extrusion.</li>
|
||||||
|
<li><b>Start node</b> - the start node. It is used to define
|
||||||
|
the direction of extrusion. </li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>Activate <b>Generate Groups</b> check-box if it is necessary to copy the groups of
|
<li>If you activate <b>Generate Groups</b> check-box, the <em>result elements</em>
|
||||||
elements of the source mesh to the newly created one. </li>
|
created from <em>selected elements</em> contained in groups will be
|
||||||
|
included into new groups named by pattern "<old group
|
||||||
|
name>_extruded" and "<old group name>_top". For example if a
|
||||||
|
selected quadrangle is included in \a g_Faces group (see figures
|
||||||
|
below) then result hexahedra will be included in \a
|
||||||
|
g_Faces_extruded group and a quadrangle created at the "top" of
|
||||||
|
extruded mesh will be included in \a g_Faces_top group. <br>
|
||||||
|
\image html extrusion_groups.png
|
||||||
|
\image html extrusion_groups_res.png
|
||||||
|
<p> This check-box is active only if there are some groups in the mesh.
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>There are two optional parameters, which can be very useful:
|
<li>There are two optional parameters, which can be very useful:
|
||||||
<ul>
|
<ul>
|
||||||
<li>If the path of extrusion is curvilinear, at each iteration the
|
<li>If the path of extrusion is curvilinear, at each iteration the
|
||||||
extruded elements are rotated to keep its initial angularity to the
|
extruded elements are rotated to keep its initial angularity to the
|
||||||
curve. By default, the <b>Base Point</b> around which the elements are rotated is
|
curve. By default, the <b>Base Point</b> around which the elements
|
||||||
the mass center of the elements, however, you can specify any point as
|
are rotated is the mass center of the elements, however, you can
|
||||||
the <b>Base Point</b> and the elements will be rotated with respect to this
|
specify any point as the <b>Base Point</b> and the elements will be
|
||||||
point.<br>
|
rotated with respect to this point.<br>
|
||||||
Note that only the displacement of the <b>Base Point</b> exactly equals to the
|
Note that only the displacement of the <b>Base Point</b> exactly
|
||||||
path, and all other extruded elements simply keep their position relatively to the <b>Base Point</b> at each iteration.
|
equals to the path, and all other extruded elements simply keep
|
||||||
</li>
|
their position relatively to the <b>Base Point</b> at each
|
||||||
<li>The elements can also be rotated around the path to get the resulting
|
iteration.</li>
|
||||||
mesh in a helical fashion. You can set the values of angles at the
|
<li>The elements can also be rotated around the path to get the
|
||||||
right, add them to the list of angles at the left by pressing the <em>"Add"</em>
|
resulting mesh in a helical fashion. You can set the values of
|
||||||
button and remove them from the list by pressing the <em>"Remove"</em> button.
|
angles at the right, add them to the list of angles at the left by
|
||||||
|
pressing the <em>"Add"</em> button and remove them from the list by
|
||||||
|
pressing the <em>"Remove"</em> button.
|
||||||
\image html add.png
|
\image html add.png
|
||||||
<center><em>"Add" button</em></center>
|
<center><em>"Add" button</em></center>
|
||||||
|
|
||||||
\image html remove.png
|
\image html remove.png
|
||||||
<center><em>"Remove" button</em></center>
|
<center><em>"Remove" button</em></center>
|
||||||
|
|
||||||
<b>Linear variation of the angles</b> option allows defining the angle of gradual rotation for the whole path.
|
<b>Linear variation of the angles</b> option allows defining the angle
|
||||||
At each step the elements will be rotated by <code>angle / nb. of steps</code>.
|
of gradual rotation for the whole path. At each step the elements will
|
||||||
|
be rotated by <code>angle / nb. of steps</code>.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<li>Click \b Apply or <b> Apply and Close</b> button to confirm the operation.
|
<li>Click \b Apply or <b> Apply and Close</b> button to confirm the
|
||||||
Mesh edges will be extruded into
|
operation. Mesh edges will be extruded into faces, faces into
|
||||||
faces, faces into volumes. The external surface of the resulting 3d
|
volumes. The external surface of the resulting 3d mesh (if faces
|
||||||
mesh (if faces have been extruded) is covered with faces, and corners
|
have been extruded) is covered with faces, and corners with
|
||||||
with edges. If the path is closed, the resulting mesh can contain
|
edges. If the path is closed, the resulting mesh can contain
|
||||||
duplicated nodes and faces, because no sewing is done.
|
duplicated nodes and faces, because no sewing is done.
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
\page revolution_page Revolution
|
\page revolution_page Revolution
|
||||||
|
|
||||||
\n Revolution is a type of surface meshing by generation from
|
\n Revolution is used to build mesh elements of plus one
|
||||||
discretized lines. It is used to build mesh elements of plus one
|
dimension than the input ones. Boundary elements around generated
|
||||||
dimension than the swept ones. Each swept 1D element produces one or
|
mesh of plus one dimension are additionally created. All created
|
||||||
more quadrangles (or triangles if one node of a rotated element lays
|
elements can be automatically grouped. Revolution can be used to create
|
||||||
on the revolution axis).
|
a \ref extrusion_struct "structured mesh from scratch".
|
||||||
|
|
||||||
<em>To apply revolution:</em>
|
<em>To apply revolution:</em>
|
||||||
<ol>
|
<ol>
|
||||||
<li>From the \b Modification menu choose the \b Revolution item or click
|
<li>From the \b Modification menu choose the \b Revolution item or click
|
||||||
<em>"Revolution"</em> button in the toolbar.
|
<em>"Revolution"</em> button in the toolbar.
|
||||||
|
|
||||||
\image html image92.png
|
\image html image92.png
|
||||||
<center><em>"Revolution" button</em></center>
|
<center><em>"Revolution" button</em></center>
|
||||||
@ -20,64 +20,90 @@ The following dialog common for line and planar elements will appear:
|
|||||||
|
|
||||||
\image html revolution1.png
|
\image html revolution1.png
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
|
||||||
In this dialog you should specify:
|
|
||||||
<ul>
|
|
||||||
<li>the type of elements which will be extruded (1D or 2D),</li>
|
|
||||||
<li>specify the IDs of the elements which will be revolved:
|
|
||||||
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li><b>Select the whole mesh, submesh or group</b> activating this
|
|
||||||
checkbox; or</li>
|
|
||||||
<li>choose mesh elements with the mouse in the 3D Viewer. It is
|
|
||||||
possible to select a whole area with a mouse frame; or</li>
|
|
||||||
<li>input the element IDs directly in <b>ID Elements</b> field. The selected elements will be highlighted in the
|
|
||||||
viewer; or</li>
|
|
||||||
<li>apply Filters. <b>Set filter</b> button allows to apply a filter to the selection of elements. See more
|
|
||||||
about filters in the \ref selection_filter_library_page "Selection filter library" page.</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>specify the axis of revolution:
|
|
||||||
<ul>
|
|
||||||
<li>specify the cooordinates of the start \b Point of the vector of revolution;</li>
|
|
||||||
<li>specify the \b Vector of revolution through the coordinates of its
|
|
||||||
end point with respect to the coordinates of the start
|
|
||||||
point. Alternatively, it is possible to specify the vector through the
|
|
||||||
normal to the selected face.</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>specify the angle of revolution and the number of revolution steps,</li>
|
|
||||||
<ul> <li> Angle by Step - the elements are extruded by the specified angle at each step (i.e. for Angle=30 and Number of Steps=2, the elements will be extruded
|
|
||||||
by 30 degrees twice for a total of 30*2=60)</li>
|
|
||||||
|
|
||||||
|
<li>In this dialog:
|
||||||
|
<ul>
|
||||||
|
<li>Use \a Selection button to specify what you are going to
|
||||||
|
select at a given moment, \b Nodes, \b Edges or \b Faces.
|
||||||
|
\image html image120.png
|
||||||
|
<center><em>"Selection" button</em></center>
|
||||||
|
</li>
|
||||||
|
<li>Specify \b Nodes, \b Edges and \b Faces, which will be revolved, by one
|
||||||
|
of following means:
|
||||||
|
<ul>
|
||||||
|
<li><b>Select the whole mesh, sub-mesh or group</b> activating this
|
||||||
|
checkbox.</li>
|
||||||
|
<li>Choose mesh elements with the mouse in the 3D Viewer. It is
|
||||||
|
possible to select a whole area with a mouse frame.</li>
|
||||||
|
<li>Input the element IDs directly in <b>Node IDs</b>, <b>Edge
|
||||||
|
IDs</b> and <b>Face IDs</b> fields. The selected elements will
|
||||||
|
be highlighted in the viewer, if the mesh is shown there.</li>
|
||||||
|
<li>Apply Filters. <b>Set filter</b> button allows to apply a
|
||||||
|
filter to the selection of elements. See more about filters in
|
||||||
|
the \ref filtering_elements "Selection filters" page.</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Specify the \b Axis of revolution:
|
||||||
|
<ul>
|
||||||
|
<li>Specify the cooordinates of the start \b Point of the
|
||||||
|
axis of revolution; either directly or by picking a node
|
||||||
|
in the Viewer (selection of nodes is activated as you click
|
||||||
|
the \a Selection button).</li>
|
||||||
|
<li>Specify the \b Vector of the axis in either of three ways:
|
||||||
|
<ul>
|
||||||
|
<li>directly adjust vector components;</li>
|
||||||
|
<li>click \a Selection button, chose <em>From Origin to
|
||||||
|
selected Point</em> in the opened menu and pick a node
|
||||||
|
in the Viewer; </li>
|
||||||
|
<li>click \a Selection button, chose <em>Normal to
|
||||||
|
selected Face</em> in the opened menu and pick a mesh
|
||||||
|
face in the Viewer.</li>
|
||||||
|
</ul></ul>
|
||||||
|
</li>
|
||||||
|
<li>Specify the \b Angle of revolution and the <b>Number of
|
||||||
|
steps </b> of revolution,
|
||||||
|
<ul>
|
||||||
|
<li> <b>Angle by Step</b> - the elements are revolved by the
|
||||||
|
specified angle at each step (i.e. for Angle=30 and Number of
|
||||||
|
Steps=2, the elements will be extruded by 30 degrees twice for a
|
||||||
|
total of 30*2=60)
|
||||||
\image html revolutionsn2.png "Example of Revolution with Angle by Step"
|
\image html revolutionsn2.png "Example of Revolution with Angle by Step"
|
||||||
|
</li>
|
||||||
<li> Total Angle - the elements are extruded by the specified angle only once and the number of steps defines the number of iterations
|
<li> <b>Total Angle</b> - the elements are revolved by the
|
||||||
(i.e.for Angle=30 and Number of Steps=2, the elements will be extruded by 30/2=15 degrees twice for a total of 30). </li>
|
specified angle only once and the number of steps defines the
|
||||||
|
number of iterations (i.e. for Angle=30 and Number of Steps=2,
|
||||||
|
the elements will be revolved by 30/2=15 degrees twice for a
|
||||||
|
total of 30).
|
||||||
\image html revolutionsn1.png "Example of Revolution with Total Angle"
|
\image html revolutionsn1.png "Example of Revolution with Total Angle"
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>Specify the \b Tolerance for the operation, which is used to
|
||||||
|
detect nodes lying on the axis of revolution.
|
||||||
|
</li>
|
||||||
|
<li>Activate <b>Preview</b> check-box to see the result mesh in
|
||||||
|
the viewer.
|
||||||
|
</li>
|
||||||
|
<li>If you activate <b>Generate Groups</b> check-box, the <em>result elements</em>
|
||||||
|
created from <em>selected elements</em> contained in groups will be
|
||||||
|
included into new groups named by pattern "<old group
|
||||||
|
name>_rotated" and "<old group name>_top". For example if a
|
||||||
|
selected quadrangle is included in \a g_Faces group (see figures
|
||||||
|
below) then result hexahedra will be included in \a
|
||||||
|
g_Faces_rotated group and a quadrangle created at the "top" of
|
||||||
|
revolved mesh will be included in \a g_Faces_top group. <br>
|
||||||
|
\image html extrusion_groups.png
|
||||||
|
\image html extrusion_groups_res.png
|
||||||
|
<p> This check-box is active only if there are some groups in the mesh.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
<li>Click \b Apply or <b> Apply and Close</b> button to confirm the
|
||||||
</li>
|
operation.</li>
|
||||||
|
|
||||||
<li>specify the tolerance for the operation</li>
|
|
||||||
|
|
||||||
<li>activate <b>Preview</b> checkbox to show the parameter-setting in the viewer </li>
|
|
||||||
<li>activate <b>Generate Groups</b> checkbox to copy the groups of
|
|
||||||
elements of the source mesh to the newly created one. </li>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<li>Click \b Apply or <b> Apply and Close</b> button to confirm the
|
|
||||||
operation.</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
|
||||||
<br><b>See Also</b> a sample TUI Script of a
|
<br><b>See Also</b> a sample TUI Script of a
|
||||||
\ref tui_revolution "Revolution" operation.
|
\ref tui_revolution "Revolution" operation.
|
||||||
|
|
||||||
|
@ -40,20 +40,20 @@ module SMESH
|
|||||||
{
|
{
|
||||||
/*!
|
/*!
|
||||||
* Return data of mesh edition preview which is computed provided
|
* Return data of mesh edition preview which is computed provided
|
||||||
* that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
|
* that the editor was obtained through SMESH_Mesh::GetMeshEditPreviewer()
|
||||||
*/
|
*/
|
||||||
MeshPreviewStruct GetPreviewData() raises (SALOME::SALOME_Exception);
|
MeshPreviewStruct GetPreviewData() raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* If during last operation of MeshEditor some nodes were
|
* If during last operation of MeshEditor some nodes were
|
||||||
* created this method returns list of their IDs, if new nodes
|
* created, this method returns list of their IDs, if new nodes
|
||||||
* not created - returns empty list
|
* not created - returns empty list
|
||||||
*/
|
*/
|
||||||
long_array GetLastCreatedNodes() raises (SALOME::SALOME_Exception);
|
long_array GetLastCreatedNodes() raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* If during last operation of MeshEditor some elements were
|
* If during last operation of MeshEditor some elements were
|
||||||
* created this method returns list of their IDs, if new elements
|
* created, this method returns list of their IDs, if new elements
|
||||||
* not created - returns empty list
|
* not created - returns empty list
|
||||||
*/
|
*/
|
||||||
long_array GetLastCreatedElems() raises (SALOME::SALOME_Exception);
|
long_array GetLastCreatedElems() raises (SALOME::SALOME_Exception);
|
||||||
@ -402,192 +402,49 @@ module SMESH
|
|||||||
void RenumberElements() raises (SALOME::SALOME_Exception);
|
void RenumberElements() raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Genarate dim+1 elements by rotation of given elements around axis
|
* \brief Generate dim+1 elements by rotation of the object around axis
|
||||||
* \param IDsOfElements - elements to ratate
|
* \param Nodes - nodes to revolve: a list including groups, sub-meshes or a mesh
|
||||||
* \param Axix - rotation axis
|
* \param Edges - edges to revolve: a list including groups, sub-meshes or a mesh
|
||||||
|
* \param Faces - faces to revolve: a list including groups, sub-meshes or a mesh
|
||||||
|
* \param Axis - rotation axis
|
||||||
* \param AngleInRadians - rotation angle
|
* \param AngleInRadians - rotation angle
|
||||||
* \param NbOfSteps - number of elements to generate from one element
|
* \param NbOfSteps - number of elements to generate from one element
|
||||||
|
* \param ToMakeGroups - if true, new elements will be included into new groups
|
||||||
|
* corresponding to groups the input elements included in.
|
||||||
|
* \return ListOfGroups - new groups craeted if \a ToMakeGroups is true
|
||||||
*/
|
*/
|
||||||
void RotationSweep(in long_array IDsOfElements,
|
ListOfGroups RotationSweepObjects(in ListOfIDSources Nodes,
|
||||||
in AxisStruct Axix,
|
in ListOfIDSources Edges,
|
||||||
|
in ListOfIDSources Faces,
|
||||||
|
in AxisStruct Axis,
|
||||||
in double AngleInRadians,
|
in double AngleInRadians,
|
||||||
in long NbOfSteps,
|
in long NbOfSteps,
|
||||||
in double Tolerance)
|
in double Tolerance,
|
||||||
raises (SALOME::SALOME_Exception);
|
in boolean ToMakeGroups)
|
||||||
/*!
|
|
||||||
* \brief Same as previous but additionally create groups of elements
|
|
||||||
* generated from elements belonging to preexisting groups
|
|
||||||
*/
|
|
||||||
ListOfGroups RotationSweepMakeGroups(in long_array IDsOfElements,
|
|
||||||
in AxisStruct Axix,
|
|
||||||
in double AngleInRadians,
|
|
||||||
in long NbOfSteps,
|
|
||||||
in double Tolerance)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Genarate dim+1 elements by rotation of the object around axis
|
|
||||||
* \param theObject - object containing elements to ratate
|
|
||||||
* \param Axix - rotation axis
|
|
||||||
* \param AngleInRadians - rotation angle
|
|
||||||
* \param NbOfSteps - number of elements to generate from one element
|
|
||||||
*/
|
|
||||||
void RotationSweepObject(in SMESH_IDSource theObject,
|
|
||||||
in AxisStruct Axix,
|
|
||||||
in double AngleInRadians,
|
|
||||||
in long NbOfSteps,
|
|
||||||
in double Tolerance)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Same as previous but additionally create groups of elements
|
|
||||||
* generated from elements belonging to preexisting groups
|
|
||||||
*/
|
|
||||||
ListOfGroups RotationSweepObjectMakeGroups(in SMESH_IDSource theObject,
|
|
||||||
in AxisStruct Axix,
|
|
||||||
in double AngleInRadians,
|
|
||||||
in long NbOfSteps,
|
|
||||||
in double Tolerance)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Genarate dim+1 elements by rotation of the object around axis
|
|
||||||
* \param theObject - object containing elements to ratate
|
|
||||||
* \param Axix - rotation axis
|
|
||||||
* \param AngleInRadians - rotation angle
|
|
||||||
* \param NbOfSteps - number of elements to generate from one element
|
|
||||||
*/
|
|
||||||
void RotationSweepObject1D(in SMESH_IDSource theObject,
|
|
||||||
in AxisStruct Axix,
|
|
||||||
in double AngleInRadians,
|
|
||||||
in long NbOfSteps,
|
|
||||||
in double Tolerance)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Same as previous but additionally create groups of elements
|
|
||||||
* generated from elements belonging to preexisting groups
|
|
||||||
*/
|
|
||||||
ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource theObject,
|
|
||||||
in AxisStruct Axix,
|
|
||||||
in double AngleInRadians,
|
|
||||||
in long NbOfSteps,
|
|
||||||
in double Tolerance)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Genarate dim+1 elements by rotation of the object around axis
|
|
||||||
* \param theObject - object containing elements to ratate
|
|
||||||
* \param Axix - rotation axis
|
|
||||||
* \param AngleInRadians - rotation angle
|
|
||||||
* \param NbOfSteps - number of elements to generate from one element
|
|
||||||
*/
|
|
||||||
void RotationSweepObject2D(in SMESH_IDSource theObject,
|
|
||||||
in AxisStruct Axix,
|
|
||||||
in double AngleInRadians,
|
|
||||||
in long NbOfSteps,
|
|
||||||
in double Tolerance)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Same as previous but additionally create groups of elements
|
|
||||||
* generated from elements belonging to preexisting groups
|
|
||||||
*/
|
|
||||||
ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource theObject,
|
|
||||||
in AxisStruct Axix,
|
|
||||||
in double AngleInRadians,
|
|
||||||
in long NbOfSteps,
|
|
||||||
in double Tolerance)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Genarate dim+1 elements by extrusion of elements along vector
|
|
||||||
* \param IDsOfElements - elements to sweep
|
|
||||||
* \param StepVector - vector giving direction and distance of an extrusion step
|
|
||||||
* \param NbOfSteps - number of elements to generate from one element
|
|
||||||
*/
|
|
||||||
void ExtrusionSweep(in long_array IDsOfElements,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Genarate dim+1 elements by extrusion of elements along vector
|
|
||||||
* \param IDsOfElements - elements to sweep
|
|
||||||
* \param StepVector - vector giving direction and distance of an extrusion step
|
|
||||||
* \param NbOfSteps - number of elements to generate from one element
|
|
||||||
*/
|
|
||||||
void ExtrusionSweep0D(in long_array IDsOfElements,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Same as previous but additionally create groups of elements
|
|
||||||
* generated from elements belonging to preexisting groups
|
|
||||||
*/
|
|
||||||
ListOfGroups ExtrusionSweepMakeGroups(in long_array IDsOfElements,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Same as previous but elements are nodes
|
|
||||||
*/
|
|
||||||
ListOfGroups ExtrusionSweepMakeGroups0D(in long_array IDsOfElements,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* Generate new elements by extrusion of theElements
|
|
||||||
* by StepVector by NbOfSteps
|
|
||||||
* param ExtrFlags set flags for performing extrusion
|
|
||||||
* param SewTolerance - uses for comparing locations of nodes if flag
|
|
||||||
* EXTRUSION_FLAG_SEW is set
|
|
||||||
*/
|
|
||||||
void AdvancedExtrusion(in long_array IDsOfElements,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps,
|
|
||||||
in long ExtrFlags,
|
|
||||||
in double SewTolerance)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
/*!
|
|
||||||
* \brief Same as previous but additionally create groups of elements
|
|
||||||
* generated from elements belonging to preexisting groups
|
|
||||||
*/
|
|
||||||
ListOfGroups AdvancedExtrusionMakeGroups(in long_array IDsOfElements,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps,
|
|
||||||
in long ExtrFlags,
|
|
||||||
in double SewTolerance)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
void ExtrusionSweepObject(in SMESH_IDSource theObject,
|
/*!
|
||||||
in DirStruct StepVector,
|
* \brief Generate dim+1 elements by extrusion of elements along vector
|
||||||
in long NbOfSteps)
|
* \param nodes - nodes to extrude: a list including groups, sub-meshes or a mesh
|
||||||
raises (SALOME::SALOME_Exception);
|
* \param edges - edges to extrude: a list including groups, sub-meshes or a mesh
|
||||||
ListOfGroups ExtrusionSweepObjectMakeGroups(in SMESH_IDSource theObject,
|
* \param faces - faces to extrude: a list including groups, sub-meshes or a mesh
|
||||||
in DirStruct StepVector,
|
* \param stepVector - vector giving direction and distance of an extrusion step
|
||||||
in long NbOfSteps)
|
* \param nbOfSteps - number of elements to generate from one element
|
||||||
|
* \param toMakeGroups - if true, new elements will be included into new groups
|
||||||
|
* corresponding to groups the input elements included in.
|
||||||
|
* \return ListOfGroups - new groups craeted if \a toMakeGroups is true
|
||||||
|
*/
|
||||||
|
ListOfGroups ExtrusionSweepObjects(in ListOfIDSources nodes,
|
||||||
|
in ListOfIDSources edges,
|
||||||
|
in ListOfIDSources faces,
|
||||||
|
in DirStruct stepVector,
|
||||||
|
in long nbOfSteps,
|
||||||
|
in boolean toMakeGroups)
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
void ExtrusionSweepObject0D(in SMESH_IDSource theObject,
|
/*! Generates new elements by extrusion along the normal to a discretized surface or wire
|
||||||
in DirStruct StepVector,
|
*/
|
||||||
in long NbOfSteps)
|
ListOfGroups ExtrusionByNormal(in ListOfIDSources theObjects,
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
ListOfGroups ExtrusionSweepObject0DMakeGroups(in SMESH_IDSource theObject,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
ListOfGroups ExtrusionSweepObject1DMakeGroups(in SMESH_IDSource theObject,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
ListOfGroups ExtrusionSweepObject2DMakeGroups(in SMESH_IDSource theObject,
|
|
||||||
in DirStruct StepVector,
|
|
||||||
in long NbOfSteps)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
ListOfGroups ExtrusionByNormal(in SMESH_IDSource theObject,
|
|
||||||
in double stepSize,
|
in double stepSize,
|
||||||
in long nbOfSteps,
|
in long nbOfSteps,
|
||||||
in boolean byAverageNormal,
|
in boolean byAverageNormal,
|
||||||
@ -596,6 +453,24 @@ module SMESH
|
|||||||
in short dim)
|
in short dim)
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Generate new elements by extrusion of theElements
|
||||||
|
* by StepVector by NbOfSteps
|
||||||
|
* \param ExtrFlags set flags for performing extrusion
|
||||||
|
* \param SewTolerance - uses for comparing locations of nodes if flag
|
||||||
|
* EXTRUSION_FLAG_SEW is set
|
||||||
|
* \param ToMakeGroups - if true, new elements will be included into new groups
|
||||||
|
* corresponding to groups the input elements included in.
|
||||||
|
* \return ListOfGroups - new groups craeted if \a ToMakeGroups is true
|
||||||
|
*/
|
||||||
|
ListOfGroups AdvancedExtrusion(in long_array IDsOfElements,
|
||||||
|
in DirStruct StepVector,
|
||||||
|
in long NbOfSteps,
|
||||||
|
in long ExtrFlags,
|
||||||
|
in double SewTolerance,
|
||||||
|
in boolean ToMakeGroups)
|
||||||
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
enum Extrusion_Error {
|
enum Extrusion_Error {
|
||||||
EXTR_OK,
|
EXTR_OK,
|
||||||
EXTR_NO_ELEMENTS,
|
EXTR_NO_ELEMENTS,
|
||||||
@ -606,8 +481,11 @@ module SMESH
|
|||||||
EXTR_CANT_GET_TANGENT
|
EXTR_CANT_GET_TANGENT
|
||||||
};
|
};
|
||||||
|
|
||||||
ListOfGroups ExtrusionAlongPathX(in long_array IDsOfElements,
|
ListOfGroups ExtrusionAlongPathObjects(in ListOfIDSources Nodes,
|
||||||
|
in ListOfIDSources Edges,
|
||||||
|
in ListOfIDSources Faces,
|
||||||
in SMESH_IDSource Path,
|
in SMESH_IDSource Path,
|
||||||
|
in GEOM::GEOM_Object PathShape,
|
||||||
in long NodeStart,
|
in long NodeStart,
|
||||||
in boolean HasAngles,
|
in boolean HasAngles,
|
||||||
in double_array Angles,
|
in double_array Angles,
|
||||||
@ -615,100 +493,6 @@ module SMESH
|
|||||||
in boolean HasRefPoint,
|
in boolean HasRefPoint,
|
||||||
in PointStruct RefPoint,
|
in PointStruct RefPoint,
|
||||||
in boolean MakeGroups,
|
in boolean MakeGroups,
|
||||||
in ElementType ElemType,
|
|
||||||
out Extrusion_Error Error)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
ListOfGroups ExtrusionAlongPathObjX(in SMESH_IDSource theObject,
|
|
||||||
in SMESH_IDSource Path,
|
|
||||||
in long NodeStart,
|
|
||||||
in boolean HasAngles,
|
|
||||||
in double_array Angles,
|
|
||||||
in boolean LinearVariation,
|
|
||||||
in boolean HasRefPoint,
|
|
||||||
in PointStruct RefPoint,
|
|
||||||
in boolean MakeGroups,
|
|
||||||
in ElementType ElemType,
|
|
||||||
out Extrusion_Error Error)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
Extrusion_Error ExtrusionAlongPath(in long_array IDsOfElements,
|
|
||||||
in SMESH_Mesh PathMesh,
|
|
||||||
in GEOM::GEOM_Object PathShape,
|
|
||||||
in long NodeStart,
|
|
||||||
in boolean HasAngles,
|
|
||||||
in double_array Angles,
|
|
||||||
in boolean HasRefPoint,
|
|
||||||
in PointStruct RefPoint)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
ListOfGroups ExtrusionAlongPathMakeGroups(in long_array IDsOfElements,
|
|
||||||
in SMESH_Mesh PathMesh,
|
|
||||||
in GEOM::GEOM_Object PathShape,
|
|
||||||
in long NodeStart,
|
|
||||||
in boolean HasAngles,
|
|
||||||
in double_array Angles,
|
|
||||||
in boolean HasRefPoint,
|
|
||||||
in PointStruct RefPoint,
|
|
||||||
out Extrusion_Error Error)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource theObject,
|
|
||||||
in SMESH_Mesh PathMesh,
|
|
||||||
in GEOM::GEOM_Object PathShape,
|
|
||||||
in long NodeStart,
|
|
||||||
in boolean HasAngles,
|
|
||||||
in double_array Angles,
|
|
||||||
in boolean HasRefPoint,
|
|
||||||
in PointStruct RefPoint)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
ListOfGroups ExtrusionAlongPathObjectMakeGroups(in SMESH_IDSource theObject,
|
|
||||||
in SMESH_Mesh PathMesh,
|
|
||||||
in GEOM::GEOM_Object PathShape,
|
|
||||||
in long NodeStart,
|
|
||||||
in boolean HasAngles,
|
|
||||||
in double_array Angles,
|
|
||||||
in boolean HasRefPoint,
|
|
||||||
in PointStruct RefPoint,
|
|
||||||
out Extrusion_Error Error)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource theObject,
|
|
||||||
in SMESH_Mesh PathMesh,
|
|
||||||
in GEOM::GEOM_Object PathShape,
|
|
||||||
in long NodeStart,
|
|
||||||
in boolean HasAngles,
|
|
||||||
in double_array Angles,
|
|
||||||
in boolean HasRefPoint,
|
|
||||||
in PointStruct RefPoint)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource theObject,
|
|
||||||
in SMESH_Mesh PathMesh,
|
|
||||||
in GEOM::GEOM_Object PathShape,
|
|
||||||
in long NodeStart,
|
|
||||||
in boolean HasAngles,
|
|
||||||
in double_array Angles,
|
|
||||||
in boolean HasRefPoint,
|
|
||||||
in PointStruct RefPoint,
|
|
||||||
out Extrusion_Error Error)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource theObject,
|
|
||||||
in SMESH_Mesh PathMesh,
|
|
||||||
in GEOM::GEOM_Object PathShape,
|
|
||||||
in long NodeStart,
|
|
||||||
in boolean HasAngles,
|
|
||||||
in double_array Angles,
|
|
||||||
in boolean HasRefPoint,
|
|
||||||
in PointStruct RefPoint)
|
|
||||||
raises (SALOME::SALOME_Exception);
|
|
||||||
ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource theObject,
|
|
||||||
in SMESH_Mesh PathMesh,
|
|
||||||
in GEOM::GEOM_Object PathShape,
|
|
||||||
in long NodeStart,
|
|
||||||
in boolean HasAngles,
|
|
||||||
in double_array Angles,
|
|
||||||
in boolean HasRefPoint,
|
|
||||||
in PointStruct RefPoint,
|
|
||||||
out Extrusion_Error Error)
|
out Extrusion_Error Error)
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
|
@ -165,7 +165,22 @@ namespace MED
|
|||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
TVWrapper::TVWrapper(const std::string& theFileName):
|
TVWrapper::TVWrapper(const std::string& theFileName):
|
||||||
myFile(new TFile(theFileName))
|
myFile(new TFile(theFileName))
|
||||||
{}
|
{
|
||||||
|
TErr aRet;
|
||||||
|
myFile->Open( eLECTURE_ECRITURE, &aRet );
|
||||||
|
// if(aRet < 0)
|
||||||
|
// myFile->Close();
|
||||||
|
// myFile->Open( eLECTURE_AJOUT, &aRet );
|
||||||
|
// }
|
||||||
|
if(aRet < 0) {
|
||||||
|
myFile->Close();
|
||||||
|
myFile->Open( eLECTURE, &aRet );
|
||||||
|
}
|
||||||
|
if(aRet < 0) {
|
||||||
|
myFile->Close();
|
||||||
|
myFile->Open( eCREATION, &aRet );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -4216,19 +4216,21 @@ void SMESH_MeshEditor::Smooth (TIDSortedElemSet & theElems,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
namespace
|
||||||
//function : isReverse
|
{
|
||||||
//purpose : Return true if normal of prevNodes is not co-directied with
|
//=======================================================================
|
||||||
// gp_Vec(prevNodes[iNotSame],nextNodes[iNotSame]).
|
//function : isReverse
|
||||||
// iNotSame is where prevNodes and nextNodes are different.
|
//purpose : Return true if normal of prevNodes is not co-directied with
|
||||||
// If result is true then future volume orientation is OK
|
// gp_Vec(prevNodes[iNotSame],nextNodes[iNotSame]).
|
||||||
//=======================================================================
|
// iNotSame is where prevNodes and nextNodes are different.
|
||||||
|
// If result is true then future volume orientation is OK
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
static bool isReverse(const SMDS_MeshElement* face,
|
bool isReverse(const SMDS_MeshElement* face,
|
||||||
const vector<const SMDS_MeshNode*>& prevNodes,
|
const vector<const SMDS_MeshNode*>& prevNodes,
|
||||||
const vector<const SMDS_MeshNode*>& nextNodes,
|
const vector<const SMDS_MeshNode*>& nextNodes,
|
||||||
const int iNotSame)
|
const int iNotSame)
|
||||||
{
|
{
|
||||||
|
|
||||||
SMESH_TNodeXYZ pP = prevNodes[ iNotSame ];
|
SMESH_TNodeXYZ pP = prevNodes[ iNotSame ];
|
||||||
SMESH_TNodeXYZ pN = nextNodes[ iNotSame ];
|
SMESH_TNodeXYZ pN = nextNodes[ iNotSame ];
|
||||||
@ -4236,6 +4238,27 @@ static bool isReverse(const SMDS_MeshElement* face,
|
|||||||
SMESH_MeshAlgos::FaceNormal( face, faceNorm, /*normalized=*/false );
|
SMESH_MeshAlgos::FaceNormal( face, faceNorm, /*normalized=*/false );
|
||||||
|
|
||||||
return faceNorm * extrDir < 0.0;
|
return faceNorm * extrDir < 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Assure that theElemSets[0] holds elements, not nodes
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void setElemsFirst( TIDSortedElemSet theElemSets[2] )
|
||||||
|
{
|
||||||
|
if ( !theElemSets[0].empty() &&
|
||||||
|
(*theElemSets[0].begin())->GetType() == SMDSAbs_Node )
|
||||||
|
{
|
||||||
|
std::swap( theElemSets[0], theElemSets[1] );
|
||||||
|
}
|
||||||
|
else if ( !theElemSets[1].empty() &&
|
||||||
|
(*theElemSets[1].begin())->GetType() != SMDSAbs_Node )
|
||||||
|
{
|
||||||
|
std::swap( theElemSets[0], theElemSets[1] );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -5121,7 +5144,7 @@ void SMESH_MeshEditor::makeWalls (TNodeOfNodeListMap & mapNewNodes,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
SMESH_MeshEditor::PGroupIDs
|
SMESH_MeshEditor::PGroupIDs
|
||||||
SMESH_MeshEditor::RotationSweep(TIDSortedElemSet & theElems,
|
SMESH_MeshEditor::RotationSweep(TIDSortedElemSet theElemSets[2],
|
||||||
const gp_Ax1& theAxis,
|
const gp_Ax1& theAxis,
|
||||||
const double theAngle,
|
const double theAngle,
|
||||||
const int theNbSteps,
|
const int theNbSteps,
|
||||||
@ -5153,8 +5176,12 @@ SMESH_MeshEditor::RotationSweep(TIDSortedElemSet & theElems,
|
|||||||
const bool isQuadraticMesh = bool( myMesh->NbEdges(ORDER_QUADRATIC) +
|
const bool isQuadraticMesh = bool( myMesh->NbEdges(ORDER_QUADRATIC) +
|
||||||
myMesh->NbFaces(ORDER_QUADRATIC) +
|
myMesh->NbFaces(ORDER_QUADRATIC) +
|
||||||
myMesh->NbVolumes(ORDER_QUADRATIC) );
|
myMesh->NbVolumes(ORDER_QUADRATIC) );
|
||||||
// loop on theElems
|
// loop on theElemSets
|
||||||
|
setElemsFirst( theElemSets );
|
||||||
TIDSortedElemSet::iterator itElem;
|
TIDSortedElemSet::iterator itElem;
|
||||||
|
for ( int is2ndSet = 0; is2ndSet < 2; ++is2ndSet )
|
||||||
|
{
|
||||||
|
TIDSortedElemSet& theElems = theElemSets[ is2ndSet ];
|
||||||
for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) {
|
for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) {
|
||||||
const SMDS_MeshElement* elem = *itElem;
|
const SMDS_MeshElement* elem = *itElem;
|
||||||
if ( !elem || elem->GetType() == SMDSAbs_Volume )
|
if ( !elem || elem->GetType() == SMDSAbs_Volume )
|
||||||
@ -5228,9 +5255,10 @@ SMESH_MeshEditor::RotationSweep(TIDSortedElemSet & theElems,
|
|||||||
// make new elements
|
// make new elements
|
||||||
sweepElement( elem, newNodesItVec, newElemsMap[elem], theNbSteps, srcElems );
|
sweepElement( elem, newNodesItVec, newElemsMap[elem], theNbSteps, srcElems );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( theMakeWalls )
|
if ( theMakeWalls )
|
||||||
makeWalls( mapNewNodes, newElemsMap, mapElemNewNodes, theElems, theNbSteps, srcElems );
|
makeWalls( mapNewNodes, newElemsMap, mapElemNewNodes, theElemSets[0], theNbSteps, srcElems );
|
||||||
|
|
||||||
PGroupIDs newGroupIDs;
|
PGroupIDs newGroupIDs;
|
||||||
if ( theMakeGroups )
|
if ( theMakeGroups )
|
||||||
@ -5568,7 +5596,7 @@ makeNodesByNormal1D( SMESHDS_Mesh* mesh,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
SMESH_MeshEditor::PGroupIDs
|
SMESH_MeshEditor::PGroupIDs
|
||||||
SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet & theElems,
|
SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet theElems[2],
|
||||||
const gp_Vec& theStep,
|
const gp_Vec& theStep,
|
||||||
const int theNbSteps,
|
const int theNbSteps,
|
||||||
TTElemOfElemListMap& newElemsMap,
|
TTElemOfElemListMap& newElemsMap,
|
||||||
@ -5586,7 +5614,7 @@ SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet & theElems,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
SMESH_MeshEditor::PGroupIDs
|
SMESH_MeshEditor::PGroupIDs
|
||||||
SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet & theElems,
|
SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet theElemSets[2],
|
||||||
ExtrusParam& theParams,
|
ExtrusParam& theParams,
|
||||||
TTElemOfElemListMap& newElemsMap)
|
TTElemOfElemListMap& newElemsMap)
|
||||||
{
|
{
|
||||||
@ -5598,8 +5626,9 @@ SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet & theElems,
|
|||||||
|
|
||||||
SMESHDS_Mesh* aMesh = GetMeshDS();
|
SMESHDS_Mesh* aMesh = GetMeshDS();
|
||||||
|
|
||||||
|
setElemsFirst( theElemSets );
|
||||||
const int nbSteps = theParams.NbSteps();
|
const int nbSteps = theParams.NbSteps();
|
||||||
theParams.SetElementsToUse( theElems );
|
theParams.SetElementsToUse( theElemSets[0] );
|
||||||
|
|
||||||
TNodeOfNodeListMap mapNewNodes;
|
TNodeOfNodeListMap mapNewNodes;
|
||||||
//TNodeOfNodeVecMap mapNewNodes;
|
//TNodeOfNodeVecMap mapNewNodes;
|
||||||
@ -5611,6 +5640,9 @@ SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet & theElems,
|
|||||||
myMesh->NbVolumes(ORDER_QUADRATIC) );
|
myMesh->NbVolumes(ORDER_QUADRATIC) );
|
||||||
// loop on theElems
|
// loop on theElems
|
||||||
TIDSortedElemSet::iterator itElem;
|
TIDSortedElemSet::iterator itElem;
|
||||||
|
for ( int is2ndSet = 0; is2ndSet < 2; ++is2ndSet )
|
||||||
|
{
|
||||||
|
TIDSortedElemSet& theElems = theElemSets[ is2ndSet ];
|
||||||
for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ )
|
for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ )
|
||||||
{
|
{
|
||||||
// check element type
|
// check element type
|
||||||
@ -5670,9 +5702,10 @@ SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet & theElems,
|
|||||||
if ( newNodesItVec.size() == nbNodes )
|
if ( newNodesItVec.size() == nbNodes )
|
||||||
sweepElement( elem, newNodesItVec, newElemsMap[elem], nbSteps, srcElems );
|
sweepElement( elem, newNodesItVec, newElemsMap[elem], nbSteps, srcElems );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( theParams.ToMakeBoundary() ) {
|
if ( theParams.ToMakeBoundary() ) {
|
||||||
makeWalls( mapNewNodes, newElemsMap, mapElemNewNodes, theElems, nbSteps, srcElems );
|
makeWalls( mapNewNodes, newElemsMap, mapElemNewNodes, theElemSets[0], nbSteps, srcElems );
|
||||||
}
|
}
|
||||||
PGroupIDs newGroupIDs;
|
PGroupIDs newGroupIDs;
|
||||||
if ( theParams.ToMakeGroups() )
|
if ( theParams.ToMakeGroups() )
|
||||||
@ -5686,7 +5719,7 @@ SMESH_MeshEditor::ExtrusionSweep (TIDSortedElemSet & theElems,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMESH_MeshEditor::Extrusion_Error
|
SMESH_MeshEditor::Extrusion_Error
|
||||||
SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements,
|
SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet theElements[2],
|
||||||
SMESH_subMesh* theTrack,
|
SMESH_subMesh* theTrack,
|
||||||
const SMDS_MeshNode* theN1,
|
const SMDS_MeshNode* theN1,
|
||||||
const bool theHasAngles,
|
const bool theHasAngles,
|
||||||
@ -5715,7 +5748,7 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements,
|
|||||||
TNodeOfNodeListMap mapNewNodes;
|
TNodeOfNodeListMap mapNewNodes;
|
||||||
|
|
||||||
// 1. Check data
|
// 1. Check data
|
||||||
aNbE = theElements.size();
|
aNbE = theElements[0].size() + theElements[1].size();
|
||||||
// nothing to do
|
// nothing to do
|
||||||
if ( !aNbE )
|
if ( !aNbE )
|
||||||
return EXTR_NO_ELEMENTS;
|
return EXTR_NO_ELEMENTS;
|
||||||
@ -5858,7 +5891,7 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMESH_MeshEditor::Extrusion_Error
|
SMESH_MeshEditor::Extrusion_Error
|
||||||
SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements,
|
SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet theElements[2],
|
||||||
SMESH_Mesh* theTrack,
|
SMESH_Mesh* theTrack,
|
||||||
const SMDS_MeshNode* theN1,
|
const SMDS_MeshNode* theN1,
|
||||||
const bool theHasAngles,
|
const bool theHasAngles,
|
||||||
@ -5886,7 +5919,7 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements,
|
|||||||
TNodeOfNodeListMap mapNewNodes;
|
TNodeOfNodeListMap mapNewNodes;
|
||||||
|
|
||||||
// 1. Check data
|
// 1. Check data
|
||||||
aNbE = theElements.size();
|
aNbE = theElements[0].size() + theElements[1].size();
|
||||||
// nothing to do
|
// nothing to do
|
||||||
if ( !aNbE )
|
if ( !aNbE )
|
||||||
return EXTR_NO_ELEMENTS;
|
return EXTR_NO_ELEMENTS;
|
||||||
@ -5927,7 +5960,7 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements,
|
|||||||
}
|
}
|
||||||
|
|
||||||
conn = nbEdgeConnectivity(theN1);
|
conn = nbEdgeConnectivity(theN1);
|
||||||
if(conn > 2)
|
if( conn != 1 )
|
||||||
return EXTR_PATH_NOT_EDGE;
|
return EXTR_PATH_NOT_EDGE;
|
||||||
|
|
||||||
aItE = theN1->GetInverseElementIterator();
|
aItE = theN1->GetInverseElementIterator();
|
||||||
@ -6207,7 +6240,7 @@ SMESH_MeshEditor::MakeEdgePathPoints(std::list<double>& aPrms,
|
|||||||
//purpose : auxilary for ExtrusionAlongTrack
|
//purpose : auxilary for ExtrusionAlongTrack
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMESH_MeshEditor::Extrusion_Error
|
SMESH_MeshEditor::Extrusion_Error
|
||||||
SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements,
|
SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet theElemSets[2],
|
||||||
list<SMESH_MeshEditor_PathPoint>& fullList,
|
list<SMESH_MeshEditor_PathPoint>& fullList,
|
||||||
const bool theHasAngles,
|
const bool theHasAngles,
|
||||||
list<double>& theAngles,
|
list<double>& theAngles,
|
||||||
@ -6245,6 +6278,9 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements
|
|||||||
gp_XYZ aGC( 0.,0.,0. );
|
gp_XYZ aGC( 0.,0.,0. );
|
||||||
TIDSortedElemSet newNodes;
|
TIDSortedElemSet newNodes;
|
||||||
|
|
||||||
|
for ( int is2ndSet = 0; is2ndSet < 2; ++is2ndSet )
|
||||||
|
{
|
||||||
|
TIDSortedElemSet& theElements = theElemSets[ is2ndSet ];
|
||||||
itElem = theElements.begin();
|
itElem = theElements.begin();
|
||||||
for ( ; itElem != theElements.end(); itElem++ ) {
|
for ( ; itElem != theElements.end(); itElem++ ) {
|
||||||
const SMDS_MeshElement* elem = *itElem;
|
const SMDS_MeshElement* elem = *itElem;
|
||||||
@ -6256,6 +6292,7 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements
|
|||||||
aGC += SMESH_TNodeXYZ( node );
|
aGC += SMESH_TNodeXYZ( node );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
aGC /= newNodes.size();
|
aGC /= newNodes.size();
|
||||||
aV0.SetXYZ( aGC );
|
aV0.SetXYZ( aGC );
|
||||||
} // if (!theHasRefPoint) {
|
} // if (!theHasRefPoint) {
|
||||||
@ -6263,11 +6300,15 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements
|
|||||||
// 4. Processing the elements
|
// 4. Processing the elements
|
||||||
SMESHDS_Mesh* aMesh = GetMeshDS();
|
SMESHDS_Mesh* aMesh = GetMeshDS();
|
||||||
|
|
||||||
|
setElemsFirst( theElemSets );
|
||||||
|
for ( int is2ndSet = 0; is2ndSet < 2; ++is2ndSet )
|
||||||
|
{
|
||||||
|
TIDSortedElemSet& theElements = theElemSets[ is2ndSet ];
|
||||||
for ( itElem = theElements.begin(); itElem != theElements.end(); itElem++ ) {
|
for ( itElem = theElements.begin(); itElem != theElements.end(); itElem++ ) {
|
||||||
// check element type
|
// check element type
|
||||||
const SMDS_MeshElement* elem = *itElem;
|
const SMDS_MeshElement* elem = *itElem;
|
||||||
SMDSAbs_ElementType aTypeE = elem->GetType();
|
SMDSAbs_ElementType aTypeE = elem->GetType();
|
||||||
if ( !elem || ( aTypeE != SMDSAbs_Face && aTypeE != SMDSAbs_Edge ) )
|
if ( !elem /*|| ( aTypeE != SMDSAbs_Face && aTypeE != SMDSAbs_Edge )*/ )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
vector<TNodeOfNodeListMapItr> & newNodesItVec = mapElemNewNodes[ elem ];
|
vector<TNodeOfNodeListMapItr> & newNodesItVec = mapElemNewNodes[ elem ];
|
||||||
@ -6399,8 +6440,9 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements
|
|||||||
// newNodesItVec[0]->second.size(), myLastCreatedElems );
|
// newNodesItVec[0]->second.size(), myLastCreatedElems );
|
||||||
sweepElement( elem, newNodesItVec, newElemsMap[elem], aNbTP-1, srcElems );
|
sweepElement( elem, newNodesItVec, newElemsMap[elem], aNbTP-1, srcElems );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
makeWalls( mapNewNodes, newElemsMap, mapElemNewNodes, theElements, aNbTP-1, srcElems );
|
makeWalls( mapNewNodes, newElemsMap, mapElemNewNodes, theElemSets[0], aNbTP-1, srcElems );
|
||||||
|
|
||||||
if ( theMakeGroups )
|
if ( theMakeGroups )
|
||||||
generateGroups( srcNodes, srcElems, "extruded");
|
generateGroups( srcNodes, srcElems, "extruded");
|
||||||
|
@ -229,7 +229,7 @@ public:
|
|||||||
typedef std::map<const SMDS_MeshElement*, TVecOfNnlmiMap, TElemSort > TElemOfVecOfNnlmiMap;
|
typedef std::map<const SMDS_MeshElement*, TVecOfNnlmiMap, TElemSort > TElemOfVecOfNnlmiMap;
|
||||||
typedef std::auto_ptr< std::list<int> > PGroupIDs;
|
typedef std::auto_ptr< std::list<int> > PGroupIDs;
|
||||||
|
|
||||||
PGroupIDs RotationSweep (TIDSortedElemSet & theElements,
|
PGroupIDs RotationSweep (TIDSortedElemSet theElements[2],
|
||||||
const gp_Ax1& theAxis,
|
const gp_Ax1& theAxis,
|
||||||
const double theAngle,
|
const double theAngle,
|
||||||
const int theNbSteps,
|
const int theNbSteps,
|
||||||
@ -345,7 +345,7 @@ public:
|
|||||||
* @param theTolerance - uses for comparing locations of nodes if flag
|
* @param theTolerance - uses for comparing locations of nodes if flag
|
||||||
* EXTRUSION_FLAG_SEW is set
|
* EXTRUSION_FLAG_SEW is set
|
||||||
*/
|
*/
|
||||||
PGroupIDs ExtrusionSweep (TIDSortedElemSet & theElems,
|
PGroupIDs ExtrusionSweep (TIDSortedElemSet theElems[2],
|
||||||
const gp_Vec& theStep,
|
const gp_Vec& theStep,
|
||||||
const int theNbSteps,
|
const int theNbSteps,
|
||||||
TTElemOfElemListMap& newElemsMap,
|
TTElemOfElemListMap& newElemsMap,
|
||||||
@ -362,7 +362,7 @@ public:
|
|||||||
* EXTRUSION_FLAG_SEW is set
|
* EXTRUSION_FLAG_SEW is set
|
||||||
* @param theParams - special structure for manage of extrusion
|
* @param theParams - special structure for manage of extrusion
|
||||||
*/
|
*/
|
||||||
PGroupIDs ExtrusionSweep (TIDSortedElemSet & theElems,
|
PGroupIDs ExtrusionSweep (TIDSortedElemSet theElems[2],
|
||||||
ExtrusParam& theParams,
|
ExtrusParam& theParams,
|
||||||
TTElemOfElemListMap& newElemsMap);
|
TTElemOfElemListMap& newElemsMap);
|
||||||
|
|
||||||
@ -380,7 +380,7 @@ public:
|
|||||||
EXTR_CANT_GET_TANGENT
|
EXTR_CANT_GET_TANGENT
|
||||||
};
|
};
|
||||||
|
|
||||||
Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet & theElements,
|
Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet theElements[2],
|
||||||
SMESH_subMesh* theTrackPattern,
|
SMESH_subMesh* theTrackPattern,
|
||||||
const SMDS_MeshNode* theNodeStart,
|
const SMDS_MeshNode* theNodeStart,
|
||||||
const bool theHasAngles,
|
const bool theHasAngles,
|
||||||
@ -389,7 +389,7 @@ public:
|
|||||||
const bool theHasRefPoint,
|
const bool theHasRefPoint,
|
||||||
const gp_Pnt& theRefPoint,
|
const gp_Pnt& theRefPoint,
|
||||||
const bool theMakeGroups);
|
const bool theMakeGroups);
|
||||||
Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet & theElements,
|
Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet theElements[2],
|
||||||
SMESH_Mesh* theTrackPattern,
|
SMESH_Mesh* theTrackPattern,
|
||||||
const SMDS_MeshNode* theNodeStart,
|
const SMDS_MeshNode* theNodeStart,
|
||||||
const bool theHasAngles,
|
const bool theHasAngles,
|
||||||
@ -730,7 +730,7 @@ public:
|
|||||||
const TopoDS_Edge& aTrackEdge,
|
const TopoDS_Edge& aTrackEdge,
|
||||||
bool aFirstIsStart,
|
bool aFirstIsStart,
|
||||||
std::list<SMESH_MeshEditor_PathPoint>& aLPP);
|
std::list<SMESH_MeshEditor_PathPoint>& aLPP);
|
||||||
Extrusion_Error MakeExtrElements(TIDSortedElemSet& theElements,
|
Extrusion_Error MakeExtrElements(TIDSortedElemSet theElements[2],
|
||||||
std::list<SMESH_MeshEditor_PathPoint>& theFullList,
|
std::list<SMESH_MeshEditor_PathPoint>& theFullList,
|
||||||
const bool theHasAngles,
|
const bool theHasAngles,
|
||||||
std::list<double>& theAngles,
|
std::list<double>& theAngles,
|
||||||
|
@ -353,7 +353,7 @@ bool SMESHGUI_Add0DElemsOnAllNodesOp::onApply()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// get a mesh
|
// get a mesh
|
||||||
SMESH::SMESH_IDSource_wrap meshObject;
|
SMESH::IDSource_wrap meshObject;
|
||||||
SMESH::SMESH_Mesh_var mesh;
|
SMESH::SMESH_Mesh_var mesh;
|
||||||
if ( !myIO.IsNull() )
|
if ( !myIO.IsNull() )
|
||||||
{
|
{
|
||||||
|
@ -309,7 +309,8 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply()
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_IDSource_wrap aPartToCopy;
|
|
||||||
|
SMESH::IDSource_wrap aPartToCopy;
|
||||||
if ( myIdSourceCheck->isChecked())
|
if ( myIdSourceCheck->isChecked())
|
||||||
{
|
{
|
||||||
aPartToCopy = mySelectedObject;
|
aPartToCopy = mySelectedObject;
|
||||||
|
@ -22,22 +22,23 @@
|
|||||||
#include "SMESHGUI_DisplayEntitiesDlg.h"
|
#include "SMESHGUI_DisplayEntitiesDlg.h"
|
||||||
|
|
||||||
#include "SMESHGUI.h"
|
#include "SMESHGUI.h"
|
||||||
|
#include "SMESHGUI_MeshUtils.h"
|
||||||
#include "SMESHGUI_Utils.h"
|
#include "SMESHGUI_Utils.h"
|
||||||
#include "SMESHGUI_VTKUtils.h"
|
#include "SMESHGUI_VTKUtils.h"
|
||||||
#include "SMESHGUI_MeshUtils.h"
|
|
||||||
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QGroupBox>
|
|
||||||
#include <QGridLayout>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QCheckBox>
|
|
||||||
|
|
||||||
#include <SUIT_Session.h>
|
|
||||||
#include <SUIT_MessageBox.h>
|
|
||||||
#include <SUIT_ResourceMgr.h>
|
|
||||||
#include <LightApp_Application.h>
|
#include <LightApp_Application.h>
|
||||||
#include <LightApp_SelectionMgr.h>
|
#include <LightApp_SelectionMgr.h>
|
||||||
#include <SALOME_ListIO.hxx>
|
#include <SALOME_ListIO.hxx>
|
||||||
|
#include <SUIT_MessageBox.h>
|
||||||
|
#include <SUIT_OverrideCursor.h>
|
||||||
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
#include <SUIT_Session.h>
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QGridLayout>
|
||||||
|
#include <QGroupBox>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
const int MARGIN = 9;
|
const int MARGIN = 9;
|
||||||
const int SPACING = 6;
|
const int SPACING = 6;
|
||||||
@ -228,6 +229,8 @@ void SMESHGUI_DisplayEntitiesDlg::onHelp()
|
|||||||
*/
|
*/
|
||||||
void SMESHGUI_DisplayEntitiesDlg::onOk()
|
void SMESHGUI_DisplayEntitiesDlg::onOk()
|
||||||
{
|
{
|
||||||
|
SUIT_OverrideCursor wc;
|
||||||
|
|
||||||
const char* entry = myIObject->getEntry();
|
const char* entry = myIObject->getEntry();
|
||||||
|
|
||||||
if ( !myActor ) {
|
if ( !myActor ) {
|
||||||
|
@ -28,13 +28,14 @@
|
|||||||
#include "SMESHGUI_ExtrusionAlongPathDlg.h"
|
#include "SMESHGUI_ExtrusionAlongPathDlg.h"
|
||||||
|
|
||||||
#include "SMESHGUI.h"
|
#include "SMESHGUI.h"
|
||||||
#include "SMESHGUI_Utils.h"
|
#include "SMESHGUI_ExtrusionDlg.h" // for SMESHGUI_3TypesSelector
|
||||||
#include "SMESHGUI_VTKUtils.h"
|
#include "SMESHGUI_FilterDlg.h"
|
||||||
|
#include "SMESHGUI_IdValidator.h"
|
||||||
|
#include "SMESHGUI_MeshEditPreview.h"
|
||||||
#include "SMESHGUI_MeshUtils.h"
|
#include "SMESHGUI_MeshUtils.h"
|
||||||
#include "SMESHGUI_SpinBox.h"
|
#include "SMESHGUI_SpinBox.h"
|
||||||
#include "SMESHGUI_IdValidator.h"
|
#include "SMESHGUI_Utils.h"
|
||||||
#include "SMESHGUI_FilterDlg.h"
|
#include "SMESHGUI_VTKUtils.h"
|
||||||
#include "SMESHGUI_MeshEditPreview.h"
|
|
||||||
|
|
||||||
#include <SMESH_Actor.h>
|
#include <SMESH_Actor.h>
|
||||||
#include <SMESH_TypeFilter.hxx>
|
#include <SMESH_TypeFilter.hxx>
|
||||||
@ -52,10 +53,8 @@
|
|||||||
#include <SUIT_Desktop.h>
|
#include <SUIT_Desktop.h>
|
||||||
#include <SUIT_MessageBox.h>
|
#include <SUIT_MessageBox.h>
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
|
|
||||||
#include <LightApp_Application.h>
|
#include <LightApp_Application.h>
|
||||||
#include <LightApp_SelectionMgr.h>
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include <SVTK_ViewWindow.h>
|
#include <SVTK_ViewWindow.h>
|
||||||
|
|
||||||
// OCCT includes
|
// OCCT includes
|
||||||
@ -111,18 +110,13 @@ private:
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule )
|
SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule )
|
||||||
: SMESHGUI_PreviewDlg( theModule ),
|
: SMESHGUI_PreviewDlg( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
|
||||||
myFilterDlg( 0 )
|
|
||||||
{
|
{
|
||||||
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
|
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
|
||||||
QPixmap edgeImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
|
|
||||||
QPixmap faceImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
|
|
||||||
QPixmap selectImage ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
|
QPixmap selectImage ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
|
||||||
QPixmap addImage ( mgr->loadPixmap("SMESH", tr("ICON_APPEND")));
|
QPixmap addImage ( mgr->loadPixmap("SMESH", tr("ICON_APPEND")));
|
||||||
QPixmap removeImage ( mgr->loadPixmap("SMESH", tr("ICON_REMOVE")));
|
QPixmap removeImage ( mgr->loadPixmap("SMESH", tr("ICON_REMOVE")));
|
||||||
|
|
||||||
myType = -1;
|
|
||||||
|
|
||||||
setModal( false );
|
setModal( false );
|
||||||
setAttribute( Qt::WA_DeleteOnClose, true );
|
setAttribute( Qt::WA_DeleteOnClose, true );
|
||||||
setWindowTitle(tr("EXTRUSION_ALONG_PATH"));
|
setWindowTitle(tr("EXTRUSION_ALONG_PATH"));
|
||||||
@ -132,47 +126,16 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
topLayout->setSpacing(SPACING);
|
topLayout->setSpacing(SPACING);
|
||||||
topLayout->setMargin(MARGIN);
|
topLayout->setMargin(MARGIN);
|
||||||
|
|
||||||
/***************************************************************/
|
|
||||||
// Elements type group box (1d / 2d elements)
|
|
||||||
ConstructorsBox = new QGroupBox(tr("SMESH_EXTRUSION"), this);
|
|
||||||
GroupConstructors = new QButtonGroup(this);
|
|
||||||
QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
|
|
||||||
ConstructorsBoxLayout->setSpacing(SPACING); ConstructorsBoxLayout->setMargin(MARGIN);
|
|
||||||
|
|
||||||
Elements1dRB = new QRadioButton(ConstructorsBox);
|
|
||||||
Elements1dRB->setIcon(edgeImage);
|
|
||||||
Elements2dRB = new QRadioButton(ConstructorsBox);
|
|
||||||
Elements2dRB->setIcon(faceImage);
|
|
||||||
Elements1dRB->setChecked(true);
|
|
||||||
|
|
||||||
// layouting
|
|
||||||
ConstructorsBoxLayout->addWidget(Elements1dRB);
|
|
||||||
ConstructorsBoxLayout->addWidget(Elements2dRB);
|
|
||||||
GroupConstructors->addButton(Elements1dRB, 0);
|
|
||||||
GroupConstructors->addButton(Elements2dRB, 1);
|
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
// Arguments group box
|
// Arguments group box
|
||||||
GroupArguments = new QGroupBox(tr("EXTRUSION_1D"), this);
|
GroupArguments = new QGroupBox(tr("SMESH_EXTRUSION"), this);
|
||||||
QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
|
QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
|
||||||
GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN);
|
GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN);
|
||||||
|
|
||||||
myIdValidator = new SMESHGUI_IdValidator(this);
|
myIdValidator = new SMESHGUI_IdValidator(this);
|
||||||
|
|
||||||
// Controls for elements selection
|
// Controls for elements selection
|
||||||
ElementsLab = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
|
SelectorWdg = new SMESHGUI_3TypesSelector( GroupArguments );
|
||||||
|
|
||||||
SelectElementsButton = new QToolButton(GroupArguments);
|
|
||||||
SelectElementsButton->setIcon(selectImage);
|
|
||||||
|
|
||||||
ElementsLineEdit = new QLineEdit(GroupArguments);
|
|
||||||
ElementsLineEdit->setValidator(myIdValidator);
|
|
||||||
ElementsLineEdit->setMaxLength(-1);
|
|
||||||
myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
|
|
||||||
connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
|
|
||||||
|
|
||||||
// Controls for the whole mesh selection
|
|
||||||
MeshCheck = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
|
|
||||||
|
|
||||||
// Controls for path selection
|
// Controls for path selection
|
||||||
PathGrp = new QGroupBox(tr("SMESH_PATH"), GroupArguments);
|
PathGrp = new QGroupBox(tr("SMESH_PATH"), GroupArguments);
|
||||||
@ -182,8 +145,9 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
// Controls for path mesh selection
|
// Controls for path mesh selection
|
||||||
QLabel* PathMeshLab = new QLabel(tr("SMESH_PATH_MESH"), PathGrp);
|
QLabel* PathMeshLab = new QLabel(tr("SMESH_PATH_MESH"), PathGrp);
|
||||||
|
|
||||||
SelectPathMeshButton = new QToolButton(PathGrp);
|
SelectPathMeshButton = new QPushButton(PathGrp);
|
||||||
SelectPathMeshButton->setIcon(selectImage);
|
SelectPathMeshButton->setIcon(selectImage);
|
||||||
|
SelectPathMeshButton->setCheckable(true);
|
||||||
|
|
||||||
PathMeshLineEdit = new QLineEdit(PathGrp);
|
PathMeshLineEdit = new QLineEdit(PathGrp);
|
||||||
PathMeshLineEdit->setReadOnly(true);
|
PathMeshLineEdit->setReadOnly(true);
|
||||||
@ -191,8 +155,9 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
// Controls for path starting point selection
|
// Controls for path starting point selection
|
||||||
QLabel* StartPointLab = new QLabel(tr("SMESH_PATH_START"), PathGrp);
|
QLabel* StartPointLab = new QLabel(tr("SMESH_PATH_START"), PathGrp);
|
||||||
|
|
||||||
SelectStartPointButton = new QToolButton(PathGrp);
|
SelectStartPointButton = new QPushButton(PathGrp);
|
||||||
SelectStartPointButton->setIcon(selectImage);
|
SelectStartPointButton->setIcon(selectImage);
|
||||||
|
SelectStartPointButton->setCheckable(true);
|
||||||
|
|
||||||
StartPointLineEdit = new QLineEdit(PathGrp);
|
StartPointLineEdit = new QLineEdit(PathGrp);
|
||||||
StartPointLineEdit->setValidator(new QIntValidator(this));
|
StartPointLineEdit->setValidator(new QIntValidator(this));
|
||||||
@ -211,8 +176,13 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
QHBoxLayout* BasePointGrpLayout = new QHBoxLayout(BasePointGrp);
|
QHBoxLayout* BasePointGrpLayout = new QHBoxLayout(BasePointGrp);
|
||||||
BasePointGrpLayout->setSpacing(SPACING); BasePointGrpLayout->setMargin(MARGIN);
|
BasePointGrpLayout->setSpacing(SPACING); BasePointGrpLayout->setMargin(MARGIN);
|
||||||
|
|
||||||
SelectBasePointButton = new QToolButton(BasePointGrp);
|
SelectBasePointButton = new QPushButton(BasePointGrp);
|
||||||
SelectBasePointButton->setIcon(selectImage);
|
SelectBasePointButton->setIcon(selectImage);
|
||||||
|
SelectBasePointButton->setCheckable(true);
|
||||||
|
|
||||||
|
SelectorWdg->GetButtonGroup()->addButton( SelectPathMeshButton );
|
||||||
|
SelectorWdg->GetButtonGroup()->addButton( SelectStartPointButton );
|
||||||
|
SelectorWdg->GetButtonGroup()->addButton( SelectBasePointButton );
|
||||||
|
|
||||||
QLabel* XLab = new QLabel(tr("SMESH_X"), BasePointGrp);
|
QLabel* XLab = new QLabel(tr("SMESH_X"), BasePointGrp);
|
||||||
XSpin = new SMESHGUI_SpinBox(BasePointGrp);
|
XSpin = new SMESHGUI_SpinBox(BasePointGrp);
|
||||||
@ -266,16 +236,12 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
myPreviewCheckBox = new QCheckBox(tr("PREVIEW"), GroupArguments);
|
myPreviewCheckBox = new QCheckBox(tr("PREVIEW"), GroupArguments);
|
||||||
|
|
||||||
// layouting
|
// layouting
|
||||||
GroupArgumentsLayout->addWidget(ElementsLab, 0, 0);
|
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0);
|
||||||
GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
|
GroupArgumentsLayout->addWidget(PathGrp, 1, 0);
|
||||||
GroupArgumentsLayout->addWidget(ElementsLineEdit, 0, 2);
|
GroupArgumentsLayout->addWidget(BasePointGrp, 2, 0);
|
||||||
GroupArgumentsLayout->addWidget(myFilterBtn, 0, 3);
|
GroupArgumentsLayout->addWidget(AnglesGrp, 3, 0);
|
||||||
GroupArgumentsLayout->addWidget(MeshCheck, 1, 0, 1, 4);
|
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 4, 0);
|
||||||
GroupArgumentsLayout->addWidget(PathGrp, 2, 0, 1, 4);
|
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0);
|
||||||
GroupArgumentsLayout->addWidget(BasePointGrp, 3, 0, 1, 4);
|
|
||||||
GroupArgumentsLayout->addWidget(AnglesGrp, 4, 0, 1, 4);
|
|
||||||
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 5, 0, 1, 4);
|
|
||||||
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 6, 0, 1, 4);
|
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
// common buttons group box
|
// common buttons group box
|
||||||
@ -307,7 +273,6 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
// layouting
|
// layouting
|
||||||
topLayout->addWidget(ConstructorsBox);
|
|
||||||
topLayout->addWidget(GroupArguments);
|
topLayout->addWidget(GroupArguments);
|
||||||
topLayout->addWidget(GroupButtons);
|
topLayout->addWidget(GroupButtons);
|
||||||
|
|
||||||
@ -322,16 +287,6 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
|
|
||||||
mySMESHGUI->SetActiveDialogBox(this);
|
mySMESHGUI->SetActiveDialogBox(this);
|
||||||
|
|
||||||
// Costruction of the logical filter for the elements: mesh/sub-mesh/group
|
|
||||||
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (SMESH::MESHorSUBMESH);
|
|
||||||
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (SMESH::GROUP);
|
|
||||||
|
|
||||||
QList<SUIT_SelectionFilter*> aListOfFilters;
|
|
||||||
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
|
|
||||||
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
|
|
||||||
|
|
||||||
myElementsFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
|
|
||||||
//myPathMeshFilter = new SMESH_TypeFilter (SMESH::MESH);
|
|
||||||
myPathMeshFilter = new SMESH_TypeFilter(SMESH::MESHorSUBMESH);
|
myPathMeshFilter = new SMESH_TypeFilter(SMESH::MESHorSUBMESH);
|
||||||
|
|
||||||
myHelpFileName = "extrusion_along_path_page.html";
|
myHelpFileName = "extrusion_along_path_page.html";
|
||||||
@ -348,42 +303,38 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleAdded()));
|
connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleAdded()));
|
||||||
connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleRemoved()));
|
connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleRemoved()));
|
||||||
|
|
||||||
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
|
|
||||||
|
|
||||||
connect(SelectElementsButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
||||||
connect(SelectPathMeshButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(SelectPathMeshButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(SelectStartPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(SelectStartPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(SelectBasePointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(SelectBasePointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(BasePointGrp, SIGNAL(toggled(bool)), this, SLOT(SetEditCurrentArgument()));
|
connect(BasePointGrp, SIGNAL(toggled(bool)), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
|
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
|
||||||
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
|
||||||
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
|
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
|
||||||
|
connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable()));
|
||||||
|
|
||||||
connect(ElementsLineEdit, SIGNAL(textChanged(const QString&)),
|
|
||||||
SLOT(onTextChange(const QString&)));
|
|
||||||
connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)),
|
connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)),
|
||||||
SLOT(onTextChange(const QString&)));
|
SLOT(onTextChange(const QString&)));
|
||||||
|
|
||||||
connect(MeshCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
|
|
||||||
|
|
||||||
connect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
connect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
connect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
connect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
connect(ZSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
connect(ZSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
||||||
connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
||||||
connect(LinearAnglesCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
|
//connect(LinearAnglesCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
|
||||||
|
|
||||||
|
|
||||||
//To Connect preview check box
|
//To Connect preview check box
|
||||||
connectPreviewControl();
|
connectPreviewControl();
|
||||||
|
|
||||||
AnglesList->installEventFilter(this);
|
AnglesList ->installEventFilter(this);
|
||||||
ElementsLineEdit->installEventFilter(this);
|
|
||||||
StartPointLineEdit->installEventFilter(this);
|
StartPointLineEdit->installEventFilter(this);
|
||||||
XSpin->editor()->installEventFilter(this);
|
XSpin->editor() ->installEventFilter(this);
|
||||||
YSpin->editor()->installEventFilter(this);
|
YSpin->editor() ->installEventFilter(this);
|
||||||
ZSpin->editor()->installEventFilter(this);
|
ZSpin->editor() ->installEventFilter(this);
|
||||||
|
|
||||||
|
CheckIsEnable();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -393,10 +344,6 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg()
|
SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg()
|
||||||
{
|
{
|
||||||
// no need to delete child widgets, Qt does it all for us
|
// no need to delete child widgets, Qt does it all for us
|
||||||
if ( myFilterDlg != 0 ) {
|
|
||||||
myFilterDlg->setParent( 0 );
|
|
||||||
delete myFilterDlg;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -408,12 +355,9 @@ void SMESHGUI_ExtrusionAlongPathDlg::Init (bool ResetControls)
|
|||||||
myBusy = false;
|
myBusy = false;
|
||||||
myEditCurrentArgument = 0;
|
myEditCurrentArgument = 0;
|
||||||
|
|
||||||
myMesh = SMESH::SMESH_Mesh::_nil();
|
|
||||||
myIDSource = SMESH::SMESH_IDSource::_nil();
|
|
||||||
myMeshActor = 0;
|
|
||||||
myPath = SMESH::SMESH_IDSource::_nil();
|
myPath = SMESH::SMESH_IDSource::_nil();
|
||||||
|
|
||||||
ElementsLineEdit->clear();
|
SelectorWdg->Clear();
|
||||||
PathMeshLineEdit->clear();
|
PathMeshLineEdit->clear();
|
||||||
StartPointLineEdit->clear();
|
StartPointLineEdit->clear();
|
||||||
|
|
||||||
@ -423,9 +367,6 @@ void SMESHGUI_ExtrusionAlongPathDlg::Init (bool ResetControls)
|
|||||||
ZSpin->SetValue(0.0);
|
ZSpin->SetValue(0.0);
|
||||||
|
|
||||||
AngleSpin->SetValue(45);
|
AngleSpin->SetValue(45);
|
||||||
MeshCheck->setChecked(false);
|
|
||||||
ConstructorsClicked(0);
|
|
||||||
onSelectMesh();
|
|
||||||
myPreviewCheckBox->setChecked(false);
|
myPreviewCheckBox->setChecked(false);
|
||||||
onDisplaySimulation(false);
|
onDisplaySimulation(false);
|
||||||
}
|
}
|
||||||
@ -433,53 +374,16 @@ void SMESHGUI_ExtrusionAlongPathDlg::Init (bool ResetControls)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ConstructorsClicked()
|
// function : CheckIsEnable()
|
||||||
// purpose : Called when user changes type of elements (1d / 2d)
|
// purpose : Check whether the Ok and Apply buttons should be enabled or not
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_ExtrusionAlongPathDlg::ConstructorsClicked (int type)
|
|
||||||
|
void SMESHGUI_ExtrusionAlongPathDlg::CheckIsEnable()
|
||||||
{
|
{
|
||||||
if (myType == type) return;
|
bool anIsEnable = SelectorWdg->IsAnythingSelected() && isValuesValid();
|
||||||
|
|
||||||
disconnect(mySelectionMgr, 0, this, 0);
|
OkButton->setEnabled(anIsEnable);
|
||||||
|
ApplyButton->setEnabled(anIsEnable);
|
||||||
hidePreview();
|
|
||||||
|
|
||||||
if (type == 0)
|
|
||||||
GroupArguments->setTitle(tr("EXTRUSION_1D"));
|
|
||||||
else if (type == 1)
|
|
||||||
GroupArguments->setTitle(tr("EXTRUSION_2D"));
|
|
||||||
|
|
||||||
// clear elements ID list
|
|
||||||
if (!MeshCheck->isChecked()) {
|
|
||||||
ElementsLineEdit->clear();
|
|
||||||
}
|
|
||||||
// set selection mode if necessary
|
|
||||||
if (myEditCurrentArgument == ElementsLineEdit) {
|
|
||||||
mySelectionMgr->clearSelected();
|
|
||||||
mySelectionMgr->clearFilters();
|
|
||||||
SMESH::SetPickable();
|
|
||||||
|
|
||||||
SMESH::SetPointRepresentation(false);
|
|
||||||
if (MeshCheck->isChecked()) {
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
|
||||||
mySelectionMgr->installFilter(myElementsFilter);
|
|
||||||
} else {
|
|
||||||
if (type == 0)
|
|
||||||
{
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
|
||||||
}
|
|
||||||
if (type == 1)
|
|
||||||
{
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
|
|
||||||
myType = type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -491,17 +395,12 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
if (mySMESHGUI->isActiveStudyLocked())
|
if (mySMESHGUI->isActiveStudyLocked())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//if (myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() ||
|
if ( !SelectorWdg->IsAnythingSelected() || myPath->_is_nil() )
|
||||||
// !myMeshActor || myPathMesh->_is_nil() || myPathShape->_is_nil())
|
|
||||||
if ( myMesh->_is_nil() || (MeshCheck->isChecked() && myIDSource->_is_nil()) ||
|
|
||||||
/*!myMeshActor ||*/ myPath->_is_nil() )
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!isValid())
|
if (!isValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SMESH::long_array_var anElementsId = getSelectedElements();
|
|
||||||
|
|
||||||
if (StartPointLineEdit->text().trimmed().isEmpty()) {
|
if (StartPointLineEdit->text().trimmed().isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -528,38 +427,43 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
aBasePoint.y = YSpin->GetValue();
|
aBasePoint.y = YSpin->GetValue();
|
||||||
aBasePoint.z = ZSpin->GetValue();
|
aBasePoint.z = ZSpin->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
aParameters << XSpin->text();
|
aParameters << XSpin->text();
|
||||||
aParameters << YSpin->text();
|
aParameters << YSpin->text();
|
||||||
aParameters << ZSpin->text();
|
aParameters << ZSpin->text();
|
||||||
|
|
||||||
|
bool meshHadNewTypeBefore = true;
|
||||||
|
int maxSelType = 0;
|
||||||
|
const bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
|
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_Mesh_var mesh = SelectorWdg->GetMesh();
|
||||||
|
|
||||||
|
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
|
SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources();
|
||||||
|
SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources();
|
||||||
|
SMESH::ListOfIDSources_var faces = new SMESH::ListOfIDSources();
|
||||||
|
maxSelType = SelectorWdg->GetSelected( nodes, edges, faces );
|
||||||
|
|
||||||
|
// is it necessary to switch on the next Display Mode?
|
||||||
|
SMESH::ElementType newType = (SMESH::ElementType)( maxSelType + 1 );
|
||||||
|
SMESH::array_of_ElementType_var oldTypes = mesh->GetTypes();
|
||||||
|
meshHadNewTypeBefore = false;
|
||||||
|
for ( size_t i = 0; i < oldTypes->length() && !meshHadNewTypeBefore; ++i )
|
||||||
|
meshHadNewTypeBefore = ( oldTypes[i] >= newType );
|
||||||
|
|
||||||
|
SMESH::SMESH_MeshEditor_var aMeshEditor = mesh->GetMeshEditor();
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
||||||
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
|
|
||||||
bool NeedGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
|
||||||
SMESH::ElementType ElemType = SMESH::FACE;
|
|
||||||
if( GetConstructorId() == 0 )
|
|
||||||
ElemType = SMESH::EDGE;
|
|
||||||
if( !MeshCheck->isChecked() ) {
|
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
|
aMeshEditor->ExtrusionAlongPathObjects( nodes, edges, faces, myPath,
|
||||||
|
GEOM::GEOM_Object::_nil(),
|
||||||
|
aNodeStart, AnglesGrp->isChecked(),
|
||||||
anAngles, LinearAnglesCheck->isChecked(),
|
anAngles, LinearAnglesCheck->isChecked(),
|
||||||
BasePointGrp->isChecked(), aBasePoint,
|
BasePointGrp->isChecked(), aBasePoint,
|
||||||
NeedGroups, ElemType, retVal);
|
makeGroups, retVal );
|
||||||
}
|
|
||||||
else {
|
|
||||||
SMESH::ListOfGroups_var groups =
|
|
||||||
aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
|
|
||||||
anAngles, LinearAnglesCheck->isChecked(),
|
|
||||||
BasePointGrp->isChecked(), aBasePoint,
|
|
||||||
NeedGroups, ElemType, retVal);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
switch (retVal) {
|
switch (retVal) {
|
||||||
@ -600,17 +504,31 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//mySelectionMgr->clearSelected();
|
SMESH_Actor* actor = SelectorWdg->GetActor();
|
||||||
if ( myMeshActor )
|
if ( actor && !meshHadNewTypeBefore )
|
||||||
SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() );
|
{
|
||||||
|
unsigned int aMode = actor->GetEntityMode();
|
||||||
|
switch ( maxSelType ) {
|
||||||
|
case SMESH::NODE: // extrude node -> edges
|
||||||
|
actor->SetRepresentation(SMESH_Actor::eEdge);
|
||||||
|
actor->SetEntityMode( aMode |= SMESH_Actor::eEdges ); break;
|
||||||
|
case SMESH::EDGE: // edge -> faces
|
||||||
|
actor->SetRepresentation(SMESH_Actor::eSurface);
|
||||||
|
actor->SetEntityMode( aMode |= SMESH_Actor::eFaces ); break;
|
||||||
|
case SMESH::FACE: // faces -> volumes
|
||||||
|
actor->SetRepresentation(SMESH_Actor::eSurface);
|
||||||
|
actor->SetEntityMode( aMode |= SMESH_Actor::eVolumes ); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( actor )
|
||||||
|
SMESH::Update( actor->getIO(), actor->GetVisibility() );
|
||||||
|
if ( makeGroups )
|
||||||
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
|
Init(false);
|
||||||
|
mySelectionMgr->clearSelected();
|
||||||
|
SelectorWdg->Clear();
|
||||||
|
|
||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
|
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
|
||||||
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
|
||||||
//SMESH::UpdateView();
|
|
||||||
Init(false);
|
|
||||||
ConstructorsClicked(GetConstructorId());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -665,6 +583,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::reject()
|
|||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
mySMESHGUI->ResetState();
|
mySMESHGUI->ResetState();
|
||||||
|
|
||||||
QDialog::reject();
|
QDialog::reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -682,54 +601,13 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
|
|||||||
// set busy flag
|
// set busy flag
|
||||||
SetBusy sb (this);
|
SetBusy sb (this);
|
||||||
|
|
||||||
if (send != StartPointLineEdit && send != ElementsLineEdit)
|
if (send == StartPointLineEdit &&
|
||||||
send = ElementsLineEdit;
|
myEditCurrentArgument == StartPointLineEdit)
|
||||||
|
{
|
||||||
if (send == ElementsLineEdit && myEditCurrentArgument == ElementsLineEdit) {
|
|
||||||
// hilight entered elements
|
|
||||||
SMDS_Mesh* aMesh = 0;
|
|
||||||
if (myMeshActor)
|
|
||||||
aMesh = myMeshActor->GetObject()->GetMesh();
|
|
||||||
|
|
||||||
if (aMesh) {
|
|
||||||
//mySelectionMgr->clearSelected();
|
|
||||||
//mySelectionMgr->AddIObject(myMeshActor->getIO());
|
|
||||||
SALOME_ListIO aList;
|
|
||||||
aList.Append(myMeshActor->getIO());
|
|
||||||
mySelectionMgr->setSelectedObjects(aList, false);
|
|
||||||
|
|
||||||
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
|
||||||
bool bOk;
|
|
||||||
const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO();
|
|
||||||
TColStd_MapOfInteger newIndices;
|
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
|
||||||
long ind = aListId[ i ].toLong(&bOk);
|
|
||||||
if (bOk) {
|
|
||||||
const SMDS_MeshElement* e = aMesh->FindElement(ind);
|
|
||||||
if (e) {
|
|
||||||
// check also type of element
|
|
||||||
bool typeMatch = (Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge) ||
|
|
||||||
(Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face);
|
|
||||||
if (typeMatch)
|
|
||||||
newIndices.Add(e->GetID());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->highlight( anIO, true, true );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (send == StartPointLineEdit &&
|
|
||||||
myEditCurrentArgument == StartPointLineEdit) {
|
|
||||||
if (!myPath->_is_nil()) {
|
if (!myPath->_is_nil()) {
|
||||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
||||||
SMDS_Mesh* aMesh = 0;
|
SMDS_Mesh* aMesh = aPathActor ? aPathActor->GetObject()->GetMesh() : 0;
|
||||||
if (aPathActor)
|
|
||||||
aMesh = aPathActor->GetObject()->GetMesh();
|
|
||||||
if (aMesh) {
|
if (aMesh) {
|
||||||
//mySelectionMgr->clearSelected();
|
|
||||||
//mySelectionMgr->AddIObject(aPathActor->getIO());
|
|
||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
aList.Append(aPathActor->getIO());
|
aList.Append(aPathActor->getIO());
|
||||||
mySelectionMgr->setSelectedObjects(aList, false);
|
mySelectionMgr->setSelectedObjects(aList, false);
|
||||||
@ -739,7 +617,6 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
|
|||||||
if (bOk) {
|
if (bOk) {
|
||||||
const SMDS_MeshNode* n = aMesh->FindNode(ind);
|
const SMDS_MeshNode* n = aMesh->FindNode(ind);
|
||||||
if (n) {
|
if (n) {
|
||||||
//if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
|
|
||||||
TColStd_MapOfInteger newIndices;
|
TColStd_MapOfInteger newIndices;
|
||||||
newIndices.Add(n->GetID());
|
newIndices.Add(n->GetID());
|
||||||
mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
|
mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
|
||||||
@ -750,6 +627,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CheckIsEnable();
|
||||||
|
onDisplaySimulation(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -773,50 +652,11 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
|
|||||||
// set busy flag
|
// set busy flag
|
||||||
SetBusy sb (this);
|
SetBusy sb (this);
|
||||||
|
|
||||||
if (myEditCurrentArgument == ElementsLineEdit) {
|
const bool isPathDef = ( SelectPathMeshButton->isChecked() ||
|
||||||
// we are now selecting mesh elements (or whole mesh/submesh/group)
|
SelectStartPointButton->isChecked() );
|
||||||
// reset
|
|
||||||
ElementsLineEdit->clear();
|
|
||||||
myMesh = SMESH::SMESH_Mesh::_nil();
|
|
||||||
myIDSource = SMESH::SMESH_IDSource::_nil();
|
|
||||||
myMeshActor = 0;
|
|
||||||
|
|
||||||
// try to get mesh from selection
|
if (myEditCurrentArgument == PathMeshLineEdit && isPathDef)
|
||||||
Handle(SALOME_InteractiveObject) IO = aList.First();
|
{
|
||||||
myMesh = SMESH::GetMeshByIO(IO);
|
|
||||||
if (myMesh->_is_nil())
|
|
||||||
return;
|
|
||||||
|
|
||||||
// MakeGroups is available if there are groups
|
|
||||||
if ( myMesh->NbGroups() == 0 ) {
|
|
||||||
MakeGroupsCheck->setChecked(false);
|
|
||||||
MakeGroupsCheck->setEnabled(false);
|
|
||||||
} else {
|
|
||||||
MakeGroupsCheck->setEnabled(true);
|
|
||||||
}
|
|
||||||
// find actor
|
|
||||||
myMeshActor = SMESH::FindActorByObject(myMesh);
|
|
||||||
if (!myMeshActor && !MeshCheck->isChecked())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (MeshCheck->isChecked()) {
|
|
||||||
// If "Select whole mesh, submesh or group" check box is on ->
|
|
||||||
// get ID source and put it's name to the edit box
|
|
||||||
QString aString;
|
|
||||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
|
||||||
|
|
||||||
myIDSource = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
|
|
||||||
ElementsLineEdit->setText(aString);
|
|
||||||
} else {
|
|
||||||
// If "Select whole mesh, submesh or group" check box is off ->
|
|
||||||
// try to get selected elements IDs
|
|
||||||
QString aString;
|
|
||||||
//int aNbUnits = SMESH::GetNameOfSelectedElements(mySelectionMgr, aString);
|
|
||||||
SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
|
||||||
ElementsLineEdit->setText(aString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (myEditCurrentArgument == PathMeshLineEdit) {
|
|
||||||
// we are now selecting path mesh
|
// we are now selecting path mesh
|
||||||
// reset
|
// reset
|
||||||
PathMeshLineEdit->clear();
|
PathMeshLineEdit->clear();
|
||||||
@ -833,7 +673,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
|
|||||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
||||||
PathMeshLineEdit->setText(aString);
|
PathMeshLineEdit->setText(aString);
|
||||||
}
|
}
|
||||||
else if (myEditCurrentArgument == StartPointLineEdit) {
|
else if (myEditCurrentArgument == StartPointLineEdit && isPathDef )
|
||||||
|
{
|
||||||
// we are now selecting start point of path
|
// we are now selecting start point of path
|
||||||
// reset
|
// reset
|
||||||
StartPointLineEdit->clear();
|
StartPointLineEdit->clear();
|
||||||
@ -853,8 +694,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
|
|||||||
int aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aPathActor->getIO(), aString);
|
int aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aPathActor->getIO(), aString);
|
||||||
if (aNbUnits == 1)
|
if (aNbUnits == 1)
|
||||||
StartPointLineEdit->setText(aString.trimmed());
|
StartPointLineEdit->setText(aString.trimmed());
|
||||||
|
}
|
||||||
} else if (myEditCurrentArgument == XSpin) {
|
else if ( myEditCurrentArgument == XSpin &&
|
||||||
|
SelectBasePointButton->isChecked() )
|
||||||
|
{
|
||||||
// we are now selecting base point
|
// we are now selecting base point
|
||||||
// reset is not performed here!
|
// reset is not performed here!
|
||||||
|
|
||||||
@ -905,7 +748,13 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
|
|||||||
YSpin->SetValue(n->Y());
|
YSpin->SetValue(n->Y());
|
||||||
ZSpin->SetValue(n->Z());
|
ZSpin->SetValue(n->Z());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
onDisplaySimulation(true);
|
onDisplaySimulation(true);
|
||||||
|
CheckIsEnable();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -914,11 +763,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
|
void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
|
||||||
{
|
{
|
||||||
QToolButton* send = (QToolButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
if ( sender() == BasePointGrp )
|
if ( sender() == BasePointGrp )
|
||||||
send = SelectBasePointButton;
|
send = SelectBasePointButton;
|
||||||
if (send != SelectElementsButton &&
|
if (send != SelectPathMeshButton &&
|
||||||
send != SelectPathMeshButton &&
|
|
||||||
send != SelectStartPointButton &&
|
send != SelectStartPointButton &&
|
||||||
send != SelectBasePointButton)
|
send != SelectBasePointButton)
|
||||||
return;
|
return;
|
||||||
@ -929,42 +777,25 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
|
|||||||
// function : SetEditCurrentArgument()
|
// function : SetEditCurrentArgument()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button)
|
void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QPushButton* button)
|
||||||
{
|
{
|
||||||
disconnect(mySelectionMgr, 0, this, 0);
|
disconnect(mySelectionMgr, 0, this, 0);
|
||||||
// mySelectionMgr->clearSelected();
|
// mySelectionMgr->clearSelected();
|
||||||
mySelectionMgr->clearFilters();
|
mySelectionMgr->clearFilters();
|
||||||
SMESH::SetPickable();
|
SMESH::SetPickable();
|
||||||
|
|
||||||
if (button == SelectElementsButton) {
|
myEditCurrentArgument = 0;
|
||||||
myEditCurrentArgument = ElementsLineEdit;
|
if (button == SelectPathMeshButton)
|
||||||
SMESH::SetPointRepresentation(false);
|
|
||||||
if (MeshCheck->isChecked()) {
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
|
||||||
mySelectionMgr->installFilter(myElementsFilter);
|
|
||||||
} else {
|
|
||||||
if (Elements1dRB->isChecked())
|
|
||||||
{
|
{
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
|
||||||
}
|
|
||||||
else if (Elements2dRB->isChecked())
|
|
||||||
{
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (button == SelectPathMeshButton) {
|
|
||||||
myEditCurrentArgument = PathMeshLineEdit;
|
myEditCurrentArgument = PathMeshLineEdit;
|
||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
aViewWindow->SetSelectionMode(ActorSelection);
|
||||||
mySelectionMgr->installFilter(myPathMeshFilter);
|
mySelectionMgr->installFilter(myPathMeshFilter);
|
||||||
}
|
}
|
||||||
else if (button == SelectStartPointButton) {
|
else if (button == SelectStartPointButton)
|
||||||
|
{
|
||||||
myEditCurrentArgument = StartPointLineEdit;
|
myEditCurrentArgument = StartPointLineEdit;
|
||||||
//if (!myPathMesh->_is_nil()) {
|
|
||||||
if (!myPath->_is_nil()) {
|
if (!myPath->_is_nil()) {
|
||||||
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
|
||||||
if (aPathActor) {
|
if (aPathActor) {
|
||||||
@ -975,7 +806,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (button == SelectBasePointButton) {
|
else if (button == SelectBasePointButton)
|
||||||
|
{
|
||||||
myEditCurrentArgument = XSpin;
|
myEditCurrentArgument = XSpin;
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
@ -1005,10 +837,11 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog()
|
void SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog()
|
||||||
{
|
{
|
||||||
if (ConstructorsBox->isEnabled()) {
|
if (GroupButtons->isEnabled())
|
||||||
ConstructorsBox->setEnabled(false);
|
{
|
||||||
GroupArguments->setEnabled(false);
|
GroupArguments->setEnabled(false);
|
||||||
GroupButtons->setEnabled(false);
|
GroupButtons->setEnabled(false);
|
||||||
|
SelectorWdg->setEnabled(false);
|
||||||
mySMESHGUI->ResetState();
|
mySMESHGUI->ResetState();
|
||||||
mySMESHGUI->SetActiveDialogBox(0);
|
mySMESHGUI->SetActiveDialogBox(0);
|
||||||
}
|
}
|
||||||
@ -1022,13 +855,11 @@ void SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog()
|
|||||||
{
|
{
|
||||||
// Emit a signal to deactivate the active dialog
|
// Emit a signal to deactivate the active dialog
|
||||||
mySMESHGUI->EmitSignalDeactivateDialog();
|
mySMESHGUI->EmitSignalDeactivateDialog();
|
||||||
ConstructorsBox->setEnabled(true);
|
|
||||||
GroupArguments->setEnabled(true);
|
GroupArguments->setEnabled(true);
|
||||||
GroupButtons->setEnabled(true);
|
GroupButtons->setEnabled(true);
|
||||||
|
SelectorWdg->setEnabled(true);
|
||||||
|
|
||||||
mySMESHGUI->SetActiveDialogBox(this);
|
mySMESHGUI->SetActiveDialogBox(this);
|
||||||
|
|
||||||
ConstructorsClicked(GetConstructorId());
|
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1038,36 +869,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_ExtrusionAlongPathDlg::enterEvent (QEvent*)
|
void SMESHGUI_ExtrusionAlongPathDlg::enterEvent (QEvent*)
|
||||||
{
|
{
|
||||||
if (!ConstructorsBox->isEnabled())
|
if (!GroupButtons->isEnabled())
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
// function : onSelectMesh()
|
|
||||||
// purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void SMESHGUI_ExtrusionAlongPathDlg::onSelectMesh()
|
|
||||||
{
|
|
||||||
bool toSelectMesh = MeshCheck->isChecked();
|
|
||||||
|
|
||||||
ElementsLineEdit->setReadOnly(toSelectMesh);
|
|
||||||
ElementsLineEdit->setValidator(toSelectMesh ? 0 : myIdValidator);
|
|
||||||
ElementsLab->setText(toSelectMesh ? tr("SMESH_NAME") : tr("SMESH_ID_ELEMENTS"));
|
|
||||||
ElementsLineEdit->clear();
|
|
||||||
myFilterBtn->setEnabled(!toSelectMesh);
|
|
||||||
|
|
||||||
SetEditCurrentArgument(SelectElementsButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : GetConstructorId()
|
|
||||||
// purpose :
|
|
||||||
//=================================================================================
|
|
||||||
int SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
|
|
||||||
{
|
|
||||||
return GroupConstructors->checkedId();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : OnAngleAdded()
|
// function : OnAngleAdded()
|
||||||
// purpose : Called when user adds angle to the list
|
// purpose : Called when user adds angle to the list
|
||||||
@ -1118,11 +923,7 @@ bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter (QObject* object, QEvent* event
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event->type() == QEvent::FocusIn) {
|
else if (event->type() == QEvent::FocusIn) {
|
||||||
if (object == ElementsLineEdit) {
|
if (object == StartPointLineEdit) {
|
||||||
if (myEditCurrentArgument != ElementsLineEdit)
|
|
||||||
SetEditCurrentArgument(SelectElementsButton);
|
|
||||||
}
|
|
||||||
else if (object == StartPointLineEdit) {
|
|
||||||
if (myEditCurrentArgument != StartPointLineEdit)
|
if (myEditCurrentArgument != StartPointLineEdit)
|
||||||
SetEditCurrentArgument(SelectStartPointButton);
|
SetEditCurrentArgument(SelectStartPointButton);
|
||||||
}
|
}
|
||||||
@ -1150,34 +951,6 @@ void SMESHGUI_ExtrusionAlongPathDlg::keyPressEvent( QKeyEvent* e )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : setFilters()
|
|
||||||
// purpose : SLOT. Called when "Filter" button pressed.
|
|
||||||
//=================================================================================
|
|
||||||
void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
|
|
||||||
{
|
|
||||||
if(myMesh->_is_nil()) {
|
|
||||||
SUIT_MessageBox::critical(this,
|
|
||||||
tr("SMESH_ERROR"),
|
|
||||||
tr("NO_MESH_SELECTED"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ( !myFilterDlg )
|
|
||||||
{
|
|
||||||
QList<int> types;
|
|
||||||
types.append( SMESH::EDGE );
|
|
||||||
types.append( SMESH::FACE );
|
|
||||||
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, types );
|
|
||||||
}
|
|
||||||
myFilterDlg->Init( Elements1dRB->isChecked() ? SMESH::EDGE : SMESH::FACE );
|
|
||||||
|
|
||||||
myFilterDlg->SetSelection();
|
|
||||||
myFilterDlg->SetMesh( myMesh );
|
|
||||||
myFilterDlg->SetSourceWg( ElementsLineEdit );
|
|
||||||
|
|
||||||
myFilterDlg->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : isValid
|
// function : isValid
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -1224,40 +997,43 @@ void SMESHGUI_ExtrusionAlongPathDlg::updateLinearAngles()
|
|||||||
// function : isValuesValid()
|
// function : isValuesValid()
|
||||||
// purpose : Return true in case if values entered into dialog are valid
|
// purpose : Return true in case if values entered into dialog are valid
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool SMESHGUI_ExtrusionAlongPathDlg::isValuesValid() {
|
|
||||||
|
|
||||||
if ( (MeshCheck->isChecked() && myIDSource->_is_nil()) ||
|
bool SMESHGUI_ExtrusionAlongPathDlg::isValuesValid()
|
||||||
myMesh->_is_nil() ||
|
{
|
||||||
myPath->_is_nil() )
|
if ( myPath->_is_nil() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(!MeshCheck->isChecked()) {
|
|
||||||
QStringList aListElementsId = ElementsLineEdit->text().split(" ", QString::SkipEmptyParts);
|
|
||||||
if(aListElementsId.count() <= 0)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool bOk;
|
bool bOk;
|
||||||
StartPointLineEdit->text().toLong(&bOk);
|
long aNodeStart = StartPointLineEdit->text().toLong(&bOk);
|
||||||
if (!bOk) {
|
if ( !bOk || aNodeStart < 1 )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
SMESH::SMESH_Mesh_var mesh = myPath->GetMesh();
|
||||||
|
if ( mesh->_is_nil() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
SMESH::ElementType type = mesh->GetElementType( aNodeStart, false );
|
||||||
|
if ( type != SMESH::NODE )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
SMESH::long_array_var elems = mesh->GetNodeInverseElements( aNodeStart );
|
||||||
|
if ( elems->length() != 1 ||
|
||||||
|
mesh->GetElementType( elems[0], true ) != SMESH::EDGE )
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : onDisplaySimulation
|
// function : onDisplaySimulation
|
||||||
// purpose : Show/Hide preview
|
// purpose : Show/Hide preview
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview ) {
|
|
||||||
if (myPreviewCheckBox->isChecked() && toDisplayPreview) {
|
|
||||||
if(isValid() && isValuesValid()) {
|
|
||||||
|
|
||||||
//Get selected elements:
|
|
||||||
SMESH::long_array_var anElementsId = getSelectedElements();
|
|
||||||
|
|
||||||
|
void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview )
|
||||||
|
{
|
||||||
|
if ( myPreviewCheckBox->isChecked() && toDisplayPreview ) {
|
||||||
|
if ( SelectorWdg->IsAnythingSelected() && isValid() && isValuesValid())
|
||||||
|
{
|
||||||
// get angles
|
// get angles
|
||||||
SMESH::double_array_var anAngles = getAngles();
|
SMESH::double_array_var anAngles = getAngles();
|
||||||
|
|
||||||
@ -1276,27 +1052,29 @@ void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview
|
|||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
SMESH::SMESH_Mesh_var mesh = SelectorWdg->GetMesh();
|
||||||
bool NeedGroups = false;
|
SMESH::SMESH_MeshEditor_var meshEditor = mesh->GetMeshEditPreviewer();
|
||||||
SMESH::ElementType ElemType = ( GetConstructorId() == 0 ) ? SMESH::EDGE : SMESH::FACE;
|
|
||||||
if( !MeshCheck->isChecked() ) {
|
SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources();
|
||||||
aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
|
SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources();
|
||||||
|
SMESH::ListOfIDSources_var faces = new SMESH::ListOfIDSources();
|
||||||
|
SelectorWdg->GetSelected( nodes, edges, faces );
|
||||||
|
const bool makeGroups = false;
|
||||||
|
|
||||||
|
SMESH::ListOfGroups_var groups =
|
||||||
|
meshEditor->ExtrusionAlongPathObjects( nodes, edges, faces, myPath,
|
||||||
|
GEOM::GEOM_Object::_nil(),
|
||||||
|
aNodeStart, AnglesGrp->isChecked(),
|
||||||
anAngles, LinearAnglesCheck->isChecked(),
|
anAngles, LinearAnglesCheck->isChecked(),
|
||||||
BasePointGrp->isChecked(), aBasePoint,
|
BasePointGrp->isChecked(), aBasePoint,
|
||||||
NeedGroups, ElemType, retVal);
|
makeGroups, retVal );
|
||||||
|
|
||||||
|
if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
|
||||||
|
{
|
||||||
|
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = meshEditor->GetPreviewData();
|
||||||
|
mySimulation->SetData( aMeshPreviewStruct._retn() );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SMESH::ListOfGroups_var groups =
|
|
||||||
aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
|
|
||||||
anAngles, LinearAnglesCheck->isChecked(),
|
|
||||||
BasePointGrp->isChecked(), aBasePoint,
|
|
||||||
NeedGroups, ElemType, retVal);
|
|
||||||
}
|
|
||||||
|
|
||||||
if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK ) {
|
|
||||||
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
|
|
||||||
mySimulation->SetData(aMeshPreviewStruct._retn());
|
|
||||||
} else {
|
|
||||||
hidePreview();
|
hidePreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1315,49 +1093,11 @@ void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SMESH::double_array_var SMESHGUI_ExtrusionAlongPathDlg::getAngles()
|
||||||
//=================================================================================
|
{
|
||||||
// function : getSelectedElements
|
|
||||||
// purpose : return list of the selected elements
|
|
||||||
//=================================================================================
|
|
||||||
SMESH::long_array_var SMESHGUI_ExtrusionAlongPathDlg::getSelectedElements() {
|
|
||||||
|
|
||||||
// If "Select whole mesh, submesh or group" check box is off ->
|
|
||||||
// use only elements of given type selected by user
|
|
||||||
SMESH::long_array_var anElementsId = new SMESH::long_array;
|
|
||||||
if (!MeshCheck->isChecked()) {
|
|
||||||
|
|
||||||
SMDS_Mesh* aMesh;
|
|
||||||
if ( myMeshActor )
|
|
||||||
aMesh = myMeshActor->GetObject()->GetMesh();
|
|
||||||
|
|
||||||
if (aMesh) {
|
|
||||||
QStringList aListElementsId = ElementsLineEdit->text().split(" ", QString::SkipEmptyParts);
|
|
||||||
anElementsId = new SMESH::long_array;
|
|
||||||
anElementsId->length(aListElementsId.count());
|
|
||||||
bool bOk;
|
|
||||||
int j = 0;
|
|
||||||
for (int i = 0; i < aListElementsId.count(); i++) {
|
|
||||||
long ind = aListElementsId[ i ].toLong(&bOk);
|
|
||||||
if (bOk) {
|
|
||||||
const SMDS_MeshElement* e = aMesh->FindElement(ind);
|
|
||||||
if (e) {
|
|
||||||
bool typeMatch = (Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge) ||
|
|
||||||
(Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face);
|
|
||||||
if (typeMatch)
|
|
||||||
anElementsId[ j++ ] = ind;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
anElementsId->length(j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return anElementsId;
|
|
||||||
}
|
|
||||||
|
|
||||||
SMESH::double_array_var SMESHGUI_ExtrusionAlongPathDlg::getAngles() {
|
|
||||||
SMESH::double_array_var anAngles = new SMESH::double_array;
|
SMESH::double_array_var anAngles = new SMESH::double_array;
|
||||||
if (AnglesGrp->isChecked()) {
|
if (AnglesGrp->isChecked())
|
||||||
|
{
|
||||||
anAngles->length(myAnglesList.count());
|
anAngles->length(myAnglesList.count());
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for (int i = 0; i < myAnglesList.count(); i++) {
|
for (int i = 0; i < myAnglesList.count(); i++) {
|
||||||
|
@ -45,14 +45,15 @@ class QCheckBox;
|
|||||||
class QListWidget;
|
class QListWidget;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
|
|
||||||
|
class LightApp_SelectionMgr;
|
||||||
class SMESHGUI;
|
class SMESHGUI;
|
||||||
class SMESH_Actor;
|
class SMESHGUI_3TypesSelector;
|
||||||
|
class SMESHGUI_FilterDlg;
|
||||||
class SMESHGUI_IdValidator;
|
class SMESHGUI_IdValidator;
|
||||||
class SMESHGUI_SpinBox;
|
class SMESHGUI_SpinBox;
|
||||||
class SMESHGUI_FilterDlg;
|
class SMESH_Actor;
|
||||||
class SVTK_Selector;
|
|
||||||
class LightApp_SelectionMgr;
|
|
||||||
class SUIT_SelectionFilter;
|
class SUIT_SelectionFilter;
|
||||||
|
class SVTK_Selector;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : SMESHGUI_ExtrusionAlongPathDlg
|
// class : SMESHGUI_ExtrusionAlongPathDlg
|
||||||
@ -75,13 +76,11 @@ private:
|
|||||||
void Init( bool = true );
|
void Init( bool = true );
|
||||||
void enterEvent( QEvent* ); /* mouse enter the QWidget */
|
void enterEvent( QEvent* ); /* mouse enter the QWidget */
|
||||||
void keyPressEvent( QKeyEvent* );
|
void keyPressEvent( QKeyEvent* );
|
||||||
int GetConstructorId();
|
void SetEditCurrentArgument( QPushButton* );
|
||||||
void SetEditCurrentArgument( QToolButton* );
|
|
||||||
|
|
||||||
bool isValid();
|
bool isValid();
|
||||||
bool isValuesValid();
|
bool isValuesValid();
|
||||||
|
|
||||||
SMESH::long_array_var getSelectedElements();
|
|
||||||
SMESH::double_array_var getAngles();
|
SMESH::double_array_var getAngles();
|
||||||
|
|
||||||
void updateLinearAngles();
|
void updateLinearAngles();
|
||||||
@ -89,38 +88,20 @@ private:
|
|||||||
SMESHGUI_IdValidator* myIdValidator;
|
SMESHGUI_IdValidator* myIdValidator;
|
||||||
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
||||||
SVTK_Selector* mySelector;
|
SVTK_Selector* mySelector;
|
||||||
|
|
||||||
QWidget* myEditCurrentArgument; /* Current argument */
|
QWidget* myEditCurrentArgument; /* Current argument */
|
||||||
|
|
||||||
bool myBusy;
|
bool myBusy;
|
||||||
SMESH::SMESH_Mesh_var myMesh;
|
|
||||||
SMESH_Actor* myMeshActor;
|
|
||||||
SMESH::SMESH_IDSource_var myIDSource;
|
|
||||||
//SMESH::SMESH_Mesh_var myPathMesh;
|
|
||||||
SMESH::SMESH_IDSource_var myPath;
|
SMESH::SMESH_IDSource_var myPath;
|
||||||
//GEOM::GEOM_Object_var myPathShape;
|
|
||||||
SUIT_SelectionFilter* myElementsFilter;
|
|
||||||
SUIT_SelectionFilter* myPathMeshFilter;
|
SUIT_SelectionFilter* myPathMeshFilter;
|
||||||
int myType;
|
|
||||||
QList<double> myAnglesList;
|
QList<double> myAnglesList;
|
||||||
|
|
||||||
// widgets
|
// widgets
|
||||||
QGroupBox* ConstructorsBox;
|
SMESHGUI_3TypesSelector* SelectorWdg;
|
||||||
QButtonGroup* GroupConstructors;
|
|
||||||
QRadioButton* Elements1dRB;
|
|
||||||
QRadioButton* Elements2dRB;
|
|
||||||
|
|
||||||
QGroupBox* GroupArguments;
|
QGroupBox* GroupArguments;
|
||||||
QLabel* ElementsLab;
|
|
||||||
QToolButton* SelectElementsButton;
|
|
||||||
QLineEdit* ElementsLineEdit;
|
|
||||||
QCheckBox* MeshCheck;
|
|
||||||
QGroupBox* PathGrp;
|
QGroupBox* PathGrp;
|
||||||
QToolButton* SelectPathMeshButton;
|
QPushButton* SelectPathMeshButton;
|
||||||
QLineEdit* PathMeshLineEdit;
|
QLineEdit* PathMeshLineEdit;
|
||||||
//QToolButton* SelectPathShapeButton;
|
QPushButton* SelectStartPointButton;
|
||||||
//QLineEdit* PathShapeLineEdit;
|
|
||||||
QToolButton* SelectStartPointButton;
|
|
||||||
QLineEdit* StartPointLineEdit;
|
QLineEdit* StartPointLineEdit;
|
||||||
QCheckBox* LinearAnglesCheck;
|
QCheckBox* LinearAnglesCheck;
|
||||||
QGroupBox* AnglesGrp;
|
QGroupBox* AnglesGrp;
|
||||||
@ -129,7 +110,7 @@ private:
|
|||||||
QToolButton* RemoveAngleButton;
|
QToolButton* RemoveAngleButton;
|
||||||
SMESHGUI_SpinBox* AngleSpin;
|
SMESHGUI_SpinBox* AngleSpin;
|
||||||
QGroupBox* BasePointGrp;
|
QGroupBox* BasePointGrp;
|
||||||
QToolButton* SelectBasePointButton;
|
QPushButton* SelectBasePointButton;
|
||||||
SMESHGUI_SpinBox* XSpin;
|
SMESHGUI_SpinBox* XSpin;
|
||||||
SMESHGUI_SpinBox* YSpin;
|
SMESHGUI_SpinBox* YSpin;
|
||||||
SMESHGUI_SpinBox* ZSpin;
|
SMESHGUI_SpinBox* ZSpin;
|
||||||
@ -143,27 +124,22 @@ private:
|
|||||||
|
|
||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
|
|
||||||
QPushButton* myFilterBtn;
|
|
||||||
SMESHGUI_FilterDlg* myFilterDlg;
|
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void reject();
|
void reject();
|
||||||
virtual void onDisplaySimulation( bool );
|
virtual void onDisplaySimulation( bool );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ConstructorsClicked( int );
|
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ClickOnHelp();
|
void ClickOnHelp();
|
||||||
|
void CheckIsEnable();
|
||||||
void SetEditCurrentArgument();
|
void SetEditCurrentArgument();
|
||||||
void SelectionIntoArgument();
|
void SelectionIntoArgument();
|
||||||
void DeactivateActiveDialog();
|
void DeactivateActiveDialog();
|
||||||
void ActivateThisDialog();
|
void ActivateThisDialog();
|
||||||
void onTextChange( const QString& );
|
void onTextChange( const QString& );
|
||||||
void onSelectMesh();
|
|
||||||
void OnAngleAdded();
|
void OnAngleAdded();
|
||||||
void OnAngleRemoved();
|
void OnAngleRemoved();
|
||||||
void setFilters();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H
|
#endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
// SMESH includes
|
// SMESH includes
|
||||||
#include "SMESH_SMESHGUI.hxx"
|
#include "SMESH_SMESHGUI.hxx"
|
||||||
#include "SMESHGUI_PreviewDlg.h"
|
#include "SMESHGUI_PreviewDlg.h"
|
||||||
|
#include "SMESHGUI_Utils.h"
|
||||||
|
|
||||||
// SALOME GUI includes
|
// SALOME GUI includes
|
||||||
#include <SALOME_InteractiveObject.hxx>
|
#include <SALOME_InteractiveObject.hxx>
|
||||||
@ -57,15 +58,80 @@ class LightApp_SelectionMgr;
|
|||||||
class SUIT_SelectionFilter;
|
class SUIT_SelectionFilter;
|
||||||
class SalomeApp_IntSpinBox;
|
class SalomeApp_IntSpinBox;
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : SMESHGUI_ExtrusionDlg
|
||||||
|
// purpose : A widget used to select both nodes, edges and faces for
|
||||||
|
// Extrusion and Revolution operations
|
||||||
|
//=================================================================================
|
||||||
|
|
||||||
|
class SMESHGUI_EXPORT SMESHGUI_3TypesSelector : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
SMESHGUI_3TypesSelector( QWidget * parent = 0 );
|
||||||
|
~SMESHGUI_3TypesSelector();
|
||||||
|
|
||||||
|
void Clear();
|
||||||
|
void SetEnabled( bool enable, SMESH::ElementType type );
|
||||||
|
bool IsAnythingSelected( SMESH::ElementType type = SMESH::ALL );
|
||||||
|
SMESH::ElementType GetSelected( SMESH::ListOfIDSources & nodes,
|
||||||
|
SMESH::ListOfIDSources & edges,
|
||||||
|
SMESH::ListOfIDSources & faces );
|
||||||
|
SMESH::SMESH_Mesh_var GetMesh() { return myMesh; }
|
||||||
|
SMESH_Actor* GetActor() { return myActor; }
|
||||||
|
Handle(SALOME_InteractiveObject) GetIO() { return myIO; }
|
||||||
|
QButtonGroup* GetButtonGroup() { return mySelectBtnGrp; }
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
void selectionChanged();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
void selectionIntoArgument();
|
||||||
|
void onTextChange( const QString& );
|
||||||
|
void onSelectMesh( bool on );
|
||||||
|
void setFilters();
|
||||||
|
void onSelectType( int iType );
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void addTmpIdSource( SMESH::long_array_var& ids,
|
||||||
|
int iType, int index);
|
||||||
|
|
||||||
|
QGroupBox* myGroups [3];
|
||||||
|
QLabel* myLabel [3];
|
||||||
|
QLineEdit* myLineEdit [3];
|
||||||
|
QCheckBox* myMeshChk [3];
|
||||||
|
QPushButton* myFilterBtn[3];
|
||||||
|
QButtonGroup* mySelectBtnGrp;
|
||||||
|
SMESHGUI_FilterDlg* myFilterDlg;
|
||||||
|
SUIT_SelectionFilter* myFilter [3];
|
||||||
|
SMESHGUI_IdValidator* myIdValidator;
|
||||||
|
|
||||||
|
bool myBusy;
|
||||||
|
SMESH::SMESH_Mesh_var myMesh;
|
||||||
|
SMESH_Actor* myActor;
|
||||||
|
Handle(SALOME_InteractiveObject) myIO;
|
||||||
|
SMESH::ListOfIDSources_var myIDSource[3];
|
||||||
|
QList<SMESH::IDSource_wrap> myTmpIDSourceList;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* mySelectionMgr;
|
||||||
|
SVTK_Selector* mySelector;
|
||||||
|
};
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : SMESHGUI_ExtrusionDlg
|
// class : SMESHGUI_ExtrusionDlg
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
|
|
||||||
class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public SMESHGUI_PreviewDlg
|
class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public SMESHGUI_PreviewDlg
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SMESHGUI_ExtrusionDlg( SMESHGUI* );
|
SMESHGUI_ExtrusionDlg( SMESHGUI* );
|
||||||
~SMESHGUI_ExtrusionDlg();
|
~SMESHGUI_ExtrusionDlg();
|
||||||
|
|
||||||
@ -81,39 +147,16 @@ private:
|
|||||||
bool isValid();
|
bool isValid();
|
||||||
bool isValuesValid();
|
bool isValuesValid();
|
||||||
|
|
||||||
SMESHGUI_IdValidator* myIdValidator;
|
|
||||||
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
||||||
QWidget* myEditCurrentArgument; /* Current argument editor */
|
|
||||||
int myNbOkElements; /* to check when elements are defined */
|
|
||||||
SVTK_Selector* mySelector;
|
SVTK_Selector* mySelector;
|
||||||
|
|
||||||
SMESH::SMESH_IDSource_var mySelectedObject;
|
|
||||||
|
|
||||||
bool myBusy;
|
|
||||||
SMESH::SMESH_Mesh_var myMesh;
|
|
||||||
SMESH::long_array_var myElementsId;
|
|
||||||
SMESH_Actor* myActor;
|
|
||||||
Handle(SALOME_InteractiveObject) myIO;
|
|
||||||
SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter0D;
|
|
||||||
SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter1D;
|
|
||||||
SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter2D;
|
|
||||||
|
|
||||||
// widgets
|
// widgets
|
||||||
QGroupBox* ConstructorsBox;
|
SMESHGUI_3TypesSelector* SelectorWdg;
|
||||||
QButtonGroup* GroupConstructors;
|
|
||||||
QRadioButton* Contructor_RBut0;
|
|
||||||
QRadioButton* Contructor_RBut1;
|
|
||||||
QRadioButton* Contructor_RBut2;
|
|
||||||
QRadioButton* ExtrMethod_RBut0;
|
QRadioButton* ExtrMethod_RBut0;
|
||||||
QRadioButton* ExtrMethod_RBut1;
|
QRadioButton* ExtrMethod_RBut1;
|
||||||
QRadioButton* ExtrMethod_RBut2;
|
QRadioButton* ExtrMethod_RBut2;
|
||||||
|
|
||||||
QGroupBox* GroupArguments;
|
QGroupBox* GroupArguments;
|
||||||
QGroupBox* GroupDimensions;
|
|
||||||
QLabel* TextLabelElements;
|
|
||||||
QPushButton* SelectElementsButton;
|
|
||||||
QLineEdit* LineEditElements;
|
|
||||||
QCheckBox* CheckBoxMesh;
|
|
||||||
QLabel* TextLabelVector;
|
QLabel* TextLabelVector;
|
||||||
QLabel* TextLabelDistance;
|
QLabel* TextLabelDistance;
|
||||||
QPushButton* SelectVectorButton;
|
QPushButton* SelectVectorButton;
|
||||||
@ -146,15 +189,11 @@ private:
|
|||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
QString myIDs;
|
QString myIDs;
|
||||||
|
|
||||||
QPushButton* myFilterBtn;
|
|
||||||
SMESHGUI_FilterDlg* myFilterDlg;
|
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void onDisplaySimulation( bool );
|
virtual void onDisplaySimulation( bool );
|
||||||
virtual void reject();
|
virtual void reject();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ConstructorsClicked( int );
|
|
||||||
void CheckIsEnable();
|
void CheckIsEnable();
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
@ -164,9 +203,6 @@ private slots:
|
|||||||
void SelectionIntoArgument();
|
void SelectionIntoArgument();
|
||||||
void DeactivateActiveDialog();
|
void DeactivateActiveDialog();
|
||||||
void ActivateThisDialog();
|
void ActivateThisDialog();
|
||||||
void onTextChange( const QString& );
|
|
||||||
void onSelectMesh( bool );
|
|
||||||
void setFilters();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SMESHGUI_EXTRUSIONDLG_H
|
#endif // SMESHGUI_EXTRUSIONDLG_H
|
||||||
|
@ -3299,12 +3299,17 @@ bool SMESHGUI_FilterDlg::onApply()
|
|||||||
insertFilterInViewer();
|
insertFilterInViewer();
|
||||||
|
|
||||||
if (!myFilter[ aCurrType ]->GetPredicate()->_is_nil()) {
|
if (!myFilter[ aCurrType ]->GetPredicate()->_is_nil()) {
|
||||||
|
//
|
||||||
|
bool toFilter = (( SMESH::FindActorByObject( myMesh )) ||
|
||||||
|
( myInitSourceWgOnApply && mySourceWg ) ||
|
||||||
|
( mySourceGrp->checkedId() == Dialog && mySourceWg ));
|
||||||
|
if ( toFilter ) {
|
||||||
QList<int> aResultIds;
|
QList<int> aResultIds;
|
||||||
filterSource(aCurrType, aResultIds);
|
filterSource(aCurrType, aResultIds);
|
||||||
// select in viewer
|
// select in viewer
|
||||||
selectInViewer(aCurrType, aResultIds);
|
selectInViewer(aCurrType, aResultIds);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
myInsertState[ aCurrType ] = mySetInViewer->isChecked();
|
myInsertState[ aCurrType ] = mySetInViewer->isChecked();
|
||||||
myApplyToState[ aCurrType ] = mySourceGrp->checkedId();
|
myApplyToState[ aCurrType ] = mySourceGrp->checkedId();
|
||||||
|
@ -1135,6 +1135,8 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
if( aMeshGroupSO )
|
if( aMeshGroupSO )
|
||||||
anEntryList.append( aMeshGroupSO->GetID().c_str() );
|
anEntryList.append( aMeshGroupSO->GetID().c_str() );
|
||||||
|
|
||||||
|
resultGroup->SetName(SMESH::toUtf8(myName->text().trimmed()));
|
||||||
|
|
||||||
if ( isCreation )
|
if ( isCreation )
|
||||||
{
|
{
|
||||||
SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );
|
SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );
|
||||||
@ -1151,8 +1153,6 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
resultGroup->SetName(SMESH::toUtf8(myName->text()));
|
|
||||||
|
|
||||||
if ( aMeshGroupSO )
|
if ( aMeshGroupSO )
|
||||||
{
|
{
|
||||||
if ( SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str()))
|
if ( SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str()))
|
||||||
|
@ -35,10 +35,11 @@
|
|||||||
#include <utilities.h>
|
#include <utilities.h>
|
||||||
|
|
||||||
// SALOME GUI includes
|
// SALOME GUI includes
|
||||||
#include <SUIT_Session.h>
|
|
||||||
#include <SUIT_MessageBox.h>
|
|
||||||
#include <SUIT_ResourceMgr.h>
|
|
||||||
#include <LightApp_Application.h>
|
#include <LightApp_Application.h>
|
||||||
|
#include <SUIT_MessageBox.h>
|
||||||
|
#include <SUIT_OverrideCursor.h>
|
||||||
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
#include <SUIT_Session.h>
|
||||||
#include <SalomeApp_IntSpinBox.h>
|
#include <SalomeApp_IntSpinBox.h>
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
@ -264,6 +265,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
|
|||||||
bool res = result==QDialog::Accepted;
|
bool res = result==QDialog::Accepted;
|
||||||
if( res )
|
if( res )
|
||||||
{
|
{
|
||||||
|
SUIT_OverrideCursor wc;
|
||||||
/*QString paramValues = */storeParams();
|
/*QString paramValues = */storeParams();
|
||||||
// No longer needed since NoteBook appears and "Value" OB field shows names of variable
|
// No longer needed since NoteBook appears and "Value" OB field shows names of variable
|
||||||
// if ( !paramValues.isEmpty() ) {
|
// if ( !paramValues.isEmpty() ) {
|
||||||
|
@ -519,8 +519,8 @@ void SMESHGUI_MinDistance::secondEdited()
|
|||||||
void SMESHGUI_MinDistance::compute()
|
void SMESHGUI_MinDistance::compute()
|
||||||
{
|
{
|
||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
SMESH::SMESH_IDSource_wrap s1;
|
SMESH::IDSource_wrap s1;
|
||||||
SMESH::SMESH_IDSource_wrap s2;
|
SMESH::IDSource_wrap s2;
|
||||||
bool isOrigin = mySecond->checkedId() == OriginTgt;
|
bool isOrigin = mySecond->checkedId() == OriginTgt;
|
||||||
|
|
||||||
// process first target
|
// process first target
|
||||||
@ -760,7 +760,8 @@ void SMESHGUI_BoundingBox::updateSelection()
|
|||||||
|
|
||||||
sourceEdited();
|
sourceEdited();
|
||||||
|
|
||||||
//selectionChanged();
|
if ( mySource->text().isEmpty() )
|
||||||
|
selectionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1206,6 +1207,9 @@ void SMESHGUI_BasicProperties::updateSelection()
|
|||||||
selMgr->installFilter( myFilter );
|
selMgr->installFilter( myFilter );
|
||||||
|
|
||||||
connect( selMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
|
connect( selMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
|
||||||
|
|
||||||
|
if ( mySource->text().isEmpty() )
|
||||||
|
selectionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -1283,7 +1283,7 @@ bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
|
|||||||
{
|
{
|
||||||
if ( hasObj )
|
if ( hasObj )
|
||||||
return theEditor->QuadTo4Tri( obj ), true;
|
return theEditor->QuadTo4Tri( obj ), true;
|
||||||
SMESH::SMESH_IDSource_wrap elems = theEditor->MakeIDSource( theIds, SMESH::FACE );
|
SMESH::IDSource_wrap elems = theEditor->MakeIDSource( theIds, SMESH::FACE );
|
||||||
theEditor->QuadTo4Tri( elems );
|
theEditor->QuadTo4Tri( elems );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1619,7 +1619,7 @@ bool SMESHGUI_SplitVolumesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
|
|||||||
const SMESH::long_array& theIds,
|
const SMESH::long_array& theIds,
|
||||||
SMESH::SMESH_IDSource_ptr theObj)
|
SMESH::SMESH_IDSource_ptr theObj)
|
||||||
{
|
{
|
||||||
SMESH::SMESH_IDSource_wrap obj = theObj;
|
SMESH::IDSource_wrap obj = theObj;
|
||||||
if ( CORBA::is_nil( obj ))
|
if ( CORBA::is_nil( obj ))
|
||||||
obj = theEditor->MakeIDSource( theIds, SMESH::VOLUME );
|
obj = theEditor->MakeIDSource( theIds, SMESH::VOLUME );
|
||||||
else
|
else
|
||||||
|
@ -332,6 +332,11 @@ void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText)
|
|||||||
aViewWindow->highlight(anIO,true,true);
|
aViewWindow->highlight(anIO,true,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
||||||
|
myNbOkElements = aListId.count();
|
||||||
|
}
|
||||||
|
|
||||||
myBusy = false;
|
myBusy = false;
|
||||||
updateButtons();
|
updateButtons();
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "SMESHGUI_IdValidator.h"
|
#include "SMESHGUI_IdValidator.h"
|
||||||
#include "SMESHGUI_MeshEditPreview.h"
|
#include "SMESHGUI_MeshEditPreview.h"
|
||||||
#include "SMESHGUI_FilterDlg.h"
|
#include "SMESHGUI_FilterDlg.h"
|
||||||
|
#include "SMESHGUI_ExtrusionDlg.h"
|
||||||
|
|
||||||
#include <SMESH_Actor.h>
|
#include <SMESH_Actor.h>
|
||||||
#include <SMESH_TypeFilter.hxx>
|
#include <SMESH_TypeFilter.hxx>
|
||||||
@ -91,17 +92,10 @@
|
|||||||
SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
||||||
: SMESHGUI_PreviewDlg( theModule ),
|
: SMESHGUI_PreviewDlg( theModule ),
|
||||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
|
||||||
myVectorDefinition(NONE_SELECT),
|
myVectorDefinition(NONE_SELECT)
|
||||||
myFilterDlg( 0 ),
|
|
||||||
mySelectedObject(SMESH::SMESH_IDSource::_nil()),
|
|
||||||
myActor(0)
|
|
||||||
{
|
{
|
||||||
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
|
|
||||||
|
|
||||||
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
|
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
|
||||||
QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
|
QPixmap image ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
|
||||||
QPixmap image1 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
|
|
||||||
QPixmap image2 ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
|
|
||||||
|
|
||||||
setModal(false);
|
setModal(false);
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
@ -113,44 +107,13 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
|||||||
SMESHGUI_RevolutionDlgLayout->setMargin(MARGIN);
|
SMESHGUI_RevolutionDlgLayout->setMargin(MARGIN);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
ConstructorsBox = new QGroupBox(tr("SMESH_REVOLUTION"), this);
|
GroupArguments = new QGroupBox(tr("REVOLUTION"), this);
|
||||||
GroupConstructors = new QButtonGroup(this);
|
|
||||||
QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
|
|
||||||
ConstructorsBoxLayout->setSpacing(SPACING);
|
|
||||||
ConstructorsBoxLayout->setMargin(MARGIN);
|
|
||||||
|
|
||||||
RadioButton1 = new QRadioButton(ConstructorsBox);
|
|
||||||
RadioButton1->setIcon(image0);
|
|
||||||
RadioButton2 = new QRadioButton(ConstructorsBox);
|
|
||||||
RadioButton2->setIcon(image1);
|
|
||||||
|
|
||||||
ConstructorsBoxLayout->addWidget(RadioButton1);
|
|
||||||
ConstructorsBoxLayout->addWidget(RadioButton2);
|
|
||||||
GroupConstructors->addButton(RadioButton1, 0);
|
|
||||||
GroupConstructors->addButton(RadioButton2, 1);
|
|
||||||
|
|
||||||
/***************************************************************/
|
|
||||||
GroupArguments = new QGroupBox(tr("REVOLUTION_1D"), this);
|
|
||||||
QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
|
QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
|
||||||
GroupArgumentsLayout->setSpacing(SPACING);
|
GroupArgumentsLayout->setSpacing(SPACING);
|
||||||
GroupArgumentsLayout->setMargin(MARGIN);
|
GroupArgumentsLayout->setMargin(MARGIN);
|
||||||
|
|
||||||
myIdValidator = new SMESHGUI_IdValidator(this);
|
|
||||||
|
|
||||||
// Controls for elements selection
|
// Controls for elements selection
|
||||||
TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
|
SelectorWdg = new SMESHGUI_3TypesSelector( GroupArguments );
|
||||||
|
|
||||||
SelectElementsButton = new QPushButton(GroupArguments);
|
|
||||||
SelectElementsButton->setIcon(image2);
|
|
||||||
|
|
||||||
LineEditElements = new QLineEdit(GroupArguments);
|
|
||||||
LineEditElements->setValidator(myIdValidator);
|
|
||||||
LineEditElements->setMaxLength(-1);
|
|
||||||
myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
|
|
||||||
connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
|
|
||||||
|
|
||||||
// Control for the whole mesh selection
|
|
||||||
CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
|
|
||||||
|
|
||||||
// Controls for axis defining
|
// Controls for axis defining
|
||||||
GroupAxis = new QGroupBox(tr("SMESH_AXIS"), GroupArguments);
|
GroupAxis = new QGroupBox(tr("SMESH_AXIS"), GroupArguments);
|
||||||
@ -160,7 +123,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
|||||||
|
|
||||||
TextLabelPoint = new QLabel(tr("SMESH_POINT"), GroupAxis);
|
TextLabelPoint = new QLabel(tr("SMESH_POINT"), GroupAxis);
|
||||||
SelectPointButton = new QPushButton(GroupAxis);
|
SelectPointButton = new QPushButton(GroupAxis);
|
||||||
SelectPointButton->setIcon(image2);
|
SelectPointButton->setIcon(image);
|
||||||
|
SelectPointButton->setCheckable(true);
|
||||||
|
|
||||||
TextLabelX = new QLabel(tr("SMESH_X"), GroupAxis);
|
TextLabelX = new QLabel(tr("SMESH_X"), GroupAxis);
|
||||||
SpinBox_X = new SMESHGUI_SpinBox(GroupAxis);
|
SpinBox_X = new SMESHGUI_SpinBox(GroupAxis);
|
||||||
@ -173,7 +137,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
|||||||
|
|
||||||
TextLabelVector = new QLabel(tr("SMESH_VECTOR"), GroupAxis);
|
TextLabelVector = new QLabel(tr("SMESH_VECTOR"), GroupAxis);
|
||||||
SelectVectorButton = new QPushButton(GroupAxis);
|
SelectVectorButton = new QPushButton(GroupAxis);
|
||||||
SelectVectorButton->setIcon(image2);
|
SelectVectorButton->setIcon(image);
|
||||||
|
SelectVectorButton->setCheckable(true);
|
||||||
|
|
||||||
TextLabelDX = new QLabel(tr("SMESH_DX"), GroupAxis);
|
TextLabelDX = new QLabel(tr("SMESH_DX"), GroupAxis);
|
||||||
SpinBox_DX = new SMESHGUI_SpinBox(GroupAxis);
|
SpinBox_DX = new SMESHGUI_SpinBox(GroupAxis);
|
||||||
@ -237,17 +202,16 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
|||||||
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
|
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
|
||||||
MakeGroupsCheck->setChecked(true);
|
MakeGroupsCheck->setChecked(true);
|
||||||
|
|
||||||
GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
|
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 1, 4);
|
||||||
GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
|
GroupArgumentsLayout->addWidget(GroupAxis, 1, 0, 1, 4);
|
||||||
GroupArgumentsLayout->addWidget(LineEditElements, 0, 2);
|
GroupArgumentsLayout->addWidget(GroupAngleBox, 2, 0, 1, 4);
|
||||||
GroupArgumentsLayout->addWidget(myFilterBtn, 0, 3);
|
GroupArgumentsLayout->addWidget(TextLabelTolerance, 3, 0, 1, 2);
|
||||||
GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 4);
|
GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 3, 2, 1, 2);
|
||||||
GroupArgumentsLayout->addWidget(GroupAxis, 2, 0, 1, 4);
|
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 4, 0, 1, 4);
|
||||||
GroupArgumentsLayout->addWidget(GroupAngleBox, 3, 0, 1, 4);
|
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0, 1, 4);
|
||||||
GroupArgumentsLayout->addWidget(TextLabelTolerance, 4, 0, 1, 2);
|
|
||||||
GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 4, 2, 1, 2);
|
SelectorWdg->GetButtonGroup()->addButton( SelectVectorButton );
|
||||||
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 5, 0, 1, 4);
|
SelectorWdg->GetButtonGroup()->addButton( SelectPointButton );
|
||||||
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 6, 0, 1, 4);
|
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupButtons = new QGroupBox(this);
|
GroupButtons = new QGroupBox(this);
|
||||||
@ -274,7 +238,6 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
|||||||
GroupButtonsLayout->addWidget(buttonHelp);
|
GroupButtonsLayout->addWidget(buttonHelp);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
SMESHGUI_RevolutionDlgLayout->addWidget(ConstructorsBox);
|
|
||||||
SMESHGUI_RevolutionDlgLayout->addWidget(GroupArguments);
|
SMESHGUI_RevolutionDlgLayout->addWidget(GroupArguments);
|
||||||
SMESHGUI_RevolutionDlgLayout->addWidget(GroupButtons);
|
SMESHGUI_RevolutionDlgLayout->addWidget(GroupButtons);
|
||||||
|
|
||||||
@ -294,23 +257,10 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
|||||||
|
|
||||||
SpinBox_Tolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision");
|
SpinBox_Tolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision");
|
||||||
|
|
||||||
RadioButton1->setChecked(true);
|
|
||||||
|
|
||||||
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
|
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
|
||||||
|
|
||||||
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
|
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
|
||||||
|
|
||||||
// Costruction of the logical filter
|
|
||||||
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (SMESH::MESHorSUBMESH);
|
|
||||||
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (SMESH::GROUP);
|
|
||||||
|
|
||||||
QList<SUIT_SelectionFilter*> aListOfFilters;
|
|
||||||
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
|
|
||||||
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
|
|
||||||
|
|
||||||
myMeshOrSubMeshOrGroupFilter =
|
|
||||||
new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
|
|
||||||
|
|
||||||
myHelpFileName = "revolution_page.html";
|
myHelpFileName = "revolution_page.html";
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
@ -326,9 +276,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
|||||||
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
|
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
|
||||||
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
|
|
||||||
|
|
||||||
connect(SelectElementsButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
||||||
connect(SelectPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(SelectPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(SelectVectorButton, SIGNAL(clicked()), this, SLOT(onSelectVectorButton()));
|
connect(SelectVectorButton, SIGNAL(clicked()), this, SLOT(onSelectVectorButton()));
|
||||||
|
|
||||||
@ -336,16 +284,19 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
|||||||
connect(SpinBox_Y, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
connect(SpinBox_Y, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
connect(SpinBox_Z, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
connect(SpinBox_Z, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
|
|
||||||
connect(SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
|
connect(SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(CheckIsEnable()));
|
||||||
connect(SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
|
connect(SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(CheckIsEnable()));
|
||||||
connect(SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
|
connect(SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(CheckIsEnable()));
|
||||||
|
connect(SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
|
|
||||||
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
|
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
|
||||||
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
|
||||||
|
connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable()));
|
||||||
/* to close dialog if study change */
|
/* to close dialog if study change */
|
||||||
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
|
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
|
||||||
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
|
|
||||||
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
|
|
||||||
|
|
||||||
connect(GroupAngle, SIGNAL(buttonClicked(int)), this, SLOT(toDisplaySimulation()));
|
connect(GroupAngle, SIGNAL(buttonClicked(int)), this, SLOT(toDisplaySimulation()));
|
||||||
connect(SpinBox_Angle, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
connect(SpinBox_Angle, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
@ -357,8 +308,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
|||||||
|
|
||||||
connect(SpinBox_Angle, SIGNAL(textChanged(const QString&)), this, SLOT(onAngleTextChange(const QString&)));
|
connect(SpinBox_Angle, SIGNAL(textChanged(const QString&)), this, SLOT(onAngleTextChange(const QString&)));
|
||||||
|
|
||||||
ConstructorsClicked(0);
|
CheckIsEnable();
|
||||||
SelectionIntoArgument();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -367,12 +317,6 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
SMESHGUI_RevolutionDlg::~SMESHGUI_RevolutionDlg()
|
SMESHGUI_RevolutionDlg::~SMESHGUI_RevolutionDlg()
|
||||||
{
|
{
|
||||||
delete mySimulation;
|
|
||||||
if ( myFilterDlg ) {
|
|
||||||
myFilterDlg->setParent( 0 );
|
|
||||||
delete myFilterDlg;
|
|
||||||
myFilterDlg = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -381,17 +325,6 @@ SMESHGUI_RevolutionDlg::~SMESHGUI_RevolutionDlg()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_RevolutionDlg::Init (bool ResetControls)
|
void SMESHGUI_RevolutionDlg::Init (bool ResetControls)
|
||||||
{
|
{
|
||||||
myBusy = false;
|
|
||||||
|
|
||||||
myEditCurrentArgument = 0;
|
|
||||||
LineEditElements->clear();
|
|
||||||
myElementsId = "";
|
|
||||||
myNbOkElements = 0;
|
|
||||||
myIDs.clear();
|
|
||||||
|
|
||||||
myActor = 0;
|
|
||||||
myMesh = SMESH::SMESH_Mesh::_nil();
|
|
||||||
|
|
||||||
if (ResetControls) {
|
if (ResetControls) {
|
||||||
SpinBox_X->SetValue(0.0);
|
SpinBox_X->SetValue(0.0);
|
||||||
SpinBox_Y->SetValue(0.0);
|
SpinBox_Y->SetValue(0.0);
|
||||||
@ -404,68 +337,51 @@ void SMESHGUI_RevolutionDlg::Init (bool ResetControls)
|
|||||||
SpinBox_NbSteps->setValue(1);
|
SpinBox_NbSteps->setValue(1);
|
||||||
SpinBox_Tolerance->SetValue(1e-05);
|
SpinBox_Tolerance->SetValue(1e-05);
|
||||||
|
|
||||||
CheckBoxMesh->setChecked(false);
|
|
||||||
onSelectMesh(false);
|
|
||||||
myPreviewCheckBox->setChecked(false);
|
myPreviewCheckBox->setChecked(false);
|
||||||
onDisplaySimulation(false);
|
onDisplaySimulation(false);
|
||||||
}
|
}
|
||||||
|
SelectorWdg->Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ConstructorsClicked()
|
// function : CheckIsEnable()
|
||||||
// purpose : Radio button management
|
// purpose : Check whether the Ok and Apply buttons should be enabled or not
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
|
|
||||||
|
void SMESHGUI_RevolutionDlg::CheckIsEnable()
|
||||||
{
|
{
|
||||||
disconnect(mySelectionMgr, 0, this, 0);
|
bool anIsEnable = SelectorWdg->IsAnythingSelected() && IsAxisOk();
|
||||||
|
|
||||||
/* SALOME_ListIO io;
|
buttonOk->setEnabled(anIsEnable);
|
||||||
mySelectionMgr->selectedObjects( io );
|
buttonApply->setEnabled(anIsEnable);
|
||||||
SALOME_ListIO aList;
|
}
|
||||||
mySelectionMgr->setSelectedObjects( aList );*/
|
|
||||||
|
|
||||||
buttonApply->setEnabled(false);
|
//=================================================================================
|
||||||
buttonOk->setEnabled(false);
|
// function : isValid
|
||||||
mySimulation->SetVisibility(false);
|
// purpose : Return true in case if values entered into dialog are valid
|
||||||
|
//=================================================================================
|
||||||
|
bool SMESHGUI_RevolutionDlg::isValid()
|
||||||
|
{
|
||||||
|
QString msg;
|
||||||
|
bool ok = true;
|
||||||
|
ok = SpinBox_X->isValid( msg, true ) && ok;
|
||||||
|
ok = SpinBox_Y->isValid( msg, true ) && ok;
|
||||||
|
ok = SpinBox_Z->isValid( msg, true ) && ok;
|
||||||
|
ok = SpinBox_DX->isValid( msg, true ) && ok;
|
||||||
|
ok = SpinBox_DY->isValid( msg, true ) && ok;
|
||||||
|
ok = SpinBox_DZ->isValid( msg, true ) && ok;
|
||||||
|
ok = SpinBox_Angle->isValid( msg, true ) && ok;
|
||||||
|
ok = SpinBox_NbSteps->isValid( msg, true ) && ok;
|
||||||
|
ok = SpinBox_Tolerance->isValid( msg, true ) && ok;
|
||||||
|
|
||||||
Selection_Mode aSelMode = ActorSelection;
|
if( !ok ) {
|
||||||
|
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
||||||
switch (constructorId) {
|
if ( !msg.isEmpty() )
|
||||||
case 0:
|
str += "\n" + msg;
|
||||||
{
|
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
||||||
GroupArguments->setTitle(tr("REVOLUTION_1D"));
|
return false;
|
||||||
aSelMode = EdgeSelection;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case 1:
|
return true;
|
||||||
{
|
|
||||||
GroupArguments->setTitle(tr("REVOLUTION_2D"));
|
|
||||||
aSelMode = FaceSelection;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (myEditCurrentArgument != (QWidget*)LineEditElements) {
|
|
||||||
SMESH::SetPointRepresentation(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!CheckBoxMesh->isChecked())
|
|
||||||
{
|
|
||||||
LineEditElements->clear();
|
|
||||||
myIDs.clear();
|
|
||||||
myNbOkElements = 0;
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(aSelMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
myEditCurrentArgument = (QWidget*)LineEditElements;
|
|
||||||
LineEditElements->setFocus();
|
|
||||||
|
|
||||||
if (CheckBoxMesh->isChecked())
|
|
||||||
onSelectMesh(true);
|
|
||||||
|
|
||||||
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
// mySelectionMgr->setSelectedObjects( io );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -480,14 +396,7 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
|
|||||||
if (!isValid())
|
if (!isValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (myNbOkElements && IsAxisOk()) {
|
if ( SelectorWdg->IsAnythingSelected() && IsAxisOk() ) {
|
||||||
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
|
|
||||||
|
|
||||||
SMESH::long_array_var anElementsId = new SMESH::long_array;
|
|
||||||
|
|
||||||
anElementsId->length(aListElementsId.count());
|
|
||||||
for (int i = 0; i < aListElementsId.count(); i++)
|
|
||||||
anElementsId[i] = aListElementsId[i].toInt();
|
|
||||||
|
|
||||||
SMESH::AxisStruct anAxis;
|
SMESH::AxisStruct anAxis;
|
||||||
|
|
||||||
@ -517,75 +426,60 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
|
|||||||
aParameters << SpinBox_Tolerance->text();
|
aParameters << SpinBox_Tolerance->text();
|
||||||
|
|
||||||
bool meshHadNewTypeBefore = true;
|
bool meshHadNewTypeBefore = true;
|
||||||
|
int maxSelType = 0;
|
||||||
|
const bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
|
|
||||||
|
SMESH::SMESH_Mesh_var mesh = SelectorWdg->GetMesh();
|
||||||
|
|
||||||
|
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
|
SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources();
|
||||||
|
SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources();
|
||||||
|
SMESH::ListOfIDSources_var faces = new SMESH::ListOfIDSources();
|
||||||
|
maxSelType = SelectorWdg->GetSelected( nodes, edges, faces );
|
||||||
|
|
||||||
// is it necessary to switch on the next Display Mode?
|
// is it necessary to switch on the next Display Mode?
|
||||||
SMESH::ElementType newType = (SMESH::ElementType)( SMESH::FACE + GetConstructorId() );
|
SMESH::ElementType newType = (SMESH::ElementType)( maxSelType + 1 );
|
||||||
SMESH::array_of_ElementType_var oldTypes = myMesh->GetTypes();
|
SMESH::array_of_ElementType_var oldTypes = mesh->GetTypes();
|
||||||
meshHadNewTypeBefore = false;
|
meshHadNewTypeBefore = false;
|
||||||
for ( size_t i = 0; i < oldTypes->length() && !meshHadNewTypeBefore; ++i )
|
for ( size_t i = 0; i < oldTypes->length() && !meshHadNewTypeBefore; ++i )
|
||||||
meshHadNewTypeBefore = ( oldTypes[i] >= newType );
|
meshHadNewTypeBefore = ( oldTypes[i] >= newType );
|
||||||
|
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = mesh->GetMeshEditor();
|
||||||
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
|
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
|
||||||
if( GetConstructorId() == 0 )
|
|
||||||
SMESH::ListOfGroups_var groups =
|
SMESH::ListOfGroups_var groups =
|
||||||
aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
|
aMeshEditor->RotationSweepObjects( nodes, edges, faces, anAxis,
|
||||||
anAngle, aNbSteps, aTolerance);
|
anAngle, aNbSteps, aTolerance, makeGroups);
|
||||||
else
|
|
||||||
SMESH::ListOfGroups_var groups =
|
|
||||||
aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
|
|
||||||
anAngle, aNbSteps, aTolerance);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SMESH::ListOfGroups_var groups =
|
|
||||||
aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
|
|
||||||
anAngle, aNbSteps, aTolerance);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
|
||||||
if( GetConstructorId() == 0 )
|
|
||||||
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
|
|
||||||
else
|
|
||||||
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( myActor && !meshHadNewTypeBefore )
|
SMESH_Actor* actor = SelectorWdg->GetActor();
|
||||||
|
if ( actor && !meshHadNewTypeBefore )
|
||||||
{
|
{
|
||||||
unsigned int aMode = myActor->GetEntityMode();
|
unsigned int aMode = actor->GetEntityMode();
|
||||||
switch ( GetConstructorId() ) {
|
switch ( maxSelType ) {
|
||||||
case 0-1: // extrude node -> edges
|
case SMESH::NODE: // extrude node -> edges
|
||||||
myActor->SetRepresentation(SMESH_Actor::eEdge);
|
actor->SetRepresentation(SMESH_Actor::eEdge);
|
||||||
myActor->SetEntityMode( aMode |= SMESH_Actor::eEdges ); break;
|
actor->SetEntityMode( aMode |= SMESH_Actor::eEdges ); break;
|
||||||
case 1-1: // edge -> faces
|
case SMESH::EDGE: // edge -> faces
|
||||||
myActor->SetRepresentation(SMESH_Actor::eSurface);
|
actor->SetRepresentation(SMESH_Actor::eSurface);
|
||||||
myActor->SetEntityMode( aMode |= SMESH_Actor::eFaces ); break;
|
actor->SetEntityMode( aMode |= SMESH_Actor::eFaces ); break;
|
||||||
case 2-1: // faces -> volumes
|
case SMESH::FACE: // faces -> volumes
|
||||||
myActor->SetRepresentation(SMESH_Actor::eSurface);
|
actor->SetRepresentation(SMESH_Actor::eSurface);
|
||||||
myActor->SetEntityMode( aMode |= SMESH_Actor::eVolumes ); break;
|
actor->SetEntityMode( aMode |= SMESH_Actor::eVolumes ); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SMESH::UpdateView();
|
if ( actor )
|
||||||
SMESH::Update(myIO, SMESH::eDisplay);
|
SMESH::Update( actor->getIO(), actor->GetVisibility() );
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
if ( makeGroups )
|
||||||
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
Init(false);
|
Init(false);
|
||||||
mySelectionMgr->clearSelected();
|
mySelectionMgr->clearSelected();
|
||||||
mySelectedObject = SMESH::SMESH_IDSource::_nil();
|
SelectorWdg->Clear();
|
||||||
SelectionIntoArgument();
|
|
||||||
ConstructorsClicked(GetConstructorId());
|
|
||||||
|
|
||||||
SMESHGUI::Modified();
|
SMESHGUI::Modified();
|
||||||
}
|
}
|
||||||
@ -660,83 +554,18 @@ void SMESHGUI_RevolutionDlg::onAngleTextChange (const QString& theNewText)
|
|||||||
RadioButton4->setEnabled( isNumber );
|
RadioButton4->setEnabled( isNumber );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
// function : onTextChange()
|
|
||||||
// purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void SMESHGUI_RevolutionDlg::onTextChange (const QString& theNewText)
|
|
||||||
{
|
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
|
||||||
|
|
||||||
if (myBusy) return;
|
|
||||||
myBusy = true;
|
|
||||||
|
|
||||||
if (send == LineEditElements)
|
|
||||||
myNbOkElements = 0;
|
|
||||||
|
|
||||||
buttonOk->setEnabled(false);
|
|
||||||
buttonApply->setEnabled(false);
|
|
||||||
|
|
||||||
// hilight entered elements
|
|
||||||
SMDS_Mesh* aMesh = 0;
|
|
||||||
if (myActor)
|
|
||||||
aMesh = myActor->GetObject()->GetMesh();
|
|
||||||
|
|
||||||
if (aMesh) {
|
|
||||||
if (send == LineEditElements) {
|
|
||||||
Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
|
|
||||||
|
|
||||||
TColStd_MapOfInteger newIndices;
|
|
||||||
|
|
||||||
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
|
|
||||||
|
|
||||||
for (int i = 0; i < aListId.count(); i++) {
|
|
||||||
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
|
|
||||||
if (e)
|
|
||||||
newIndices.Add(e->GetID());
|
|
||||||
myNbOkElements++;
|
|
||||||
}
|
|
||||||
|
|
||||||
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->highlight( myActor->getIO(), true, true );
|
|
||||||
|
|
||||||
myElementsId = theNewText;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (myNbOkElements && IsAxisOk()) {
|
|
||||||
buttonOk->setEnabled(true);
|
|
||||||
buttonApply->setEnabled(true);
|
|
||||||
}
|
|
||||||
onDisplaySimulation(true);
|
|
||||||
|
|
||||||
myBusy = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection as changed or other case
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
|
void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
if (myBusy) return;
|
|
||||||
|
|
||||||
// clear
|
|
||||||
QString aString = "";
|
|
||||||
|
|
||||||
myBusy = true;
|
|
||||||
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
|
|
||||||
LineEditElements->setText(aString);
|
|
||||||
myNbOkElements = 0;
|
|
||||||
buttonOk->setEnabled(false);
|
|
||||||
buttonApply->setEnabled(false);
|
|
||||||
}
|
|
||||||
myBusy = false;
|
|
||||||
|
|
||||||
if (!GroupButtons->isEnabled()) // inactive
|
if (!GroupButtons->isEnabled()) // inactive
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ( SelectVectorButton->isChecked() ||
|
||||||
|
SelectPointButton->isChecked() )
|
||||||
|
{
|
||||||
// get selected mesh
|
// get selected mesh
|
||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
mySelectionMgr->selectedObjects(aList);
|
mySelectionMgr->selectedObjects(aList);
|
||||||
@ -745,52 +574,18 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Handle(SALOME_InteractiveObject) IO = aList.First();
|
Handle(SALOME_InteractiveObject) IO = aList.First();
|
||||||
SMESH::SMESH_Mesh_var aMeshVar = SMESH::GetMeshByIO(IO);
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
if (aMeshVar->_is_nil())
|
mySelector->GetIndex(IO,aMapIndex);
|
||||||
|
if ( aMapIndex.Extent() != 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SMESH_Actor* anActor = SMESH::FindActorByObject(aMeshVar);
|
SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
|
||||||
if (!anActor)
|
SMDS_Mesh* aMesh = anActor ? anActor->GetObject()->GetMesh() : 0;
|
||||||
anActor = SMESH::FindActorByEntry(IO->getEntry());
|
if ( !aMesh )
|
||||||
if (!anActor && !CheckBoxMesh->isChecked())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int aNbUnits = 0;
|
int aNbUnits = 0;
|
||||||
|
|
||||||
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
|
|
||||||
myElementsId = "";
|
|
||||||
myMesh = aMeshVar;
|
|
||||||
myActor = anActor;
|
|
||||||
myIO = IO;
|
|
||||||
|
|
||||||
// MakeGroups is available if there are groups
|
|
||||||
if ( myMesh->NbGroups() == 0 ) {
|
|
||||||
MakeGroupsCheck->setChecked(false);
|
|
||||||
MakeGroupsCheck->setEnabled(false);
|
|
||||||
} else {
|
|
||||||
MakeGroupsCheck->setEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CheckBoxMesh->isChecked()) {
|
|
||||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
|
||||||
|
|
||||||
if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
|
|
||||||
mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
|
||||||
myElementsId = aString;
|
|
||||||
if (aNbUnits < 1)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
myNbOkElements = true;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();
|
|
||||||
if (!aMesh)
|
|
||||||
return;
|
|
||||||
|
|
||||||
bool isNodeSelected = (myEditCurrentArgument == (QWidget*)SpinBox_X ||
|
bool isNodeSelected = (myEditCurrentArgument == (QWidget*)SpinBox_X ||
|
||||||
(myEditCurrentArgument == (QWidget*)SpinBox_DX &&
|
(myEditCurrentArgument == (QWidget*)SpinBox_DX &&
|
||||||
myVectorDefinition==POINT_SELECT));
|
myVectorDefinition==POINT_SELECT));
|
||||||
@ -798,21 +593,11 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
|
|||||||
bool isFaceSelected = (myEditCurrentArgument == (QWidget*)SpinBox_DX &&
|
bool isFaceSelected = (myEditCurrentArgument == (QWidget*)SpinBox_DX &&
|
||||||
myVectorDefinition==FACE_SELECT);
|
myVectorDefinition==FACE_SELECT);
|
||||||
|
|
||||||
if(isNodeSelected) {
|
if ( isNodeSelected )
|
||||||
aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
|
{
|
||||||
}
|
const SMDS_MeshNode * n = aMesh->FindNode( aMapIndex(1) );
|
||||||
else if(isFaceSelected){
|
|
||||||
aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aNbUnits != 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(isNodeSelected) {
|
|
||||||
const SMDS_MeshNode * n = aMesh->FindNode(aString.toInt());
|
|
||||||
if (!n)
|
if (!n)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
double x = n->X();
|
double x = n->X();
|
||||||
double y = n->Y();
|
double y = n->Y();
|
||||||
double z = n->Z();
|
double z = n->Z();
|
||||||
@ -827,11 +612,12 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
|
|||||||
SpinBox_DZ->SetValue(z - SpinBox_Z->GetValue());
|
SpinBox_DZ->SetValue(z - SpinBox_Z->GetValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(isFaceSelected){
|
else if ( isFaceSelected )
|
||||||
const SMDS_MeshFace* face = dynamic_cast<const SMDS_MeshFace*>(aMesh->FindElement(aString.toInt()));
|
{
|
||||||
|
const SMDS_MeshFace* face =
|
||||||
|
dynamic_cast<const SMDS_MeshFace*>(aMesh->FindElement(aMapIndex(1)));
|
||||||
if (!face)
|
if (!face)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gp_XYZ aNormale = SMESH::getNormale(face);
|
gp_XYZ aNormale = SMESH::getNormale(face);
|
||||||
SpinBox_DX->SetValue(aNormale.X());
|
SpinBox_DX->SetValue(aNormale.X());
|
||||||
SpinBox_DY->SetValue(aNormale.Y());
|
SpinBox_DY->SetValue(aNormale.Y());
|
||||||
@ -840,17 +626,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myBusy = true;
|
CheckIsEnable();
|
||||||
if (myEditCurrentArgument == (QWidget*)LineEditElements)
|
|
||||||
LineEditElements->setText(aString);
|
|
||||||
myBusy = false;
|
|
||||||
|
|
||||||
// OK
|
|
||||||
if (myNbOkElements && IsAxisOk()) {
|
|
||||||
buttonOk->setEnabled(true);
|
|
||||||
buttonApply->setEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
onDisplaySimulation(true);
|
onDisplaySimulation(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -866,35 +642,13 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument()
|
|||||||
mySelectionMgr->clearSelected();
|
mySelectionMgr->clearSelected();
|
||||||
mySelectionMgr->clearFilters();
|
mySelectionMgr->clearFilters();
|
||||||
|
|
||||||
if (send == SelectElementsButton) {
|
if (send == SelectPointButton) {
|
||||||
mySimulation->SetVisibility(false);
|
|
||||||
myEditCurrentArgument = (QWidget*)LineEditElements;
|
|
||||||
SMESH::SetPointRepresentation(false);
|
|
||||||
if (CheckBoxMesh->isChecked()) {
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
|
||||||
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
|
||||||
} else {
|
|
||||||
int aConstructorId = GetConstructorId();
|
|
||||||
if (aConstructorId == 0)
|
|
||||||
{
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
|
||||||
}
|
|
||||||
else if (aConstructorId == 1)
|
|
||||||
{
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (send == SelectPointButton) {
|
|
||||||
myEditCurrentArgument = (QWidget*)SpinBox_X;
|
myEditCurrentArgument = (QWidget*)SpinBox_X;
|
||||||
|
myEditCurrentArgument->setFocus();
|
||||||
SMESH::SetPointRepresentation(true);
|
SMESH::SetPointRepresentation(true);
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode(NodeSelection);
|
aViewWindow->SetSelectionMode(NodeSelection);
|
||||||
}
|
}
|
||||||
|
|
||||||
myEditCurrentArgument->setFocus();
|
|
||||||
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
@ -905,10 +659,11 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_RevolutionDlg::DeactivateActiveDialog()
|
void SMESHGUI_RevolutionDlg::DeactivateActiveDialog()
|
||||||
{
|
{
|
||||||
if (ConstructorsBox->isEnabled()) {
|
if (GroupButtons->isEnabled())
|
||||||
ConstructorsBox->setEnabled(false);
|
{
|
||||||
GroupArguments->setEnabled(false);
|
GroupArguments->setEnabled(false);
|
||||||
GroupButtons->setEnabled(false);
|
GroupButtons->setEnabled(false);
|
||||||
|
SelectorWdg->setEnabled(false);
|
||||||
mySMESHGUI->ResetState();
|
mySMESHGUI->ResetState();
|
||||||
mySMESHGUI->SetActiveDialogBox(0);
|
mySMESHGUI->SetActiveDialogBox(0);
|
||||||
}
|
}
|
||||||
@ -922,14 +677,11 @@ void SMESHGUI_RevolutionDlg::ActivateThisDialog()
|
|||||||
{
|
{
|
||||||
/* Emit a signal to deactivate the active dialog */
|
/* Emit a signal to deactivate the active dialog */
|
||||||
mySMESHGUI->EmitSignalDeactivateDialog();
|
mySMESHGUI->EmitSignalDeactivateDialog();
|
||||||
ConstructorsBox->setEnabled(true);
|
|
||||||
GroupArguments->setEnabled(true);
|
GroupArguments->setEnabled(true);
|
||||||
GroupButtons->setEnabled(true);
|
GroupButtons->setEnabled(true);
|
||||||
|
SelectorWdg->setEnabled(true);
|
||||||
|
|
||||||
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
|
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
|
||||||
|
|
||||||
ConstructorsClicked(GetConstructorId());
|
|
||||||
SelectionIntoArgument();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -938,73 +690,10 @@ void SMESHGUI_RevolutionDlg::ActivateThisDialog()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_RevolutionDlg::enterEvent (QEvent*)
|
void SMESHGUI_RevolutionDlg::enterEvent (QEvent*)
|
||||||
{
|
{
|
||||||
if (!ConstructorsBox->isEnabled())
|
if (!GroupButtons->isEnabled())
|
||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : onSelectMesh
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
|
|
||||||
{
|
|
||||||
if (toSelectMesh) {
|
|
||||||
myIDs = LineEditElements->text();
|
|
||||||
TextLabelElements->setText(tr("SMESH_NAME"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
|
|
||||||
myFilterBtn->setEnabled(!toSelectMesh);
|
|
||||||
|
|
||||||
if (myEditCurrentArgument != LineEditElements) {
|
|
||||||
LineEditElements->clear();
|
|
||||||
mySimulation->SetVisibility(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mySelectionMgr->clearFilters();
|
|
||||||
SMESH::SetPointRepresentation(false);
|
|
||||||
|
|
||||||
if (toSelectMesh) {
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(ActorSelection);
|
|
||||||
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
|
|
||||||
LineEditElements->setReadOnly(true);
|
|
||||||
LineEditElements->setValidator(0);
|
|
||||||
} else {
|
|
||||||
int aConstructorId = GetConstructorId();
|
|
||||||
if (aConstructorId == 0)
|
|
||||||
{
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(EdgeSelection);
|
|
||||||
}
|
|
||||||
else if (aConstructorId == 1)
|
|
||||||
{
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
|
||||||
aViewWindow->SetSelectionMode(FaceSelection);
|
|
||||||
}
|
|
||||||
|
|
||||||
LineEditElements->setReadOnly(false);
|
|
||||||
LineEditElements->setValidator(myIdValidator);
|
|
||||||
onTextChange(LineEditElements->text());
|
|
||||||
mySimulation->SetVisibility(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
SelectionIntoArgument();
|
|
||||||
|
|
||||||
if (!toSelectMesh)
|
|
||||||
LineEditElements->setText( myIDs );
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : GetConstructorId()
|
|
||||||
// purpose :
|
|
||||||
//=================================================================================
|
|
||||||
int SMESHGUI_RevolutionDlg::GetConstructorId()
|
|
||||||
{
|
|
||||||
return GroupConstructors->checkedId();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : IsAxisOk()
|
// function : IsAxisOk()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -1016,22 +705,6 @@ bool SMESHGUI_RevolutionDlg::IsAxisOk()
|
|||||||
SpinBox_DZ->GetValue() != 0);
|
SpinBox_DZ->GetValue() != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : onVectorChanged()
|
|
||||||
// purpose :
|
|
||||||
//=================================================================================
|
|
||||||
void SMESHGUI_RevolutionDlg::onVectorChanged()
|
|
||||||
{
|
|
||||||
if (IsAxisOk()) {
|
|
||||||
buttonOk->setEnabled(true);
|
|
||||||
buttonApply->setEnabled(true);
|
|
||||||
} else {
|
|
||||||
buttonOk->setEnabled(false);
|
|
||||||
buttonApply->setEnabled(false);
|
|
||||||
}
|
|
||||||
onDisplaySimulation(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : keyPressEvent()
|
// function : keyPressEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -1056,17 +729,8 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
|
|||||||
{
|
{
|
||||||
if (myPreviewCheckBox->isChecked() && toDisplayPreview)
|
if (myPreviewCheckBox->isChecked() && toDisplayPreview)
|
||||||
{
|
{
|
||||||
//display preview
|
if (SelectorWdg->IsAnythingSelected() && IsAxisOk())
|
||||||
if (myNbOkElements && IsAxisOk())
|
|
||||||
{
|
{
|
||||||
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
|
|
||||||
|
|
||||||
SMESH::long_array_var anElementsId = new SMESH::long_array;
|
|
||||||
|
|
||||||
anElementsId->length(aListElementsId.count());
|
|
||||||
for (int i = 0; i < aListElementsId.count(); i++)
|
|
||||||
anElementsId[i] = aListElementsId[i].toInt();
|
|
||||||
|
|
||||||
SMESH::AxisStruct anAxis;
|
SMESH::AxisStruct anAxis;
|
||||||
|
|
||||||
anAxis.x = SpinBox_X->GetValue();
|
anAxis.x = SpinBox_X->GetValue();
|
||||||
@ -1083,26 +747,27 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
|
|||||||
if (GroupAngle->checkedId() == 1)
|
if (GroupAngle->checkedId() == 1)
|
||||||
anAngle = anAngle/aNbSteps;
|
anAngle = anAngle/aNbSteps;
|
||||||
|
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
|
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
SMESH::SMESH_Mesh_var mesh = SelectorWdg->GetMesh();
|
||||||
if( GetConstructorId() == 0 )
|
SMESH::SMESH_MeshEditor_var meshEditor = mesh->GetMeshEditPreviewer();
|
||||||
aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
|
SMESH::ListOfGroups_var groups;
|
||||||
anAngle, aNbSteps, aTolerance);
|
|
||||||
else
|
SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources();
|
||||||
aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
|
SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources();
|
||||||
anAngle, aNbSteps, aTolerance);
|
SMESH::ListOfIDSources_var faces = new SMESH::ListOfIDSources();
|
||||||
|
SelectorWdg->GetSelected( nodes, edges, faces );
|
||||||
|
const bool makeGroups = false;
|
||||||
|
|
||||||
|
meshEditor->RotationSweepObjects(nodes, edges, faces,
|
||||||
|
anAxis, anAngle, aNbSteps, aTolerance, makeGroups );
|
||||||
|
|
||||||
|
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = meshEditor->GetPreviewData();
|
||||||
|
mySimulation->SetData( aMeshPreviewStruct._retn() );
|
||||||
}
|
}
|
||||||
else
|
catch (...) {}
|
||||||
aMeshEditor->RotationSweep(anElementsId.inout(),
|
|
||||||
anAxis,
|
|
||||||
anAngle,
|
|
||||||
aNbSteps,
|
|
||||||
aTolerance);
|
|
||||||
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
|
|
||||||
mySimulation->SetData(aMeshPreviewStruct._retn());
|
|
||||||
} catch (...) {}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1120,7 +785,8 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
|
|||||||
// function : onSelectVectorButton()
|
// function : onSelectVectorButton()
|
||||||
// purpose : [slot]
|
// purpose : [slot]
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_RevolutionDlg::onSelectVectorButton(){
|
void SMESHGUI_RevolutionDlg::onSelectVectorButton()
|
||||||
|
{
|
||||||
if(SelectVectorMenu) {
|
if(SelectVectorMenu) {
|
||||||
SelectVectorMenu->exec( QCursor::pos() );
|
SelectVectorMenu->exec( QCursor::pos() );
|
||||||
}
|
}
|
||||||
@ -1130,7 +796,8 @@ void SMESHGUI_RevolutionDlg::onSelectVectorButton(){
|
|||||||
// function : onSelectVectorMenu()
|
// function : onSelectVectorMenu()
|
||||||
// purpose : [slot]
|
// purpose : [slot]
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_RevolutionDlg::onSelectVectorMenu( QAction* action){
|
void SMESHGUI_RevolutionDlg::onSelectVectorMenu( QAction* action)
|
||||||
|
{
|
||||||
if(!action)
|
if(!action)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1157,58 +824,4 @@ void SMESHGUI_RevolutionDlg::onSelectVectorMenu( QAction* action){
|
|||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : setFilters()
|
|
||||||
// purpose : SLOT. Called when "Filter" button pressed.
|
|
||||||
//=================================================================================
|
|
||||||
void SMESHGUI_RevolutionDlg::setFilters()
|
|
||||||
{
|
|
||||||
if(myMesh->_is_nil()) {
|
|
||||||
SUIT_MessageBox::critical(this,
|
|
||||||
tr("SMESH_ERROR"),
|
|
||||||
tr("NO_MESH_SELECTED"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ( !myFilterDlg )
|
|
||||||
{
|
|
||||||
QList<int> types;
|
|
||||||
types.append( SMESH::EDGE );
|
|
||||||
types.append( SMESH::FACE );
|
|
||||||
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, types );
|
|
||||||
}
|
|
||||||
myFilterDlg->Init( GetConstructorId() ? SMESH::FACE : SMESH::EDGE );
|
|
||||||
|
|
||||||
myFilterDlg->SetSelection();
|
|
||||||
myFilterDlg->SetMesh( myMesh );
|
|
||||||
myFilterDlg->SetSourceWg( LineEditElements );
|
|
||||||
|
|
||||||
myFilterDlg->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : isValid
|
|
||||||
// purpose :
|
|
||||||
//=================================================================================
|
|
||||||
bool SMESHGUI_RevolutionDlg::isValid()
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
bool ok = true;
|
|
||||||
ok = SpinBox_X->isValid( msg, true ) && ok;
|
|
||||||
ok = SpinBox_Y->isValid( msg, true ) && ok;
|
|
||||||
ok = SpinBox_Z->isValid( msg, true ) && ok;
|
|
||||||
ok = SpinBox_DX->isValid( msg, true ) && ok;
|
|
||||||
ok = SpinBox_DY->isValid( msg, true ) && ok;
|
|
||||||
ok = SpinBox_DZ->isValid( msg, true ) && ok;
|
|
||||||
ok = SpinBox_Angle->isValid( msg, true ) && ok;
|
|
||||||
ok = SpinBox_NbSteps->isValid( msg, true ) && ok;
|
|
||||||
ok = SpinBox_Tolerance->isValid( msg, true ) && ok;
|
|
||||||
|
|
||||||
if( !ok ) {
|
|
||||||
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
|
||||||
if ( !msg.isEmpty() )
|
|
||||||
str += "\n" + msg;
|
|
||||||
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
@ -41,26 +41,27 @@
|
|||||||
#include <SALOMEconfig.h>
|
#include <SALOMEconfig.h>
|
||||||
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
||||||
|
|
||||||
|
class LightApp_SelectionMgr;
|
||||||
|
class QAction;
|
||||||
class QButtonGroup;
|
class QButtonGroup;
|
||||||
|
class QCheckBox;
|
||||||
class QGroupBox;
|
class QGroupBox;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
|
class QMenu;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
class QRadioButton;
|
class QRadioButton;
|
||||||
class QCheckBox;
|
|
||||||
class SalomeApp_IntSpinBox;
|
|
||||||
class SMESHGUI_IdValidator;
|
|
||||||
class SMESHGUI_SpinBox;
|
|
||||||
class SMESHGUI;
|
|
||||||
class SMESHGUI_FilterDlg;
|
|
||||||
class SMESH_Actor;
|
|
||||||
class SVTK_Selector;
|
|
||||||
class LightApp_SelectionMgr;
|
|
||||||
class SMESH_LogicalFilter;
|
|
||||||
class SALOME_Actor;
|
class SALOME_Actor;
|
||||||
|
class SMESHGUI;
|
||||||
|
class SMESHGUI_3TypesSelector;
|
||||||
|
class SMESHGUI_FilterDlg;
|
||||||
|
class SMESHGUI_IdValidator;
|
||||||
class SMESHGUI_MeshEditPreview;
|
class SMESHGUI_MeshEditPreview;
|
||||||
class QMenu;
|
class SMESHGUI_SpinBox;
|
||||||
class QAction;
|
class SMESH_Actor;
|
||||||
|
class SMESH_LogicalFilter;
|
||||||
|
class SVTK_Selector;
|
||||||
|
class SalomeApp_IntSpinBox;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : SMESHGUI_RevolutionDlg
|
// class : SMESHGUI_RevolutionDlg
|
||||||
@ -85,27 +86,11 @@ private:
|
|||||||
|
|
||||||
bool isValid();
|
bool isValid();
|
||||||
|
|
||||||
SMESHGUI_IdValidator* myIdValidator;
|
|
||||||
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
||||||
int myNbOkElements; /* to check when elements are defined */
|
|
||||||
QString myElementsId;
|
|
||||||
QWidget* myEditCurrentArgument; /* Current argument */
|
|
||||||
SVTK_Selector* mySelector;
|
SVTK_Selector* mySelector;
|
||||||
Handle(SALOME_InteractiveObject) myIO;
|
QWidget* myEditCurrentArgument; /* Current argument */
|
||||||
|
|
||||||
SMESH::SMESH_IDSource_var mySelectedObject;
|
SMESHGUI_3TypesSelector* SelectorWdg;
|
||||||
|
|
||||||
bool myBusy;
|
|
||||||
SMESH::SMESH_Mesh_var myMesh;
|
|
||||||
SMESH_Actor* myActor;
|
|
||||||
SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
|
|
||||||
SMESHGUI_MeshEditPreview* mySimulation;
|
|
||||||
SALOME_Actor* myPreviewActor;
|
|
||||||
|
|
||||||
QGroupBox* ConstructorsBox;
|
|
||||||
QButtonGroup* GroupConstructors;
|
|
||||||
QRadioButton* RadioButton1;
|
|
||||||
QRadioButton* RadioButton2;
|
|
||||||
QGroupBox* GroupButtons;
|
QGroupBox* GroupButtons;
|
||||||
QPushButton* buttonOk;
|
QPushButton* buttonOk;
|
||||||
QPushButton* buttonCancel;
|
QPushButton* buttonCancel;
|
||||||
@ -113,10 +98,6 @@ private:
|
|||||||
QPushButton* buttonHelp;
|
QPushButton* buttonHelp;
|
||||||
QGroupBox* GroupArguments;
|
QGroupBox* GroupArguments;
|
||||||
QGroupBox* GroupAxis;
|
QGroupBox* GroupAxis;
|
||||||
QLabel* TextLabelElements;
|
|
||||||
QPushButton* SelectElementsButton;
|
|
||||||
QLineEdit* LineEditElements;
|
|
||||||
QCheckBox* CheckBoxMesh;
|
|
||||||
QCheckBox* MakeGroupsCheck;
|
QCheckBox* MakeGroupsCheck;
|
||||||
QGroupBox* GroupAngleBox;
|
QGroupBox* GroupAngleBox;
|
||||||
QButtonGroup* GroupAngle;
|
QButtonGroup* GroupAngle;
|
||||||
@ -153,17 +134,13 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
QString myIDs;
|
|
||||||
|
|
||||||
QPushButton* myFilterBtn;
|
|
||||||
SMESHGUI_FilterDlg* myFilterDlg;
|
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void onDisplaySimulation( bool );
|
virtual void onDisplaySimulation( bool );
|
||||||
virtual void reject();
|
virtual void reject();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ConstructorsClicked( int );
|
void CheckIsEnable();
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ClickOnHelp();
|
void ClickOnHelp();
|
||||||
@ -171,13 +148,9 @@ private slots:
|
|||||||
void SelectionIntoArgument();
|
void SelectionIntoArgument();
|
||||||
void DeactivateActiveDialog();
|
void DeactivateActiveDialog();
|
||||||
void ActivateThisDialog();
|
void ActivateThisDialog();
|
||||||
void onTextChange( const QString& );
|
|
||||||
void onAngleTextChange( const QString& );
|
void onAngleTextChange( const QString& );
|
||||||
void onSelectMesh( bool );
|
|
||||||
void onVectorChanged();
|
|
||||||
void onSelectVectorMenu( QAction* );
|
void onSelectVectorMenu( QAction* );
|
||||||
void onSelectVectorButton();
|
void onSelectVectorButton();
|
||||||
void setFilters();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SMESHGUI_REVOLUTIONDLG_H
|
#endif // SMESHGUI_REVOLUTIONDLG_H
|
||||||
|
@ -486,7 +486,7 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
|
||||||
SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
|
SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
|
||||||
myMeshes[0]->SetParameters( aParameters.join( ":" ).toLatin1().constData() );
|
myMeshes[0]->SetParameters( aParameters.join( ":" ).toLatin1().constData() );
|
||||||
aMeshEditor->Scale( src, aPoint, aScaleFact, false);
|
aMeshEditor->Scale( src, aPoint, aScaleFact, false);
|
||||||
}
|
}
|
||||||
@ -503,7 +503,7 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
|
||||||
SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
|
SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
|
||||||
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
|
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
|
||||||
groups = aMeshEditor->ScaleMakeGroups( src, aPoint, aScaleFact);
|
groups = aMeshEditor->ScaleMakeGroups( src, aPoint, aScaleFact);
|
||||||
}
|
}
|
||||||
@ -518,7 +518,7 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
|
||||||
SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
|
SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
|
||||||
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
|
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
|
||||||
aMeshEditor->Scale( src, aPoint, aScaleFact, true);
|
aMeshEditor->Scale( src, aPoint, aScaleFact, true);
|
||||||
}
|
}
|
||||||
@ -541,7 +541,7 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
else {
|
else {
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
|
||||||
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
|
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
|
||||||
SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
|
SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
|
||||||
mesh = aMeshEditor->ScaleMakeMesh( src, aPoint, aScaleFact, makeGroups,
|
mesh = aMeshEditor->ScaleMakeMesh( src, aPoint, aScaleFact, makeGroups,
|
||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
||||||
@ -1147,7 +1147,7 @@ void SMESHGUI_ScaleDlg::onDisplaySimulation( bool toDisplayPreview ) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer();
|
||||||
SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
|
SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
|
||||||
aMeshEditor->Scale( src, aPoint, aScaleFact, copy);
|
aMeshEditor->Scale( src, aPoint, aScaleFact, copy);
|
||||||
aMeshPreviewStruct << aMeshEditor->GetPreviewData();
|
aMeshPreviewStruct << aMeshEditor->GetPreviewData();
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ SMESHGUI_EXPORT
|
|||||||
|
|
||||||
|
|
||||||
// type to use instead of SMESH_IDSource_var for automatic UnRegister()
|
// type to use instead of SMESH_IDSource_var for automatic UnRegister()
|
||||||
typedef SALOME::GenericObj_wrap<SMESH_IDSource> SMESH_IDSource_wrap;
|
typedef SALOME::GenericObj_wrap<SMESH_IDSource> IDSource_wrap;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Class usefull to convert a string returned from a CORBA call
|
* \brief Class usefull to convert a string returned from a CORBA call
|
||||||
|
@ -286,7 +286,7 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_MESH_ORDER</source>
|
<source>MEN_MESH_ORDER</source>
|
||||||
<translation>Change submesh priority</translation>
|
<translation>Change sub-mesh priority</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_CREATE_GROUP</source>
|
<source>MEN_CREATE_GROUP</source>
|
||||||
@ -1287,7 +1287,7 @@ Please enter correct values and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ADD_SUBMESH</source>
|
<source>SMESH_ADD_SUBMESH</source>
|
||||||
<translation>SubMesh Construction</translation>
|
<translation>Sub-mesh Construction</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ADD_TETRAS</source>
|
<source>SMESH_ADD_TETRAS</source>
|
||||||
@ -1805,7 +1805,7 @@ add the exported data to its contents?</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_HYP_10</source>
|
<source>SMESH_HYP_10</source>
|
||||||
<translation>Hypothesis and submesh dimensions mismatch</translation>
|
<translation>Hypothesis and sub-mesh dimensions mismatch</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_HYP_11</source>
|
<source>SMESH_HYP_11</source>
|
||||||
@ -1830,7 +1830,7 @@ Check algorithm documentation for supported geometry</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_HYP_4</source>
|
<source>SMESH_HYP_4</source>
|
||||||
<translation>Submesh is ignored as there is another algorithm of upper dimension generating %1D elements</translation>
|
<translation>Sub-mesh is ignored as there is another algorithm of upper dimension generating %1D elements</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_HYP_5</source>
|
<source>SMESH_HYP_5</source>
|
||||||
@ -1853,20 +1853,20 @@ Check algorithm documentation for supported geometry</translation>
|
|||||||
<translation>Such dimention hypothesis is already assigned to the shape</translation>
|
<translation>Such dimention hypothesis is already assigned to the shape</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ID_DIAGONAL</source>
|
<source>SMESH_ID_EDGES</source>
|
||||||
<translation>Id Edges</translation>
|
<translation>Edge IDs</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ID_ELEMENTS</source>
|
<source>SMESH_ID_ELEMENTS</source>
|
||||||
<translation>Id Elements</translation>
|
<translation>Element IDs</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ID_FACES</source>
|
<source>SMESH_ID_FACES</source>
|
||||||
<translation>Id Faces</translation>
|
<translation>Face IDs</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ID_NODES</source>
|
<source>SMESH_ID_NODES</source>
|
||||||
<translation>Id Nodes</translation>
|
<translation>Node IDs</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_INCORRECT_INPUT</source>
|
<source>SMESH_INCORRECT_INPUT</source>
|
||||||
@ -1938,23 +1938,23 @@ Check algorithm documentation for supported geometry</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_MEN_SubMeshesOnCompound</source>
|
<source>SMESH_MEN_SubMeshesOnCompound</source>
|
||||||
<translation>SubMeshes On Compound</translation>
|
<translation>Sub-meshes On Compound</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_MEN_SubMeshesOnEdge</source>
|
<source>SMESH_MEN_SubMeshesOnEdge</source>
|
||||||
<translation>SubMeshes On Edge</translation>
|
<translation>Sub-meshes On Edge</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_MEN_SubMeshesOnFace</source>
|
<source>SMESH_MEN_SubMeshesOnFace</source>
|
||||||
<translation>SubMeshes On Face</translation>
|
<translation>Sub-meshes On Face</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_MEN_SubMeshesOnSolid</source>
|
<source>SMESH_MEN_SubMeshesOnSolid</source>
|
||||||
<translation>SubMeshes On Solid</translation>
|
<translation>Sub-meshes On Solid</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_MEN_SubMeshesOnVertex</source>
|
<source>SMESH_MEN_SubMeshesOnVertex</source>
|
||||||
<translation>SubMeshes On Vertex</translation>
|
<translation>Sub-meshes On Vertex</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_AUTOMATIC</source>
|
<source>SMESH_AUTOMATIC</source>
|
||||||
@ -2168,9 +2168,13 @@ Check algorithm documentation for supported geometry</translation>
|
|||||||
<source>SMESH_OBJECT_MESH</source>
|
<source>SMESH_OBJECT_MESH</source>
|
||||||
<translation>Mesh</translation>
|
<translation>Mesh</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_OBJECTS</source>
|
||||||
|
<translation>Objects</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_OBJECT_MESHorSUBMESH</source>
|
<source>SMESH_OBJECT_MESHorSUBMESH</source>
|
||||||
<translation>Mesh or SubMesh</translation>
|
<translation>Mesh or Sub-mesh</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_OPERATION_FAILED</source>
|
<source>SMESH_OPERATION_FAILED</source>
|
||||||
@ -2587,11 +2591,11 @@ Check algorithm documentation for supported geometry</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_SUBMESH</source>
|
<source>SMESH_SUBMESH</source>
|
||||||
<translation>SubMesh</translation>
|
<translation>Sub-mesh</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_SUBMESH_SELECTED</source>
|
<source>SMESH_SUBMESH_SELECTED</source>
|
||||||
<translation>%1 SubMeshes</translation>
|
<translation>%1 Sub-meshes</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_SYMMETRY</source>
|
<source>SMESH_SYMMETRY</source>
|
||||||
@ -2914,7 +2918,7 @@ Use Display Entity menu command to show them.
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_MESH_ORDER</source>
|
<source>STB_MESH_ORDER</source>
|
||||||
<translation>Change submesh priority</translation>
|
<translation>Change sub-mesh priority</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_CREATE_GROUP</source>
|
<source>STB_CREATE_GROUP</source>
|
||||||
@ -3574,7 +3578,7 @@ Use Display Entity menu command to show them.
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_MESH_ORDER</source>
|
<source>TOP_MESH_ORDER</source>
|
||||||
<translation>Change submesh priority</translation>
|
<translation>Change sub-mesh priority</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_CREATE_GROUP</source>
|
<source>TOP_CREATE_GROUP</source>
|
||||||
@ -4833,9 +4837,9 @@ Please, create VTK viewer and try again</translation>
|
|||||||
<name>SMESHGUI_PrecomputeOp</name>
|
<name>SMESHGUI_PrecomputeOp</name>
|
||||||
<message>
|
<message>
|
||||||
<source>CLEAR_SUBMESH_QUESTION</source>
|
<source>CLEAR_SUBMESH_QUESTION</source>
|
||||||
<translation>Temporary submeshes on the selected geometry
|
<translation>Temporary sub-meshes on the selected geometry
|
||||||
were created during preview operation.
|
were created during preview operation.
|
||||||
Do you want to remove all these submeshes?</translation>
|
Do you want to remove all these sub-meshes?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_WRN_NOTHING_PREVIEW</source>
|
<source>SMESH_WRN_NOTHING_PREVIEW</source>
|
||||||
@ -4843,8 +4847,8 @@ Do you want to remove all these submeshes?</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_REJECT_MESH_ORDER</source>
|
<source>SMESH_REJECT_MESH_ORDER</source>
|
||||||
<translation>The submesh priority changed during preview operation.
|
<translation>The sub-mesh priority changed during preview operation.
|
||||||
Do you want to restore original submesh priority?</translation>
|
Do you want to restore original sub-mesh priority?</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -4940,7 +4944,7 @@ Please verify validity of entered information</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MESH_OR_SUBMESH</source>
|
<source>MESH_OR_SUBMESH</source>
|
||||||
<translation>Mesh or SubMesh</translation>
|
<translation>Mesh or Sub-mesh</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>PATTERN</source>
|
<source>PATTERN</source>
|
||||||
@ -5104,7 +5108,7 @@ Please select a group and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_PATH_MESH</source>
|
<source>SMESH_PATH_MESH</source>
|
||||||
<translation>Mesh or submesh</translation>
|
<translation>Mesh or sub-mesh</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_PATH_SHAPE</source>
|
<source>SMESH_PATH_SHAPE</source>
|
||||||
@ -6034,12 +6038,12 @@ Please specify them and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>EDIT_SUBMESH_QUESTION</source>
|
<source>EDIT_SUBMESH_QUESTION</source>
|
||||||
<translation>A submesh on the selected geometry already exists.
|
<translation>A sub-mesh on the selected geometry already exists.
|
||||||
Do you want to edit this submesh?</translation>
|
Do you want to edit this sub-mesh?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SUBMESH_NOT_ALLOWED</source>
|
<source>SUBMESH_NOT_ALLOWED</source>
|
||||||
<translation>No sense in creating a submesh ignored by global algorithm "%1"</translation>
|
<translation>No sense in creating a sub-mesh ignored by global algorithm "%1"</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOMETRY_OBJECT_IS_NOT_DEFINED_MESH</source>
|
<source>GEOMETRY_OBJECT_IS_NOT_DEFINED_MESH</source>
|
||||||
@ -6108,7 +6112,7 @@ Please enter valid name and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>NAME_OF_SUBMESH_IS_EMPTY</source>
|
<source>NAME_OF_SUBMESH_IS_EMPTY</source>
|
||||||
<translation>Name of submesh is empty
|
<translation>Name of sub-mesh is empty
|
||||||
Please enter valid name and try again</translation>
|
Please enter valid name and try again</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@ -6415,8 +6419,8 @@ It is impossible to read point coordinates from file</translation>
|
|||||||
<translation>Preview</translation>
|
<translation>Preview</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>REVOLUTION_1D</source>
|
<source>REVOLUTION</source>
|
||||||
<translation>Revolution of 1D elements</translation>
|
<translation>Revolution</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>REVOLUTION_2D</source>
|
<source>REVOLUTION_2D</source>
|
||||||
@ -6650,14 +6654,14 @@ It is impossible to read point coordinates from file</translation>
|
|||||||
<name>SMESHGUI_MeshOrderDlg</name>
|
<name>SMESHGUI_MeshOrderDlg</name>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_MESHORDER_TITLE</source>
|
<source>SMESH_MESHORDER_TITLE</source>
|
||||||
<translation>Order of submesh in meshing process</translation>
|
<translation>Order of sub-mesh in meshing process</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SMESHGUI_MeshOrderOp</name>
|
<name>SMESHGUI_MeshOrderOp</name>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_NO_CONCURENT_MESH</source>
|
<source>SMESH_NO_CONCURENT_MESH</source>
|
||||||
<translation>No concurent submeshes detected</translation>
|
<translation>No concurent sub-meshes detected</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
@ -80,7 +80,7 @@ namespace SMESHUtils
|
|||||||
struct Deleter
|
struct Deleter
|
||||||
{
|
{
|
||||||
TOBJ* _obj;
|
TOBJ* _obj;
|
||||||
Deleter( TOBJ* obj ): _obj( obj ) {}
|
Deleter( TOBJ* obj = (TOBJ*)NULL ): _obj( obj ) {}
|
||||||
~Deleter() { delete _obj; _obj = 0; }
|
~Deleter() { delete _obj; _obj = 0; }
|
||||||
private:
|
private:
|
||||||
Deleter( const Deleter& );
|
Deleter( const Deleter& );
|
||||||
|
@ -384,6 +384,7 @@ namespace {
|
|||||||
"ExtrusionSweepObjectMakeGroups","ExtrusionSweepObject0D",
|
"ExtrusionSweepObjectMakeGroups","ExtrusionSweepObject0D",
|
||||||
"ExtrusionSweepObject1D","ExtrusionSweepObject1DMakeGroups",
|
"ExtrusionSweepObject1D","ExtrusionSweepObject1DMakeGroups",
|
||||||
"ExtrusionSweepObject2D","ExtrusionSweepObject2DMakeGroups",
|
"ExtrusionSweepObject2D","ExtrusionSweepObject2DMakeGroups",
|
||||||
|
"ExtrusionSweepObjects","RotationSweepObjects","ExtrusionAlongPathObjects",
|
||||||
"Translate","TranslateMakeGroups","TranslateMakeMesh",
|
"Translate","TranslateMakeGroups","TranslateMakeMesh",
|
||||||
"TranslateObject","TranslateObjectMakeGroups", "TranslateObjectMakeMesh",
|
"TranslateObject","TranslateObjectMakeGroups", "TranslateObjectMakeMesh",
|
||||||
"ExtrusionAlongPathX","ExtrusionAlongPathObjX","SplitHexahedraIntoPrisms"
|
"ExtrusionAlongPathX","ExtrusionAlongPathObjX","SplitHexahedraIntoPrisms"
|
||||||
@ -431,7 +432,8 @@ namespace {
|
|||||||
"ExportCGNS","ExportGMF",
|
"ExportCGNS","ExportGMF",
|
||||||
"Create0DElementsOnAllNodes","Reorient2D","QuadTo4Tri",
|
"Create0DElementsOnAllNodes","Reorient2D","QuadTo4Tri",
|
||||||
"ScaleMakeGroups","Scale","ScaleMakeMesh",
|
"ScaleMakeGroups","Scale","ScaleMakeMesh",
|
||||||
"FindCoincidentNodesOnPartBut","DoubleElements"
|
"FindCoincidentNodesOnPartBut","DoubleElements",
|
||||||
|
"ExtrusionSweepObjects","RotationSweepObjects","ExtrusionAlongPathObjects"
|
||||||
,"" }; // <- mark of the end
|
,"" }; // <- mark of the end
|
||||||
methodsAcceptingList.Insert( methodNames );
|
methodsAcceptingList.Insert( methodNames );
|
||||||
}
|
}
|
||||||
@ -2404,6 +2406,7 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
|
|||||||
"ExtrusionSweep","AdvancedExtrusion","ExtrusionSweepObject","ExtrusionSweepObject1D",
|
"ExtrusionSweep","AdvancedExtrusion","ExtrusionSweepObject","ExtrusionSweepObject1D",
|
||||||
"ExtrusionSweepObject2D","ExtrusionAlongPath","ExtrusionAlongPathObject",
|
"ExtrusionSweepObject2D","ExtrusionAlongPath","ExtrusionAlongPathObject",
|
||||||
"ExtrusionAlongPathX","ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
|
"ExtrusionAlongPathX","ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
|
||||||
|
"ExtrusionSweepObjects","RotationSweepObjects","ExtrusionAlongPathObjects",
|
||||||
"Mirror","MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
|
"Mirror","MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
|
||||||
"FindCoincidentNodes","MergeNodes","FindEqualElements",
|
"FindCoincidentNodes","MergeNodes","FindEqualElements",
|
||||||
"MergeElements","MergeEqualElements","SewFreeBorders","SewConformFreeBorders",
|
"MergeElements","MergeEqualElements","SewFreeBorders","SewConformFreeBorders",
|
||||||
|
@ -2413,6 +2413,7 @@ GetElementsId( SMESH_Mesh_ptr theMesh )
|
|||||||
{
|
{
|
||||||
SMESH::long_array_var anArray = new SMESH::long_array;
|
SMESH::long_array_var anArray = new SMESH::long_array;
|
||||||
if(!CORBA::is_nil(theMesh) && myPredicate){
|
if(!CORBA::is_nil(theMesh) && myPredicate){
|
||||||
|
theMesh->Load();
|
||||||
Controls::Filter::TIdSequence aSequence;
|
Controls::Filter::TIdSequence aSequence;
|
||||||
GetElementsId(myPredicate,theMesh,aSequence);
|
GetElementsId(myPredicate,theMesh,aSequence);
|
||||||
long i = 0, iEnd = aSequence.size();
|
long i = 0, iEnd = aSequence.size();
|
||||||
|
@ -308,58 +308,25 @@ public:
|
|||||||
void RenumberNodes() throw (SALOME::SALOME_Exception);
|
void RenumberNodes() throw (SALOME::SALOME_Exception);
|
||||||
void RenumberElements() throw (SALOME::SALOME_Exception);
|
void RenumberElements() throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
void RotationSweep(const SMESH::long_array & IDsOfElements,
|
SMESH::ListOfGroups* RotationSweepObjects(const SMESH::ListOfIDSources & nodes,
|
||||||
|
const SMESH::ListOfIDSources & edges,
|
||||||
|
const SMESH::ListOfIDSources & faces,
|
||||||
const SMESH::AxisStruct & Axis,
|
const SMESH::AxisStruct & Axis,
|
||||||
CORBA::Double AngleInRadians,
|
CORBA::Double AngleInRadians,
|
||||||
CORBA::Long NbOfSteps,
|
CORBA::Long NbOfSteps,
|
||||||
CORBA::Double Tolerance)
|
CORBA::Double Tolerance,
|
||||||
throw (SALOME::SALOME_Exception);
|
CORBA::Boolean toMakeGroups)
|
||||||
void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
|
|
||||||
const SMESH::AxisStruct & Axis,
|
|
||||||
CORBA::Double AngleInRadians,
|
|
||||||
CORBA::Long NbOfSteps,
|
|
||||||
CORBA::Double Tolerance)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
|
|
||||||
const SMESH::AxisStruct & Axis,
|
|
||||||
CORBA::Double AngleInRadians,
|
|
||||||
CORBA::Long NbOfSteps,
|
|
||||||
CORBA::Double Tolerance)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
|
|
||||||
const SMESH::AxisStruct & Axis,
|
|
||||||
CORBA::Double AngleInRadians,
|
|
||||||
CORBA::Long NbOfSteps,
|
|
||||||
CORBA::Double Tolerance)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
|
SMESH::ListOfGroups* ExtrusionSweepObjects(const SMESH::ListOfIDSources & nodes,
|
||||||
const SMESH::DirStruct & StepVector,
|
const SMESH::ListOfIDSources & edges,
|
||||||
CORBA::Long NbOfSteps)
|
const SMESH::ListOfIDSources & faces,
|
||||||
throw (SALOME::SALOME_Exception);
|
const SMESH::DirStruct & stepVector,
|
||||||
void ExtrusionSweep0D(const SMESH::long_array & IDsOfElements,
|
CORBA::Long nbOfSteps,
|
||||||
const SMESH::DirStruct & StepVector,
|
CORBA::Boolean toMakeGroups)
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
|
SMESH::ListOfGroups* ExtrusionByNormal(const SMESH::ListOfIDSources& objects,
|
||||||
const SMESH::DirStruct & StepVector,
|
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
void ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObject,
|
|
||||||
const SMESH::DirStruct & StepVector,
|
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
|
|
||||||
const SMESH::DirStruct & StepVector,
|
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
|
|
||||||
const SMESH::DirStruct & StepVector,
|
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionByNormal(SMESH::SMESH_IDSource_ptr object,
|
|
||||||
CORBA::Double stepSize,
|
CORBA::Double stepSize,
|
||||||
CORBA::Long nbOfSteps,
|
CORBA::Long nbOfSteps,
|
||||||
CORBA::Boolean byAverageNormal,
|
CORBA::Boolean byAverageNormal,
|
||||||
@ -367,53 +334,28 @@ public:
|
|||||||
CORBA::Boolean makeGroups,
|
CORBA::Boolean makeGroups,
|
||||||
CORBA::Short dim)
|
CORBA::Short dim)
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
|
SMESH::ListOfGroups* AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
|
||||||
const SMESH::DirStruct & theStepVector,
|
const SMESH::DirStruct & theStepVector,
|
||||||
CORBA::Long theNbOfSteps,
|
CORBA::Long theNbOfSteps,
|
||||||
CORBA::Long theExtrFlags,
|
CORBA::Long theExtrFlags,
|
||||||
CORBA::Double theSewTolerance)
|
CORBA::Double theSewTolerance,
|
||||||
|
CORBA::Boolean theMakeGroups)
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error
|
SMESH::ListOfGroups*
|
||||||
ExtrusionAlongPath(const SMESH::long_array & IDsOfElements,
|
ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & nodes,
|
||||||
SMESH::SMESH_Mesh_ptr PathMesh,
|
const SMESH::ListOfIDSources & edges,
|
||||||
|
const SMESH::ListOfIDSources & faces,
|
||||||
|
SMESH::SMESH_IDSource_ptr PathMesh,
|
||||||
GEOM::GEOM_Object_ptr PathShape,
|
GEOM::GEOM_Object_ptr PathShape,
|
||||||
CORBA::Long NodeStart,
|
CORBA::Long NodeStart,
|
||||||
CORBA::Boolean HasAngles,
|
CORBA::Boolean HasAngles,
|
||||||
const SMESH::double_array & Angles,
|
const SMESH::double_array & Angles,
|
||||||
|
CORBA::Boolean LinearVariation,
|
||||||
CORBA::Boolean HasRefPoint,
|
CORBA::Boolean HasRefPoint,
|
||||||
const SMESH::PointStruct & RefPoint)
|
const SMESH::PointStruct & RefPoint,
|
||||||
throw (SALOME::SALOME_Exception);
|
bool MakeGroups,
|
||||||
|
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error
|
|
||||||
ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
|
|
||||||
SMESH::SMESH_Mesh_ptr PathMesh,
|
|
||||||
GEOM::GEOM_Object_ptr PathShape,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array & Angles,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct & RefPoint)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error
|
|
||||||
ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr theObject,
|
|
||||||
SMESH::SMESH_Mesh_ptr PathMesh,
|
|
||||||
GEOM::GEOM_Object_ptr PathShape,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array & Angles,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct & RefPoint)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error
|
|
||||||
ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr theObject,
|
|
||||||
SMESH::SMESH_Mesh_ptr PathMesh,
|
|
||||||
GEOM::GEOM_Object_ptr PathShape,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array & Angles,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct & RefPoint)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr PathMesh,
|
SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr PathMesh,
|
||||||
@ -449,128 +391,6 @@ public:
|
|||||||
CORBA::Boolean Copy)
|
CORBA::Boolean Copy)
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
|
|
||||||
const SMESH::AxisStruct& Axix,
|
|
||||||
CORBA::Double AngleInRadians,
|
|
||||||
CORBA::Long NbOfSteps,
|
|
||||||
CORBA::Double Tolerance)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
const SMESH::AxisStruct& Axix,
|
|
||||||
CORBA::Double AngleInRadians,
|
|
||||||
CORBA::Long NbOfSteps,
|
|
||||||
CORBA::Double Tolerance)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
const SMESH::AxisStruct& Axix,
|
|
||||||
CORBA::Double AngleInRadians,
|
|
||||||
CORBA::Long NbOfSteps,
|
|
||||||
CORBA::Double Tolerance)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
const SMESH::AxisStruct& Axix,
|
|
||||||
CORBA::Double AngleInRadians,
|
|
||||||
CORBA::Long NbOfSteps,
|
|
||||||
CORBA::Double Tolerance)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
|
|
||||||
const SMESH::DirStruct& StepVector,
|
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionSweepMakeGroups0D(const SMESH::long_array& IDsOfElements,
|
|
||||||
const SMESH::DirStruct& StepVector,
|
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
|
|
||||||
const SMESH::DirStruct& StepVector,
|
|
||||||
CORBA::Long NbOfSteps,
|
|
||||||
CORBA::Long ExtrFlags,
|
|
||||||
CORBA::Double SewTolerance)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
const SMESH::DirStruct& StepVector,
|
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
const SMESH::DirStruct& StepVector,
|
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
const SMESH::DirStruct& StepVector,
|
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
const SMESH::DirStruct& StepVector,
|
|
||||||
CORBA::Long NbOfSteps)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array& IDsOfElements,
|
|
||||||
SMESH::SMESH_Mesh_ptr PathMesh,
|
|
||||||
GEOM::GEOM_Object_ptr PathShape,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array& Angles,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct& RefPoint,
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
SMESH::SMESH_Mesh_ptr PathMesh,
|
|
||||||
GEOM::GEOM_Object_ptr PathShape,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array& Angles,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct& RefPoint,
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
SMESH::SMESH_Mesh_ptr PathMesh,
|
|
||||||
GEOM::GEOM_Object_ptr PathShape,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array& Angles,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct& RefPoint,
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
SMESH::SMESH_Mesh_ptr PathMesh,
|
|
||||||
GEOM::GEOM_Object_ptr PathShape,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array& Angles,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct& RefPoint,
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
// skl 04.06.2009
|
|
||||||
SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr Object,
|
|
||||||
SMESH::SMESH_IDSource_ptr Path,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array& Angles,
|
|
||||||
CORBA::Boolean LinearVariation,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct& RefPoint,
|
|
||||||
CORBA::Boolean MakeGroups,
|
|
||||||
SMESH::ElementType ElemType,
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array& IDsOfElements,
|
|
||||||
SMESH::SMESH_IDSource_ptr Path,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array& Angles,
|
|
||||||
CORBA::Boolean LinearVariation,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct& RefPoint,
|
|
||||||
CORBA::Boolean MakeGroups,
|
|
||||||
SMESH::ElementType ElemType,
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
|
|
||||||
SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
|
SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
|
||||||
const SMESH::AxisStruct& Mirror,
|
const SMESH::AxisStruct& Mirror,
|
||||||
SMESH::SMESH_MeshEditor::MirrorType MirrorType)
|
SMESH::SMESH_MeshEditor::MirrorType MirrorType)
|
||||||
@ -1026,49 +846,6 @@ private: //!< private methods
|
|||||||
SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs)
|
SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs)
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
|
|
||||||
const SMESH::AxisStruct & Axis,
|
|
||||||
CORBA::Double AngleInRadians,
|
|
||||||
CORBA::Long NbOfSteps,
|
|
||||||
CORBA::Double Tolerance,
|
|
||||||
const bool MakeGroups,
|
|
||||||
const SMDSAbs_ElementType ElementType=SMDSAbs_All)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
|
|
||||||
MeshEditor_I::ExtrusionParams& params,
|
|
||||||
const SMDSAbs_ElementType ElementType=SMDSAbs_All)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
|
|
||||||
const SMESH::DirStruct & theStepVector,
|
|
||||||
CORBA::Long theNbOfSteps,
|
|
||||||
CORBA::Long theExtrFlags,
|
|
||||||
CORBA::Double theSewTolerance,
|
|
||||||
const bool MakeGroups)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array & IDsOfElements,
|
|
||||||
SMESH::SMESH_Mesh_ptr PathMesh,
|
|
||||||
GEOM::GEOM_Object_ptr PathShape,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array & Angles,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct & RefPoint,
|
|
||||||
const bool MakeGroups,
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
|
|
||||||
const SMDSAbs_ElementType ElementType=SMDSAbs_All)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array & IDsOfElements,
|
|
||||||
SMESH::SMESH_IDSource_ptr Path,
|
|
||||||
CORBA::Long NodeStart,
|
|
||||||
CORBA::Boolean HasAngles,
|
|
||||||
const SMESH::double_array& Angles,
|
|
||||||
CORBA::Boolean LinearVariation,
|
|
||||||
CORBA::Boolean HasRefPoint,
|
|
||||||
const SMESH::PointStruct& RefPoint,
|
|
||||||
bool MakeGroups,
|
|
||||||
const SMDSAbs_ElementType ElementType,
|
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error & theError)
|
|
||||||
throw (SALOME::SALOME_Exception);
|
|
||||||
SMESH::ListOfGroups* mirror(TIDSortedElemSet & IDsOfElements,
|
SMESH::ListOfGroups* mirror(TIDSortedElemSet & IDsOfElements,
|
||||||
const SMESH::AxisStruct & Axis,
|
const SMESH::AxisStruct & Axis,
|
||||||
SMESH::SMESH_MeshEditor::MirrorType MirrorType,
|
SMESH::SMESH_MeshEditor::MirrorType MirrorType,
|
||||||
@ -1112,7 +889,18 @@ private: //!< private methods
|
|||||||
|
|
||||||
void prepareIdSource(SMESH::SMESH_IDSource_ptr theObject);
|
void prepareIdSource(SMESH::SMESH_IDSource_ptr theObject);
|
||||||
|
|
||||||
private: //!< fields
|
|
||||||
|
enum IDSource_Error { IDSource_OK, IDSource_INVALID, IDSource_EMPTY };
|
||||||
|
|
||||||
|
bool idSourceToSet(SMESH::SMESH_IDSource_ptr theIDSource,
|
||||||
|
const SMESHDS_Mesh* theMeshDS,
|
||||||
|
TIDSortedElemSet& theElemSet,
|
||||||
|
const SMDSAbs_ElementType theType,
|
||||||
|
const bool emptyIfIsMesh = false,
|
||||||
|
IDSource_Error* error = 0);
|
||||||
|
|
||||||
|
|
||||||
|
private: //!< fields
|
||||||
|
|
||||||
SMESH_Mesh_i* myMesh_i;
|
SMESH_Mesh_i* myMesh_i;
|
||||||
SMESH_Mesh * myMesh;
|
SMESH_Mesh * myMesh;
|
||||||
|
@ -1077,14 +1077,35 @@ void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup
|
|||||||
if ( _preMeshInfo )
|
if ( _preMeshInfo )
|
||||||
_preMeshInfo->FullLoadFromFile();
|
_preMeshInfo->FullLoadFromFile();
|
||||||
|
|
||||||
if ( theGroup->_is_nil() )
|
if ( theGroup->_is_nil() || theGroup->IsEmpty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
vector<int> nodeIds; // to remove nodes becoming free
|
||||||
|
CORBA::Long elemID = theGroup->GetID( 1 );
|
||||||
|
int nbElemNodes = GetElemNbNodes( elemID );
|
||||||
|
if ( nbElemNodes > 0 )
|
||||||
|
nodeIds.reserve( theGroup->Size() * nbElemNodes );
|
||||||
|
|
||||||
// Remove contents
|
// Remove contents
|
||||||
SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( theGroup );
|
SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( theGroup );
|
||||||
SMDS_ElemIteratorPtr elemIt = GetElements( idSrc, theGroup->GetType() );
|
SMDS_ElemIteratorPtr elemIt = GetElements( idSrc, theGroup->GetType() );
|
||||||
while ( elemIt->more() )
|
while ( elemIt->more() )
|
||||||
|
{
|
||||||
|
const SMDS_MeshElement* e = elemIt->next();
|
||||||
|
|
||||||
|
SMDS_ElemIteratorPtr nIt = e->nodesIterator();
|
||||||
|
while ( nIt->more() )
|
||||||
|
nodeIds.push_back( nIt->next()->GetID() );
|
||||||
|
|
||||||
_impl->GetMeshDS()->RemoveElement( elemIt->next() );
|
_impl->GetMeshDS()->RemoveElement( elemIt->next() );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove free nodes
|
||||||
|
if ( theGroup->GetType() != SMESH::NODE )
|
||||||
|
for ( size_t i = 0 ; i < nodeIds.size(); ++i )
|
||||||
|
if ( const SMDS_MeshNode* n = _impl->GetMeshDS()->FindNode( nodeIds[i] ))
|
||||||
|
if ( n->NbInverseElements() == 0 )
|
||||||
|
_impl->GetMeshDS()->RemoveFreeNode( n, /*sm=*/0 );
|
||||||
|
|
||||||
TPythonDump pyDump; // Supress dump from RemoveGroup()
|
TPythonDump pyDump; // Supress dump from RemoveGroup()
|
||||||
|
|
||||||
@ -6022,6 +6043,8 @@ SMESH_MeshPartDS::SMESH_MeshPartDS(SMESH::SMESH_IDSource_ptr meshPart):
|
|||||||
}
|
}
|
||||||
myInfo = tmpInfo;
|
myInfo = tmpInfo;
|
||||||
|
|
||||||
|
ShapeToMesh( _meshDS->ShapeToMesh() );
|
||||||
|
|
||||||
_meshDS = 0; // to enforce iteration on _elements and _nodes
|
_meshDS = 0; // to enforce iteration on _elements and _nodes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,6 +161,9 @@ SMESH.PointStruct.__init__ = __initPointStruct
|
|||||||
# Substitute AxisStruct.__init__() to create SMESH.AxisStruct using notebook variables.
|
# Substitute AxisStruct.__init__() to create SMESH.AxisStruct using notebook variables.
|
||||||
# Parameters are stored in AxisStruct.parameters attribute
|
# Parameters are stored in AxisStruct.parameters attribute
|
||||||
def __initAxisStruct(ax,*args):
|
def __initAxisStruct(ax,*args):
|
||||||
|
if len( args ) != 6:
|
||||||
|
raise RuntimeError,\
|
||||||
|
"Bad nb args (%s) passed in SMESH.AxisStruct(x,y,z,dx,dy,dz)"%(len( args ))
|
||||||
ax.x, ax.y, ax.z, ax.vx, ax.vy, ax.vz, ax.parameters,hasVars = ParseParameters(*args)
|
ax.x, ax.y, ax.z, ax.vx, ax.vy, ax.vz, ax.parameters,hasVars = ParseParameters(*args)
|
||||||
pass
|
pass
|
||||||
SMESH.AxisStruct.__init__ = __initAxisStruct
|
SMESH.AxisStruct.__init__ = __initAxisStruct
|
||||||
@ -3515,6 +3518,56 @@ class Mesh:
|
|||||||
def RenumberElements(self):
|
def RenumberElements(self):
|
||||||
self.editor.RenumberElements()
|
self.editor.RenumberElements()
|
||||||
|
|
||||||
|
## Private method converting \a arg into a list of SMESH_IdSource's
|
||||||
|
def _getIdSourceList(self, arg, idType, unRegister):
|
||||||
|
if arg and isinstance( arg, list ):
|
||||||
|
if isinstance( arg[0], int ):
|
||||||
|
arg = self.GetIDSource( arg, idType )
|
||||||
|
unRegister.set( arg )
|
||||||
|
elif isinstance( arg[0], Mesh ):
|
||||||
|
arg[0] = arg[0].GetMesh()
|
||||||
|
elif isinstance( arg, Mesh ):
|
||||||
|
arg = arg.GetMesh()
|
||||||
|
if arg and isinstance( arg, SMESH._objref_SMESH_IDSource ):
|
||||||
|
arg = [arg]
|
||||||
|
return arg
|
||||||
|
|
||||||
|
## Generates new elements by rotation of the given elements and nodes around the axis
|
||||||
|
# @param nodes - nodes to revolve: a list including ids, groups, sub-meshes or a mesh
|
||||||
|
# @param edges - edges to revolve: a list including ids, groups, sub-meshes or a mesh
|
||||||
|
# @param faces - faces to revolve: a list including ids, groups, sub-meshes or a mesh
|
||||||
|
# @param Axis the axis of rotation: AxisStruct, line (geom object) or [x,y,z,dx,dy,dz]
|
||||||
|
# @param AngleInRadians the angle of Rotation (in radians) or a name of variable
|
||||||
|
# which defines angle in degrees
|
||||||
|
# @param NbOfSteps the number of steps
|
||||||
|
# @param Tolerance tolerance
|
||||||
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
|
# @param TotalAngle gives meaning of AngleInRadians: if True then it is an angular size
|
||||||
|
# of all steps, else - size of each step
|
||||||
|
# @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
||||||
|
# @ingroup l2_modif_extrurev
|
||||||
|
def RotationSweepObjects(self, nodes, edges, faces, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
||||||
|
MakeGroups=False, TotalAngle=False):
|
||||||
|
unRegister = genObjUnRegister()
|
||||||
|
nodes = self._getIdSourceList( nodes, SMESH.NODE, unRegister )
|
||||||
|
edges = self._getIdSourceList( edges, SMESH.EDGE, unRegister )
|
||||||
|
faces = self._getIdSourceList( faces, SMESH.FACE, unRegister )
|
||||||
|
|
||||||
|
if isinstance( Axis, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
|
Axis = self.smeshpyD.GetDirStruct( Axis )
|
||||||
|
if isinstance( Axis, list ):
|
||||||
|
Axis = SMESH.AxisStruct( *Axis )
|
||||||
|
|
||||||
|
AngleInRadians,AngleParameters,hasVars = ParseAngles(AngleInRadians)
|
||||||
|
NbOfSteps,Tolerance,Parameters,hasVars = ParseParameters(NbOfSteps,Tolerance)
|
||||||
|
Parameters = Axis.parameters + var_separator + AngleParameters + var_separator + Parameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
|
if TotalAngle and NbOfSteps:
|
||||||
|
AngleInRadians /= NbOfSteps
|
||||||
|
return self.editor.RotationSweepObjects( nodes, edges, faces,
|
||||||
|
Axis, AngleInRadians,
|
||||||
|
NbOfSteps, Tolerance, MakeGroups)
|
||||||
|
|
||||||
## Generates new elements by rotation of the elements around the axis
|
## Generates new elements by rotation of the elements around the axis
|
||||||
# @param IDsOfElements the list of ids of elements to sweep
|
# @param IDsOfElements the list of ids of elements to sweep
|
||||||
# @param Axis the axis of rotation, AxisStruct or line(geom object)
|
# @param Axis the axis of rotation, AxisStruct or line(geom object)
|
||||||
@ -3528,9 +3581,15 @@ class Mesh:
|
|||||||
# @ingroup l2_modif_extrurev
|
# @ingroup l2_modif_extrurev
|
||||||
def RotationSweep(self, IDsOfElements, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
def RotationSweep(self, IDsOfElements, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
||||||
MakeGroups=False, TotalAngle=False):
|
MakeGroups=False, TotalAngle=False):
|
||||||
|
unRegister = genObjUnRegister()
|
||||||
if IDsOfElements == []:
|
if IDsOfElements == []:
|
||||||
IDsOfElements = self.GetElementsId()
|
IDsOfElements = self.mesh
|
||||||
if ( isinstance( Axis, geomBuilder.GEOM._objref_GEOM_Object)):
|
if IDsOfElements and \
|
||||||
|
isinstance( IDsOfElements, list ) and \
|
||||||
|
isinstance( IDsOfElements[0], int ):
|
||||||
|
IDsOfElements = self.GetIDSource( IDsOfElements, SMESH.ALL )
|
||||||
|
unRegister.set( IDsOfElements )
|
||||||
|
if isinstance( Axis, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
||||||
AngleInRadians,AngleParameters,hasVars = ParseAngles(AngleInRadians)
|
AngleInRadians,AngleParameters,hasVars = ParseAngles(AngleInRadians)
|
||||||
NbOfSteps,Tolerance,Parameters,hasVars = ParseParameters(NbOfSteps,Tolerance)
|
NbOfSteps,Tolerance,Parameters,hasVars = ParseParameters(NbOfSteps,Tolerance)
|
||||||
@ -3538,11 +3597,8 @@ class Mesh:
|
|||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if TotalAngle and NbOfSteps:
|
if TotalAngle and NbOfSteps:
|
||||||
AngleInRadians /= NbOfSteps
|
AngleInRadians /= NbOfSteps
|
||||||
if MakeGroups:
|
return self.editor.RotationSweepObjects([],[IDsOfElements],[IDsOfElements], Axis,
|
||||||
return self.editor.RotationSweepMakeGroups(IDsOfElements, Axis,
|
AngleInRadians, NbOfSteps, Tolerance, MakeGroups)
|
||||||
AngleInRadians, NbOfSteps, Tolerance)
|
|
||||||
self.editor.RotationSweep(IDsOfElements, Axis, AngleInRadians, NbOfSteps, Tolerance)
|
|
||||||
return []
|
|
||||||
|
|
||||||
## Generates new elements by rotation of the elements of object around the axis
|
## Generates new elements by rotation of the elements of object around the axis
|
||||||
# @param theObject object which elements should be sweeped.
|
# @param theObject object which elements should be sweeped.
|
||||||
@ -3558,9 +3614,9 @@ class Mesh:
|
|||||||
# @ingroup l2_modif_extrurev
|
# @ingroup l2_modif_extrurev
|
||||||
def RotationSweepObject(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
def RotationSweepObject(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
||||||
MakeGroups=False, TotalAngle=False):
|
MakeGroups=False, TotalAngle=False):
|
||||||
if ( isinstance( theObject, Mesh )):
|
if isinstance( theObject, Mesh ):
|
||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( Axis, geomBuilder.GEOM._objref_GEOM_Object)):
|
if isinstance( Axis, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
||||||
AngleInRadians,AngleParameters,hasVars = ParseAngles(AngleInRadians)
|
AngleInRadians,AngleParameters,hasVars = ParseAngles(AngleInRadians)
|
||||||
NbOfSteps,Tolerance,Parameters,hasVars = ParseParameters(NbOfSteps,Tolerance)
|
NbOfSteps,Tolerance,Parameters,hasVars = ParseParameters(NbOfSteps,Tolerance)
|
||||||
@ -3568,11 +3624,8 @@ class Mesh:
|
|||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if TotalAngle and NbOfSteps:
|
if TotalAngle and NbOfSteps:
|
||||||
AngleInRadians /= NbOfSteps
|
AngleInRadians /= NbOfSteps
|
||||||
if MakeGroups:
|
return self.editor.RotationSweepObjects([],[theObject],[theObject], Axis,
|
||||||
return self.editor.RotationSweepObjectMakeGroups(theObject, Axis, AngleInRadians,
|
AngleInRadians, NbOfSteps, Tolerance )
|
||||||
NbOfSteps, Tolerance)
|
|
||||||
self.editor.RotationSweepObject(theObject, Axis, AngleInRadians, NbOfSteps, Tolerance)
|
|
||||||
return []
|
|
||||||
|
|
||||||
## Generates new elements by rotation of the elements of object around the axis
|
## Generates new elements by rotation of the elements of object around the axis
|
||||||
# @param theObject object which elements should be sweeped.
|
# @param theObject object which elements should be sweeped.
|
||||||
@ -3588,9 +3641,9 @@ class Mesh:
|
|||||||
# @ingroup l2_modif_extrurev
|
# @ingroup l2_modif_extrurev
|
||||||
def RotationSweepObject1D(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
def RotationSweepObject1D(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
||||||
MakeGroups=False, TotalAngle=False):
|
MakeGroups=False, TotalAngle=False):
|
||||||
if ( isinstance( theObject, Mesh )):
|
if isinstance( theObject, Mesh ):
|
||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( Axis, geomBuilder.GEOM._objref_GEOM_Object)):
|
if isinstance( Axis, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
||||||
AngleInRadians,AngleParameters,hasVars = ParseAngles(AngleInRadians)
|
AngleInRadians,AngleParameters,hasVars = ParseAngles(AngleInRadians)
|
||||||
NbOfSteps,Tolerance,Parameters,hasVars = ParseParameters(NbOfSteps,Tolerance)
|
NbOfSteps,Tolerance,Parameters,hasVars = ParseParameters(NbOfSteps,Tolerance)
|
||||||
@ -3598,11 +3651,8 @@ class Mesh:
|
|||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if TotalAngle and NbOfSteps:
|
if TotalAngle and NbOfSteps:
|
||||||
AngleInRadians /= NbOfSteps
|
AngleInRadians /= NbOfSteps
|
||||||
if MakeGroups:
|
return self.editor.RotationSweepObjects([],[theObject],[], Axis,
|
||||||
return self.editor.RotationSweepObject1DMakeGroups(theObject, Axis, AngleInRadians,
|
AngleInRadians, NbOfSteps, Tolerance)
|
||||||
NbOfSteps, Tolerance)
|
|
||||||
self.editor.RotationSweepObject1D(theObject, Axis, AngleInRadians, NbOfSteps, Tolerance)
|
|
||||||
return []
|
|
||||||
|
|
||||||
## Generates new elements by rotation of the elements of object around the axis
|
## Generates new elements by rotation of the elements of object around the axis
|
||||||
# @param theObject object which elements should be sweeped.
|
# @param theObject object which elements should be sweeped.
|
||||||
@ -3618,9 +3668,9 @@ class Mesh:
|
|||||||
# @ingroup l2_modif_extrurev
|
# @ingroup l2_modif_extrurev
|
||||||
def RotationSweepObject2D(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
def RotationSweepObject2D(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
|
||||||
MakeGroups=False, TotalAngle=False):
|
MakeGroups=False, TotalAngle=False):
|
||||||
if ( isinstance( theObject, Mesh )):
|
if isinstance( theObject, Mesh ):
|
||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( Axis, geomBuilder.GEOM._objref_GEOM_Object)):
|
if isinstance( Axis, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
Axis = self.smeshpyD.GetAxisStruct(Axis)
|
||||||
AngleInRadians,AngleParameters,hasVars = ParseAngles(AngleInRadians)
|
AngleInRadians,AngleParameters,hasVars = ParseAngles(AngleInRadians)
|
||||||
NbOfSteps,Tolerance,Parameters,hasVars = ParseParameters(NbOfSteps,Tolerance)
|
NbOfSteps,Tolerance,Parameters,hasVars = ParseParameters(NbOfSteps,Tolerance)
|
||||||
@ -3628,11 +3678,37 @@ class Mesh:
|
|||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if TotalAngle and NbOfSteps:
|
if TotalAngle and NbOfSteps:
|
||||||
AngleInRadians /= NbOfSteps
|
AngleInRadians /= NbOfSteps
|
||||||
if MakeGroups:
|
return self.editor.RotationSweepObjects([],[],[theObject], Axis, AngleInRadians,
|
||||||
return self.editor.RotationSweepObject2DMakeGroups(theObject, Axis, AngleInRadians,
|
|
||||||
NbOfSteps, Tolerance)
|
NbOfSteps, Tolerance)
|
||||||
self.editor.RotationSweepObject2D(theObject, Axis, AngleInRadians, NbOfSteps, Tolerance)
|
|
||||||
return []
|
## Generates new elements by extrusion of the given elements and nodes
|
||||||
|
# @param nodes - nodes to extrude: a list including ids, groups, sub-meshes or a mesh
|
||||||
|
# @param edges - edges to extrude: a list including ids, groups, sub-meshes or a mesh
|
||||||
|
# @param faces - faces to extrude: a list including ids, groups, sub-meshes or a mesh
|
||||||
|
# @param StepVector vector or DirStruct or 3 vector components, defining
|
||||||
|
# the direction and value of extrusion for one step (the total extrusion
|
||||||
|
# length will be NbOfSteps * ||StepVector||)
|
||||||
|
# @param NbOfSteps the number of steps
|
||||||
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
|
# @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
||||||
|
# @ingroup l2_modif_extrurev
|
||||||
|
def ExtrusionSweepObjects(self, nodes, edges, faces, StepVector, NbOfSteps, MakeGroups=False):
|
||||||
|
unRegister = genObjUnRegister()
|
||||||
|
nodes = self._getIdSourceList( nodes, SMESH.NODE, unRegister )
|
||||||
|
edges = self._getIdSourceList( edges, SMESH.EDGE, unRegister )
|
||||||
|
faces = self._getIdSourceList( faces, SMESH.FACE, unRegister )
|
||||||
|
|
||||||
|
if isinstance( StepVector, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
|
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
||||||
|
if isinstance( StepVector, list ):
|
||||||
|
StepVector = self.smeshpyD.MakeDirStruct(*StepVector)
|
||||||
|
|
||||||
|
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
||||||
|
Parameters = StepVector.PS.parameters + var_separator + Parameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
|
|
||||||
|
return self.editor.ExtrusionSweepObjects( nodes, edges, faces, StepVector, NbOfSteps, MakeGroups)
|
||||||
|
|
||||||
|
|
||||||
## Generates new elements by extrusion of the elements with given ids
|
## Generates new elements by extrusion of the elements with given ids
|
||||||
# @param IDsOfElements the list of elements ids for extrusion
|
# @param IDsOfElements the list of elements ids for extrusion
|
||||||
@ -3646,7 +3722,13 @@ class Mesh:
|
|||||||
# @ingroup l2_modif_extrurev
|
# @ingroup l2_modif_extrurev
|
||||||
def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps, MakeGroups=False, IsNodes = False):
|
def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps, MakeGroups=False, IsNodes = False):
|
||||||
if IDsOfElements == []:
|
if IDsOfElements == []:
|
||||||
IDsOfElements = self.GetElementsId()
|
IDsOfElements = self.mesh
|
||||||
|
unRegister = genObjUnRegister()
|
||||||
|
if IDsOfElements and \
|
||||||
|
isinstance( IDsOfElements, list ) and \
|
||||||
|
isinstance( IDsOfElements[0], int ):
|
||||||
|
IDsOfElements = self.GetIDSource( IDsOfElements, SMESH.ALL )
|
||||||
|
unRegister.set( IDsOfElements )
|
||||||
if isinstance( StepVector, geomBuilder.GEOM._objref_GEOM_Object):
|
if isinstance( StepVector, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
||||||
if isinstance( StepVector, list ):
|
if isinstance( StepVector, list ):
|
||||||
@ -3654,46 +3736,14 @@ class Mesh:
|
|||||||
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
||||||
Parameters = StepVector.PS.parameters + var_separator + Parameters
|
Parameters = StepVector.PS.parameters + var_separator + Parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
n,e,f = [],[],[]
|
||||||
if(IsNodes):
|
if IsNodes: n = [IDsOfElements]
|
||||||
return self.editor.ExtrusionSweepMakeGroups0D(IDsOfElements, StepVector, NbOfSteps)
|
else : e,f, = [IDsOfElements],[IDsOfElements]
|
||||||
else:
|
return self.editor.ExtrusionSweepObjects(n,e,f, StepVector, NbOfSteps, MakeGroups)
|
||||||
return self.editor.ExtrusionSweepMakeGroups(IDsOfElements, StepVector, NbOfSteps)
|
|
||||||
if(IsNodes):
|
|
||||||
self.editor.ExtrusionSweep0D(IDsOfElements, StepVector, NbOfSteps)
|
|
||||||
else:
|
|
||||||
self.editor.ExtrusionSweep(IDsOfElements, StepVector, NbOfSteps)
|
|
||||||
return []
|
|
||||||
|
|
||||||
## Generates new elements by extrusion of the elements with given ids
|
|
||||||
# @param IDsOfElements is ids of elements
|
|
||||||
# @param StepVector vector or DirStruct or 3 vector components, defining
|
|
||||||
# the direction and value of extrusion for one step (the total extrusion
|
|
||||||
# length will be NbOfSteps * ||StepVector||)
|
|
||||||
# @param NbOfSteps the number of steps
|
|
||||||
# @param ExtrFlags sets flags for extrusion
|
|
||||||
# @param SewTolerance uses for comparing locations of nodes if flag
|
|
||||||
# EXTRUSION_FLAG_SEW is set
|
|
||||||
# @param MakeGroups forces the generation of new groups from existing ones
|
|
||||||
# @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
|
||||||
# @ingroup l2_modif_extrurev
|
|
||||||
def AdvancedExtrusion(self, IDsOfElements, StepVector, NbOfSteps,
|
|
||||||
ExtrFlags, SewTolerance, MakeGroups=False):
|
|
||||||
if ( isinstance( StepVector, geomBuilder.GEOM._objref_GEOM_Object)):
|
|
||||||
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
|
||||||
if isinstance( StepVector, list ):
|
|
||||||
StepVector = self.smeshpyD.MakeDirStruct(*StepVector)
|
|
||||||
if MakeGroups:
|
|
||||||
return self.editor.AdvancedExtrusionMakeGroups(IDsOfElements, StepVector, NbOfSteps,
|
|
||||||
ExtrFlags, SewTolerance)
|
|
||||||
self.editor.AdvancedExtrusion(IDsOfElements, StepVector, NbOfSteps,
|
|
||||||
ExtrFlags, SewTolerance)
|
|
||||||
return []
|
|
||||||
|
|
||||||
## Generates new elements by extrusion along the normal to a discretized surface or wire
|
## Generates new elements by extrusion along the normal to a discretized surface or wire
|
||||||
# @param Elements container of elements to extrude;
|
# @param Elements elements to extrude - a list including ids, groups, sub-meshes or a mesh
|
||||||
# it can be Mesh, Group, Sub-mesh, Filter or list of IDs;
|
# Only faces can be extruded so far. Sub-mesh should be a sub-mesh on geom faces.
|
||||||
# Only faces can be extruded so far. Sub-mesh sould be a sub-mesh on geom faces.
|
|
||||||
# @param StepSize length of one extrusion step (the total extrusion
|
# @param StepSize length of one extrusion step (the total extrusion
|
||||||
# length will be \a NbOfSteps * \a StepSize ).
|
# length will be \a NbOfSteps * \a StepSize ).
|
||||||
# @param NbOfSteps number of extrusion steps.
|
# @param NbOfSteps number of extrusion steps.
|
||||||
@ -3715,14 +3765,15 @@ class Mesh:
|
|||||||
ByAverageNormal=False, UseInputElemsOnly=True, MakeGroups=False, Dim = 2):
|
ByAverageNormal=False, UseInputElemsOnly=True, MakeGroups=False, Dim = 2):
|
||||||
unRegister = genObjUnRegister()
|
unRegister = genObjUnRegister()
|
||||||
if isinstance( Elements, Mesh ):
|
if isinstance( Elements, Mesh ):
|
||||||
Elements = Elements.GetMesh()
|
Elements = [ Elements.GetMesh() ]
|
||||||
if isinstance( Elements, list ):
|
if isinstance( Elements, list ):
|
||||||
if not Elements:
|
if not Elements:
|
||||||
raise RuntimeError, "List of element IDs is empty!"
|
raise RuntimeError, "Elements empty!"
|
||||||
if not isinstance( Elements[0], int ):
|
if isinstance( Elements[0], int ):
|
||||||
raise RuntimeError, "List must contain element IDs and not %s"% Elements[0]
|
|
||||||
Elements = self.GetIDSource( Elements, SMESH.ALL )
|
Elements = self.GetIDSource( Elements, SMESH.ALL )
|
||||||
unRegister.set( Elements )
|
unRegister.set( Elements )
|
||||||
|
else:
|
||||||
|
Elements = [ Elements ]
|
||||||
StepSize,NbOfSteps,Parameters,hasVars = ParseParameters(StepSize,NbOfSteps)
|
StepSize,NbOfSteps,Parameters,hasVars = ParseParameters(StepSize,NbOfSteps)
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
return self.editor.ExtrusionByNormal(Elements, StepSize, NbOfSteps,
|
return self.editor.ExtrusionByNormal(Elements, StepSize, NbOfSteps,
|
||||||
@ -3736,29 +3787,23 @@ class Mesh:
|
|||||||
# length will be NbOfSteps * ||StepVector||)
|
# length will be NbOfSteps * ||StepVector||)
|
||||||
# @param NbOfSteps the number of steps
|
# @param NbOfSteps the number of steps
|
||||||
# @param MakeGroups forces the generation of new groups from existing ones
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
# @param IsNodes is True if elements which belong to the object are nodes
|
# @param IsNodes is True if elements to extrude are nodes
|
||||||
# @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
# @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
||||||
# @ingroup l2_modif_extrurev
|
# @ingroup l2_modif_extrurev
|
||||||
def ExtrusionSweepObject(self, theObject, StepVector, NbOfSteps, MakeGroups=False, IsNodes=False):
|
def ExtrusionSweepObject(self, theObject, StepVector, NbOfSteps, MakeGroups=False, IsNodes=False):
|
||||||
if ( isinstance( theObject, Mesh )):
|
if isinstance( theObject, Mesh ):
|
||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( StepVector, geomBuilder.GEOM._objref_GEOM_Object)):
|
if isinstance( StepVector, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
||||||
if isinstance( StepVector, list ):
|
if isinstance( StepVector, list ):
|
||||||
StepVector = self.smeshpyD.MakeDirStruct(*StepVector)
|
StepVector = self.smeshpyD.MakeDirStruct(*StepVector)
|
||||||
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
||||||
Parameters = StepVector.PS.parameters + var_separator + Parameters
|
Parameters = StepVector.PS.parameters + var_separator + Parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
n,e,f = [],[],[]
|
||||||
if(IsNodes):
|
if IsNodes: n = [theObject]
|
||||||
return self.editor.ExtrusionSweepObject0DMakeGroups(theObject, StepVector, NbOfSteps)
|
else : e,f, = [theObject],[theObject]
|
||||||
else:
|
return self.editor.ExtrusionSweepObjects(n,e,f, StepVector, NbOfSteps, MakeGroups)
|
||||||
return self.editor.ExtrusionSweepObjectMakeGroups(theObject, StepVector, NbOfSteps)
|
|
||||||
if(IsNodes):
|
|
||||||
self.editor.ExtrusionSweepObject0D(theObject, StepVector, NbOfSteps)
|
|
||||||
else:
|
|
||||||
self.editor.ExtrusionSweepObject(theObject, StepVector, NbOfSteps)
|
|
||||||
return []
|
|
||||||
|
|
||||||
## Generates new elements by extrusion of the elements which belong to the object
|
## Generates new elements by extrusion of the elements which belong to the object
|
||||||
# @param theObject object which elements should be processed.
|
# @param theObject object which elements should be processed.
|
||||||
@ -3780,10 +3825,8 @@ class Mesh:
|
|||||||
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
||||||
Parameters = StepVector.PS.parameters + var_separator + Parameters
|
Parameters = StepVector.PS.parameters + var_separator + Parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
return self.editor.ExtrusionSweepObjects([],[theObject],[],
|
||||||
return self.editor.ExtrusionSweepObject1DMakeGroups(theObject, StepVector, NbOfSteps)
|
StepVector, NbOfSteps, MakeGroups)
|
||||||
self.editor.ExtrusionSweepObject1D(theObject, StepVector, NbOfSteps)
|
|
||||||
return []
|
|
||||||
|
|
||||||
## Generates new elements by extrusion of the elements which belong to the object
|
## Generates new elements by extrusion of the elements which belong to the object
|
||||||
# @param theObject object which elements should be processed.
|
# @param theObject object which elements should be processed.
|
||||||
@ -3805,12 +3848,72 @@ class Mesh:
|
|||||||
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
||||||
Parameters = StepVector.PS.parameters + var_separator + Parameters
|
Parameters = StepVector.PS.parameters + var_separator + Parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if MakeGroups:
|
return self.editor.ExtrusionSweepObjects([],[],[theObject],
|
||||||
return self.editor.ExtrusionSweepObject2DMakeGroups(theObject, StepVector, NbOfSteps)
|
StepVector, NbOfSteps, MakeGroups)
|
||||||
self.editor.ExtrusionSweepObject2D(theObject, StepVector, NbOfSteps)
|
|
||||||
return []
|
|
||||||
|
|
||||||
|
## Generates new elements by extrusion of the elements with given ids
|
||||||
|
# @param IDsOfElements is ids of elements
|
||||||
|
# @param StepVector vector or DirStruct or 3 vector components, defining
|
||||||
|
# the direction and value of extrusion for one step (the total extrusion
|
||||||
|
# length will be NbOfSteps * ||StepVector||)
|
||||||
|
# @param NbOfSteps the number of steps
|
||||||
|
# @param ExtrFlags sets flags for extrusion
|
||||||
|
# @param SewTolerance uses for comparing locations of nodes if flag
|
||||||
|
# EXTRUSION_FLAG_SEW is set
|
||||||
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
|
# @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
|
||||||
|
# @ingroup l2_modif_extrurev
|
||||||
|
def AdvancedExtrusion(self, IDsOfElements, StepVector, NbOfSteps,
|
||||||
|
ExtrFlags, SewTolerance, MakeGroups=False):
|
||||||
|
if isinstance( StepVector, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
|
StepVector = self.smeshpyD.GetDirStruct(StepVector)
|
||||||
|
if isinstance( StepVector, list ):
|
||||||
|
StepVector = self.smeshpyD.MakeDirStruct(*StepVector)
|
||||||
|
return self.editor.AdvancedExtrusion(IDsOfElements, StepVector, NbOfSteps,
|
||||||
|
ExtrFlags, SewTolerance, MakeGroups)
|
||||||
|
|
||||||
|
## Generates new elements by extrusion of the given elements and nodes along the path.
|
||||||
|
# The path of extrusion must be a meshed edge.
|
||||||
|
# @param Nodes nodes to extrude: a list including ids, groups, sub-meshes or a mesh
|
||||||
|
# @param Edges edges to extrude: a list including ids, groups, sub-meshes or a mesh
|
||||||
|
# @param Faces faces to extrude: a list including ids, groups, sub-meshes or a mesh
|
||||||
|
# @param PathMesh 1D mesh or 1D sub-mesh, along which proceeds the extrusion
|
||||||
|
# @param PathShape shape (edge) defines the sub-mesh of PathMesh if PathMesh
|
||||||
|
# contains not only path segments, else it can be None
|
||||||
|
# @param NodeStart the first or the last node on the path. Defines the direction of extrusion
|
||||||
|
# @param HasAngles allows the shape to be rotated around the path
|
||||||
|
# to get the resulting mesh in a helical fashion
|
||||||
|
# @param Angles list of angles
|
||||||
|
# @param HasRefPoint allows using the reference point
|
||||||
|
# @param RefPoint the point around which the shape is rotated (the mass center of the
|
||||||
|
# shape by default). The User can specify any point as the Reference Point.
|
||||||
|
# @param MakeGroups forces the generation of new groups from existing ones
|
||||||
|
# @param LinearVariation forces the computation of rotation angles as linear
|
||||||
|
# variation of the given Angles along path steps
|
||||||
|
# @return list of created groups (SMESH_GroupBase) and SMESH::Extrusion_Error
|
||||||
|
# @ingroup l2_modif_extrurev
|
||||||
|
def ExtrusionAlongPathObjects(self, Nodes, Edges, Faces, PathMesh, PathShape=None,
|
||||||
|
NodeStart=1, HasAngles=False, Angles=[],
|
||||||
|
HasRefPoint=False, RefPoint=[0,0,0],
|
||||||
|
MakeGroups=False, LinearVariation=False):
|
||||||
|
unRegister = genObjUnRegister()
|
||||||
|
Nodes = self._getIdSourceList( Nodes, SMESH.NODE, unRegister )
|
||||||
|
Edges = self._getIdSourceList( Edges, SMESH.EDGE, unRegister )
|
||||||
|
Faces = self._getIdSourceList( Faces, SMESH.FACE, unRegister )
|
||||||
|
|
||||||
|
if isinstance( RefPoint, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
|
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
|
||||||
|
if isinstance( RefPoint, list ):
|
||||||
|
RefPoint = SMESH.PointStruct( *RefPoint )
|
||||||
|
if isinstance( PathMesh, Mesh ):
|
||||||
|
PathMesh = PathMesh.GetMesh()
|
||||||
|
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
||||||
|
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
||||||
|
self.mesh.SetParameters(Parameters)
|
||||||
|
return self.editor.ExtrusionAlongPathObjects(Nodes, Edges, Faces,
|
||||||
|
PathMesh, PathShape, NodeStart,
|
||||||
|
HasAngles, Angles, LinearVariation,
|
||||||
|
HasRefPoint, RefPoint, MakeGroups)
|
||||||
|
|
||||||
## Generates new elements by extrusion of the given elements
|
## Generates new elements by extrusion of the given elements
|
||||||
# The path of extrusion must be a meshed edge.
|
# The path of extrusion must be a meshed edge.
|
||||||
@ -3845,21 +3948,28 @@ class Mesh:
|
|||||||
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
|
|
||||||
if (isinstance(Path, Mesh)): Path = Path.GetMesh()
|
if isinstance(Path, Mesh): Path = Path.GetMesh()
|
||||||
|
|
||||||
|
unRegister = genObjUnRegister()
|
||||||
if isinstance(Base, list):
|
if isinstance(Base, list):
|
||||||
IDsOfElements = []
|
if Base:
|
||||||
if Base == []: IDsOfElements = self.GetElementsId()
|
Base = self.GetIDSource( Base, ElemType )
|
||||||
else: IDsOfElements = Base
|
unRegister.set( Base )
|
||||||
return self.editor.ExtrusionAlongPathX(IDsOfElements, Path, NodeStart,
|
|
||||||
HasAngles, Angles, LinearVariation,
|
|
||||||
HasRefPoint, RefPoint, MakeGroups, ElemType)
|
|
||||||
else:
|
else:
|
||||||
if isinstance(Base, Mesh): Base = Base.GetMesh()
|
Base = self.mesh
|
||||||
if isinstance(Base, SMESH._objref_SMESH_Mesh) or isinstance(Base, SMESH._objref_SMESH_Group) or isinstance(Base, SMESH._objref_SMESH_subMesh):
|
else:
|
||||||
return self.editor.ExtrusionAlongPathObjX(Base, Path, NodeStart,
|
if isinstance(Base, Mesh):
|
||||||
|
Base = Base.GetMesh()
|
||||||
|
if isinstance(Base, SMESH._objref_SMESH_IDSource):
|
||||||
|
n,e,f = [],[],[]
|
||||||
|
if ElemType == SMESH.NODE: n = [Base]
|
||||||
|
if ElemType == SMESH.EDGE: e = [Base]
|
||||||
|
if ElemType == SMESH.FACE: f = [Base]
|
||||||
|
gr,er = self.editor.ExtrusionAlongPathObjects(n,e,f, Path, None, NodeStart,
|
||||||
HasAngles, Angles, LinearVariation,
|
HasAngles, Angles, LinearVariation,
|
||||||
HasRefPoint, RefPoint, MakeGroups, ElemType)
|
HasRefPoint, RefPoint, MakeGroups)
|
||||||
|
if MakeGroups: return gr,er
|
||||||
|
return er
|
||||||
else:
|
else:
|
||||||
raise RuntimeError, "Invalid Base for ExtrusionAlongPathX"
|
raise RuntimeError, "Invalid Base for ExtrusionAlongPathX"
|
||||||
|
|
||||||
@ -3887,28 +3997,26 @@ class Mesh:
|
|||||||
MakeGroups=False, LinearVariation=False):
|
MakeGroups=False, LinearVariation=False):
|
||||||
if IDsOfElements == []:
|
if IDsOfElements == []:
|
||||||
IDsOfElements = self.GetElementsId()
|
IDsOfElements = self.GetElementsId()
|
||||||
if ( isinstance( RefPoint, geomBuilder.GEOM._objref_GEOM_Object)):
|
if isinstance( RefPoint, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
|
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
|
||||||
pass
|
pass
|
||||||
if ( isinstance( PathMesh, Mesh )):
|
if isinstance( PathMesh, Mesh ):
|
||||||
PathMesh = PathMesh.GetMesh()
|
PathMesh = PathMesh.GetMesh()
|
||||||
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
||||||
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if HasAngles and Angles and LinearVariation:
|
n,e,f = [],[IDsOfElements],[IDsOfElements]
|
||||||
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
|
gr,er = self.editor.ExtrusionAlongPathObjects(n,e,f, PathMesh, PathShape,
|
||||||
pass
|
NodeStart, HasAngles, Angles,
|
||||||
if MakeGroups:
|
LinearVariation,
|
||||||
return self.editor.ExtrusionAlongPathMakeGroups(IDsOfElements, PathMesh,
|
HasRefPoint, RefPoint, MakeGroups)
|
||||||
PathShape, NodeStart, HasAngles,
|
if MakeGroups: return gr,er
|
||||||
Angles, HasRefPoint, RefPoint)
|
return er
|
||||||
return self.editor.ExtrusionAlongPath(IDsOfElements, PathMesh, PathShape,
|
|
||||||
NodeStart, HasAngles, Angles, HasRefPoint, RefPoint)
|
|
||||||
|
|
||||||
## Generates new elements by extrusion of the elements which belong to the object
|
## Generates new elements by extrusion of the elements which belong to the object
|
||||||
# The path of extrusion must be a meshed edge.
|
# The path of extrusion must be a meshed edge.
|
||||||
# @param theObject the object which elements should be processed.
|
# @param theObject the object which elements should be processed.
|
||||||
# It can be a mesh, a sub mesh or a group.
|
# It can be a mesh, a sub-mesh or a group.
|
||||||
# @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
|
# @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
|
||||||
# @param PathShape shape(edge) defines the sub-mesh for the path
|
# @param PathShape shape(edge) defines the sub-mesh for the path
|
||||||
# @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
|
# @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
|
||||||
@ -3927,25 +4035,21 @@ class Mesh:
|
|||||||
def ExtrusionAlongPathObject(self, theObject, PathMesh, PathShape, NodeStart,
|
def ExtrusionAlongPathObject(self, theObject, PathMesh, PathShape, NodeStart,
|
||||||
HasAngles, Angles, HasRefPoint, RefPoint,
|
HasAngles, Angles, HasRefPoint, RefPoint,
|
||||||
MakeGroups=False, LinearVariation=False):
|
MakeGroups=False, LinearVariation=False):
|
||||||
if ( isinstance( theObject, Mesh )):
|
if isinstance( theObject, Mesh ):
|
||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( RefPoint, geomBuilder.GEOM._objref_GEOM_Object)):
|
if isinstance( RefPoint, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
|
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
|
||||||
if ( isinstance( PathMesh, Mesh )):
|
if isinstance( PathMesh, Mesh ):
|
||||||
PathMesh = PathMesh.GetMesh()
|
PathMesh = PathMesh.GetMesh()
|
||||||
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
||||||
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if HasAngles and Angles and LinearVariation:
|
n,e,f = [],[theObject],[theObject]
|
||||||
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
|
gr,er = self.editor.ExtrusionAlongPathObjects(n,e,f, PathMesh, PathShape, NodeStart,
|
||||||
pass
|
HasAngles, Angles, LinearVariation,
|
||||||
if MakeGroups:
|
HasRefPoint, RefPoint, MakeGroups)
|
||||||
return self.editor.ExtrusionAlongPathObjectMakeGroups(theObject, PathMesh,
|
if MakeGroups: return gr,er
|
||||||
PathShape, NodeStart, HasAngles,
|
return er
|
||||||
Angles, HasRefPoint, RefPoint)
|
|
||||||
return self.editor.ExtrusionAlongPathObject(theObject, PathMesh, PathShape,
|
|
||||||
NodeStart, HasAngles, Angles, HasRefPoint,
|
|
||||||
RefPoint)
|
|
||||||
|
|
||||||
## Generates new elements by extrusion of the elements which belong to the object
|
## Generates new elements by extrusion of the elements which belong to the object
|
||||||
# The path of extrusion must be a meshed edge.
|
# The path of extrusion must be a meshed edge.
|
||||||
@ -3969,25 +4073,21 @@ class Mesh:
|
|||||||
def ExtrusionAlongPathObject1D(self, theObject, PathMesh, PathShape, NodeStart,
|
def ExtrusionAlongPathObject1D(self, theObject, PathMesh, PathShape, NodeStart,
|
||||||
HasAngles, Angles, HasRefPoint, RefPoint,
|
HasAngles, Angles, HasRefPoint, RefPoint,
|
||||||
MakeGroups=False, LinearVariation=False):
|
MakeGroups=False, LinearVariation=False):
|
||||||
if ( isinstance( theObject, Mesh )):
|
if isinstance( theObject, Mesh ):
|
||||||
theObject = theObject.GetMesh()
|
theObject = theObject.GetMesh()
|
||||||
if ( isinstance( RefPoint, geomBuilder.GEOM._objref_GEOM_Object)):
|
if isinstance( RefPoint, geomBuilder.GEOM._objref_GEOM_Object):
|
||||||
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
|
RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
|
||||||
if ( isinstance( PathMesh, Mesh )):
|
if isinstance( PathMesh, Mesh ):
|
||||||
PathMesh = PathMesh.GetMesh()
|
PathMesh = PathMesh.GetMesh()
|
||||||
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
||||||
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if HasAngles and Angles and LinearVariation:
|
n,e,f = [],[theObject],[]
|
||||||
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
|
gr,er = self.editor.ExtrusionAlongPathObjects(n,e,f, PathMesh, PathShape, NodeStart,
|
||||||
pass
|
HasAngles, Angles, LinearVariation,
|
||||||
if MakeGroups:
|
HasRefPoint, RefPoint, MakeGroups)
|
||||||
return self.editor.ExtrusionAlongPathObject1DMakeGroups(theObject, PathMesh,
|
if MakeGroups: return gr,er
|
||||||
PathShape, NodeStart, HasAngles,
|
return er
|
||||||
Angles, HasRefPoint, RefPoint)
|
|
||||||
return self.editor.ExtrusionAlongPathObject1D(theObject, PathMesh, PathShape,
|
|
||||||
NodeStart, HasAngles, Angles, HasRefPoint,
|
|
||||||
RefPoint)
|
|
||||||
|
|
||||||
## Generates new elements by extrusion of the elements which belong to the object
|
## Generates new elements by extrusion of the elements which belong to the object
|
||||||
# The path of extrusion must be a meshed edge.
|
# The path of extrusion must be a meshed edge.
|
||||||
@ -4020,16 +4120,12 @@ class Mesh:
|
|||||||
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
||||||
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
if HasAngles and Angles and LinearVariation:
|
n,e,f = [],[],[theObject]
|
||||||
Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
|
gr,er = self.editor.ExtrusionAlongPathObjects(n,e,f, PathMesh, PathShape, NodeStart,
|
||||||
pass
|
HasAngles, Angles, LinearVariation,
|
||||||
if MakeGroups:
|
HasRefPoint, RefPoint, MakeGroups)
|
||||||
return self.editor.ExtrusionAlongPathObject2DMakeGroups(theObject, PathMesh,
|
if MakeGroups: return gr,er
|
||||||
PathShape, NodeStart, HasAngles,
|
return er
|
||||||
Angles, HasRefPoint, RefPoint)
|
|
||||||
return self.editor.ExtrusionAlongPathObject2D(theObject, PathMesh, PathShape,
|
|
||||||
NodeStart, HasAngles, Angles, HasRefPoint,
|
|
||||||
RefPoint)
|
|
||||||
|
|
||||||
## Creates a symmetrical copy of mesh elements
|
## Creates a symmetrical copy of mesh elements
|
||||||
# @param IDsOfElements list of elements ids
|
# @param IDsOfElements list of elements ids
|
||||||
@ -4360,7 +4456,9 @@ class Mesh:
|
|||||||
return self.editor.FindCoincidentNodesOnPartBut(SubMeshOrGroup, Tolerance,exceptNodes)
|
return self.editor.FindCoincidentNodesOnPartBut(SubMeshOrGroup, Tolerance,exceptNodes)
|
||||||
|
|
||||||
## Merges nodes
|
## Merges nodes
|
||||||
# @param GroupsOfNodes a list of pairs of nodes IDs for merging (e.g. [[1,12],[25,4]])
|
# @param GroupsOfNodes a list of pairs of nodes IDs for merging
|
||||||
|
# (e.g. [[1,12],[25,4]], then nodes 12 and 4 will be removed and replaced
|
||||||
|
# by nodes 1 and 25 correspondingly in all elements and groups
|
||||||
# @ingroup l2_modif_trsf
|
# @ingroup l2_modif_trsf
|
||||||
def MergeNodes (self, GroupsOfNodes):
|
def MergeNodes (self, GroupsOfNodes):
|
||||||
self.editor.MergeNodes(GroupsOfNodes)
|
self.editor.MergeNodes(GroupsOfNodes)
|
||||||
@ -4369,13 +4467,17 @@ class Mesh:
|
|||||||
# @param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching
|
# @param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching
|
||||||
# @return the list of pairs of equal elements IDs (e.g. [[1,12],[25,4]])
|
# @return the list of pairs of equal elements IDs (e.g. [[1,12],[25,4]])
|
||||||
# @ingroup l2_modif_trsf
|
# @ingroup l2_modif_trsf
|
||||||
def FindEqualElements (self, MeshOrSubMeshOrGroup):
|
def FindEqualElements (self, MeshOrSubMeshOrGroup=None):
|
||||||
if ( isinstance( MeshOrSubMeshOrGroup, Mesh )):
|
if not MeshOrSubMeshOrGroup:
|
||||||
|
MeshOrSubMeshOrGroup=self.mesh
|
||||||
|
elif isinstance( MeshOrSubMeshOrGroup, Mesh ):
|
||||||
MeshOrSubMeshOrGroup = MeshOrSubMeshOrGroup.GetMesh()
|
MeshOrSubMeshOrGroup = MeshOrSubMeshOrGroup.GetMesh()
|
||||||
return self.editor.FindEqualElements(MeshOrSubMeshOrGroup)
|
return self.editor.FindEqualElements( MeshOrSubMeshOrGroup )
|
||||||
|
|
||||||
## Merges elements in each given group.
|
## Merges elements in each given group.
|
||||||
# @param GroupsOfElementsID a list of pairs of elements IDs for merging (e.g. [[1,12],[25,4]])
|
# @param GroupsOfElementsID a list of pairs of elements IDs for merging
|
||||||
|
# (e.g. [[1,12],[25,4]], then elements 12 and 4 will be removed and
|
||||||
|
# replaced by elements 1 and 25 in all groups)
|
||||||
# @ingroup l2_modif_trsf
|
# @ingroup l2_modif_trsf
|
||||||
def MergeElements(self, GroupsOfElementsID):
|
def MergeElements(self, GroupsOfElementsID):
|
||||||
self.editor.MergeElements(GroupsOfElementsID)
|
self.editor.MergeElements(GroupsOfElementsID)
|
||||||
|