mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-04 10:00:34 +05:00
23620: EDF 10301 - Completing Extrusion along a path
Add scale factors to Extrusion along line Add angles to Extrusion along path
This commit is contained in:
parent
69119810f6
commit
401b2a2e54
@ -1,5 +1,7 @@
|
|||||||
# Extrusion
|
# Extrusion
|
||||||
|
|
||||||
|
# There is a series of Extrusion Along Line methods added at different times;
|
||||||
|
# a fully functional method is ExtrusionSweepObjects()
|
||||||
|
|
||||||
import salome, math
|
import salome, math
|
||||||
salome.salome_init()
|
salome.salome_init()
|
||||||
@ -48,22 +50,13 @@ stepVector = [0.,0.,1.]
|
|||||||
mesh.ExtrusionSweepObject1D( obj, stepVector, nbSteps )
|
mesh.ExtrusionSweepObject1D( obj, stepVector, nbSteps )
|
||||||
|
|
||||||
# extrude a group
|
# extrude a group
|
||||||
lineExtruded = None
|
obj = mesh.GetGroupByName( "line_extruded", SMESH.FACE )[0]
|
||||||
for g in mesh.GetGroups( SMESH.FACE ):
|
|
||||||
if g.GetName() == "line_extruded":
|
|
||||||
lineExtruded = g
|
|
||||||
break
|
|
||||||
obj = lineExtruded
|
|
||||||
stepVector = [0,-5.,0.]
|
stepVector = [0,-5.,0.]
|
||||||
nbSteps = 1
|
nbSteps = 1
|
||||||
mesh.ExtrusionSweepObject( obj, stepVector, nbSteps )
|
mesh.ExtrusionSweepObject( obj, stepVector, nbSteps )
|
||||||
|
|
||||||
# extrude all nodes and triangle faces of the disk quarter, applying a scale factor
|
# extrude all nodes and triangle faces of the disk quarter, applying a scale factor
|
||||||
diskGroup = None
|
diskGroup = mesh.GetGroupByName( "line_rotated", SMESH.FACE )[0]
|
||||||
for g in mesh.GetGroups( SMESH.FACE ):
|
|
||||||
if g.GetName() == "line_rotated":
|
|
||||||
diskGroup = g
|
|
||||||
break
|
|
||||||
crit = [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_ElemGeomType,'=',SMESH.Geom_TRIANGLE ),
|
crit = [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_ElemGeomType,'=',SMESH.Geom_TRIANGLE ),
|
||||||
smesh.GetCriterion( SMESH.FACE, SMESH.FT_BelongToMeshGroup,'=', diskGroup )]
|
smesh.GetCriterion( SMESH.FACE, SMESH.FT_BelongToMeshGroup,'=', diskGroup )]
|
||||||
trianglesFilter = smesh.GetFilterFromCriteria( crit )
|
trianglesFilter = smesh.GetFilterFromCriteria( crit )
|
||||||
|
@ -19,7 +19,7 @@ iv = 1
|
|||||||
vertices = []
|
vertices = []
|
||||||
for point in points:
|
for point in points:
|
||||||
vert = geompy.MakeVertex(point[0], point[1], 0)
|
vert = geompy.MakeVertex(point[0], point[1], 0)
|
||||||
geompy.addToStudy(vert, "Vertex_" + repr(iv))
|
#geompy.addToStudy(vert, "Vertex_" + repr(iv))
|
||||||
vertices.append(vert)
|
vertices.append(vert)
|
||||||
iv += 1
|
iv += 1
|
||||||
pass
|
pass
|
||||||
@ -97,8 +97,8 @@ Edge_Circle_mesh = Mesh1D(Edge_Circle , 8, "Edge_Circle" , smesh_builder=sme
|
|||||||
# IDsOfElements, PathMesh, PathShape, NodeStart,
|
# IDsOfElements, PathMesh, PathShape, NodeStart,
|
||||||
# HasAngles, Angles, HasRefPoint, RefPoint
|
# HasAngles, Angles, HasRefPoint, RefPoint
|
||||||
refPoint = SMESH.PointStruct(0, 0, 0)
|
refPoint = SMESH.PointStruct(0, 0, 0)
|
||||||
a10 = 10.0*math.pi/180.0
|
a10 = math.radians( 10.0 )
|
||||||
a45 = 45.0*math.pi/180.0
|
a45 = math.radians( 45.0 )
|
||||||
|
|
||||||
# 1. Extrusion of two mesh edges along a straight path
|
# 1. Extrusion of two mesh edges along a straight path
|
||||||
error = quad_1.ExtrusionAlongPath([1,2], Edge_straight_mesh, Edge_straight, 1,
|
error = quad_1.ExtrusionAlongPath([1,2], Edge_straight_mesh, Edge_straight, 1,
|
||||||
@ -128,4 +128,53 @@ error = quad_6.ExtrusionAlongPath(ff_6 , Edge_Circle_mesh, Edge_Circle, 1,
|
|||||||
error = quad_7.ExtrusionAlongPath(ff_7, Edge_Circle_mesh, Edge_Circle, 1,
|
error = quad_7.ExtrusionAlongPath(ff_7, Edge_Circle_mesh, Edge_Circle, 1,
|
||||||
1, [a45, -a45, a45, -a45, a45, -a45, a45, -a45], 0, refPoint)
|
1, [a45, -a45, a45, -a45, a45, -a45, a45, -a45], 0, refPoint)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Make the same meshes using a fully functional method ExtrusionAlongPathObjects() having
|
||||||
|
# the following arguments:
|
||||||
|
# Nodes, Edges, Faces, PathObject, PathShape=None,
|
||||||
|
# NodeStart=1, HasAngles=False, Angles=[], LinearVariation=False,
|
||||||
|
# HasRefPoint=False, RefPoint=[0,0,0], MakeGroups=False,
|
||||||
|
# ScaleFactors=[], ScalesVariation=False
|
||||||
|
|
||||||
|
quad_1 = MakeQuadMesh2("quad_1", smesh_builder=smesh)[0]
|
||||||
|
quad_2 = MakeQuadMesh2("quad_2", smesh_builder=smesh)[0]
|
||||||
|
quad_3 = MakeQuadMesh2("quad_3", smesh_builder=smesh)[0]
|
||||||
|
quad_4 = MakeQuadMesh2("quad_4", smesh_builder=smesh)[0]
|
||||||
|
quad_5 = MakeQuadMesh2("quad_5", smesh_builder=smesh)[0]
|
||||||
|
quad_6 = MakeQuadMesh2("quad_6", smesh_builder=smesh)[0]
|
||||||
|
quad_7 = MakeQuadMesh2("quad_7", smesh_builder=smesh)[0]
|
||||||
|
|
||||||
|
# 1. Extrusion of two mesh edges along a straight path
|
||||||
|
nn, ee, ff = [], [1,2], []
|
||||||
|
error = quad_1.ExtrusionAlongPathObjects( nn, ee, ff, Edge_straight_mesh )
|
||||||
|
|
||||||
|
# 2. Extrusion of one mesh edge along a curved path
|
||||||
|
nn, ee, ff = [], [2], []
|
||||||
|
error = quad_2.ExtrusionAlongPathObjects( nn, ee, ff, Edge_bezierrr_mesh )
|
||||||
|
|
||||||
|
# 3. Extrusion of one mesh edge along a curved path with usage of angles
|
||||||
|
error = quad_3.ExtrusionAlongPathObjects( nn, ee, ff, Edge_bezierrr_mesh,
|
||||||
|
Angles=[a45, a45, a45, 0, -a45, -a45, -a45])
|
||||||
|
|
||||||
|
# 4. Extrusion of one mesh edge along the path, which is a part of a meshed wire
|
||||||
|
nn, ee, ff = [], [4], []
|
||||||
|
error = quad_4.ExtrusionAlongPathObjects( nn, ee, ff, Wire_polyline_mesh, Wire_polyline_edges[0],
|
||||||
|
Angles=[a10, a10, a10])
|
||||||
|
|
||||||
|
# 5. Extrusion of two mesh faces along the path, which is a part of a meshed wire
|
||||||
|
nn, ee, ff = [], [], quad_5
|
||||||
|
error = quad_5.ExtrusionAlongPathObjects( nn, ee, ff, Wire_polyline_mesh, Wire_polyline_edges[2],
|
||||||
|
NodeStart=4 )
|
||||||
|
|
||||||
|
# 6. Extrusion of two mesh faces along a closed path
|
||||||
|
nn, ee, ff = [], [], quad_6
|
||||||
|
error = quad_6.ExtrusionAlongPathObjects( nn, ee, ff, Edge_Circle_mesh )
|
||||||
|
|
||||||
|
# 7. Extrusion of two mesh faces along a closed path with usage of angles
|
||||||
|
nn, ee, ff = [], [], quad_7
|
||||||
|
error = quad_7.ExtrusionAlongPathObjects( nn, ee, ff, Edge_Circle_mesh, Edge_Circle,
|
||||||
|
Angles=[a45, -a45, a45, -a45, a45, -a45, a45, -a45])
|
||||||
|
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 45 KiB |
Binary file not shown.
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 47 KiB |
@ -63,10 +63,10 @@ When 2D elements are extruded, in addition to 3D elements segments are created o
|
|||||||
* Input the element IDs directly in **Node IDs**, **Edge IDs** and **Face IDs** fields. The selected elements will be highlighted in the viewer, if the mesh is shown there.
|
* Input the element IDs directly in **Node IDs**, **Edge IDs** and **Face IDs** fields. The selected elements will be highlighted in the viewer, if the mesh is shown there.
|
||||||
* Apply Filters. **Set filter** button allows to apply a filter to the selection of elements. See more about filters in the :ref:`filtering_elements` page.
|
* Apply Filters. **Set filter** button allows to apply a filter to the selection of elements. See more about filters in the :ref:`filtering_elements` page.
|
||||||
|
|
||||||
* If the **Extrusion to Distance** radio button is selected
|
* If the **Extrusion to distance** radio button is selected
|
||||||
* specify the translation vector by which the elements will be extruded.
|
* specify the translation vector by which the elements will be extruded.
|
||||||
|
|
||||||
* If the **Extrusion Along Vector** radio button is selected
|
* If the **Extrusion along vector** radio button is selected
|
||||||
|
|
||||||
.. image:: ../images/extrusionalongaline2.png
|
.. image:: ../images/extrusionalongaline2.png
|
||||||
:align: center
|
:align: center
|
||||||
@ -76,7 +76,7 @@ When 2D elements are extruded, in addition to 3D elements segments are created o
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
* If the **Extrusion By Normal** radio button is selected, every node of the selected faces is extruded along the *average* of the *normal* vectors to the faces sharing the node. (Nodes and edges cannot be extruded in this mode.)
|
* If the **Extrusion by normal** radio button is selected, every node of the selected faces is extruded along the *average* of the *normal* vectors to the faces sharing the node. (Nodes and edges cannot be extruded in this mode.)
|
||||||
|
|
||||||
.. image:: ../images/extrusionalongaline3.png
|
.. image:: ../images/extrusionalongaline3.png
|
||||||
:align: center
|
:align: center
|
||||||
@ -115,11 +115,15 @@ When 2D elements are extruded, in addition to 3D elements segments are created o
|
|||||||
|
|
||||||
|
|
||||||
* Specify the **Number of steps**.
|
* Specify the **Number of steps**.
|
||||||
* Optionally specify **Scale Factors**. Each scale factor in the list is applied to nodes of a corresponding extrusion step unless **Linear Variation of Scale Factors** is checked, is which case the scale factors are spread over all extrusion steps.
|
* Optionally specify **Scale factors**. Each scale factor in the list is applied to nodes of a corresponding extrusion step unless **Linear variation of factors** is checked, is which case the scale factors are spread over all extrusion steps.
|
||||||
* **Scaling Center** can be defined either using spin boxes or by picking a node in the Viewer or by picking a geometrical vertex in the Object Browser.
|
* **Base point** serving as a scaling canter can be defined either using spin boxes or by picking a node in the Viewer or by picking a geometrical vertex in the Object Browser.
|
||||||
* **Add** button |add| adds a scale factor to the list.
|
* **Add** button |add| adds a scale factor to the list.
|
||||||
* **Remove** button |rm| removes selected scale factors from the list.
|
* **Remove** button |rm| removes selected scale factors from the list.
|
||||||
|
|
||||||
|
* The elements can also be rotated around the **Base point** to get the resulting mesh in a helical fashion. You can set the values of **Rotation angles** to the list by pressing the *"Add"* button |add| and remove them from the list by pressing the *"Remove"* button |rm|.
|
||||||
|
|
||||||
|
**Linear variation of angles** option allows defining the angle of gradual rotation for the whole path. At each step the elements will be rotated by *( angle / nb. of steps )*.
|
||||||
|
|
||||||
* If you activate **Generate Groups** check-box, the *result elements* created from *selected elements* 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 *g_Faces* group (see figures below) then result hexahedra will be included in *g_Faces_extruded* group and a quadrangle created at the "top" of extruded mesh will be included in *g_Faces_top group*.
|
* If you activate **Generate Groups** check-box, the *result elements* created from *selected elements* 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 *g_Faces* group (see figures below) then result hexahedra will be included in *g_Faces_extruded* group and a quadrangle created at the "top" of extruded mesh will be included in *g_Faces_top group*.
|
||||||
|
|
||||||
.. image:: ../images/extrusion_groups.png
|
.. image:: ../images/extrusion_groups.png
|
||||||
|
@ -123,7 +123,7 @@ Extrusion of 2d elements along a closed path
|
|||||||
* **Start node** - the start node of the Path. It is used to define the direction of extrusion.
|
* **Start node** - the start node of the Path. It is used to define the direction of extrusion.
|
||||||
|
|
||||||
|
|
||||||
* If you activate **Generate Groups** check-box, the **result elements** created from **selected elements** 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 *g_Faces* group (see figures below) then result hexahedra will be included in *g_Faces_extruded* group and a quadrangle created at the "top" of extruded mesh will be included in *g_Faces_top group*.
|
* If you activate **Generate groups** check-box, the *result elements* created from *selected elements* 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 *g_Faces* group (see figures below) then result hexahedra will be included in *g_Faces_extruded* group and a quadrangle created at the "top" of extruded mesh will be included in *g_Faces_top group*.
|
||||||
|
|
||||||
.. image:: ../images/extrusion_groups.png
|
.. image:: ../images/extrusion_groups.png
|
||||||
:align: center
|
:align: center
|
||||||
@ -138,16 +138,18 @@ Extrusion of 2d elements along a closed path
|
|||||||
|
|
||||||
#. There are two optional parameters, which can be very useful:
|
#. There are two optional parameters, which can be very useful:
|
||||||
|
|
||||||
* If the path of extrusion is curvilinear, at each iteration the extruded elements are rotated to keep its initial angularity to the curve. By default, the **Base Point** around which the elements are rotated is the mass center of the elements (note that it can differ from the gravity center computed by *Geometry* module for the underlying shape), however, you can specify any point as the **Base Point** and the elements will be rotated with respect to this point. Note that only the displacement of the **Base Point** exactly equals to the path, and all other extruded elements simply keep their position relatively to the **Base Point** at each iteration.
|
* If the path of extrusion is curvilinear, at each iteration the extruded elements are rotated to keep its initial angularity to the curve. By default, the **Base point** around which the elements are rotated is the mass center of the elements (note that it can differ from the gravity center computed by *Geometry* module for the underlying shape), however, you can specify any point as the **Base point** and the elements will be rotated with respect to this point. Note that only the displacement of the **Base point** exactly equals to the path, and all other extruded elements simply keep their position relatively to the **Base point** at each iteration.
|
||||||
|
|
||||||
.. |add| image:: ../images/add.png
|
.. |add| image:: ../images/add.png
|
||||||
.. |rem| image:: ../images/remove.png
|
.. |rem| image:: ../images/remove.png
|
||||||
|
|
||||||
* The elements can also be rotated around the path to get the resulting mesh in a helical fashion. You can set the values of angles at the right, add them to the list of angles at the left by pressing the *"Add"* button |add| and remove them from the list by pressing the *"Remove"* button |rem|.
|
* The elements can also be rotated around the path with rotaion center at the **Base point** to get the resulting mesh in a helical fashion. You can set the values of angles at the right, add them to **Rotation angles** list at the left by pressing the *"Add"* button |add| and remove them from the list by pressing the *"Remove"* button |rem|.
|
||||||
|
|
||||||
|
**Linear variation of angles** option allows defining the angle of gradual rotation for the whole path. At each step the elements will be rotated by *( angle / nb. of steps )*.
|
||||||
|
|
||||||
**Linear variation of the angles** option allows defining the angle of gradual rotation for the whole path. At each step the elements will be rotated by *( angle / nb. of steps )*.
|
* Each of optional **Scale factors** in the list is applied to nodes of a corresponding extrusion step unless **Linear variation of factors** is checked, is which case the scale factors are spread over all extrusion steps. **Base point** serves as a scaling canter.
|
||||||
|
* *"Add"* button |add| adds a scale factor to the list.
|
||||||
|
* *"Remove"* button |rem| removes selected scale factors from the list.
|
||||||
|
|
||||||
|
|
||||||
#. Click **Apply** or **Apply and Close** button to confirm the operation. Mesh edges will be extruded into faces, faces into volumes. The external surface of the resulting 3d mesh (if faces have been extruded) is covered with faces, and corners with edges. If the path is closed, the resulting mesh can contain duplicated nodes and faces, because no sewing is done.
|
#. Click **Apply** or **Apply and Close** button to confirm the operation. Mesh edges will be extruded into faces, faces into volumes. The external surface of the resulting 3d mesh (if faces have been extruded) is covered with faces, and corners with edges. If the path is closed, the resulting mesh can contain duplicated nodes and faces, because no sewing is done.
|
||||||
|
@ -510,13 +510,21 @@ module SMESH
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Generate dim+1 elements by extrusion of elements along vector
|
* \brief Generate dim+1 elements by extrusion of elements along vector
|
||||||
* \param nodes - nodes to extrude: a list including groups, sub-meshes or a mesh
|
* \param nodes - nodes to extrude: a list including groups, sub-meshes or a mesh.
|
||||||
* \param edges - edges to extrude: a list including groups, sub-meshes or a mesh
|
* \param edges - edges to extrude: a list including groups, sub-meshes or a mesh.
|
||||||
* \param faces - faces to extrude: a list including groups, sub-meshes or a mesh
|
* \param faces - faces to extrude: a list including groups, sub-meshes or a mesh.
|
||||||
* \param stepVector - vector giving direction and distance of an extrusion step
|
* \param stepVector - vector giving direction and distance of an extrusion step.
|
||||||
* \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
|
* \param toMakeGroups - if true, new elements will be included into new groups
|
||||||
* corresponding to groups the input elements included in.
|
* corresponding to groups the input elements included in.
|
||||||
|
* \param scaleFactors - optional scale factors to apply during extrusion; it's
|
||||||
|
* usage depends on \a scalesVariation parameter.
|
||||||
|
* \param scalesVariation - if \c True, \a scaleFactors are spread over all \a NbOfSteps,
|
||||||
|
otherwise \a scaleFactors[i] is applied to nodes at the i-th extrusion step.
|
||||||
|
* \param angles - optional rotation angles to apply during extrusion; it's
|
||||||
|
* usage depends on \a anglesVariation parameter.
|
||||||
|
* \param anglesVariation - if \c True, \a angles are spread over all \a NbOfSteps,
|
||||||
|
otherwise \a angle[i] is applied to nodes at the i-th extrusion step.
|
||||||
* \return ListOfGroups - new groups created if \a toMakeGroups is true
|
* \return ListOfGroups - new groups created if \a toMakeGroups is true
|
||||||
*/
|
*/
|
||||||
ListOfGroups ExtrusionSweepObjects(in ListOfIDSources nodes,
|
ListOfGroups ExtrusionSweepObjects(in ListOfIDSources nodes,
|
||||||
@ -524,10 +532,12 @@ module SMESH
|
|||||||
in ListOfIDSources faces,
|
in ListOfIDSources faces,
|
||||||
in DirStruct stepVector,
|
in DirStruct stepVector,
|
||||||
in long nbOfSteps,
|
in long nbOfSteps,
|
||||||
|
in boolean toMakeGroups,
|
||||||
in double_array scaleFactors,
|
in double_array scaleFactors,
|
||||||
in boolean linearVariation,
|
in boolean scaleVariation,
|
||||||
in double_array basePoint,
|
in double_array basePoint,
|
||||||
in boolean toMakeGroups)
|
in double_array angles,
|
||||||
|
in boolean angleVariation)
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
/*! 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
|
||||||
@ -569,18 +579,20 @@ module SMESH
|
|||||||
EXTR_CANT_GET_TANGENT
|
EXTR_CANT_GET_TANGENT
|
||||||
};
|
};
|
||||||
|
|
||||||
ListOfGroups ExtrusionAlongPathObjects(in ListOfIDSources Nodes,
|
ListOfGroups ExtrusionAlongPathObjects(in ListOfIDSources Nodes,
|
||||||
in ListOfIDSources Edges,
|
in ListOfIDSources Edges,
|
||||||
in ListOfIDSources Faces,
|
in ListOfIDSources Faces,
|
||||||
in SMESH_IDSource Path,
|
in SMESH_IDSource Path,
|
||||||
in GEOM::GEOM_Object PathShape,
|
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,
|
||||||
in boolean LinearVariation,
|
in boolean AnglesVariation,
|
||||||
in boolean HasRefPoint,
|
in boolean HasRefPoint,
|
||||||
in PointStruct RefPoint,
|
in PointStruct RefPoint,
|
||||||
in boolean MakeGroups,
|
in boolean MakeGroups,
|
||||||
|
in double_array ScaleFactors,
|
||||||
|
in boolean ScaleVariation,
|
||||||
out Extrusion_Error Error)
|
out Extrusion_Error Error)
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -297,6 +297,7 @@ public:
|
|||||||
* USE_INPUT_ELEMS_ONLY: to use only input elements to compute extrusion direction
|
* USE_INPUT_ELEMS_ONLY: to use only input elements to compute extrusion direction
|
||||||
* for ExtrusionByNormal()
|
* for ExtrusionByNormal()
|
||||||
* SCALE_LINEAR_VARIATION: to make linear variation of scale factors
|
* SCALE_LINEAR_VARIATION: to make linear variation of scale factors
|
||||||
|
* ANGLE_LINEAR_VARIATION: to make linear variation of angles
|
||||||
*/
|
*/
|
||||||
enum ExtrusionFlags {
|
enum ExtrusionFlags {
|
||||||
EXTRUSION_FLAG_BOUNDARY = 0x01,
|
EXTRUSION_FLAG_BOUNDARY = 0x01,
|
||||||
@ -304,7 +305,8 @@ public:
|
|||||||
EXTRUSION_FLAG_GROUPS = 0x04,
|
EXTRUSION_FLAG_GROUPS = 0x04,
|
||||||
EXTRUSION_FLAG_BY_AVG_NORMAL = 0x08,
|
EXTRUSION_FLAG_BY_AVG_NORMAL = 0x08,
|
||||||
EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY = 0x10,
|
EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY = 0x10,
|
||||||
EXTRUSION_FLAG_SCALE_LINEAR_VARIATION = 0x20
|
EXTRUSION_FLAG_SCALE_LINEAR_VARIATION = 0x20,
|
||||||
|
EXTRUSION_FLAG_ANGLE_LINEAR_VARIATION = 0x40
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -312,24 +314,20 @@ public:
|
|||||||
*/
|
*/
|
||||||
class SMESH_EXPORT ExtrusParam
|
class SMESH_EXPORT ExtrusParam
|
||||||
{
|
{
|
||||||
gp_Dir myDir; // direction of extrusion
|
|
||||||
Handle(TColStd_HSequenceOfReal) mySteps; // magnitudes for each step
|
|
||||||
std::vector<double> myScales, myMediumScales;// scale factors
|
|
||||||
gp_XYZ myBaseP; // scaling center
|
|
||||||
SMESH_SequenceOfNode myNodes; // nodes for using in sewing
|
|
||||||
int myFlags; // see ExtrusionFlags
|
|
||||||
double myTolerance; // tolerance for sewing nodes
|
|
||||||
const TIDSortedElemSet* myElemsToUse; // elements to use for extrusion by normal
|
|
||||||
|
|
||||||
int (ExtrusParam::*myMakeNodesFun)(SMESHDS_Mesh* mesh,
|
|
||||||
const SMDS_MeshNode* srcNode,
|
|
||||||
std::list<const SMDS_MeshNode*> & newNodes,
|
|
||||||
const bool makeMediumNodes);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
//! Point on extrusion path
|
||||||
|
struct PathPoint
|
||||||
|
{
|
||||||
|
gp_Pnt myPnt;
|
||||||
|
gp_Dir myTgt;
|
||||||
|
double myAngle, myScale;
|
||||||
|
PathPoint(): myPnt(99., 99., 99.), myTgt(1.,0.,0.), myAngle(0), myScale(0) {}
|
||||||
|
};
|
||||||
|
|
||||||
ExtrusParam( const gp_Vec& theStep,
|
ExtrusParam( const gp_Vec& theStep,
|
||||||
const int theNbSteps,
|
const int theNbSteps,
|
||||||
const std::list<double>& theScales,
|
const std::list<double>& theScales,
|
||||||
|
const std::list<double>& theAngles,
|
||||||
const gp_XYZ* theBaseP,
|
const gp_XYZ* theBaseP,
|
||||||
const int theFlags = 0,
|
const int theFlags = 0,
|
||||||
const double theTolerance = 1e-6);
|
const double theTolerance = 1e-6);
|
||||||
@ -341,15 +339,21 @@ public:
|
|||||||
const int theNbSteps,
|
const int theNbSteps,
|
||||||
const int theFlags,
|
const int theFlags,
|
||||||
const int theDim); // for extrusion by normal
|
const int theDim); // for extrusion by normal
|
||||||
|
ExtrusParam( const std::vector< PathPoint >& thePoints,
|
||||||
|
const gp_Pnt* theBaseP,
|
||||||
|
const std::list<double>& theScales,
|
||||||
|
const bool theMakeGroups); // for extrusion along path
|
||||||
|
|
||||||
SMESH_SequenceOfNode& ChangeNodes() { return myNodes; }
|
SMESH_SequenceOfNode& ChangeNodes() { return myNodes; }
|
||||||
int& Flags() { return myFlags; }
|
int& Flags() { return myFlags; }
|
||||||
bool ToMakeBoundary() const { return myFlags & EXTRUSION_FLAG_BOUNDARY; }
|
bool ToMakeBoundary() const { return myFlags & EXTRUSION_FLAG_BOUNDARY; }
|
||||||
bool ToMakeGroups() const { return myFlags & EXTRUSION_FLAG_GROUPS; }
|
bool ToMakeGroups() const { return myFlags & EXTRUSION_FLAG_GROUPS; }
|
||||||
bool ToUseInpElemsOnly() const { return myFlags & EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY; }
|
bool ToUseInpElemsOnly() const { return myFlags & EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY; }
|
||||||
bool IsLinearVariation() const { return myFlags & EXTRUSION_FLAG_SCALE_LINEAR_VARIATION; }
|
bool IsScaleVariation() const { return myFlags & EXTRUSION_FLAG_SCALE_LINEAR_VARIATION; }
|
||||||
int NbSteps() const { return mySteps->Length(); }
|
bool IsAngleVariation() const { return myFlags & EXTRUSION_FLAG_ANGLE_LINEAR_VARIATION; }
|
||||||
|
int NbSteps() const {
|
||||||
|
return mySteps.IsNull() ? myPathPoints.size() - 1: mySteps->Length();
|
||||||
|
}
|
||||||
// stores elements to use for extrusion by normal, depending on
|
// stores elements to use for extrusion by normal, depending on
|
||||||
// state of EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY flag;
|
// state of EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY flag;
|
||||||
// define myBaseP for scaling
|
// define myBaseP for scaling
|
||||||
@ -365,6 +369,20 @@ public:
|
|||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
gp_Dir myDir; // direction of extrusion
|
||||||
|
Handle(TColStd_HSequenceOfReal) mySteps; // magnitudes for each step
|
||||||
|
std::vector<double> myScales;// scale factors
|
||||||
|
std::vector<double> myAngles;// angles
|
||||||
|
gp_XYZ myBaseP; // scaling/rotation center
|
||||||
|
SMESH_SequenceOfNode myNodes; // nodes for using in sewing
|
||||||
|
int myFlags; // see ExtrusionFlags
|
||||||
|
double myTolerance; // tolerance for sewing nodes
|
||||||
|
const TIDSortedElemSet* myElemsToUse; // elements to use for extrusion by normal
|
||||||
|
std::vector< PathPoint > myPathPoints; // points along a path
|
||||||
|
int (ExtrusParam::* myMakeNodesFun)(SMESHDS_Mesh*, // function of extrusion method
|
||||||
|
const SMDS_MeshNode*,
|
||||||
|
std::list<const SMDS_MeshNode*> &,
|
||||||
|
const bool);
|
||||||
int makeNodesByDir( SMESHDS_Mesh* mesh,
|
int makeNodesByDir( SMESHDS_Mesh* mesh,
|
||||||
const SMDS_MeshNode* srcNode,
|
const SMDS_MeshNode* srcNode,
|
||||||
std::list<const SMDS_MeshNode*> & newNodes,
|
std::list<const SMDS_MeshNode*> & newNodes,
|
||||||
@ -381,6 +399,10 @@ public:
|
|||||||
const SMDS_MeshNode* srcNode,
|
const SMDS_MeshNode* srcNode,
|
||||||
std::list<const SMDS_MeshNode*> & newNodes,
|
std::list<const SMDS_MeshNode*> & newNodes,
|
||||||
const bool makeMediumNodes);
|
const bool makeMediumNodes);
|
||||||
|
int makeNodesAlongTrack( SMESHDS_Mesh* mesh,
|
||||||
|
const SMDS_MeshNode* srcNode,
|
||||||
|
std::list<const SMDS_MeshNode*> & newNodes,
|
||||||
|
const bool makeMediumNodes);
|
||||||
// step iteration
|
// step iteration
|
||||||
void beginStepIter( bool withMediumNodes );
|
void beginStepIter( bool withMediumNodes );
|
||||||
bool moreSteps();
|
bool moreSteps();
|
||||||
@ -438,24 +460,16 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet theElements[2],
|
Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet theElements[2],
|
||||||
SMESH_subMesh* theTrackPattern,
|
SMESH_Mesh* theTrackMesh,
|
||||||
|
SMDS_ElemIteratorPtr theTrackIterator,
|
||||||
const SMDS_MeshNode* theNodeStart,
|
const SMDS_MeshNode* theNodeStart,
|
||||||
const bool theHasAngles,
|
|
||||||
std::list<double>& theAngles,
|
std::list<double>& theAngles,
|
||||||
const bool theLinearVariation,
|
const bool theAngleVariation,
|
||||||
const bool theHasRefPoint,
|
std::list<double>& theScales,
|
||||||
const gp_Pnt& theRefPoint,
|
const bool theScaleVariation,
|
||||||
|
const gp_Pnt* theRefPoint,
|
||||||
const bool theMakeGroups);
|
const bool theMakeGroups);
|
||||||
Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet theElements[2],
|
// Generate new elements by extrusion of theElements along path given by theTrackIterator,
|
||||||
SMESH_Mesh* theTrackPattern,
|
|
||||||
const SMDS_MeshNode* theNodeStart,
|
|
||||||
const bool theHasAngles,
|
|
||||||
std::list<double>& theAngles,
|
|
||||||
const bool theLinearVariation,
|
|
||||||
const bool theHasRefPoint,
|
|
||||||
const gp_Pnt& theRefPoint,
|
|
||||||
const bool theMakeGroups);
|
|
||||||
// Generate new elements by extrusion of theElements along path given by theTrackPattern,
|
|
||||||
// theHasAngles are the rotation angles, base point can be given by theRefPoint
|
// theHasAngles are the rotation angles, base point can be given by theRefPoint
|
||||||
|
|
||||||
PGroupIDs Transform (TIDSortedElemSet & theElements,
|
PGroupIDs Transform (TIDSortedElemSet & theElements,
|
||||||
@ -791,36 +805,10 @@ public:
|
|||||||
const int nbSteps,
|
const int nbSteps,
|
||||||
SMESH_SequenceOfElemPtr& srcElements);
|
SMESH_SequenceOfElemPtr& srcElements);
|
||||||
|
|
||||||
struct SMESH_MeshEditor_PathPoint
|
|
||||||
{
|
|
||||||
gp_Pnt myPnt;
|
|
||||||
gp_Dir myTgt;
|
|
||||||
double myAngle, myPrm;
|
|
||||||
|
|
||||||
SMESH_MeshEditor_PathPoint(): myPnt(99., 99., 99.), myTgt(1.,0.,0.), myAngle(0), myPrm(0) {}
|
|
||||||
void SetPnt (const gp_Pnt& aP3D) { myPnt =aP3D; }
|
|
||||||
void SetTangent (const gp_Dir& aTgt) { myTgt =aTgt; }
|
|
||||||
void SetAngle (const double& aBeta) { myAngle=aBeta; }
|
|
||||||
void SetParameter(const double& aPrm) { myPrm =aPrm; }
|
|
||||||
const gp_Pnt& Pnt ()const { return myPnt; }
|
|
||||||
const gp_Dir& Tangent ()const { return myTgt; }
|
|
||||||
double Angle ()const { return myAngle; }
|
|
||||||
double Parameter ()const { return myPrm; }
|
|
||||||
};
|
|
||||||
Extrusion_Error makeEdgePathPoints(std::list<double>& aPrms,
|
|
||||||
const TopoDS_Edge& aTrackEdge,
|
|
||||||
bool aFirstIsStart,
|
|
||||||
std::list<SMESH_MeshEditor_PathPoint>& aLPP);
|
|
||||||
Extrusion_Error makeExtrElements(TIDSortedElemSet theElements[2],
|
|
||||||
std::list<SMESH_MeshEditor_PathPoint>& theFullList,
|
|
||||||
const bool theHasAngles,
|
|
||||||
std::list<double>& theAngles,
|
|
||||||
const bool theLinearVariation,
|
|
||||||
const bool theHasRefPoint,
|
|
||||||
const gp_Pnt& theRefPoint,
|
|
||||||
const bool theMakeGroups);
|
|
||||||
static void linearAngleVariation(const int NbSteps,
|
static void linearAngleVariation(const int NbSteps,
|
||||||
std::list<double>& theAngles);
|
std::list<double>& theAngles);
|
||||||
|
static void linearScaleVariation(const int NbSteps,
|
||||||
|
std::list<double>& theScales);
|
||||||
|
|
||||||
bool doubleNodes( SMESHDS_Mesh* theMeshDS,
|
bool doubleNodes( SMESHDS_Mesh* theMeshDS,
|
||||||
const TIDSortedElemSet& theElems,
|
const TIDSortedElemSet& theElems,
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "SMESH_HypoFilter.hxx"
|
#include "SMESH_HypoFilter.hxx"
|
||||||
#include "SMESH_Mesh.hxx"
|
#include "SMESH_Mesh.hxx"
|
||||||
#include "SMESH_MeshAlgos.hxx"
|
#include "SMESH_MeshAlgos.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
#include "SMESH_ProxyMesh.hxx"
|
#include "SMESH_ProxyMesh.hxx"
|
||||||
#include "SMESH_subMesh.hxx"
|
#include "SMESH_subMesh.hxx"
|
||||||
|
|
||||||
@ -73,7 +74,7 @@ using namespace std;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
inline SMESH_TNodeXYZ XYZ(const SMDS_MeshNode* n) { return SMESH_TNodeXYZ(n); }
|
inline SMESH_NodeXYZ XYZ(const SMDS_MeshNode* n) { return SMESH_NodeXYZ(n); }
|
||||||
|
|
||||||
enum { U_periodic = 1, V_periodic = 2 };
|
enum { U_periodic = 1, V_periodic = 2 };
|
||||||
}
|
}
|
||||||
@ -1035,6 +1036,16 @@ double SMESH_MesherHelper::GetNodeU(const TopoDS_Edge& E,
|
|||||||
int vertexID = n->getshapeId();
|
int vertexID = n->getshapeId();
|
||||||
const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID));
|
const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID));
|
||||||
param = BRep_Tool::Parameter( V, E );
|
param = BRep_Tool::Parameter( V, E );
|
||||||
|
|
||||||
|
if ( inEdgeNode )
|
||||||
|
{
|
||||||
|
BRepAdaptor_Curve curve( E );
|
||||||
|
if ( curve.IsPeriodic() )
|
||||||
|
{
|
||||||
|
double uInEdge = GetNodeU( E, inEdgeNode );
|
||||||
|
param += ShapeAnalysis::AdjustByPeriod( param, uInEdge, curve.Period() );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( check )
|
if ( check )
|
||||||
|
@ -29,7 +29,8 @@
|
|||||||
|
|
||||||
#include "SMESH_SMESH.hxx"
|
#include "SMESH_SMESH.hxx"
|
||||||
|
|
||||||
#include "SMESH_MeshEditor.hxx" // needed for many meshers
|
#include "SMESH_ComputeError.hxx"
|
||||||
|
#include "SMESH_TypeDefs.hxx"
|
||||||
|
|
||||||
#include <Geom_Surface.hxx>
|
#include <Geom_Surface.hxx>
|
||||||
#include <ShapeAnalysis_Surface.hxx>
|
#include <ShapeAnalysis_Surface.hxx>
|
||||||
@ -44,8 +45,15 @@ class GeomAPI_ProjectPointOnCurve;
|
|||||||
class GeomAPI_ProjectPointOnSurf;
|
class GeomAPI_ProjectPointOnSurf;
|
||||||
class SMDS_MeshNode;
|
class SMDS_MeshNode;
|
||||||
class SMESHDS_Hypothesis;
|
class SMESHDS_Hypothesis;
|
||||||
|
class SMESHDS_Mesh;
|
||||||
|
class SMESHDS_SubMesh;
|
||||||
class SMESH_Gen;
|
class SMESH_Gen;
|
||||||
|
class SMESH_Mesh;
|
||||||
class SMESH_ProxyMesh;
|
class SMESH_ProxyMesh;
|
||||||
|
class SMESH_subMesh;
|
||||||
|
class TopoDS_Edge;
|
||||||
|
class TopoDS_Face;
|
||||||
|
class TopoDS_Vertex;
|
||||||
|
|
||||||
typedef std::map<SMESH_TLink, const SMDS_MeshNode*> TLinkNodeMap;
|
typedef std::map<SMESH_TLink, const SMDS_MeshNode*> TLinkNodeMap;
|
||||||
typedef std::map<SMESH_TLink, const SMDS_MeshNode*>::iterator ItTLinkNode;
|
typedef std::map<SMESH_TLink, const SMDS_MeshNode*>::iterator ItTLinkNode;
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include "SMESH_Block.hxx"
|
#include "SMESH_Block.hxx"
|
||||||
#include "SMESH_Mesh.hxx"
|
#include "SMESH_Mesh.hxx"
|
||||||
#include "SMESH_MeshAlgos.hxx"
|
#include "SMESH_MeshAlgos.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
#include "SMESH_subMesh.hxx"
|
#include "SMESH_subMesh.hxx"
|
||||||
|
|
||||||
|
@ -1202,7 +1202,7 @@ bool SMESHDS_Mesh::IsGroupOfSubShapes (const TopoDS_Shape& theShape) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
for ( TopoDS_Iterator it( theShape ); it.More(); it.Next() )
|
for ( TopoDS_Iterator it( theShape ); it.More(); it.Next() )
|
||||||
if (IsGroupOfSubShapes( it.Value() ))
|
if ( IsGroupOfSubShapes( it.Value() ))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -200,6 +200,7 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
BasePointGrpLayout->addWidget(ZLab);
|
BasePointGrpLayout->addWidget(ZLab);
|
||||||
BasePointGrpLayout->addWidget(ZSpin);
|
BasePointGrpLayout->addWidget(ZSpin);
|
||||||
|
|
||||||
|
// Angles
|
||||||
AnglesGrp = new QGroupBox(tr("SMESH_ANGLES"), GroupArguments);
|
AnglesGrp = new QGroupBox(tr("SMESH_ANGLES"), GroupArguments);
|
||||||
AnglesGrp->setCheckable(true);
|
AnglesGrp->setCheckable(true);
|
||||||
AnglesGrp->setChecked(false);
|
AnglesGrp->setChecked(false);
|
||||||
@ -219,15 +220,42 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
|
|
||||||
LinearAnglesCheck = new QCheckBox(tr("LINEAR_ANGLES"), AnglesGrp);
|
LinearAnglesCheck = new QCheckBox(tr("LINEAR_ANGLES"), AnglesGrp);
|
||||||
|
|
||||||
// layouting
|
|
||||||
AnglesGrpLayout->addWidget(AnglesList, 0, 0, 4, 1);
|
AnglesGrpLayout->addWidget(AnglesList, 0, 0, 4, 1);
|
||||||
AnglesGrpLayout->addWidget(AddAngleButton, 0, 1);
|
AnglesGrpLayout->addWidget(AddAngleButton, 0, 1);
|
||||||
AnglesGrpLayout->addWidget(RemoveAngleButton, 2, 1);
|
AnglesGrpLayout->addWidget(RemoveAngleButton, 2, 1);
|
||||||
AnglesGrpLayout->addWidget(AngleSpin, 0, 2);
|
AnglesGrpLayout->addWidget(AngleSpin, 0, 2);
|
||||||
AnglesGrpLayout->addWidget(LinearAnglesCheck, 4, 0);
|
AnglesGrpLayout->addWidget(LinearAnglesCheck, 4, 0, 1, 3);
|
||||||
AnglesGrpLayout->setRowMinimumHeight(1, 10);
|
AnglesGrpLayout->setRowMinimumHeight(1, 10);
|
||||||
AnglesGrpLayout->setRowStretch(3, 10);
|
AnglesGrpLayout->setRowStretch(3, 10);
|
||||||
|
|
||||||
|
// Scales
|
||||||
|
ScalesGrp = new QGroupBox(tr("SMESH_SCALES"), GroupArguments);
|
||||||
|
ScalesGrp->setCheckable(true);
|
||||||
|
ScalesGrp->setChecked(false);
|
||||||
|
QGridLayout* ScalesGrpLayout = new QGridLayout(ScalesGrp);
|
||||||
|
ScalesGrpLayout->setSpacing(SPACING); ScalesGrpLayout->setMargin(MARGIN);
|
||||||
|
|
||||||
|
ScalesList = new QListWidget(ScalesGrp);
|
||||||
|
ScalesList->setSelectionMode(QListWidget::ExtendedSelection);
|
||||||
|
|
||||||
|
AddScaleButton = new QToolButton(ScalesGrp);
|
||||||
|
AddScaleButton->setIcon(addImage);
|
||||||
|
|
||||||
|
RemoveScaleButton = new QToolButton(ScalesGrp);
|
||||||
|
RemoveScaleButton->setIcon(removeImage);
|
||||||
|
|
||||||
|
ScaleSpin = new SMESHGUI_SpinBox(ScalesGrp);
|
||||||
|
|
||||||
|
LinearScalesCheck = new QCheckBox(tr("LINEAR_SCALES"), ScalesGrp);
|
||||||
|
|
||||||
|
ScalesGrpLayout->addWidget(ScalesList, 0, 0, 4, 1);
|
||||||
|
ScalesGrpLayout->addWidget(AddScaleButton, 0, 1);
|
||||||
|
ScalesGrpLayout->addWidget(RemoveScaleButton, 2, 1);
|
||||||
|
ScalesGrpLayout->addWidget(ScaleSpin, 0, 2);
|
||||||
|
ScalesGrpLayout->addWidget(LinearScalesCheck, 4, 0, 1, 3);
|
||||||
|
ScalesGrpLayout->setRowMinimumHeight(1, 10);
|
||||||
|
ScalesGrpLayout->setRowStretch(3, 10);
|
||||||
|
|
||||||
// CheckBox for groups generation
|
// CheckBox for groups generation
|
||||||
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
|
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
|
||||||
MakeGroupsCheck->setChecked(true);
|
MakeGroupsCheck->setChecked(true);
|
||||||
@ -236,10 +264,11 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
myPreviewCheckBox = new QCheckBox(tr("PREVIEW"), GroupArguments);
|
myPreviewCheckBox = new QCheckBox(tr("PREVIEW"), GroupArguments);
|
||||||
|
|
||||||
// layouting
|
// layouting
|
||||||
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0);
|
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 1, 2);
|
||||||
GroupArgumentsLayout->addWidget(PathGrp, 1, 0);
|
GroupArgumentsLayout->addWidget(PathGrp, 1, 0, 1, 2);
|
||||||
GroupArgumentsLayout->addWidget(BasePointGrp, 2, 0);
|
GroupArgumentsLayout->addWidget(BasePointGrp, 2, 0, 1, 2);
|
||||||
GroupArgumentsLayout->addWidget(AnglesGrp, 3, 0);
|
GroupArgumentsLayout->addWidget(AnglesGrp, 3, 0);
|
||||||
|
GroupArgumentsLayout->addWidget(ScalesGrp, 3, 1);
|
||||||
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 4, 0);
|
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 4, 0);
|
||||||
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0);
|
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0);
|
||||||
|
|
||||||
@ -282,12 +311,13 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
||||||
ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
||||||
AngleSpin->RangeStepAndValidator(-180.0, 180.0, 5.0, "angle_precision");
|
AngleSpin->RangeStepAndValidator(-180.0, 180.0, 5.0, "angle_precision");
|
||||||
|
ScaleSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 1.0, "length_precision");
|
||||||
|
|
||||||
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
|
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
|
||||||
|
|
||||||
mySMESHGUI->SetActiveDialogBox(this);
|
mySMESHGUI->SetActiveDialogBox(this);
|
||||||
|
|
||||||
myPathMeshFilter = new SMESH_TypeFilter(SMESH::MESHorSUBMESH);
|
myPathMeshFilter = new SMESH_TypeFilter(SMESH::IDSOURCE_EDGE);
|
||||||
|
|
||||||
myHelpFileName = "extrusion_along_path.html";
|
myHelpFileName = "extrusion_along_path.html";
|
||||||
|
|
||||||
@ -302,6 +332,8 @@ 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(AddScaleButton, SIGNAL(clicked()), this, SLOT(OnAngleAdded()));
|
||||||
|
connect(RemoveScaleButton, SIGNAL(clicked()), this, SLOT(OnAngleRemoved()));
|
||||||
|
|
||||||
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()));
|
||||||
@ -324,19 +356,27 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
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(AddScaleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(RemoveScaleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(LinearScalesCheck, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(LinearAnglesCheck, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(ScalesGrp, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(AnglesGrp, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
||||||
|
|
||||||
|
|
||||||
//To Connect preview check box
|
//To Connect preview check box
|
||||||
connectPreviewControl();
|
connectPreviewControl();
|
||||||
|
|
||||||
AnglesList ->installEventFilter(this);
|
AnglesList ->installEventFilter(this);
|
||||||
|
ScalesList ->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();
|
CheckIsEnable();
|
||||||
|
|
||||||
|
resize( minimumSizeHint() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -369,6 +409,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::Init (bool ResetControls)
|
|||||||
ZSpin->SetValue(0.0);
|
ZSpin->SetValue(0.0);
|
||||||
|
|
||||||
AngleSpin->SetValue(45);
|
AngleSpin->SetValue(45);
|
||||||
|
ScaleSpin->SetValue(2);
|
||||||
myPreviewCheckBox->setChecked(false);
|
myPreviewCheckBox->setChecked(false);
|
||||||
onDisplaySimulation(false);
|
onDisplaySimulation(false);
|
||||||
}
|
}
|
||||||
@ -416,12 +457,10 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
QStringList aParameters;
|
QStringList aParameters;
|
||||||
|
|
||||||
//get angles
|
//get angles
|
||||||
SMESH::double_array_var anAngles = getAngles();
|
SMESH::double_array_var anAngles = getAngles();
|
||||||
|
|
||||||
for (int i = 0; i < myAnglesList.count(); i++)
|
for (int i = 0; i < myAnglesList.count(); i++)
|
||||||
aParameters << AnglesList->item(i)->text();
|
aParameters << AnglesList->item(i)->text();
|
||||||
|
|
||||||
|
|
||||||
// get base point
|
// get base point
|
||||||
SMESH::PointStruct aBasePoint;
|
SMESH::PointStruct aBasePoint;
|
||||||
if (BasePointGrp->isChecked()) {
|
if (BasePointGrp->isChecked()) {
|
||||||
@ -433,6 +472,11 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
aParameters << YSpin->text();
|
aParameters << YSpin->text();
|
||||||
aParameters << ZSpin->text();
|
aParameters << ZSpin->text();
|
||||||
|
|
||||||
|
//get scales
|
||||||
|
SMESH::double_array_var aScales = getScales();
|
||||||
|
for (int i = 0; i < myScalesList.count(); i++)
|
||||||
|
aParameters << ScalesList->item(i)->text();
|
||||||
|
|
||||||
bool meshHadNewTypeBefore = true;
|
bool meshHadNewTypeBefore = true;
|
||||||
int maxSelType = 0;
|
int maxSelType = 0;
|
||||||
const bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
const bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
||||||
@ -464,8 +508,8 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
GEOM::GEOM_Object::_nil(),
|
GEOM::GEOM_Object::_nil(),
|
||||||
aNodeStart, AnglesGrp->isChecked(),
|
aNodeStart, AnglesGrp->isChecked(),
|
||||||
anAngles, LinearAnglesCheck->isChecked(),
|
anAngles, LinearAnglesCheck->isChecked(),
|
||||||
BasePointGrp->isChecked(), aBasePoint,
|
BasePointGrp->isChecked(), aBasePoint, makeGroups,
|
||||||
makeGroups, retVal );
|
aScales, LinearScalesCheck->isChecked(), retVal );
|
||||||
|
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
switch (retVal) {
|
switch (retVal) {
|
||||||
@ -911,17 +955,34 @@ void SMESHGUI_ExtrusionAlongPathDlg::enterEvent (QEvent*)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
|
void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
|
||||||
{
|
{
|
||||||
QString msg;
|
if ( sender() == AddAngleButton )
|
||||||
if( !AngleSpin->isValid( msg, true ) ) {
|
{
|
||||||
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
QString msg;
|
||||||
if ( !msg.isEmpty() )
|
if( !AngleSpin->isValid( msg, true ) ) {
|
||||||
str += "\n" + msg;
|
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
||||||
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
if ( !msg.isEmpty() )
|
||||||
return;
|
str += "\n" + msg;
|
||||||
|
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
AnglesList->addItem(AngleSpin->text());
|
||||||
|
myAnglesList.append(AngleSpin->GetValue());
|
||||||
}
|
}
|
||||||
AnglesList->addItem(AngleSpin->text());
|
|
||||||
myAnglesList.append(AngleSpin->GetValue());
|
if ( sender() == AddScaleButton )
|
||||||
|
{
|
||||||
|
QString msg;
|
||||||
|
if( !ScaleSpin->isValid( msg, true ) ) {
|
||||||
|
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
||||||
|
if ( !msg.isEmpty() )
|
||||||
|
str += "\n" + msg;
|
||||||
|
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ScalesList->addItem(ScaleSpin->text());
|
||||||
|
myScalesList.append(ScaleSpin->GetValue());
|
||||||
|
}
|
||||||
|
|
||||||
updateLinearAngles();
|
updateLinearAngles();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -931,10 +992,23 @@ void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved()
|
void SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved()
|
||||||
{
|
{
|
||||||
QList<QListWidgetItem*> aList = AnglesList->selectedItems();
|
QListWidget* widget;
|
||||||
|
QList<double>* list;
|
||||||
|
if ( sender() == RemoveScaleButton )
|
||||||
|
{
|
||||||
|
widget = ScalesList;
|
||||||
|
list = & myScalesList;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
widget = AnglesList;
|
||||||
|
list = & myAnglesList;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QListWidgetItem*> aList = widget->selectedItems();
|
||||||
QListWidgetItem* anItem;
|
QListWidgetItem* anItem;
|
||||||
foreach(anItem, aList) {
|
foreach(anItem, aList) {
|
||||||
myAnglesList.removeAt(AnglesList->row(anItem));
|
list->removeAt( widget->row( anItem ));
|
||||||
delete anItem;
|
delete anItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -951,7 +1025,11 @@ bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter (QObject* object, QEvent* event
|
|||||||
QKeyEvent* ke = (QKeyEvent*)event;
|
QKeyEvent* ke = (QKeyEvent*)event;
|
||||||
if (object == AnglesList) {
|
if (object == AnglesList) {
|
||||||
if (ke->key() == Qt::Key_Delete)
|
if (ke->key() == Qt::Key_Delete)
|
||||||
OnAngleRemoved();
|
RemoveAngleButton->click();
|
||||||
|
}
|
||||||
|
if (object == ScalesList) {
|
||||||
|
if (ke->key() == Qt::Key_Delete)
|
||||||
|
RemoveScaleButton->click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event->type() == QEvent::FocusIn) {
|
else if (event->type() == QEvent::FocusIn) {
|
||||||
@ -1023,6 +1101,19 @@ void SMESHGUI_ExtrusionAlongPathDlg::updateLinearAngles()
|
|||||||
if( !enableLinear )
|
if( !enableLinear )
|
||||||
LinearAnglesCheck->setChecked( false );
|
LinearAnglesCheck->setChecked( false );
|
||||||
LinearAnglesCheck->setEnabled( enableLinear );
|
LinearAnglesCheck->setEnabled( enableLinear );
|
||||||
|
|
||||||
|
enableLinear = true;
|
||||||
|
for( int row = 0, nbRows = ScalesList->count(); row < nbRows; row++ ) {
|
||||||
|
if( QListWidgetItem* anItem = ScalesList->item( row ) ) {
|
||||||
|
enableLinear = false;
|
||||||
|
anItem->text().toDouble(&enableLinear);
|
||||||
|
if( !enableLinear )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( !enableLinear )
|
||||||
|
LinearScalesCheck->setChecked( false );
|
||||||
|
LinearScalesCheck->setEnabled( enableLinear );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -1074,9 +1165,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview
|
|||||||
if ( myPreviewCheckBox->isChecked() && toDisplayPreview ) {
|
if ( myPreviewCheckBox->isChecked() && toDisplayPreview ) {
|
||||||
if ( SelectorWdg->IsAnythingSelected() && isValid() && isValuesValid())
|
if ( SelectorWdg->IsAnythingSelected() && isValid() && isValuesValid())
|
||||||
{
|
{
|
||||||
// get angles
|
// get angles and scales
|
||||||
SMESH::double_array_var anAngles = getAngles();
|
SMESH::double_array_var anAngles = getAngles();
|
||||||
|
SMESH::double_array_var aScales = getScales();
|
||||||
|
|
||||||
// get base point
|
// get base point
|
||||||
SMESH::PointStruct aBasePoint;
|
SMESH::PointStruct aBasePoint;
|
||||||
if (BasePointGrp->isChecked()) {
|
if (BasePointGrp->isChecked()) {
|
||||||
@ -1107,7 +1199,9 @@ void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview
|
|||||||
aNodeStart, AnglesGrp->isChecked(),
|
aNodeStart, AnglesGrp->isChecked(),
|
||||||
anAngles, LinearAnglesCheck->isChecked(),
|
anAngles, LinearAnglesCheck->isChecked(),
|
||||||
BasePointGrp->isChecked(), aBasePoint,
|
BasePointGrp->isChecked(), aBasePoint,
|
||||||
makeGroups, retVal );
|
makeGroups,
|
||||||
|
aScales, LinearScalesCheck->isChecked(),
|
||||||
|
retVal);
|
||||||
|
|
||||||
if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
|
if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
|
||||||
{
|
{
|
||||||
@ -1133,18 +1227,36 @@ void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : getAngles
|
||||||
|
//purpose : return CORBA array of angles
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
SMESH::double_array_var SMESHGUI_ExtrusionAlongPathDlg::getAngles()
|
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;
|
for (int i = 0; i < myAnglesList.count(); i++)
|
||||||
for (int i = 0; i < myAnglesList.count(); i++) {
|
anAngles[ i ] = myAnglesList[ i ] * M_PI / 180.;
|
||||||
double angle = myAnglesList[i];
|
|
||||||
anAngles[ j++ ] = angle*M_PI/180.;
|
|
||||||
}
|
|
||||||
anAngles->length(j);
|
|
||||||
}
|
}
|
||||||
return anAngles;
|
return anAngles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : getScales
|
||||||
|
//purpose : return CORBA array of scale factors
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
SMESH::double_array_var SMESHGUI_ExtrusionAlongPathDlg::getScales()
|
||||||
|
{
|
||||||
|
SMESH::double_array_var anScales = new SMESH::double_array;
|
||||||
|
if ( ScalesGrp->isChecked() )
|
||||||
|
{
|
||||||
|
anScales->length( myScalesList.count() );
|
||||||
|
for (int i = 0; i < myScalesList.count(); i++)
|
||||||
|
anScales[ i ] = myScalesList[ i ];
|
||||||
|
}
|
||||||
|
return anScales;
|
||||||
|
}
|
||||||
|
@ -82,6 +82,7 @@ private:
|
|||||||
bool isValuesValid();
|
bool isValuesValid();
|
||||||
|
|
||||||
SMESH::double_array_var getAngles();
|
SMESH::double_array_var getAngles();
|
||||||
|
SMESH::double_array_var getScales();
|
||||||
|
|
||||||
void updateLinearAngles();
|
void updateLinearAngles();
|
||||||
|
|
||||||
@ -94,6 +95,7 @@ private:
|
|||||||
SMESH::SMESH_IDSource_var myPath;
|
SMESH::SMESH_IDSource_var myPath;
|
||||||
SUIT_SelectionFilter* myPathMeshFilter;
|
SUIT_SelectionFilter* myPathMeshFilter;
|
||||||
QList<double> myAnglesList;
|
QList<double> myAnglesList;
|
||||||
|
QList<double> myScalesList;
|
||||||
|
|
||||||
// widgets
|
// widgets
|
||||||
SMESHGUI_3TypesSelector* SelectorWdg;
|
SMESHGUI_3TypesSelector* SelectorWdg;
|
||||||
@ -103,12 +105,21 @@ private:
|
|||||||
QLineEdit* PathMeshLineEdit;
|
QLineEdit* PathMeshLineEdit;
|
||||||
QPushButton* SelectStartPointButton;
|
QPushButton* SelectStartPointButton;
|
||||||
QLineEdit* StartPointLineEdit;
|
QLineEdit* StartPointLineEdit;
|
||||||
|
|
||||||
QCheckBox* LinearAnglesCheck;
|
QCheckBox* LinearAnglesCheck;
|
||||||
QGroupBox* AnglesGrp;
|
QGroupBox* AnglesGrp;
|
||||||
QListWidget* AnglesList;
|
QListWidget* AnglesList;
|
||||||
QToolButton* AddAngleButton;
|
QToolButton* AddAngleButton;
|
||||||
QToolButton* RemoveAngleButton;
|
QToolButton* RemoveAngleButton;
|
||||||
SMESHGUI_SpinBox* AngleSpin;
|
SMESHGUI_SpinBox* AngleSpin;
|
||||||
|
|
||||||
|
QCheckBox* LinearScalesCheck;
|
||||||
|
QGroupBox* ScalesGrp;
|
||||||
|
QListWidget* ScalesList;
|
||||||
|
QToolButton* AddScaleButton;
|
||||||
|
QToolButton* RemoveScaleButton;
|
||||||
|
SMESHGUI_SpinBox* ScaleSpin;
|
||||||
|
|
||||||
QGroupBox* BasePointGrp;
|
QGroupBox* BasePointGrp;
|
||||||
QPushButton* SelectBasePointButton;
|
QPushButton* SelectBasePointButton;
|
||||||
SMESHGUI_SpinBox* XSpin;
|
SMESHGUI_SpinBox* XSpin;
|
||||||
|
@ -709,6 +709,8 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
|||||||
// Scales
|
// Scales
|
||||||
|
|
||||||
ScalesGrp = new QGroupBox(tr("SMESH_SCALES"), GroupArguments);
|
ScalesGrp = new QGroupBox(tr("SMESH_SCALES"), GroupArguments);
|
||||||
|
ScalesGrp->setCheckable(true);
|
||||||
|
ScalesGrp->setChecked(false);
|
||||||
QGridLayout* ScalesGrpLayout = new QGridLayout( ScalesGrp );
|
QGridLayout* ScalesGrpLayout = new QGridLayout( ScalesGrp );
|
||||||
ScalesGrpLayout->setSpacing(SPACING); ScalesGrpLayout->setMargin(MARGIN);
|
ScalesGrpLayout->setSpacing(SPACING); ScalesGrpLayout->setMargin(MARGIN);
|
||||||
|
|
||||||
@ -730,10 +732,40 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
|||||||
ScalesGrpLayout->addWidget(AddScaleButton, 0, 1);
|
ScalesGrpLayout->addWidget(AddScaleButton, 0, 1);
|
||||||
ScalesGrpLayout->addWidget(RemoveScaleButton, 2, 1);
|
ScalesGrpLayout->addWidget(RemoveScaleButton, 2, 1);
|
||||||
ScalesGrpLayout->addWidget(ScaleSpin, 0, 2);
|
ScalesGrpLayout->addWidget(ScaleSpin, 0, 2);
|
||||||
ScalesGrpLayout->addWidget(LinearScalesCheck, 4, 0);
|
ScalesGrpLayout->addWidget(LinearScalesCheck, 4, 0, 1, 3);
|
||||||
ScalesGrpLayout->setRowMinimumHeight(1, 10);
|
ScalesGrpLayout->setRowMinimumHeight(1, 10);
|
||||||
ScalesGrpLayout->setRowStretch(3, 10);
|
ScalesGrpLayout->setRowStretch(3, 10);
|
||||||
|
|
||||||
|
// Angles
|
||||||
|
|
||||||
|
AnglesGrp = new QGroupBox(tr("SMESH_ANGLES"), GroupArguments);
|
||||||
|
AnglesGrp->setCheckable(true);
|
||||||
|
AnglesGrp->setChecked(false);
|
||||||
|
QGridLayout* AnglesGrpLayout = new QGridLayout( AnglesGrp );
|
||||||
|
AnglesGrpLayout->setSpacing(SPACING); AnglesGrpLayout->setMargin(MARGIN);
|
||||||
|
|
||||||
|
AnglesList = new QListWidget( AnglesGrp );
|
||||||
|
AnglesList->setSelectionMode(QListWidget::ExtendedSelection);
|
||||||
|
|
||||||
|
AddAngleButton = new QToolButton( AnglesGrp );
|
||||||
|
AddAngleButton->setIcon( addImage );
|
||||||
|
|
||||||
|
RemoveAngleButton = new QToolButton( AnglesGrp );
|
||||||
|
RemoveAngleButton->setIcon( removeImage );
|
||||||
|
|
||||||
|
AngleSpin = new SMESHGUI_SpinBox( AnglesGrp );
|
||||||
|
AngleSpin->SetValue(10);
|
||||||
|
|
||||||
|
LinearAnglesCheck = new QCheckBox(tr("LINEAR_ANGLES"), AnglesGrp );
|
||||||
|
|
||||||
|
AnglesGrpLayout->addWidget(AnglesList, 0, 0, 4, 1);
|
||||||
|
AnglesGrpLayout->addWidget(AddAngleButton, 0, 1);
|
||||||
|
AnglesGrpLayout->addWidget(RemoveAngleButton, 2, 1);
|
||||||
|
AnglesGrpLayout->addWidget(AngleSpin, 0, 2);
|
||||||
|
AnglesGrpLayout->addWidget(LinearAnglesCheck, 4, 0, 1, 3);
|
||||||
|
AnglesGrpLayout->setRowMinimumHeight(1, 10);
|
||||||
|
AnglesGrpLayout->setRowStretch(3, 10);
|
||||||
|
|
||||||
// layouting
|
// layouting
|
||||||
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 1, 9);
|
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 1, 9);
|
||||||
GroupArgumentsLayout->addWidget(ExtrMethod_RBut0, 1, 0, 1, 3);
|
GroupArgumentsLayout->addWidget(ExtrMethod_RBut0, 1, 0, 1, 3);
|
||||||
@ -761,7 +793,8 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
|||||||
GroupArgumentsLayout->addWidget(ByAverageNormalCheck, 6, 0, 1, 4);
|
GroupArgumentsLayout->addWidget(ByAverageNormalCheck, 6, 0, 1, 4);
|
||||||
GroupArgumentsLayout->addWidget(UseInputElemsOnlyCheck, 6, 4, 1, 4);
|
GroupArgumentsLayout->addWidget(UseInputElemsOnlyCheck, 6, 4, 1, 4);
|
||||||
GroupArgumentsLayout->addWidget(BasePointGrp, 7, 0, 1, 9);
|
GroupArgumentsLayout->addWidget(BasePointGrp, 7, 0, 1, 9);
|
||||||
GroupArgumentsLayout->addWidget(ScalesGrp, 8, 0, 1, 9);
|
GroupArgumentsLayout->addWidget(ScalesGrp, 8, 0, 1, 4);
|
||||||
|
GroupArgumentsLayout->addWidget(AnglesGrp, 8, 5, 1, 4);
|
||||||
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 9, 0, 1, 8);
|
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 9, 0, 1, 8);
|
||||||
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 10,0, 1, 8);
|
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 10,0, 1, 8);
|
||||||
GroupArgumentsLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 10, 0);
|
GroupArgumentsLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 10, 0);
|
||||||
@ -810,12 +843,13 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
|||||||
BasePoint_YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
BasePoint_YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
||||||
BasePoint_ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
BasePoint_ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
|
||||||
ScaleSpin->RangeStepAndValidator (COORD_MIN, COORD_MAX, 1.0, "length_precision");
|
ScaleSpin->RangeStepAndValidator (COORD_MIN, COORD_MAX, 1.0, "length_precision");
|
||||||
|
AngleSpin->RangeStepAndValidator (-180.0, 180.0, 5.0, "angle_precision");
|
||||||
|
|
||||||
ExtrMethod_RBut0->setChecked(true);
|
ExtrMethod_RBut0->setChecked(true);
|
||||||
UseInputElemsOnlyCheck->setChecked(true);
|
UseInputElemsOnlyCheck->setChecked(true);
|
||||||
MakeGroupsCheck->setChecked(true);
|
MakeGroupsCheck->setChecked(true);
|
||||||
|
|
||||||
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
|
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
|
||||||
|
|
||||||
mySMESHGUI->SetActiveDialogBox(this);
|
mySMESHGUI->SetActiveDialogBox(this);
|
||||||
|
|
||||||
@ -844,6 +878,8 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
|||||||
|
|
||||||
connect(AddScaleButton, SIGNAL(clicked()), this, SLOT(OnScaleAdded()));
|
connect(AddScaleButton, SIGNAL(clicked()), this, SLOT(OnScaleAdded()));
|
||||||
connect(RemoveScaleButton, SIGNAL(clicked()), this, SLOT(OnScaleRemoved()));
|
connect(RemoveScaleButton, SIGNAL(clicked()), this, SLOT(OnScaleRemoved()));
|
||||||
|
connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(OnScaleAdded()));
|
||||||
|
connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(OnScaleRemoved()));
|
||||||
|
|
||||||
connect(SelectVectorButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(SelectVectorButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(SelectBasePointButton,SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(SelectBasePointButton,SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
@ -871,10 +907,15 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
|
|||||||
connect(AddScaleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
connect(AddScaleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
||||||
connect(RemoveScaleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
connect(RemoveScaleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
||||||
connect(LinearScalesCheck, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
connect(LinearScalesCheck, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(LinearAnglesCheck, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
||||||
connect(BasePointGrp, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
connect(BasePointGrp, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
||||||
connect(BasePoint_XSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
connect(BasePoint_XSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
connect(BasePoint_YSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
connect(BasePoint_YSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
connect(BasePoint_ZSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
connect(BasePoint_ZSpin, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(ScalesGrp, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
||||||
|
connect(AnglesGrp, SIGNAL(toggled(bool)), this, SLOT(toDisplaySimulation()));
|
||||||
|
|
||||||
//To Connect preview check box
|
//To Connect preview check box
|
||||||
connectPreviewControl();
|
connectPreviewControl();
|
||||||
@ -964,14 +1005,26 @@ bool SMESHGUI_ExtrusionDlg::isValuesValid()
|
|||||||
//purpose : return 3 scaling parameters
|
//purpose : return 3 scaling parameters
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
bool SMESHGUI_ExtrusionDlg::getScaleParams( SMESH::double_array*& scales,
|
void SMESHGUI_ExtrusionDlg::getScaleParams( SMESH::double_array*& scales,
|
||||||
SMESH::double_array*& basePoint )
|
SMESH::double_array*& basePoint,
|
||||||
|
bool & scalesVariation,
|
||||||
|
SMESH::double_array*& angles,
|
||||||
|
bool & anglesVariation )
|
||||||
{
|
{
|
||||||
scales = new SMESH::double_array;
|
scales = new SMESH::double_array;
|
||||||
scales->length( myScalesList.count() );
|
if ( ScalesGrp->isChecked() )
|
||||||
for ( int i = 0; i < myScalesList.count(); ++i )
|
{
|
||||||
(*scales)[i] = myScalesList[i];
|
scales->length( myScalesList.count() );
|
||||||
|
for ( int i = 0; i < myScalesList.count(); ++i )
|
||||||
|
(*scales)[i] = myScalesList[i];
|
||||||
|
}
|
||||||
|
angles = new SMESH::double_array;
|
||||||
|
if ( AnglesGrp->isChecked() )
|
||||||
|
{
|
||||||
|
angles->length( myAnglesList.count() );
|
||||||
|
for ( int i = 0; i < myAnglesList.count(); ++i )
|
||||||
|
(*angles)[i] = myAnglesList[i]*M_PI/180.;
|
||||||
|
}
|
||||||
basePoint = new SMESH::double_array;
|
basePoint = new SMESH::double_array;
|
||||||
if ( BasePointGrp->isChecked() )
|
if ( BasePointGrp->isChecked() )
|
||||||
{
|
{
|
||||||
@ -981,7 +1034,8 @@ bool SMESHGUI_ExtrusionDlg::getScaleParams( SMESH::double_array*& scales,
|
|||||||
(*basePoint)[2] = BasePoint_ZSpin->GetValue();
|
(*basePoint)[2] = BasePoint_ZSpin->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ( scales->length() > 0 && LinearScalesCheck->isChecked() );
|
scalesVariation = ( scales->length() > 0 && LinearScalesCheck->isChecked() );
|
||||||
|
anglesVariation = ( angles->length() > 0 && LinearAnglesCheck->isChecked() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -1074,6 +1128,7 @@ void SMESHGUI_ExtrusionDlg::ClickOnRadio()
|
|||||||
|
|
||||||
BasePointGrp->setEnabled( !ExtrMethod_RBut2->isChecked() );
|
BasePointGrp->setEnabled( !ExtrMethod_RBut2->isChecked() );
|
||||||
ScalesGrp ->setEnabled( !ExtrMethod_RBut2->isChecked() );
|
ScalesGrp ->setEnabled( !ExtrMethod_RBut2->isChecked() );
|
||||||
|
AnglesGrp ->setEnabled( !ExtrMethod_RBut2->isChecked() );
|
||||||
|
|
||||||
|
|
||||||
CheckIsEnable();
|
CheckIsEnable();
|
||||||
@ -1126,13 +1181,11 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
long aNbSteps = (long)SpinBox_NbSteps->value();
|
long aNbSteps = (long)SpinBox_NbSteps->value();
|
||||||
aParameters << SpinBox_NbSteps->text();
|
aParameters << SpinBox_NbSteps->text();
|
||||||
|
|
||||||
SMESH::double_array_var scales = new SMESH::double_array;
|
|
||||||
scales->length( myScalesList.count() );
|
|
||||||
for (int i = 0; i < myScalesList.count(); i++)
|
for (int i = 0; i < myScalesList.count(); i++)
|
||||||
{
|
|
||||||
scales[i] = myScalesList[i];
|
|
||||||
aParameters << ScalesList->item(i)->text();
|
aParameters << ScalesList->item(i)->text();
|
||||||
}
|
|
||||||
|
for (int i = 0; i < myAnglesList.count(); i++)
|
||||||
|
aParameters << AnglesList->item(i)->text();
|
||||||
|
|
||||||
bool meshHadNewTypeBefore = true;
|
bool meshHadNewTypeBefore = true;
|
||||||
int maxSelType = 0;
|
int maxSelType = 0;
|
||||||
@ -1175,12 +1228,14 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SMESH::double_array_var scales, basePoint;
|
SMESH::double_array_var scales, basePoint, angles;
|
||||||
bool linVariation = getScaleParams( scales.out(), basePoint.out() );
|
bool scalesVariation, anglesVariation;
|
||||||
|
getScaleParams( scales.out(), basePoint.out(), scalesVariation,
|
||||||
|
angles.out(), anglesVariation );
|
||||||
groups = meshEditor->ExtrusionSweepObjects( nodes, edges, faces,
|
groups = meshEditor->ExtrusionSweepObjects( nodes, edges, faces,
|
||||||
aVector, aNbSteps,
|
aVector, aNbSteps, makeGroups,
|
||||||
scales, linVariation, basePoint,
|
scales, scalesVariation, basePoint,
|
||||||
makeGroups );
|
angles, anglesVariation );
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
@ -1565,12 +1620,14 @@ void SMESHGUI_ExtrusionDlg::onDisplaySimulation( bool toDisplayPreview )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SMESH::double_array_var scales, basePoint;
|
SMESH::double_array_var scales, basePoint, angles;
|
||||||
bool linVariation = getScaleParams( scales.out(), basePoint.out() );
|
bool scalesVariation, anglesVariation;
|
||||||
|
getScaleParams( scales.out(), basePoint.out(), scalesVariation,
|
||||||
|
angles.out(), anglesVariation );
|
||||||
groups = meshEditor->ExtrusionSweepObjects( nodes, edges, faces,
|
groups = meshEditor->ExtrusionSweepObjects( nodes, edges, faces,
|
||||||
aVector, aNbSteps,
|
aVector, aNbSteps, makeGroups,
|
||||||
scales, linVariation, basePoint,
|
scales, scalesVariation, basePoint,
|
||||||
makeGroups );
|
angles, anglesVariation );
|
||||||
}
|
}
|
||||||
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = meshEditor->GetPreviewData();
|
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = meshEditor->GetPreviewData();
|
||||||
mySimulation->SetData(aMeshPreviewStruct);
|
mySimulation->SetData(aMeshPreviewStruct);
|
||||||
@ -1614,35 +1671,65 @@ void SMESHGUI_ExtrusionDlg::getExtrusionVector(SMESH::DirStruct& aVector)
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : OnScaleAdded()
|
// function : OnScaleAdded()
|
||||||
// purpose : Called when user adds Scale to the list
|
// purpose : Called when user adds Scale or Angle to the list
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void SMESHGUI_ExtrusionDlg::OnScaleAdded()
|
void SMESHGUI_ExtrusionDlg::OnScaleAdded()
|
||||||
{
|
{
|
||||||
QString msg;
|
if ( sender() == AddScaleButton )
|
||||||
if( !ScaleSpin->isValid( msg, true ) ) {
|
{
|
||||||
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
QString msg;
|
||||||
if ( !msg.isEmpty() )
|
if( !ScaleSpin->isValid( msg, true ) ) {
|
||||||
str += "\n" + msg;
|
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
||||||
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
if ( !msg.isEmpty() )
|
||||||
return;
|
str += "\n" + msg;
|
||||||
|
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ScalesList->addItem(ScaleSpin->text());
|
||||||
|
myScalesList.append(ScaleSpin->GetValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( sender() == AddAngleButton )
|
||||||
|
{
|
||||||
|
QString msg;
|
||||||
|
if( !AngleSpin->isValid( msg, true ) ) {
|
||||||
|
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
|
||||||
|
if ( !msg.isEmpty() )
|
||||||
|
str += "\n" + msg;
|
||||||
|
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
AnglesList->addItem(AngleSpin->text());
|
||||||
|
myAnglesList.append(AngleSpin->GetValue());
|
||||||
}
|
}
|
||||||
ScalesList->addItem(ScaleSpin->text());
|
|
||||||
myScalesList.append(ScaleSpin->GetValue());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : OnScaleRemoved()
|
// function : OnScaleRemoved()
|
||||||
// purpose : Called when user removes Scale(s) from the list
|
// purpose : Called when user removes Scales or Angles from the list
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void SMESHGUI_ExtrusionDlg::OnScaleRemoved()
|
void SMESHGUI_ExtrusionDlg::OnScaleRemoved()
|
||||||
{
|
{
|
||||||
QList<QListWidgetItem*> aList = ScalesList->selectedItems();
|
QListWidget* widget;
|
||||||
|
QList<double>* list;
|
||||||
|
if ( sender() == RemoveScaleButton )
|
||||||
|
{
|
||||||
|
widget = ScalesList;
|
||||||
|
list = & myScalesList;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
widget = AnglesList;
|
||||||
|
list = & myAnglesList;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QListWidgetItem*> aList = widget->selectedItems();
|
||||||
QListWidgetItem* anItem;
|
QListWidgetItem* anItem;
|
||||||
int row = 0;
|
int row = 0;
|
||||||
foreach(anItem, aList) {
|
foreach(anItem, aList) {
|
||||||
row = ScalesList->row(anItem);
|
row = widget->row(anItem);
|
||||||
myScalesList.removeAt(row);
|
list->removeAt(row);
|
||||||
delete anItem;
|
delete anItem;
|
||||||
}
|
}
|
||||||
ScalesList->setCurrentRow( row, QItemSelectionModel::Select );
|
widget->setCurrentRow( row, QItemSelectionModel::Select );
|
||||||
}
|
}
|
||||||
|
@ -145,8 +145,11 @@ private:
|
|||||||
void getExtrusionVector(SMESH::DirStruct& aVector);
|
void getExtrusionVector(SMESH::DirStruct& aVector);
|
||||||
void extrusionByNormal(SMESH::SMESH_MeshEditor_ptr meshEditor,
|
void extrusionByNormal(SMESH::SMESH_MeshEditor_ptr meshEditor,
|
||||||
const bool makeGroups=false);
|
const bool makeGroups=false);
|
||||||
bool getScaleParams( SMESH::double_array*& scales,
|
void getScaleParams( SMESH::double_array*& scales,
|
||||||
SMESH::double_array*& basePoint );
|
SMESH::double_array*& basePoint,
|
||||||
|
bool & scalesVariation,
|
||||||
|
SMESH::double_array*& angles,
|
||||||
|
bool & anglesVariation);
|
||||||
|
|
||||||
bool isValid();
|
bool isValid();
|
||||||
bool isValuesValid();
|
bool isValuesValid();
|
||||||
@ -154,6 +157,7 @@ private:
|
|||||||
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
||||||
SVTK_Selector* mySelector;
|
SVTK_Selector* mySelector;
|
||||||
QList<double> myScalesList;
|
QList<double> myScalesList;
|
||||||
|
QList<double> myAnglesList;
|
||||||
|
|
||||||
// widgets
|
// widgets
|
||||||
SMESHGUI_3TypesSelector* SelectorWdg;
|
SMESHGUI_3TypesSelector* SelectorWdg;
|
||||||
@ -198,6 +202,13 @@ private:
|
|||||||
SMESHGUI_SpinBox* ScaleSpin;
|
SMESHGUI_SpinBox* ScaleSpin;
|
||||||
QCheckBox* LinearScalesCheck;
|
QCheckBox* LinearScalesCheck;
|
||||||
|
|
||||||
|
QGroupBox* AnglesGrp;
|
||||||
|
QListWidget* AnglesList;
|
||||||
|
QToolButton* AddAngleButton;
|
||||||
|
QToolButton* RemoveAngleButton;
|
||||||
|
SMESHGUI_SpinBox* AngleSpin;
|
||||||
|
QCheckBox* LinearAnglesCheck;
|
||||||
|
|
||||||
QGroupBox* GroupButtons;
|
QGroupBox* GroupButtons;
|
||||||
QPushButton* buttonOk;
|
QPushButton* buttonOk;
|
||||||
QPushButton* buttonCancel;
|
QPushButton* buttonCancel;
|
||||||
|
@ -1847,15 +1847,15 @@ Do you want to continue?</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_EXTRUSION_TO_DISTANCE</source>
|
<source>SMESH_EXTRUSION_TO_DISTANCE</source>
|
||||||
<translation>Extrusion To Distance</translation>
|
<translation>Extrusion to distance</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_EXTRUSION_ALONG_VECTOR</source>
|
<source>SMESH_EXTRUSION_ALONG_VECTOR</source>
|
||||||
<translation>Extrusion Along Vector</translation>
|
<translation>Extrusion along vector</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_EXTRUSION_BY_NORMAL</source>
|
<source>SMESH_EXTRUSION_BY_NORMAL</source>
|
||||||
<translation>Extrusion By Normal</translation>
|
<translation>Extrusion by normal</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_FACE</source>
|
<source>SMESH_FACE</source>
|
||||||
@ -5517,18 +5517,6 @@ Please select a group and try again</translation>
|
|||||||
<source>CANT_GET_TANGENT</source>
|
<source>CANT_GET_TANGENT</source>
|
||||||
<translation>Can't get tangent for one of the path nodes</translation>
|
<translation>Can't get tangent for one of the path nodes</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>EXTRUSION_0D</source>
|
|
||||||
<translation>Extrusion of 0D elements</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>EXTRUSION_1D</source>
|
|
||||||
<translation>Extrusion of 1D elements</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>EXTRUSION_2D</source>
|
|
||||||
<translation>Extrusion of 2D elements</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>EXTRUSION_ALONG_PATH</source>
|
<source>EXTRUSION_ALONG_PATH</source>
|
||||||
<translation>Extrusion along a path</translation>
|
<translation>Extrusion along a path</translation>
|
||||||
@ -5539,7 +5527,7 @@ Please select a group and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>LINEAR_ANGLES</source>
|
<source>LINEAR_ANGLES</source>
|
||||||
<translation>Linear variation of the angles</translation>
|
<translation>Linear variation of angles</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>NO_ELEMENTS_SELECTED</source>
|
<source>NO_ELEMENTS_SELECTED</source>
|
||||||
@ -5551,11 +5539,19 @@ Please select a group and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ANGLES</source>
|
<source>SMESH_ANGLES</source>
|
||||||
<translation>Rotation Angles</translation>
|
<translation>Rotation angles</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_BASE_POINT</source>
|
<source>SMESH_BASE_POINT</source>
|
||||||
<translation>Base Point</translation>
|
<translation>Base point</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_SCALES</source>
|
||||||
|
<translation>Scale factors</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>LINEAR_SCALES</source>
|
||||||
|
<translation>Linear variation of factors</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_PATH</source>
|
<source>SMESH_PATH</source>
|
||||||
@ -5575,11 +5571,11 @@ Please select a group and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_USE_ANGLES</source>
|
<source>SMESH_USE_ANGLES</source>
|
||||||
<translation>Use Angles</translation>
|
<translation>Use angles</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_USE_BASE_POINT</source>
|
<source>SMESH_USE_BASE_POINT</source>
|
||||||
<translation>Use Base Point</translation>
|
<translation>Use base point</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>WRONG_ANGLES_NUMBER</source>
|
<source>WRONG_ANGLES_NUMBER</source>
|
||||||
@ -5588,18 +5584,6 @@ Please select a group and try again</translation>
|
|||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SMESHGUI_ExtrusionDlg</name>
|
<name>SMESHGUI_ExtrusionDlg</name>
|
||||||
<message>
|
|
||||||
<source>EXTRUSION_0D</source>
|
|
||||||
<translation>Extrusion of nodes</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>EXTRUSION_1D</source>
|
|
||||||
<translation>Extrusion of 1D elements</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>EXTRUSION_2D</source>
|
|
||||||
<translation>Extrusion of 2D elements</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>EXTRUSION_ALONG_LINE</source>
|
<source>EXTRUSION_ALONG_LINE</source>
|
||||||
<translation>Extrusion along a line</translation>
|
<translation>Extrusion along a line</translation>
|
||||||
@ -5614,15 +5598,23 @@ Please select a group and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_SCALES</source>
|
<source>SMESH_SCALES</source>
|
||||||
<translation>Scale Factors</translation>
|
<translation>Scale factors</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>LINEAR_SCALES</source>
|
<source>LINEAR_SCALES</source>
|
||||||
<translation>Linear Variation of Scale Factors</translation>
|
<translation>Linear variation of factors</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>BASE_POINT</source>
|
<source>BASE_POINT</source>
|
||||||
<translation>Scaling Center</translation>
|
<translation>Base point</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>LINEAR_ANGLES</source>
|
||||||
|
<translation>Linear variation of angles</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_ANGLES</source>
|
||||||
|
<translation>Rotation angles</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
@ -79,8 +79,8 @@ class SMESHUtils_EXPORT SMESH_Delaunay
|
|||||||
// return UV of the i-th source boundary node (zero based)
|
// return UV of the i-th source boundary node (zero based)
|
||||||
gp_XY GetBndUV(const int iNode) const;
|
gp_XY GetBndUV(const int iNode) const;
|
||||||
|
|
||||||
// return scale factor to convert real UV to/from UV used for Delauney meshing:
|
// return scale factor to convert real UV to/from UV used for Delaunay meshing:
|
||||||
// delauney_UV = real_UV * scale
|
// delaunay_UV = real_UV * scale
|
||||||
const gp_XY& GetScale() const { return _scale; }
|
const gp_XY& GetScale() const { return _scale; }
|
||||||
|
|
||||||
void ToPython() const;
|
void ToPython() const;
|
||||||
|
@ -1764,7 +1764,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshVolume* volume,
|
|||||||
!vTool.GetFaceBaryCenter( iF, bc[0], bc[1], bc[2] ))
|
!vTool.GetFaceBaryCenter( iF, bc[0], bc[1], bc[2] ))
|
||||||
continue;
|
continue;
|
||||||
gp_XYZ bcp = point.XYZ() - gp_XYZ( bc[0], bc[1], bc[2] );
|
gp_XYZ bcp = point.XYZ() - gp_XYZ( bc[0], bc[1], bc[2] );
|
||||||
if ( gp_XYZ( n[0], n[1], n[2] ) * bcp < 1e-6 )
|
if ( gp_XYZ( n[0], n[1], n[2] ) * bcp < -1e-12 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// find distance to a facet
|
// find distance to a facet
|
||||||
|
@ -2496,7 +2496,8 @@ namespace MeshEditor_I
|
|||||||
bool myIsExtrusionByNormal;
|
bool myIsExtrusionByNormal;
|
||||||
|
|
||||||
static int makeFlags( CORBA::Boolean MakeGroups,
|
static int makeFlags( CORBA::Boolean MakeGroups,
|
||||||
CORBA::Boolean LinearVariation = false,
|
CORBA::Boolean ScaleVariation = false,
|
||||||
|
CORBA::Boolean AngleVariation = false,
|
||||||
CORBA::Boolean ByAverageNormal = false,
|
CORBA::Boolean ByAverageNormal = false,
|
||||||
CORBA::Boolean UseInputElemsOnly = false,
|
CORBA::Boolean UseInputElemsOnly = false,
|
||||||
CORBA::Long Flags = 0,
|
CORBA::Long Flags = 0,
|
||||||
@ -2505,7 +2506,8 @@ namespace MeshEditor_I
|
|||||||
if ( MakeGroups ) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_GROUPS;
|
if ( MakeGroups ) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_GROUPS;
|
||||||
if ( ByAverageNormal ) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_BY_AVG_NORMAL;
|
if ( ByAverageNormal ) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_BY_AVG_NORMAL;
|
||||||
if ( UseInputElemsOnly) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY;
|
if ( UseInputElemsOnly) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY;
|
||||||
if ( LinearVariation ) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_SCALE_LINEAR_VARIATION;
|
if ( ScaleVariation ) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_SCALE_LINEAR_VARIATION;
|
||||||
|
if ( AngleVariation ) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_ANGLE_LINEAR_VARIATION;
|
||||||
if ( MakeBoundary ) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_BOUNDARY;
|
if ( MakeBoundary ) Flags |= ::SMESH_MeshEditor::EXTRUSION_FLAG_BOUNDARY;
|
||||||
return Flags;
|
return Flags;
|
||||||
}
|
}
|
||||||
@ -2513,7 +2515,9 @@ namespace MeshEditor_I
|
|||||||
ExtrusionParams(const SMESH::DirStruct & theDir,
|
ExtrusionParams(const SMESH::DirStruct & theDir,
|
||||||
CORBA::Long theNbOfSteps,
|
CORBA::Long theNbOfSteps,
|
||||||
const SMESH::double_array & theScaleFactors,
|
const SMESH::double_array & theScaleFactors,
|
||||||
CORBA::Boolean theLinearVariation,
|
CORBA::Boolean theScaleVariation,
|
||||||
|
const SMESH::double_array & theAngles,
|
||||||
|
CORBA::Boolean theAngleVariation,
|
||||||
const SMESH::double_array & theBasePoint,
|
const SMESH::double_array & theBasePoint,
|
||||||
CORBA::Boolean theMakeGroups):
|
CORBA::Boolean theMakeGroups):
|
||||||
::SMESH_MeshEditor::ExtrusParam ( gp_Vec( theDir.PS.x,
|
::SMESH_MeshEditor::ExtrusParam ( gp_Vec( theDir.PS.x,
|
||||||
@ -2521,8 +2525,9 @@ namespace MeshEditor_I
|
|||||||
theDir.PS.z ),
|
theDir.PS.z ),
|
||||||
theNbOfSteps,
|
theNbOfSteps,
|
||||||
toList( theScaleFactors ),
|
toList( theScaleFactors ),
|
||||||
|
toList( theAngles ),
|
||||||
TBasePoint( theBasePoint ),
|
TBasePoint( theBasePoint ),
|
||||||
makeFlags( theMakeGroups, theLinearVariation )),
|
makeFlags( theMakeGroups, theScaleVariation, theAngleVariation )),
|
||||||
myIsExtrusionByNormal( false )
|
myIsExtrusionByNormal( false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -2537,8 +2542,9 @@ namespace MeshEditor_I
|
|||||||
theDir.PS.z ),
|
theDir.PS.z ),
|
||||||
theNbOfSteps,
|
theNbOfSteps,
|
||||||
std::list<double>(),
|
std::list<double>(),
|
||||||
|
std::list<double>(),
|
||||||
0,
|
0,
|
||||||
makeFlags( theMakeGroups, false, false, false,
|
makeFlags( theMakeGroups, false, false, false, false,
|
||||||
theExtrFlags, false ),
|
theExtrFlags, false ),
|
||||||
theSewTolerance ),
|
theSewTolerance ),
|
||||||
myIsExtrusionByNormal( false )
|
myIsExtrusionByNormal( false )
|
||||||
@ -2553,7 +2559,7 @@ namespace MeshEditor_I
|
|||||||
CORBA::Boolean theMakeGroups ):
|
CORBA::Boolean theMakeGroups ):
|
||||||
::SMESH_MeshEditor::ExtrusParam ( theStepSize,
|
::SMESH_MeshEditor::ExtrusParam ( theStepSize,
|
||||||
theNbOfSteps,
|
theNbOfSteps,
|
||||||
makeFlags( theMakeGroups, false,
|
makeFlags( theMakeGroups, false, false,
|
||||||
theByAverageNormal, theUseInputElemsOnly ),
|
theByAverageNormal, theUseInputElemsOnly ),
|
||||||
theDim),
|
theDim),
|
||||||
myIsExtrusionByNormal( true )
|
myIsExtrusionByNormal( true )
|
||||||
@ -2565,8 +2571,6 @@ namespace MeshEditor_I
|
|||||||
Flags() &= ~(::SMESH_MeshEditor::EXTRUSION_FLAG_GROUPS);
|
Flags() &= ~(::SMESH_MeshEditor::EXTRUSION_FLAG_GROUPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
static std::list<double> toList( const SMESH::double_array & theScaleFactors )
|
static std::list<double> toList( const SMESH::double_array & theScaleFactors )
|
||||||
{
|
{
|
||||||
std::list<double> scales;
|
std::list<double> scales;
|
||||||
@ -2575,6 +2579,8 @@ namespace MeshEditor_I
|
|||||||
return scales;
|
return scales;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
// structure used to convert SMESH::double_array to gp_XYZ*
|
// structure used to convert SMESH::double_array to gp_XYZ*
|
||||||
struct TBasePoint
|
struct TBasePoint
|
||||||
{
|
{
|
||||||
@ -2613,17 +2619,19 @@ SMESH_MeshEditor_i::ExtrusionSweepObjects(const SMESH::ListOfIDSources & theNode
|
|||||||
const SMESH::ListOfIDSources & theFaces,
|
const SMESH::ListOfIDSources & theFaces,
|
||||||
const SMESH::DirStruct & theStepVector,
|
const SMESH::DirStruct & theStepVector,
|
||||||
CORBA::Long theNbOfSteps,
|
CORBA::Long theNbOfSteps,
|
||||||
|
CORBA::Boolean theToMakeGroups,
|
||||||
const SMESH::double_array & theScaleFactors,
|
const SMESH::double_array & theScaleFactors,
|
||||||
CORBA::Boolean theLinearVariation,
|
CORBA::Boolean theScalesVariation,
|
||||||
const SMESH::double_array & theBasePoint,
|
const SMESH::double_array & theBasePoint,
|
||||||
CORBA::Boolean theToMakeGroups)
|
const SMESH::double_array & theAngles,
|
||||||
|
CORBA::Boolean theAnglesVariation)
|
||||||
throw (SALOME::SALOME_Exception)
|
throw (SALOME::SALOME_Exception)
|
||||||
{
|
{
|
||||||
SMESH_TRY;
|
SMESH_TRY;
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
ExtrusionParams params( theStepVector, theNbOfSteps, theScaleFactors,
|
ExtrusionParams params( theStepVector, theNbOfSteps, theScaleFactors, theScalesVariation,
|
||||||
theLinearVariation, theBasePoint, theToMakeGroups );
|
theAngles, theAnglesVariation, theBasePoint, theToMakeGroups );
|
||||||
|
|
||||||
TIDSortedElemSet elemsNodes[2];
|
TIDSortedElemSet elemsNodes[2];
|
||||||
for ( int i = 0, nb = theNodes.length(); i < nb; ++i ) {
|
for ( int i = 0, nb = theNodes.length(); i < nb; ++i ) {
|
||||||
@ -2664,12 +2672,17 @@ SMESH_MeshEditor_i::ExtrusionSweepObjects(const SMESH::ListOfIDSources & theNode
|
|||||||
{
|
{
|
||||||
dumpGroupsList( aPythonDump, aGroups );
|
dumpGroupsList( aPythonDump, aGroups );
|
||||||
aPythonDump << this<< ".ExtrusionSweepObjects( "
|
aPythonDump << this<< ".ExtrusionSweepObjects( "
|
||||||
<< theNodes << ", "
|
<< theNodes << ", "
|
||||||
<< theEdges << ", "
|
<< theEdges << ", "
|
||||||
<< theFaces << ", "
|
<< theFaces << ", "
|
||||||
<< theStepVector << ", "
|
<< theStepVector << ", "
|
||||||
<< TVar( theNbOfSteps ) << ", "
|
<< TVar( theNbOfSteps ) << ", "
|
||||||
<< theToMakeGroups << " )";
|
<< theToMakeGroups << ", "
|
||||||
|
<< TVar( theScaleFactors ) << ", "
|
||||||
|
<< theScalesVariation << ", "
|
||||||
|
<< TVar( theBasePoint ) << ", "
|
||||||
|
<< TVar( theAngles ) << ", "
|
||||||
|
<< theAnglesVariation << " )";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2847,15 +2860,17 @@ SMESH::ListOfGroups*
|
|||||||
SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & theNodes,
|
SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & theNodes,
|
||||||
const SMESH::ListOfIDSources & theEdges,
|
const SMESH::ListOfIDSources & theEdges,
|
||||||
const SMESH::ListOfIDSources & theFaces,
|
const SMESH::ListOfIDSources & theFaces,
|
||||||
SMESH::SMESH_IDSource_ptr thePathMesh,
|
SMESH::SMESH_IDSource_ptr thePathObject,
|
||||||
GEOM::GEOM_Object_ptr thePathShape,
|
GEOM::GEOM_Object_ptr thePathShape,
|
||||||
CORBA::Long theNodeStart,
|
CORBA::Long theNodeStart,
|
||||||
CORBA::Boolean theHasAngles,
|
CORBA::Boolean theHasAngles,
|
||||||
const SMESH::double_array & theAngles,
|
const SMESH::double_array & theAngles,
|
||||||
CORBA::Boolean theLinearVariation,
|
CORBA::Boolean theAnglesVariation,
|
||||||
CORBA::Boolean theHasRefPoint,
|
CORBA::Boolean theHasRefPoint,
|
||||||
const SMESH::PointStruct & theRefPoint,
|
const SMESH::PointStruct & theRefPoint,
|
||||||
bool theMakeGroups,
|
bool theMakeGroups,
|
||||||
|
const SMESH::double_array & theScaleFactors,
|
||||||
|
CORBA::Boolean theScalesVariation,
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& theError)
|
SMESH::SMESH_MeshEditor::Extrusion_Error& theError)
|
||||||
throw (SALOME::SALOME_Exception)
|
throw (SALOME::SALOME_Exception)
|
||||||
{
|
{
|
||||||
@ -2865,45 +2880,58 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & the
|
|||||||
SMESH::ListOfGroups_var aGroups = new SMESH::ListOfGroups;
|
SMESH::ListOfGroups_var aGroups = new SMESH::ListOfGroups;
|
||||||
|
|
||||||
theError = SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE;
|
theError = SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE;
|
||||||
if ( thePathMesh->_is_nil() )
|
if ( thePathObject->_is_nil() )
|
||||||
return aGroups._retn();
|
return aGroups._retn();
|
||||||
|
|
||||||
// get a sub-mesh
|
|
||||||
SMESH_subMesh* aSubMesh = 0;
|
SMDS_ElemIteratorPtr pathEdgesIterator;
|
||||||
SMESH_Mesh_i* aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( thePathMesh );
|
|
||||||
if ( thePathShape->_is_nil() )
|
SMESH_Mesh_i* aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( thePathObject );
|
||||||
|
if ( !CORBA::is_nil( thePathShape ) && aMeshImp )
|
||||||
{
|
{
|
||||||
// thePathMesh should be either a sub-mesh or a mesh with 1D elements only
|
// get a sub-mesh of thePathShape
|
||||||
if ( SMESH_subMesh_i* sm = SMESH::DownCast<SMESH_subMesh_i*>( thePathMesh ))
|
TopoDS_Shape aShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( thePathShape );
|
||||||
{
|
SMESH_subMesh* aSubMesh = aMeshImp->GetImpl().GetSubMesh( aShape );
|
||||||
SMESH::SMESH_Mesh_var mesh = thePathMesh->GetMesh();
|
if ( !aSubMesh )
|
||||||
aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
|
|
||||||
if ( !aMeshImp ) return aGroups._retn();
|
|
||||||
aSubMesh = aMeshImp->GetImpl().GetSubMeshContaining( sm->GetId() );
|
|
||||||
if ( !aSubMesh ) return aGroups._retn();
|
|
||||||
}
|
|
||||||
else if ( !aMeshImp ||
|
|
||||||
aMeshImp->NbEdges() != aMeshImp->NbElements() )
|
|
||||||
{
|
|
||||||
return aGroups._retn();
|
return aGroups._retn();
|
||||||
|
|
||||||
|
if ( !aSubMesh->GetSubMeshDS() )
|
||||||
|
{
|
||||||
|
SMESHDS_Mesh * meshDS = aMeshImp->GetImpl().GetMeshDS();
|
||||||
|
meshDS->AddCompoundSubmesh( aShape, TopAbs_EDGE );
|
||||||
|
if ( !aSubMesh->GetSubMeshDS() )
|
||||||
|
return aGroups._retn();
|
||||||
}
|
}
|
||||||
|
theError = SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE;
|
||||||
|
pathEdgesIterator = aSubMesh->GetSubMeshDS()->GetElements();
|
||||||
|
if ( !pathEdgesIterator->more() ||
|
||||||
|
pathEdgesIterator->next()->GetType() != SMDSAbs_Edge )
|
||||||
|
return aGroups._retn();
|
||||||
|
|
||||||
|
pathEdgesIterator = aSubMesh->GetSubMeshDS()->GetElements();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( !aMeshImp ) return aGroups._retn();
|
theError = SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE;
|
||||||
TopoDS_Shape aShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( thePathShape );
|
prepareIdSource( thePathObject );
|
||||||
aSubMesh = aMeshImp->GetImpl().GetSubMesh( aShape );
|
pathEdgesIterator = SMESH_Mesh_i::GetElements( thePathObject, SMESH::EDGE );
|
||||||
if ( !aSubMesh /*|| !aSubMesh->GetSubMeshDS()*/ )
|
if ( !pathEdgesIterator || !pathEdgesIterator->more() )
|
||||||
return aGroups._retn();
|
return aGroups._retn();
|
||||||
}
|
}
|
||||||
|
|
||||||
SMDS_MeshNode* nodeStart =
|
if ( !aMeshImp )
|
||||||
(SMDS_MeshNode*)aMeshImp->GetImpl().GetMeshDS()->FindNode(theNodeStart);
|
{
|
||||||
if ( !nodeStart ) {
|
SMESH::SMESH_Mesh_var pathMesh = thePathObject->GetMesh();
|
||||||
theError = SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
|
aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( pathMesh );
|
||||||
return aGroups._retn();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
theError = SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
|
||||||
|
const SMDS_MeshNode* nodeStart = aMeshImp->GetImpl().GetMeshDS()->FindNode( theNodeStart );
|
||||||
|
if ( !nodeStart )
|
||||||
|
return aGroups._retn();
|
||||||
|
|
||||||
|
|
||||||
TIDSortedElemSet elemsNodes[2];
|
TIDSortedElemSet elemsNodes[2];
|
||||||
for ( int i = 0, nb = theNodes.length(); i < nb; ++i ) {
|
for ( int i = 0, nb = theNodes.length(); i < nb; ++i ) {
|
||||||
if ( SMDS_ElemIteratorPtr nIt = myMesh_i->GetElements( theNodes[i], SMESH::NODE ))
|
if ( SMDS_ElemIteratorPtr nIt = myMesh_i->GetElements( theNodes[i], SMESH::NODE ))
|
||||||
@ -2914,12 +2942,11 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & the
|
|||||||
for ( int i = 0, nb = theFaces.length(); i < nb; ++i )
|
for ( int i = 0, nb = theFaces.length(); i < nb; ++i )
|
||||||
idSourceToSet( theFaces[i], getMeshDS(), elemsNodes[0], SMDSAbs_Face );
|
idSourceToSet( theFaces[i], getMeshDS(), elemsNodes[0], SMDSAbs_Face );
|
||||||
|
|
||||||
list<double> angles;
|
list<double> angles = ExtrusionParams::toList( theAngles );
|
||||||
for ( CORBA::ULong i = 0; i < theAngles.length(); i++ ) {
|
list<double> scales = ExtrusionParams::toList( theScaleFactors );
|
||||||
angles.push_back( theAngles[i] );
|
|
||||||
}
|
|
||||||
|
|
||||||
gp_Pnt refPnt( theRefPoint.x, theRefPoint.y, theRefPoint.z );
|
gp_Pnt refPnt( theRefPoint.x, theRefPoint.y, theRefPoint.z );
|
||||||
|
const gp_Pnt *refPntPtr = theHasRefPoint ? &refPnt : 0;
|
||||||
|
|
||||||
int nbOldGroups = myMesh->NbGroup();
|
int nbOldGroups = myMesh->NbGroup();
|
||||||
|
|
||||||
@ -2934,15 +2961,12 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & the
|
|||||||
theMakeGroups = false;
|
theMakeGroups = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
::SMESH_MeshEditor::Extrusion_Error error;
|
::SMESH_MeshEditor::Extrusion_Error error =
|
||||||
if ( !aSubMesh )
|
getEditor().ExtrusionAlongTrack( workElements,
|
||||||
error = getEditor().ExtrusionAlongTrack( workElements, &(aMeshImp->GetImpl()), nodeStart,
|
&(aMeshImp->GetImpl()), pathEdgesIterator, nodeStart,
|
||||||
theHasAngles, angles, theLinearVariation,
|
angles, theAnglesVariation,
|
||||||
theHasRefPoint, refPnt, theMakeGroups );
|
scales, theScalesVariation,
|
||||||
else
|
refPntPtr, theMakeGroups );
|
||||||
error = getEditor().ExtrusionAlongTrack( workElements, aSubMesh, nodeStart,
|
|
||||||
theHasAngles, angles, theLinearVariation,
|
|
||||||
theHasRefPoint, refPnt, theMakeGroups );
|
|
||||||
|
|
||||||
declareMeshModified( /*isReComputeSafe=*/true );
|
declareMeshModified( /*isReComputeSafe=*/true );
|
||||||
theError = convExtrError( error );
|
theError = convExtrError( error );
|
||||||
@ -2964,18 +2988,20 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & the
|
|||||||
<< theNodes << ", "
|
<< theNodes << ", "
|
||||||
<< theEdges << ", "
|
<< theEdges << ", "
|
||||||
<< theFaces << ", "
|
<< theFaces << ", "
|
||||||
<< thePathMesh << ", "
|
<< thePathObject << ", "
|
||||||
<< thePathShape << ", "
|
<< thePathShape << ", "
|
||||||
<< theNodeStart << ", "
|
<< theNodeStart << ", "
|
||||||
<< theHasAngles << ", "
|
<< theHasAngles << ", "
|
||||||
<< TVar( theAngles ) << ", "
|
<< TVar( theAngles ) << ", "
|
||||||
<< theLinearVariation << ", "
|
<< theAnglesVariation << ", "
|
||||||
<< theHasRefPoint << ", "
|
<< theHasRefPoint << ", "
|
||||||
<< "SMESH.PointStruct( "
|
<< "SMESH.PointStruct( "
|
||||||
<< TVar( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
|
<< TVar( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
|
||||||
<< TVar( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
|
<< TVar( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
|
||||||
<< TVar( theHasRefPoint ? theRefPoint.z : 0 ) << " ), "
|
<< TVar( theHasRefPoint ? theRefPoint.z : 0 ) << " ), "
|
||||||
<< theMakeGroups << " )";
|
<< theMakeGroups << ", "
|
||||||
|
<< TVar( theScaleFactors ) << ", "
|
||||||
|
<< theScalesVariation << " )";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -322,25 +322,27 @@ 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);
|
||||||
|
|
||||||
SMESH::ListOfGroups* RotationSweepObjects(const SMESH::ListOfIDSources & nodes,
|
SMESH::ListOfGroups* RotationSweepObjects(const SMESH::ListOfIDSources & Nodes,
|
||||||
const SMESH::ListOfIDSources & edges,
|
const SMESH::ListOfIDSources & Edges,
|
||||||
const SMESH::ListOfIDSources & faces,
|
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,
|
||||||
CORBA::Boolean toMakeGroups)
|
CORBA::Boolean ToMakeGroups)
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
SMESH::ListOfGroups* ExtrusionSweepObjects(const SMESH::ListOfIDSources & nodes,
|
SMESH::ListOfGroups* ExtrusionSweepObjects(const SMESH::ListOfIDSources & Nodes,
|
||||||
const SMESH::ListOfIDSources & edges,
|
const SMESH::ListOfIDSources & Edges,
|
||||||
const SMESH::ListOfIDSources & faces,
|
const SMESH::ListOfIDSources & Faces,
|
||||||
const SMESH::DirStruct & stepVector,
|
const SMESH::DirStruct & StepVector,
|
||||||
CORBA::Long nbOfSteps,
|
CORBA::Long NbOfSteps,
|
||||||
const SMESH::double_array & theScaleFactors,
|
CORBA::Boolean ToMakeGroups,
|
||||||
CORBA::Boolean theLinearVariation,
|
const SMESH::double_array & ScaleFactors,
|
||||||
const SMESH::double_array & theBasePoint,
|
CORBA::Boolean ScalesVariation,
|
||||||
CORBA::Boolean toMakeGroups)
|
const SMESH::double_array & BasePoint,
|
||||||
|
const SMESH::double_array & Angles,
|
||||||
|
CORBA::Boolean AnglesVariation)
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
SMESH::ListOfGroups* ExtrusionByNormal(const SMESH::ListOfIDSources& objects,
|
SMESH::ListOfGroups* ExtrusionByNormal(const SMESH::ListOfIDSources& objects,
|
||||||
@ -360,18 +362,20 @@ public:
|
|||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
SMESH::ListOfGroups*
|
SMESH::ListOfGroups*
|
||||||
ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & nodes,
|
ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & Nodes,
|
||||||
const SMESH::ListOfIDSources & edges,
|
const SMESH::ListOfIDSources & Edges,
|
||||||
const SMESH::ListOfIDSources & faces,
|
const SMESH::ListOfIDSources & Faces,
|
||||||
SMESH::SMESH_IDSource_ptr PathMesh,
|
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 AnglesVariation,
|
||||||
CORBA::Boolean HasRefPoint,
|
CORBA::Boolean HasRefPoint,
|
||||||
const SMESH::PointStruct & RefPoint,
|
const SMESH::PointStruct & RefPoint,
|
||||||
bool MakeGroups,
|
bool MakeGroups,
|
||||||
|
const SMESH::double_array & ScaleFactors,
|
||||||
|
CORBA::Boolean ScalesVariation,
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
|
||||||
throw (SALOME::SALOME_Exception);
|
throw (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
|
@ -752,26 +752,28 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if not meshes: return None
|
if not meshes: return None
|
||||||
for i,m in enumerate(meshes):
|
if not isinstance( meshes, list ):
|
||||||
if isinstance(m, Mesh):
|
meshes = [ meshes ]
|
||||||
|
for i,m in enumerate( meshes ):
|
||||||
|
if isinstance( m, Mesh ):
|
||||||
meshes[i] = m.GetMesh()
|
meshes[i] = m.GetMesh()
|
||||||
mergeTolerance,Parameters,hasVars = ParseParameters(mergeTolerance)
|
mergeTolerance,Parameters,hasVars = ParseParameters( mergeTolerance )
|
||||||
if hasattr(meshes[0], "SetParameters"):
|
if hasattr(meshes[0], "SetParameters"):
|
||||||
meshes[0].SetParameters(Parameters)
|
meshes[0].SetParameters( Parameters )
|
||||||
else:
|
else:
|
||||||
meshes[0].GetMesh().SetParameters(Parameters)
|
meshes[0].GetMesh().SetParameters( Parameters )
|
||||||
if isinstance( meshToAppendTo, Mesh ):
|
if isinstance( meshToAppendTo, Mesh ):
|
||||||
meshToAppendTo = meshToAppendTo.GetMesh()
|
meshToAppendTo = meshToAppendTo.GetMesh()
|
||||||
if allGroups:
|
if allGroups:
|
||||||
aSmeshMesh = SMESH._objref_SMESH_Gen.ConcatenateWithGroups(
|
aSmeshMesh = SMESH._objref_SMESH_Gen.ConcatenateWithGroups(
|
||||||
self,meshes,uniteIdenticalGroups,mergeNodesAndElements,
|
self,meshes,uniteIdenticalGroups,mergeNodesAndElements,
|
||||||
mergeTolerance,meshToAppendTo)
|
mergeTolerance,meshToAppendTo )
|
||||||
else:
|
else:
|
||||||
aSmeshMesh = SMESH._objref_SMESH_Gen.Concatenate(
|
aSmeshMesh = SMESH._objref_SMESH_Gen.Concatenate(
|
||||||
self,meshes,uniteIdenticalGroups,mergeNodesAndElements,
|
self,meshes,uniteIdenticalGroups,mergeNodesAndElements,
|
||||||
mergeTolerance,meshToAppendTo)
|
mergeTolerance,meshToAppendTo )
|
||||||
|
|
||||||
aMesh = Mesh(self, self.geompyD, aSmeshMesh, name=name)
|
aMesh = Mesh( self, self.geompyD, aSmeshMesh, name=name )
|
||||||
return aMesh
|
return aMesh
|
||||||
|
|
||||||
def CopyMesh( self, meshPart, meshName, toCopyGroups=False, toKeepIDs=False):
|
def CopyMesh( self, meshPart, meshName, toCopyGroups=False, toKeepIDs=False):
|
||||||
@ -2501,6 +2503,25 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
minor = -1
|
minor = -1
|
||||||
# invoke engine's function
|
# invoke engine's function
|
||||||
self.mesh.ExportMED(fileName, auto_groups, minor, overwrite, autoDimension)
|
self.mesh.ExportMED(fileName, auto_groups, minor, overwrite, autoDimension)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def Append(self, meshes, uniteIdenticalGroups = True,
|
||||||
|
mergeNodesAndElements = False, mergeTolerance = 1e-5, allGroups = False):
|
||||||
|
"""
|
||||||
|
Append given meshes into this mesh.
|
||||||
|
All groups of input meshes will be created in this mesh.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
meshes: :class:`meshes, sub-meshes, groups or filters <SMESH.SMESH_IDSource>` to append
|
||||||
|
uniteIdenticalGroups: if True, groups with same names are united, else they are renamed
|
||||||
|
mergeNodesAndElements: if True, equal nodes and elements are merged
|
||||||
|
mergeTolerance: tolerance for merging nodes
|
||||||
|
allGroups: forces creation of groups corresponding to every input mesh
|
||||||
|
"""
|
||||||
|
self.smeshpyD.Concatenate( meshes, uniteIdenticalGroups,
|
||||||
|
mergeNodesAndElements, mergeTolerance, allGroups,
|
||||||
|
meshToAppendTo = self.GetMesh() )
|
||||||
|
|
||||||
# Operations with groups:
|
# Operations with groups:
|
||||||
# ----------------------
|
# ----------------------
|
||||||
@ -5340,7 +5361,8 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
NbOfSteps, Tolerance, MakeGroups, TotalAngle)
|
NbOfSteps, Tolerance, MakeGroups, TotalAngle)
|
||||||
|
|
||||||
def ExtrusionSweepObjects(self, nodes, edges, faces, StepVector, NbOfSteps, MakeGroups=False,
|
def ExtrusionSweepObjects(self, nodes, edges, faces, StepVector, NbOfSteps, MakeGroups=False,
|
||||||
scaleFactors=[], linearVariation=False, basePoint=[] ):
|
scaleFactors=[], linearVariation=False, basePoint=[],
|
||||||
|
angles=[], anglesVariation=False):
|
||||||
"""
|
"""
|
||||||
Generate new elements by extrusion of the given elements and nodes
|
Generate new elements by extrusion of the given elements and nodes
|
||||||
|
|
||||||
@ -5354,15 +5376,19 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
NbOfSteps: the number of steps
|
NbOfSteps: the number of steps
|
||||||
MakeGroups: forces the generation of new groups from existing ones
|
MakeGroups: forces the generation of new groups from existing ones
|
||||||
scaleFactors: optional scale factors to apply during extrusion
|
scaleFactors: optional scale factors to apply during extrusion
|
||||||
linearVariation: if *True*, scaleFactors are spread over all *scaleFactors*,
|
linearVariation: if *True*, *scaleFactors* are spread over all *NbOfSteps*,
|
||||||
else scaleFactors[i] is applied to nodes at the i-th extrusion step
|
else *scaleFactors* [i] is applied to nodes at the i-th extrusion step
|
||||||
basePoint: optional scaling center; if not provided, a gravity center of
|
basePoint: optional scaling and rotation center; if not provided, a gravity center of
|
||||||
nodes and elements being extruded is used as the scaling center.
|
nodes and elements being extruded is used as the scaling center.
|
||||||
It can be either
|
It can be either
|
||||||
|
|
||||||
- a list of tree components of the point or
|
- a list of tree components of the point or
|
||||||
- a node ID or
|
- a node ID or
|
||||||
- a GEOM point
|
- a GEOM point
|
||||||
|
angles: list of angles in radians. Nodes at each extrusion step are rotated
|
||||||
|
around *basePoint*, additionally to previous steps.
|
||||||
|
anglesVariation: forces the computation of rotation angles as linear
|
||||||
|
variation of the given *angles* along path steps
|
||||||
Returns:
|
Returns:
|
||||||
the list of created :class:`groups <SMESH.SMESH_GroupBase>` if *MakeGroups* == True, empty list otherwise
|
the list of created :class:`groups <SMESH.SMESH_GroupBase>` if *MakeGroups* == True, empty list otherwise
|
||||||
|
|
||||||
@ -5387,13 +5413,17 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
basePoint = self.geompyD.PointCoordinates( basePoint )
|
basePoint = self.geompyD.PointCoordinates( basePoint )
|
||||||
|
|
||||||
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
NbOfSteps,Parameters,hasVars = ParseParameters(NbOfSteps)
|
||||||
Parameters = StepVector.PS.parameters + var_separator + Parameters
|
scaleFactors,scaleParameters,hasVars = ParseParameters(scaleFactors)
|
||||||
|
angles,angleParameters,hasVars = ParseAngles(angles)
|
||||||
|
Parameters = StepVector.PS.parameters + var_separator + \
|
||||||
|
Parameters + var_separator + \
|
||||||
|
scaleParameters + var_separator + angleParameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
|
|
||||||
return self.editor.ExtrusionSweepObjects( nodes, edges, faces,
|
return self.editor.ExtrusionSweepObjects( nodes, edges, faces,
|
||||||
StepVector, NbOfSteps,
|
StepVector, NbOfSteps, MakeGroups,
|
||||||
scaleFactors, linearVariation, basePoint,
|
scaleFactors, linearVariation, basePoint,
|
||||||
MakeGroups)
|
angles, anglesVariation )
|
||||||
|
|
||||||
|
|
||||||
def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps, MakeGroups=False, IsNodes = False):
|
def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps, MakeGroups=False, IsNodes = False):
|
||||||
@ -5555,9 +5585,10 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
return self.editor.AdvancedExtrusion(IDsOfElements, StepVector, NbOfSteps,
|
return self.editor.AdvancedExtrusion(IDsOfElements, StepVector, NbOfSteps,
|
||||||
ExtrFlags, SewTolerance, MakeGroups)
|
ExtrFlags, SewTolerance, MakeGroups)
|
||||||
|
|
||||||
def ExtrusionAlongPathObjects(self, Nodes, Edges, Faces, PathMesh, PathShape=None,
|
def ExtrusionAlongPathObjects(self, Nodes, Edges, Faces, PathObject, PathShape=None,
|
||||||
NodeStart=1, HasAngles=False, Angles=[], LinearVariation=False,
|
NodeStart=1, HasAngles=False, Angles=[], LinearVariation=False,
|
||||||
HasRefPoint=False, RefPoint=[0,0,0], MakeGroups=False):
|
HasRefPoint=False, RefPoint=[0,0,0], MakeGroups=False,
|
||||||
|
ScaleFactors=[], ScalesVariation=False):
|
||||||
"""
|
"""
|
||||||
Generate new elements by extrusion of the given elements and nodes along the path.
|
Generate new elements by extrusion of the given elements and nodes along the path.
|
||||||
The path of extrusion must be a meshed edge.
|
The path of extrusion must be a meshed edge.
|
||||||
@ -5566,20 +5597,22 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
Nodes: nodes to extrude: a list including ids, :class:`a mesh, sub-meshes, groups or filters <SMESH.SMESH_IDSource>`
|
Nodes: nodes to extrude: a list including ids, :class:`a mesh, sub-meshes, groups or filters <SMESH.SMESH_IDSource>`
|
||||||
Edges: edges to extrude: a list including ids, :class:`a mesh, sub-meshes, groups or filters <SMESH.SMESH_IDSource>`
|
Edges: edges to extrude: a list including ids, :class:`a mesh, sub-meshes, groups or filters <SMESH.SMESH_IDSource>`
|
||||||
Faces: faces to extrude: a list including ids, :class:`a mesh, sub-meshes, groups or filters <SMESH.SMESH_IDSource>`
|
Faces: faces to extrude: a list including ids, :class:`a mesh, sub-meshes, groups or filters <SMESH.SMESH_IDSource>`
|
||||||
PathMesh: 1D mesh or 1D sub-mesh, along which proceeds the extrusion
|
PathObject: :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>` containing edges along which proceeds the extrusion
|
||||||
PathShape: shape (edge) defines the sub-mesh of PathMesh if PathMesh
|
PathShape: optional shape (edge or wire) which defines the sub-mesh of the mesh defined by *PathObject* if the mesh contains not only path segments, else it can be None
|
||||||
contains not only path segments, else it can be None
|
|
||||||
NodeStart: the first or the last node on the path. Defines the direction of extrusion
|
NodeStart: the first or the last node on the path. Defines the direction of extrusion
|
||||||
HasAngles: allows the shape to be rotated around the path
|
HasAngles: not used obsolete
|
||||||
to get the resulting mesh in a helical fashion
|
Angles: list of angles in radians. Nodes at each extrusion step are rotated
|
||||||
Angles: list of angles
|
around *basePoint*, additionally to previous steps.
|
||||||
LinearVariation: forces the computation of rotation angles as linear
|
LinearVariation: forces the computation of rotation angles as linear
|
||||||
variation of the given Angles along path steps
|
variation of the given Angles along path steps
|
||||||
HasRefPoint: allows using the reference point
|
HasRefPoint: allows using the reference point
|
||||||
RefPoint: the reference point around which the shape is rotated (the mass center of the
|
RefPoint: optional scaling and rotation center (mass center of the extruded
|
||||||
shape by default). The User can specify any point as the Reference Point.
|
elements by default). The User can specify any point as the Reference Point.
|
||||||
*RefPoint* can be either GEOM Vertex, [x,y,z] or :class:`SMESH.PointStruct`
|
*RefPoint* can be either GEOM Vertex, [x,y,z] or :class:`SMESH.PointStruct`
|
||||||
MakeGroups: forces the generation of new groups from existing ones
|
MakeGroups: forces the generation of new groups from existing ones
|
||||||
|
ScaleFactors: optional scale factors to apply during extrusion
|
||||||
|
ScalesVariation: if *True*, *scaleFactors* are spread over all *NbOfSteps*,
|
||||||
|
else *scaleFactors* [i] is applied to nodes at the i-th extrusion step
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
list of created :class:`groups <SMESH.SMESH_GroupBase>` and
|
list of created :class:`groups <SMESH.SMESH_GroupBase>` and
|
||||||
@ -5597,15 +5630,18 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
if isinstance( RefPoint, list ):
|
if isinstance( RefPoint, list ):
|
||||||
if not RefPoint: RefPoint = [0,0,0]
|
if not RefPoint: RefPoint = [0,0,0]
|
||||||
RefPoint = SMESH.PointStruct( *RefPoint )
|
RefPoint = SMESH.PointStruct( *RefPoint )
|
||||||
if isinstance( PathMesh, Mesh ):
|
if isinstance( PathObject, Mesh ):
|
||||||
PathMesh = PathMesh.GetMesh()
|
PathObject = PathObject.GetMesh()
|
||||||
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
Angles,AnglesParameters,hasVars = ParseAngles(Angles)
|
||||||
Parameters = AnglesParameters + var_separator + RefPoint.parameters
|
ScaleFactors,ScalesParameters,hasVars = ParseParameters(ScaleFactors)
|
||||||
|
Parameters = AnglesParameters + var_separator + \
|
||||||
|
RefPoint.parameters + var_separator + ScalesParameters
|
||||||
self.mesh.SetParameters(Parameters)
|
self.mesh.SetParameters(Parameters)
|
||||||
return self.editor.ExtrusionAlongPathObjects(Nodes, Edges, Faces,
|
return self.editor.ExtrusionAlongPathObjects(Nodes, Edges, Faces,
|
||||||
PathMesh, PathShape, NodeStart,
|
PathObject, PathShape, NodeStart,
|
||||||
HasAngles, Angles, LinearVariation,
|
HasAngles, Angles, LinearVariation,
|
||||||
HasRefPoint, RefPoint, MakeGroups)
|
HasRefPoint, RefPoint, MakeGroups,
|
||||||
|
ScaleFactors, ScalesVariation)
|
||||||
|
|
||||||
def ExtrusionAlongPathX(self, Base, Path, NodeStart,
|
def ExtrusionAlongPathX(self, Base, Path, NodeStart,
|
||||||
HasAngles=False, Angles=[], LinearVariation=False,
|
HasAngles=False, Angles=[], LinearVariation=False,
|
||||||
@ -5619,9 +5655,9 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
Base: :class:`mesh, sub-mesh, group, filter <SMESH.SMESH_IDSource>`, or list of ids of elements for extrusion
|
Base: :class:`mesh, sub-mesh, group, filter <SMESH.SMESH_IDSource>`, or list of ids of elements for extrusion
|
||||||
Path: 1D mesh or 1D sub-mesh, along which proceeds the extrusion
|
Path: 1D mesh or 1D sub-mesh, along which proceeds the extrusion
|
||||||
NodeStart: the start node from Path. Defines the direction of extrusion
|
NodeStart: the start node from Path. Defines the direction of extrusion
|
||||||
HasAngles: allows the shape to be rotated around the path
|
HasAngles: not used obsolete
|
||||||
to get the resulting mesh in a helical fashion
|
Angles: list of angles in radians. Nodes at each extrusion step are rotated
|
||||||
Angles: list of angles in radians
|
around *basePoint*, additionally to previous steps.
|
||||||
LinearVariation: forces the computation of rotation angles as linear
|
LinearVariation: forces the computation of rotation angles as linear
|
||||||
variation of the given Angles along path steps
|
variation of the given Angles along path steps
|
||||||
HasRefPoint: allows using the reference point
|
HasRefPoint: allows using the reference point
|
||||||
@ -5662,9 +5698,9 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
PathMesh: mesh containing a 1D sub-mesh on the edge, along which proceeds the extrusion
|
PathMesh: mesh containing a 1D sub-mesh on the edge, along which proceeds the extrusion
|
||||||
PathShape: shape (edge) defines the sub-mesh for the path
|
PathShape: shape (edge) defines the sub-mesh for the path
|
||||||
NodeStart: the first or the last node on the edge. Defines the direction of extrusion
|
NodeStart: the first or the last node on the edge. Defines the direction of extrusion
|
||||||
HasAngles: allows the shape to be rotated around the path
|
HasAngles: not used obsolete
|
||||||
to get the resulting mesh in a helical fashion
|
Angles: list of angles in radians. Nodes at each extrusion step are rotated
|
||||||
Angles: list of angles in radians
|
around *basePoint*, additionally to previous steps.
|
||||||
HasRefPoint: allows using the reference point
|
HasRefPoint: allows using the reference point
|
||||||
RefPoint: the reference point around which the shape is rotated (the mass center of the shape by default).
|
RefPoint: the reference 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.
|
The User can specify any point as the Reference Point.
|
||||||
@ -5703,9 +5739,9 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
PathMesh: mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
|
PathMesh: mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
|
||||||
PathShape: shape (edge) defines the sub-mesh for the path
|
PathShape: shape (edge) defines the sub-mesh for the path
|
||||||
NodeStart: the first or the last node on the edge. Defines the direction of extrusion
|
NodeStart: the first or the last node on the edge. Defines the direction of extrusion
|
||||||
HasAngles: allows the shape to be rotated around the path
|
HasAngles: not used obsolete
|
||||||
to get the resulting mesh in a helical fashion
|
Angles: list of angles in radians. Nodes at each extrusion step are rotated
|
||||||
Angles: list of angles
|
around *basePoint*, additionally to previous steps.
|
||||||
HasRefPoint: allows using the reference point
|
HasRefPoint: allows using the reference point
|
||||||
RefPoint: the reference point around which the shape is rotated (the mass center of the shape by default).
|
RefPoint: the reference 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.
|
The User can specify any point as the Reference Point.
|
||||||
@ -5741,9 +5777,9 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
PathMesh: mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
|
PathMesh: mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
|
||||||
PathShape: shape (edge) defines the sub-mesh for the path
|
PathShape: shape (edge) defines the sub-mesh for the path
|
||||||
NodeStart: the first or the last node on the edge. Defines the direction of extrusion
|
NodeStart: the first or the last node on the edge. Defines the direction of extrusion
|
||||||
HasAngles: allows the shape to be rotated around the path
|
HasAngles: not used obsolete
|
||||||
to get the resulting mesh in a helical fashion
|
Angles: list of angles in radians. Nodes at each extrusion step are rotated
|
||||||
Angles: list of angles
|
around *basePoint*, additionally to previous steps.
|
||||||
HasRefPoint: allows using the reference point
|
HasRefPoint: allows using the reference point
|
||||||
RefPoint: the reference point around which the shape is rotated (the mass center of the shape by default).
|
RefPoint: the reference 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.
|
The User can specify any point as the Reference Point.
|
||||||
@ -5779,9 +5815,9 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
PathMesh: mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
|
PathMesh: mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
|
||||||
PathShape: shape (edge) defines the sub-mesh for the path
|
PathShape: shape (edge) defines the sub-mesh for the path
|
||||||
NodeStart: the first or the last node on the edge. Defines the direction of extrusion
|
NodeStart: the first or the last node on the edge. Defines the direction of extrusion
|
||||||
HasAngles: allows the shape to be rotated around the path
|
HasAngles: not used obsolete
|
||||||
to get the resulting mesh in a helical fashion
|
Angles: list of angles in radians. Nodes at each extrusion step are rotated
|
||||||
Angles: list of angles
|
around *basePoint*, additionally to previous steps.
|
||||||
HasRefPoint: allows using the reference point
|
HasRefPoint: allows using the reference point
|
||||||
RefPoint: the reference point around which the shape is rotated (the mass center of the shape by default).
|
RefPoint: the reference 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.
|
The User can specify any point as the Reference Point.
|
||||||
|
@ -32,10 +32,11 @@
|
|||||||
#include "SMESHDS_Mesh.hxx"
|
#include "SMESHDS_Mesh.hxx"
|
||||||
#include "SMESHDS_SubMesh.hxx"
|
#include "SMESHDS_SubMesh.hxx"
|
||||||
#include "SMESH_Algo.hxx"
|
#include "SMESH_Algo.hxx"
|
||||||
#include "SMESH_Mesh.hxx"
|
|
||||||
#include "SMESH_MesherHelper.hxx"
|
|
||||||
#include "SMESH_ComputeError.hxx"
|
|
||||||
#include "SMESH_Block.hxx"
|
#include "SMESH_Block.hxx"
|
||||||
|
#include "SMESH_ComputeError.hxx"
|
||||||
|
#include "SMESH_Mesh.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
|
#include "SMESH_MesherHelper.hxx"
|
||||||
|
|
||||||
#include <Adaptor2d_Curve2d.hxx>
|
#include <Adaptor2d_Curve2d.hxx>
|
||||||
#include <BRepAdaptor_CompCurve.hxx>
|
#include <BRepAdaptor_CompCurve.hxx>
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "SMESH_Group.hxx"
|
#include "SMESH_Group.hxx"
|
||||||
#include "SMESH_HypoFilter.hxx"
|
#include "SMESH_HypoFilter.hxx"
|
||||||
#include "SMESH_Mesh.hxx"
|
#include "SMESH_Mesh.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
#include "SMESH_subMesh.hxx"
|
#include "SMESH_subMesh.hxx"
|
||||||
#include "SMESH_subMeshEventListener.hxx"
|
#include "SMESH_subMeshEventListener.hxx"
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "SMESH_Mesh.hxx"
|
#include "SMESH_Mesh.hxx"
|
||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
#include "SMESH_OctreeNode.hxx"
|
#include "SMESH_OctreeNode.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
#include "SMESH_subMesh.hxx"
|
#include "SMESH_subMesh.hxx"
|
||||||
|
|
||||||
#include "Utils_SALOME_Exception.hxx"
|
#include "Utils_SALOME_Exception.hxx"
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "SMESH_Comment.hxx"
|
#include "SMESH_Comment.hxx"
|
||||||
#include "SMESH_Gen.hxx"
|
#include "SMESH_Gen.hxx"
|
||||||
#include "SMESH_HypoFilter.hxx"
|
#include "SMESH_HypoFilter.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
#include "StdMeshers_FaceSide.hxx"
|
#include "StdMeshers_FaceSide.hxx"
|
||||||
#include "StdMeshers_ProjectionSource1D.hxx"
|
#include "StdMeshers_ProjectionSource1D.hxx"
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "SMESH_Hypothesis.hxx"
|
#include "SMESH_Hypothesis.hxx"
|
||||||
#include "SMESH_Mesh.hxx"
|
#include "SMESH_Mesh.hxx"
|
||||||
#include "SMESH_MeshAlgos.hxx"
|
#include "SMESH_MeshAlgos.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
#include "SMESH_subMesh.hxx"
|
#include "SMESH_subMesh.hxx"
|
||||||
#include "SMESH_subMeshEventListener.hxx"
|
#include "SMESH_subMeshEventListener.hxx"
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include "SMESH_Gen.hxx"
|
#include "SMESH_Gen.hxx"
|
||||||
#include "SMESH_Mesh.hxx"
|
#include "SMESH_Mesh.hxx"
|
||||||
#include "SMESH_MeshAlgos.hxx"
|
#include "SMESH_MeshAlgos.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
#include "SMESH_Pattern.hxx"
|
#include "SMESH_Pattern.hxx"
|
||||||
#include "SMESH_subMesh.hxx"
|
#include "SMESH_subMesh.hxx"
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "SMDS_MeshNode.hxx"
|
#include "SMDS_MeshNode.hxx"
|
||||||
#include "SMESHDS_Mesh.hxx"
|
#include "SMESHDS_Mesh.hxx"
|
||||||
#include "SMESHDS_SubMesh.hxx"
|
#include "SMESHDS_SubMesh.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
#include "SMESH_ProxyMesh.hxx"
|
#include "SMESH_ProxyMesh.hxx"
|
||||||
#include "SMESH_subMesh.hxx"
|
#include "SMESH_subMesh.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
#include "SMESH_subMeshEventListener.hxx"
|
#include "SMESH_subMeshEventListener.hxx"
|
||||||
#include "StdMeshers_FaceSide.hxx"
|
#include "StdMeshers_FaceSide.hxx"
|
||||||
#include "StdMeshers_ViscousLayers2D.hxx"
|
#include "StdMeshers_ViscousLayers2D.hxx"
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include "SMESH_Group.hxx"
|
#include "SMESH_Group.hxx"
|
||||||
#include "SMESH_HypoFilter.hxx"
|
#include "SMESH_HypoFilter.hxx"
|
||||||
#include "SMESH_Mesh.hxx"
|
#include "SMESH_Mesh.hxx"
|
||||||
|
#include "SMESH_MeshEditor.hxx"
|
||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
#include "SMESH_ProxyMesh.hxx"
|
#include "SMESH_ProxyMesh.hxx"
|
||||||
#include "SMESH_Quadtree.hxx"
|
#include "SMESH_Quadtree.hxx"
|
||||||
|
Loading…
Reference in New Issue
Block a user