1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
23 // File : SMESH_MeshEditor.hxx
24 // Created : Mon Apr 12 14:56:19 2004
25 // Author : Edward AGAPOV (eap)
28 #ifndef SMESH_MeshEditor_HeaderFile
29 #define SMESH_MeshEditor_HeaderFile
31 #include "SMESH_SMESH.hxx"
33 #include "SMDS_MeshElement.hxx"
34 #include "SMESH_Controls.hxx"
35 #include "SMESH_Mesh.hxx"
36 #include "SMESH_SequenceOfElemPtr.hxx"
37 #include "SMESH_SequenceOfNode.hxx"
39 #include <utilities.h>
41 #include <TColStd_HSequenceOfReal.hxx>
53 class SMESH_MesherHelper;
56 typedef std::map<const SMDS_MeshElement*,
57 std::list<const SMDS_MeshElement*> > TElemOfElemListMap;
58 typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
60 //!< Set of elements sorted by ID, to be used to assure predictability of edition
61 typedef std::set< const SMDS_MeshElement*, TIDCompare > TIDSortedElemSet;
63 typedef pair< const SMDS_MeshNode*, const SMDS_MeshNode* > NLink;
66 //=======================================================================
68 * \brief Searcher for the node closest to point
70 //=======================================================================
71 struct SMESH_NodeSearcher
73 virtual const SMDS_MeshNode* FindClosestTo( const gp_Pnt& pnt ) = 0;
74 virtual void MoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt ) = 0;
77 //=======================================================================
79 * \brief Find elements of given type where the given point is IN or ON.
80 * Returns nb of found elements and elements them-selves.
82 * 'ALL' type means elements of any type excluding nodes and 0D elements
84 //=======================================================================
86 struct SMESH_ElementSearcher
88 virtual int FindElementsByPoint(const gp_Pnt& point,
89 SMDSAbs_ElementType type,
90 std::vector< const SMDS_MeshElement* >& foundElems)=0;
93 //=======================================================================
95 * \brief A sorted pair of nodes
97 //=======================================================================
99 struct SMESH_TLink: public NLink
101 SMESH_TLink(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2 ):NLink( n1, n2 )
102 { if ( n1->GetID() < n2->GetID() ) std::swap( first, second ); }
103 SMESH_TLink(const NLink& link ):NLink( link )
104 { if ( first->GetID() < second->GetID() ) std::swap( first, second ); }
105 const SMDS_MeshNode* node1() const { return first; }
106 const SMDS_MeshNode* node2() const { return second; }
110 // ============================================================
112 * \brief Editor of a mesh
114 // ============================================================
116 class SMESH_EXPORT SMESH_MeshEditor
119 //------------------------------------------
121 * \brief SMDS_MeshNode -> gp_XYZ convertor
123 //------------------------------------------
124 struct TNodeXYZ : public gp_XYZ
126 const SMDS_MeshNode* _node;
127 TNodeXYZ( const SMDS_MeshElement* e):_node(0) {
129 ASSERT( e->GetType() == SMDSAbs_Node );
130 _node = static_cast<const SMDS_MeshNode*>(e);
131 SetCoord( _node->X(), _node->Y(), _node->Z() );
134 double Distance(const SMDS_MeshNode* n) const { return (TNodeXYZ( n )-*this).Modulus(); }
135 double SquareDistance(const SMDS_MeshNode* n) const { return (TNodeXYZ( n )-*this).SquareModulus(); }
136 bool operator==(const TNodeXYZ& other) const { return _node == other._node; }
141 SMESH_MeshEditor( SMESH_Mesh* theMesh );
146 SMDS_MeshElement* AddElement(const std::vector<const SMDS_MeshNode*> & nodes,
147 const SMDSAbs_ElementType type,
153 SMDS_MeshElement* AddElement(const std::vector<int> & nodeIDs,
154 const SMDSAbs_ElementType type,
158 bool Remove (const std::list< int >& theElemIDs, const bool isNodes);
159 // Remove a node or an element.
160 // Modify a compute state of sub-meshes which become empty
162 bool InverseDiag (const SMDS_MeshElement * theTria1,
163 const SMDS_MeshElement * theTria2 );
164 // Replace two neighbour triangles with ones built on the same 4 nodes
165 // but having other common link.
166 // Return False if args are improper
168 bool InverseDiag (const SMDS_MeshNode * theNode1,
169 const SMDS_MeshNode * theNode2 );
170 // Replace two neighbour triangles sharing theNode1-theNode2 link
171 // with ones built on the same 4 nodes but having other common link.
172 // Return false if proper faces not found
174 bool DeleteDiag (const SMDS_MeshNode * theNode1,
175 const SMDS_MeshNode * theNode2 );
176 // Replace two neighbour triangles sharing theNode1-theNode2 link
177 // with a quadrangle built on the same 4 nodes.
178 // Return false if proper faces not found
180 bool Reorient (const SMDS_MeshElement * theElement);
181 // Reverse theElement orientation
185 * \brief Fuse neighbour triangles into quadrangles.
186 * \param theElems - The triangles to be fused.
187 * \param theCriterion - Is used to choose a neighbour to fuse with.
188 * \param theMaxAngle - Is a max angle between element normals at which fusion
189 * is still performed; theMaxAngle is mesured in radians.
190 * \retval bool - Success or not.
192 bool TriToQuad (TIDSortedElemSet & theElems,
193 SMESH::Controls::NumericalFunctorPtr theCriterion,
194 const double theMaxAngle);
197 * \brief Split quadrangles into triangles.
198 * \param theElems - The faces to be splitted.
199 * \param theCriterion - Is used to choose a diagonal for splitting.
200 * \retval bool - Success or not.
202 bool QuadToTri (TIDSortedElemSet & theElems,
203 SMESH::Controls::NumericalFunctorPtr theCriterion);
206 * \brief Split quadrangles into triangles.
207 * \param theElems - The faces to be splitted.
208 * \param the13Diag - Is used to choose a diagonal for splitting.
209 * \retval bool - Success or not.
211 bool QuadToTri (TIDSortedElemSet & theElems,
212 const bool the13Diag);
215 * \brief Find better diagonal for splitting.
216 * \param theQuad - The face to find better splitting of.
217 * \param theCriterion - Is used to choose a diagonal for splitting.
218 * \retval int - 1 for 1-3 diagonal, 2 for 2-4, -1 - for errors.
220 int BestSplit (const SMDS_MeshElement* theQuad,
221 SMESH::Controls::NumericalFunctorPtr theCriterion);
224 enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL };
226 void Smooth (TIDSortedElemSet & theElements,
227 std::set<const SMDS_MeshNode*> & theFixedNodes,
228 const SmoothMethod theSmoothMethod,
229 const int theNbIterations,
230 double theTgtAspectRatio = 1.0,
231 const bool the2D = true);
232 // Smooth theElements using theSmoothMethod during theNbIterations
233 // or until a worst element has aspect ratio <= theTgtAspectRatio.
234 // Aspect Ratio varies in range [1.0, inf].
235 // If theElements is empty, the whole mesh is smoothed.
236 // theFixedNodes contains additionally fixed nodes. Nodes built
237 // on edges and boundary nodes are always fixed.
238 // If the2D, smoothing is performed using UV parameters of nodes
239 // on geometrical faces
241 typedef std::auto_ptr< std::list<int> > PGroupIDs;
243 PGroupIDs RotationSweep (TIDSortedElemSet & theElements,
244 const gp_Ax1& theAxis,
245 const double theAngle,
246 const int theNbSteps,
247 const double theToler,
248 const bool theMakeGroups,
249 const bool theMakeWalls=true);
250 // Generate new elements by rotation of theElements around theAxis
251 // by theAngle by theNbSteps
254 * Auxilary flag for advanced extrusion.
255 * BOUNDARY: create or not boundary for result of extrusion
256 * SEW: try to use existing nodes or create new nodes in any case
258 enum ExtrusionFlags {
259 EXTRUSION_FLAG_BOUNDARY = 0x01,
260 EXTRUSION_FLAG_SEW = 0x02
264 * special structire for control of extrusion functionality
267 gp_Dir myDir; // direction of extrusion
268 Handle(TColStd_HSequenceOfReal) mySteps; // magnitudes for each step
269 SMESH_SequenceOfNode myNodes; // nodes for using in sewing
273 * Create new node in the mesh with given coordinates
274 * (auxilary for advanced extrusion)
276 const SMDS_MeshNode* CreateNode(const double x,
279 const double tolnode,
280 SMESH_SequenceOfNode& aNodes);
283 * Generate new elements by extrusion of theElements
284 * It is a method used in .idl file. All functionality
285 * is implemented in the next method (see below) which
286 * is used in the cuurent method.
287 * param theElems - list of elements for extrusion
288 * param newElemsMap returns history of extrusion
289 * param theFlags set flags for performing extrusion (see description
290 * of enum ExtrusionFlags for additional information)
291 * param theTolerance - uses for comparing locations of nodes if flag
292 * EXTRUSION_FLAG_SEW is set
294 PGroupIDs ExtrusionSweep (TIDSortedElemSet & theElems,
295 const gp_Vec& theStep,
296 const int theNbSteps,
297 TElemOfElemListMap& newElemsMap,
298 const bool theMakeGroups,
299 const int theFlags = EXTRUSION_FLAG_BOUNDARY,
300 const double theTolerance = 1.e-6);
303 * Generate new elements by extrusion of theElements
304 * param theElems - list of elements for extrusion
305 * param newElemsMap returns history of extrusion
306 * param theFlags set flags for performing extrusion (see description
307 * of enum ExtrusionFlags for additional information)
308 * param theTolerance - uses for comparing locations of nodes if flag
309 * EXTRUSION_FLAG_SEW is set
310 * param theParams - special structure for manage of extrusion
312 PGroupIDs ExtrusionSweep (TIDSortedElemSet & theElems,
313 ExtrusParam& theParams,
314 TElemOfElemListMap& newElemsMap,
315 const bool theMakeGroups,
317 const double theTolerance);
320 // Generate new elements by extrusion of theElements
321 // by theStep by theNbSteps
323 enum Extrusion_Error {
328 EXTR_BAD_STARTING_NODE,
329 EXTR_BAD_ANGLES_NUMBER,
330 EXTR_CANT_GET_TANGENT
333 Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet & theElements,
334 SMESH_subMesh* theTrackPattern,
335 const SMDS_MeshNode* theNodeStart,
336 const bool theHasAngles,
337 std::list<double>& theAngles,
338 const bool theLinearVariation,
339 const bool theHasRefPoint,
340 const gp_Pnt& theRefPoint,
341 const bool theMakeGroups);
342 Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet & theElements,
343 SMESH_Mesh* theTrackPattern,
344 const SMDS_MeshNode* theNodeStart,
345 const bool theHasAngles,
346 std::list<double>& theAngles,
347 const bool theLinearVariation,
348 const bool theHasRefPoint,
349 const gp_Pnt& theRefPoint,
350 const bool theMakeGroups);
351 // Generate new elements by extrusion of theElements along path given by theTrackPattern,
352 // theHasAngles are the rotation angles, base point can be given by theRefPoint
354 PGroupIDs Transform (TIDSortedElemSet & theElements,
355 const gp_Trsf& theTrsf,
357 const bool theMakeGroups,
358 SMESH_Mesh* theTargetMesh=0);
359 // Move or copy theElements applying theTrsf to their nodes
362 typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes;
364 void FindCoincidentNodes (std::set<const SMDS_MeshNode*> & theNodes,
365 const double theTolerance,
366 TListOfListOfNodes & theGroupsOfNodes);
367 // Return list of group of nodes close to each other within theTolerance.
368 // Search among theNodes or in the whole mesh if theNodes is empty.
371 * \brief Return SMESH_NodeSearcher
373 SMESH_NodeSearcher* GetNodeSearcher();
376 * \brief Return SMESH_ElementSearcher
378 SMESH_ElementSearcher* GetElementSearcher();
380 * \brief Return true if the point is IN or ON of the element
382 static bool isOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol );
385 int SimplifyFace (const std::vector<const SMDS_MeshNode *> faceNodes,
386 std::vector<const SMDS_MeshNode *>& poly_nodes,
387 std::vector<int>& quantities) const;
388 // Split face, defined by <faceNodes>, into several faces by repeating nodes.
389 // Is used by MergeNodes()
391 void MergeNodes (TListOfListOfNodes & theNodeGroups);
392 // In each group, the cdr of nodes are substituted by the first one
395 typedef std::list< std::list< int > > TListOfListOfElementsID;
397 void FindEqualElements(std::set<const SMDS_MeshElement*> & theElements,
398 TListOfListOfElementsID & theGroupsOfElementsID);
399 // Return list of group of elements build on the same nodes.
400 // Search among theElements or in the whole mesh if theElements is empty.
402 void MergeElements(TListOfListOfElementsID & theGroupsOfElementsID);
403 // In each group remove all but first of elements.
405 void MergeEqualElements();
406 // Remove all but one of elements built on the same nodes.
407 // Return nb of successfully merged groups.
409 static bool CheckFreeBorderNodes(const SMDS_MeshNode* theNode1,
410 const SMDS_MeshNode* theNode2,
411 const SMDS_MeshNode* theNode3 = 0);
412 // Return true if the three nodes are on a free border
414 static bool FindFreeBorder (const SMDS_MeshNode* theFirstNode,
415 const SMDS_MeshNode* theSecondNode,
416 const SMDS_MeshNode* theLastNode,
417 std::list< const SMDS_MeshNode* > & theNodes,
418 std::list< const SMDS_MeshElement* >& theFaces);
419 // Return nodes and faces of a free border if found
423 // for SewFreeBorder()
424 SEW_BORDER1_NOT_FOUND,
425 SEW_BORDER2_NOT_FOUND,
426 SEW_BOTH_BORDERS_NOT_FOUND,
428 SEW_VOLUMES_TO_SPLIT,
429 // for SewSideElements()
430 SEW_DIFF_NB_OF_ELEMENTS,
431 SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
438 Sew_Error SewFreeBorder (const SMDS_MeshNode* theBorderFirstNode,
439 const SMDS_MeshNode* theBorderSecondNode,
440 const SMDS_MeshNode* theBorderLastNode,
441 const SMDS_MeshNode* theSide2FirstNode,
442 const SMDS_MeshNode* theSide2SecondNode,
443 const SMDS_MeshNode* theSide2ThirdNode = 0,
444 const bool theSide2IsFreeBorder = true,
445 const bool toCreatePolygons = false,
446 const bool toCreatePolyedrs = false);
447 // Sew the free border to the side2 by replacing nodes in
448 // elements on the free border with nodes of the elements
449 // of the side 2. If nb of links in the free border and
450 // between theSide2FirstNode and theSide2LastNode are different,
451 // additional nodes are inserted on a link provided that no
452 // volume elements share the splitted link.
453 // The side 2 is a free border if theSide2IsFreeBorder == true.
454 // Sewing is peformed between the given first, second and last
455 // nodes on the sides.
456 // theBorderFirstNode is merged with theSide2FirstNode.
457 // if (!theSide2IsFreeBorder) then theSide2SecondNode gives
458 // the last node on the side 2, which will be merged with
459 // theBorderLastNode.
460 // if (theSide2IsFreeBorder) then theSide2SecondNode will
461 // be merged with theBorderSecondNode.
462 // if (theSide2IsFreeBorder && theSide2ThirdNode == 0) then
463 // the 2 free borders are sewn link by link and no additional
464 // nodes are inserted.
465 // Return false, if sewing failed.
467 Sew_Error SewSideElements (TIDSortedElemSet& theSide1,
468 TIDSortedElemSet& theSide2,
469 const SMDS_MeshNode* theFirstNode1ToMerge,
470 const SMDS_MeshNode* theFirstNode2ToMerge,
471 const SMDS_MeshNode* theSecondNode1ToMerge,
472 const SMDS_MeshNode* theSecondNode2ToMerge);
473 // Sew two sides of a mesh. Nodes belonging to theSide1 are
474 // merged with nodes of elements of theSide2.
475 // Number of elements in theSide1 and in theSide2 must be
476 // equal and they should have similar node connectivity.
477 // The nodes to merge should belong to side s borders and
478 // the first node should be linked to the second.
480 void InsertNodesIntoLink(const SMDS_MeshElement* theFace,
481 const SMDS_MeshNode* theBetweenNode1,
482 const SMDS_MeshNode* theBetweenNode2,
483 std::list<const SMDS_MeshNode*>& theNodesToInsert,
484 const bool toCreatePoly = false);
485 // insert theNodesToInsert into theFace between theBetweenNode1 and theBetweenNode2.
486 // If toCreatePoly is true, replace theFace by polygon, else split theFace.
488 void UpdateVolumes (const SMDS_MeshNode* theBetweenNode1,
489 const SMDS_MeshNode* theBetweenNode2,
490 std::list<const SMDS_MeshNode*>& theNodesToInsert);
491 // insert theNodesToInsert into all volumes, containing link
492 // theBetweenNode1 - theBetweenNode2, between theBetweenNode1 and theBetweenNode2.
494 void ConvertToQuadratic(const bool theForce3d);
495 //converts all mesh to quadratic one, deletes old elements, replacing
496 //them with quadratic ones with the same id.
498 bool ConvertFromQuadratic();
499 //converts all mesh from quadratic to ordinary ones, deletes old quadratic elements, replacing
500 //them with ordinary mesh elements with the same id.
502 static void AddToSameGroups (const SMDS_MeshElement* elemToAdd,
503 const SMDS_MeshElement* elemInGroups,
504 SMESHDS_Mesh * aMesh);
505 // Add elemToAdd to the all groups the elemInGroups belongs to
507 static void RemoveElemFromGroups (const SMDS_MeshElement* element,
508 SMESHDS_Mesh * aMesh);
509 // remove element from the all groups
511 static void ReplaceElemInGroups (const SMDS_MeshElement* elemToRm,
512 const SMDS_MeshElement* elemToAdd,
513 SMESHDS_Mesh * aMesh);
514 // replace elemToRm by elemToAdd in the all groups
517 * \brief Return nodes linked to the given one in elements of the type
519 static void GetLinkedNodes( const SMDS_MeshNode* node,
520 TIDSortedElemSet & linkedNodes,
521 SMDSAbs_ElementType type = SMDSAbs_All );
523 static const SMDS_MeshElement* FindFaceInSet(const SMDS_MeshNode* n1,
524 const SMDS_MeshNode* n2,
525 const TIDSortedElemSet& elemSet,
526 const TIDSortedElemSet& avoidSet,
529 // Return a face having linked nodes n1 and n2 and which is
530 // - not in avoidSet,
531 // - in elemSet provided that !elemSet.empty()
532 // i1 and i2 optionally returns indices of n1 and n2
535 * \brief Find corresponding nodes in two sets of faces
536 * \param theSide1 - first face set
537 * \param theSide2 - second first face
538 * \param theFirstNode1 - a boundary node of set 1
539 * \param theFirstNode2 - a node of set 2 corresponding to theFirstNode1
540 * \param theSecondNode1 - a boundary node of set 1 linked with theFirstNode1
541 * \param theSecondNode2 - a node of set 2 corresponding to theSecondNode1
542 * \param nReplaceMap - output map of corresponding nodes
543 * \retval Sew_Error - is a success or not
545 static Sew_Error FindMatchingNodes(std::set<const SMDS_MeshElement*>& theSide1,
546 std::set<const SMDS_MeshElement*>& theSide2,
547 const SMDS_MeshNode* theFirstNode1,
548 const SMDS_MeshNode* theFirstNode2,
549 const SMDS_MeshNode* theSecondNode1,
550 const SMDS_MeshNode* theSecondNode2,
551 TNodeNodeMap & theNodeReplaceMap);
554 * \brief Returns true if given node is medium
555 * \param n - node to check
556 * \param typeToCheck - type of elements containing the node to ask about node status
557 * \retval bool - check result
559 static bool IsMedium(const SMDS_MeshNode* node,
560 const SMDSAbs_ElementType typeToCheck = SMDSAbs_All);
562 int FindShape (const SMDS_MeshElement * theElem);
563 // Return an index of the shape theElem is on
564 // or zero if a shape not found
566 SMESH_Mesh * GetMesh() { return myMesh; }
568 SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
570 const SMESH_SequenceOfElemPtr& GetLastCreatedNodes() const { return myLastCreatedNodes; }
572 const SMESH_SequenceOfElemPtr& GetLastCreatedElems() const { return myLastCreatedElems; }
574 bool DoubleNodes( const std::list< int >& theListOfNodes,
575 const std::list< int >& theListOfModifiedElems );
577 bool DoubleNodes( const TIDSortedElemSet& theElems,
578 const TIDSortedElemSet& theNodesNot,
579 const TIDSortedElemSet& theAffectedElems );
581 bool DoubleNodesInRegion( const TIDSortedElemSet& theElems,
582 const TIDSortedElemSet& theNodesNot,
583 const TopoDS_Shape& theShape );
586 * \brief Generated skin mesh (containing 2D cells) from 3D mesh
587 * The created 2D mesh elements based on nodes of free faces of boundary volumes
588 * \return TRUE if operation has been completed successfully, FALSE otherwise
590 bool Make2DMeshFrom3D();
595 * \brief Convert elements contained in a submesh to quadratic
596 * \retval int - nb of checked elements
598 int convertElemToQuadratic(SMESHDS_SubMesh * theSm,
599 SMESH_MesherHelper& theHelper,
600 const bool theForce3d);
603 * \brief Convert quadratic elements to linear ones and remove quadratic nodes
604 * \retval int - nb of checked elements
606 int removeQuadElem( SMESHDS_SubMesh * theSm,
607 SMDS_ElemIteratorPtr theItr,
608 const int theShapeID);
610 * \brief Create groups of elements made during transformation
611 * \param nodeGens - nodes making corresponding myLastCreatedNodes
612 * \param elemGens - elements making corresponding myLastCreatedElems
613 * \param postfix - to append to names of new groups
615 PGroupIDs generateGroups(const SMESH_SequenceOfElemPtr& nodeGens,
616 const SMESH_SequenceOfElemPtr& elemGens,
617 const std::string& postfix,
618 SMESH_Mesh* targetMesh=0);
621 typedef std::map<const SMDS_MeshNode*, std::list<const SMDS_MeshNode*> > TNodeOfNodeListMap;
622 typedef TNodeOfNodeListMap::iterator TNodeOfNodeListMapItr;
623 typedef std::vector<TNodeOfNodeListMapItr> TVecOfNnlmiMap;
624 typedef std::map<const SMDS_MeshElement*, TVecOfNnlmiMap > TElemOfVecOfNnlmiMap;
627 * \brief Create elements by sweeping an element
628 * \param elem - element to sweep
629 * \param newNodesItVec - nodes generated from each node of the element
630 * \param newElems - generated elements
631 * \param nbSteps - number of sweeping steps
632 * \param srcElements - to append elem for each generated element
634 void sweepElement(const SMDS_MeshElement* elem,
635 const std::vector<TNodeOfNodeListMapItr> & newNodesItVec,
636 std::list<const SMDS_MeshElement*>& newElems,
638 SMESH_SequenceOfElemPtr& srcElements);
641 * \brief Create 1D and 2D elements around swept elements
642 * \param mapNewNodes - source nodes and ones generated from them
643 * \param newElemsMap - source elements and ones generated from them
644 * \param elemNewNodesMap - nodes generated from each node of each element
645 * \param elemSet - all swept elements
646 * \param nbSteps - number of sweeping steps
647 * \param srcElements - to append elem for each generated element
649 void makeWalls (TNodeOfNodeListMap & mapNewNodes,
650 TElemOfElemListMap & newElemsMap,
651 TElemOfVecOfNnlmiMap & elemNewNodesMap,
652 TIDSortedElemSet& elemSet,
654 SMESH_SequenceOfElemPtr& srcElements);
656 struct SMESH_MeshEditor_PathPoint
660 double myAngle, myPrm;
662 SMESH_MeshEditor_PathPoint(): myPnt(99., 99., 99.), myTgt(1.,0.,0.), myAngle(0), myPrm(0) {}
663 void SetPnt (const gp_Pnt& aP3D) { myPnt =aP3D; }
664 void SetTangent (const gp_Dir& aTgt) { myTgt =aTgt; }
665 void SetAngle (const double& aBeta) { myAngle=aBeta; }
666 void SetParameter(const double& aPrm) { myPrm =aPrm; }
667 const gp_Pnt& Pnt ()const { return myPnt; }
668 const gp_Dir& Tangent ()const { return myTgt; }
669 double Angle ()const { return myAngle; }
670 double Parameter ()const { return myPrm; }
672 Extrusion_Error MakeEdgePathPoints(std::list<double>& aPrms,
673 const TopoDS_Edge& aTrackEdge,
675 std::list<SMESH_MeshEditor_PathPoint>& aLPP);
676 Extrusion_Error MakeExtrElements(TIDSortedElemSet& theElements,
677 std::list<SMESH_MeshEditor_PathPoint>& theFullList,
678 const bool theHasAngles,
679 std::list<double>& theAngles,
680 const bool theLinearVariation,
681 const bool theHasRefPoint,
682 const gp_Pnt& theRefPoint,
683 const bool theMakeGroups);
684 void LinearAngleVariation(const int NbSteps,
685 list<double>& theAngles);
687 bool doubleNodes( SMESHDS_Mesh* theMeshDS,
688 const TIDSortedElemSet& theElems,
689 const TIDSortedElemSet& theNodesNot,
690 std::map< const SMDS_MeshNode*, const SMDS_MeshNode* >& theNodeNodeMap,
691 const bool theIsDoubleElem );
698 * Sequence for keeping nodes created during last operation
700 SMESH_SequenceOfElemPtr myLastCreatedNodes;
703 * Sequence for keeping elements created during last operation
705 SMESH_SequenceOfElemPtr myLastCreatedElems;