1 // Copyright (C) 2007-2013 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
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_TypeDefs.hxx"
37 #include "SMESH_ComputeError.hxx"
39 #include <utilities.h>
41 #include <TColStd_HSequenceOfReal.hxx>
53 class SMESH_MesherHelper;
54 class SMESH_NodeSearcher;
56 // ============================================================
58 * \brief Editor of a mesh
60 // ============================================================
62 class SMESH_EXPORT SMESH_MeshEditor
66 SMESH_MeshEditor( SMESH_Mesh* theMesh );
68 SMESH_Mesh * GetMesh() { return myMesh; }
69 SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
71 const SMESH_SequenceOfElemPtr& GetLastCreatedNodes() const { return myLastCreatedNodes; }
72 const SMESH_SequenceOfElemPtr& GetLastCreatedElems() const { return myLastCreatedElems; }
73 void CrearLastCreated();
74 SMESH_ComputeErrorPtr & GetError() { return myError; }
79 SMDS_MeshElement* AddElement(const std::vector<const SMDS_MeshNode*> & nodes,
80 const SMDSAbs_ElementType type,
83 const double ballDiameter=0.);
87 SMDS_MeshElement* AddElement(const std::vector<int> & nodeIDs,
88 const SMDSAbs_ElementType type,
92 int Remove (const std::list< int >& theElemIDs, const bool isNodes);
93 // Remove a node or an element.
94 // Modify a compute state of sub-meshes which become empty
96 void Create0DElementsOnAllNodes( const TIDSortedElemSet& elements,
97 TIDSortedElemSet& all0DElems);
98 // Create 0D elements on all nodes of the given object except those
99 // nodes on which a 0D element already exists. \a all0DElems returns
100 // all 0D elements found or created on nodes of \a elements
102 bool InverseDiag (const SMDS_MeshElement * theTria1,
103 const SMDS_MeshElement * theTria2 );
104 // Replace two neighbour triangles with ones built on the same 4 nodes
105 // but having other common link.
106 // Return False if args are improper
108 bool InverseDiag (const SMDS_MeshNode * theNode1,
109 const SMDS_MeshNode * theNode2 );
110 // Replace two neighbour triangles sharing theNode1-theNode2 link
111 // with ones built on the same 4 nodes but having other common link.
112 // Return false if proper faces not found
114 bool DeleteDiag (const SMDS_MeshNode * theNode1,
115 const SMDS_MeshNode * theNode2 );
116 // Replace two neighbour triangles sharing theNode1-theNode2 link
117 // with a quadrangle built on the same 4 nodes.
118 // Return false if proper faces not found
120 bool Reorient (const SMDS_MeshElement * theElement);
121 // Reverse theElement orientation
123 int Reorient2D (TIDSortedElemSet & theFaces,
124 const gp_Dir& theDirection,
125 const SMDS_MeshElement * theFace);
126 // Reverse theFaces whose orientation to be same as that of theFace
127 // oriented according to theDirection. Return nb of reoriented faces
130 * \brief Fuse neighbour triangles into quadrangles.
131 * \param theElems - The triangles to be fused.
132 * \param theCriterion - Is used to choose a neighbour to fuse with.
133 * \param theMaxAngle - Is a max angle between element normals at which fusion
134 * is still performed; theMaxAngle is mesured in radians.
135 * \return bool - Success or not.
137 bool TriToQuad (TIDSortedElemSet & theElems,
138 SMESH::Controls::NumericalFunctorPtr theCriterion,
139 const double theMaxAngle);
141 * \brief Split quadrangles into triangles.
142 * \param theElems - The faces to be splitted.
143 * \param theCriterion - Is used to choose a diagonal for splitting.
144 * \return bool - Success or not.
146 bool QuadToTri (TIDSortedElemSet & theElems,
147 SMESH::Controls::NumericalFunctorPtr theCriterion);
149 * \brief Split quadrangles into triangles.
150 * \param theElems - The faces to be splitted.
151 * \param the13Diag - Is used to choose a diagonal for splitting.
152 * \return bool - Success or not.
154 bool QuadToTri (TIDSortedElemSet & theElems,
155 const bool the13Diag);
157 * \brief Split each of given quadrangles into 4 triangles.
158 * \param theElems - The faces to be splitted. If empty all faces are split.
160 void QuadTo4Tri (TIDSortedElemSet & theElems);
163 * \brief Find better diagonal for splitting.
164 * \param theQuad - The face to find better splitting of.
165 * \param theCriterion - Is used to choose a diagonal for splitting.
166 * \return int - 1 for 1-3 diagonal, 2 for 2-4, -1 - for errors.
168 int BestSplit (const SMDS_MeshElement* theQuad,
169 SMESH::Controls::NumericalFunctorPtr theCriterion);
172 enum SplitVolumToTetraFlags { HEXA_TO_5 = 1, HEXA_TO_6 = 2, HEXA_TO_24 = 3 };//!<arg of SplitVolumesIntoTetra()
174 * \brief Split volumic elements into tetrahedra.
176 void SplitVolumesIntoTetra (const TIDSortedElemSet & theElems, const int theMethodFlags);
179 enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL };
181 void Smooth (TIDSortedElemSet & theElements,
182 std::set<const SMDS_MeshNode*> & theFixedNodes,
183 const SmoothMethod theSmoothMethod,
184 const int theNbIterations,
185 double theTgtAspectRatio = 1.0,
186 const bool the2D = true);
187 // Smooth theElements using theSmoothMethod during theNbIterations
188 // or until a worst element has aspect ratio <= theTgtAspectRatio.
189 // Aspect Ratio varies in range [1.0, inf].
190 // If theElements is empty, the whole mesh is smoothed.
191 // theFixedNodes contains additionally fixed nodes. Nodes built
192 // on edges and boundary nodes are always fixed.
193 // If the2D, smoothing is performed using UV parameters of nodes
194 // on geometrical faces
196 typedef std::auto_ptr< std::list<int> > PGroupIDs;
198 PGroupIDs RotationSweep (TIDSortedElemSet & theElements,
199 const gp_Ax1& theAxis,
200 const double theAngle,
201 const int theNbSteps,
202 const double theToler,
203 const bool theMakeGroups,
204 const bool theMakeWalls=true);
205 // Generate new elements by rotation of theElements around theAxis
206 // by theAngle by theNbSteps
209 * Auxilary flag for advanced extrusion.
210 * BOUNDARY: create or not boundary for result of extrusion
211 * SEW: try to use existing nodes or create new nodes in any case
213 enum ExtrusionFlags {
214 EXTRUSION_FLAG_BOUNDARY = 0x01,
215 EXTRUSION_FLAG_SEW = 0x02
219 * special structure for control of extrusion functionality
222 gp_Dir myDir; // direction of extrusion
223 Handle(TColStd_HSequenceOfReal) mySteps; // magnitudes for each step
224 SMESH_SequenceOfNode myNodes; // nodes for using in sewing
228 * Create new node in the mesh with given coordinates
229 * (auxiliary for advanced extrusion)
231 const SMDS_MeshNode* CreateNode(const double x,
234 const double tolnode,
235 SMESH_SequenceOfNode& aNodes);
238 * Generate new elements by extrusion of theElements
239 * It is a method used in .idl file. All functionality
240 * is implemented in the next method (see below) which
241 * is used in the current method.
242 * @param theElems - list of elements for extrusion
243 * @param newElemsMap returns history of extrusion
244 * @param theFlags set flags for performing extrusion (see description
245 * of enum ExtrusionFlags for additional information)
246 * @param theTolerance - uses for comparing locations of nodes if flag
247 * EXTRUSION_FLAG_SEW is set
249 PGroupIDs ExtrusionSweep (TIDSortedElemSet & theElems,
250 const gp_Vec& theStep,
251 const int theNbSteps,
252 TElemOfElemListMap& newElemsMap,
253 const bool theMakeGroups,
254 const int theFlags = EXTRUSION_FLAG_BOUNDARY,
255 const double theTolerance = 1.e-6);
258 * Generate new elements by extrusion of theElements
259 * @param theElems - list of elements for extrusion
260 * @param newElemsMap returns history of extrusion
261 * @param theFlags set flags for performing extrusion (see description
262 * of enum ExtrusionFlags for additional information)
263 * @param theTolerance - uses for comparing locations of nodes if flag
264 * EXTRUSION_FLAG_SEW is set
265 * @param theParams - special structure for manage of extrusion
267 PGroupIDs ExtrusionSweep (TIDSortedElemSet & theElems,
268 ExtrusParam& theParams,
269 TElemOfElemListMap& newElemsMap,
270 const bool theMakeGroups,
272 const double theTolerance);
275 // Generate new elements by extrusion of theElements
276 // by theStep by theNbSteps
278 enum Extrusion_Error {
283 EXTR_BAD_STARTING_NODE,
284 EXTR_BAD_ANGLES_NUMBER,
285 EXTR_CANT_GET_TANGENT
288 Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet & theElements,
289 SMESH_subMesh* theTrackPattern,
290 const SMDS_MeshNode* theNodeStart,
291 const bool theHasAngles,
292 std::list<double>& theAngles,
293 const bool theLinearVariation,
294 const bool theHasRefPoint,
295 const gp_Pnt& theRefPoint,
296 const bool theMakeGroups);
297 Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet & theElements,
298 SMESH_Mesh* theTrackPattern,
299 const SMDS_MeshNode* theNodeStart,
300 const bool theHasAngles,
301 std::list<double>& theAngles,
302 const bool theLinearVariation,
303 const bool theHasRefPoint,
304 const gp_Pnt& theRefPoint,
305 const bool theMakeGroups);
306 // Generate new elements by extrusion of theElements along path given by theTrackPattern,
307 // theHasAngles are the rotation angles, base point can be given by theRefPoint
309 PGroupIDs Transform (TIDSortedElemSet & theElements,
310 const gp_Trsf& theTrsf,
312 const bool theMakeGroups,
313 SMESH_Mesh* theTargetMesh=0);
314 // Move or copy theElements applying theTrsf to their nodes
316 typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes;
318 void FindCoincidentNodes (TIDSortedNodeSet & theNodes,
319 const double theTolerance,
320 TListOfListOfNodes & theGroupsOfNodes);
321 // Return list of group of nodes close to each other within theTolerance.
322 // Search among theNodes or in the whole mesh if theNodes is empty.
324 void MergeNodes (TListOfListOfNodes & theNodeGroups);
325 // In each group, the cdr of nodes are substituted by the first one
328 typedef std::list< std::list< int > > TListOfListOfElementsID;
330 void FindEqualElements(TIDSortedElemSet & theElements,
331 TListOfListOfElementsID & theGroupsOfElementsID);
332 // Return list of group of elements build on the same nodes.
333 // Search among theElements or in the whole mesh if theElements is empty.
335 void MergeElements(TListOfListOfElementsID & theGroupsOfElementsID);
336 // In each group remove all but first of elements.
338 void MergeEqualElements();
339 // Remove all but one of elements built on the same nodes.
340 // Return nb of successfully merged groups.
342 int SimplifyFace (const std::vector<const SMDS_MeshNode *>& faceNodes,
343 std::vector<const SMDS_MeshNode *>& poly_nodes,
344 std::vector<int>& quantities) const;
345 // Split face, defined by <faceNodes>, into several faces by repeating nodes.
346 // Is used by MergeNodes()
348 static bool CheckFreeBorderNodes(const SMDS_MeshNode* theNode1,
349 const SMDS_MeshNode* theNode2,
350 const SMDS_MeshNode* theNode3 = 0);
351 // Return true if the three nodes are on a free border
353 static bool FindFreeBorder (const SMDS_MeshNode* theFirstNode,
354 const SMDS_MeshNode* theSecondNode,
355 const SMDS_MeshNode* theLastNode,
356 std::list< const SMDS_MeshNode* > & theNodes,
357 std::list< const SMDS_MeshElement* >& theFaces);
358 // Return nodes and faces of a free border if found
362 // for SewFreeBorder()
363 SEW_BORDER1_NOT_FOUND,
364 SEW_BORDER2_NOT_FOUND,
365 SEW_BOTH_BORDERS_NOT_FOUND,
367 SEW_VOLUMES_TO_SPLIT,
368 // for SewSideElements()
369 SEW_DIFF_NB_OF_ELEMENTS,
370 SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
377 Sew_Error SewFreeBorder (const SMDS_MeshNode* theBorderFirstNode,
378 const SMDS_MeshNode* theBorderSecondNode,
379 const SMDS_MeshNode* theBorderLastNode,
380 const SMDS_MeshNode* theSide2FirstNode,
381 const SMDS_MeshNode* theSide2SecondNode,
382 const SMDS_MeshNode* theSide2ThirdNode = 0,
383 const bool theSide2IsFreeBorder = true,
384 const bool toCreatePolygons = false,
385 const bool toCreatePolyedrs = false);
386 // Sew the free border to the side2 by replacing nodes in
387 // elements on the free border with nodes of the elements
388 // of the side 2. If nb of links in the free border and
389 // between theSide2FirstNode and theSide2LastNode are different,
390 // additional nodes are inserted on a link provided that no
391 // volume elements share the splitted link.
392 // The side 2 is a free border if theSide2IsFreeBorder == true.
393 // Sewing is peformed between the given first, second and last
394 // nodes on the sides.
395 // theBorderFirstNode is merged with theSide2FirstNode.
396 // if (!theSide2IsFreeBorder) then theSide2SecondNode gives
397 // the last node on the side 2, which will be merged with
398 // theBorderLastNode.
399 // if (theSide2IsFreeBorder) then theSide2SecondNode will
400 // be merged with theBorderSecondNode.
401 // if (theSide2IsFreeBorder && theSide2ThirdNode == 0) then
402 // the 2 free borders are sewn link by link and no additional
403 // nodes are inserted.
404 // Return false, if sewing failed.
406 Sew_Error SewSideElements (TIDSortedElemSet& theSide1,
407 TIDSortedElemSet& theSide2,
408 const SMDS_MeshNode* theFirstNode1ToMerge,
409 const SMDS_MeshNode* theFirstNode2ToMerge,
410 const SMDS_MeshNode* theSecondNode1ToMerge,
411 const SMDS_MeshNode* theSecondNode2ToMerge);
412 // Sew two sides of a mesh. Nodes belonging to theSide1 are
413 // merged with nodes of elements of theSide2.
414 // Number of elements in theSide1 and in theSide2 must be
415 // equal and they should have similar node connectivity.
416 // The nodes to merge should belong to side s borders and
417 // the first node should be linked to the second.
419 void InsertNodesIntoLink(const SMDS_MeshElement* theFace,
420 const SMDS_MeshNode* theBetweenNode1,
421 const SMDS_MeshNode* theBetweenNode2,
422 std::list<const SMDS_MeshNode*>& theNodesToInsert,
423 const bool toCreatePoly = false);
424 // insert theNodesToInsert into theFace between theBetweenNode1 and theBetweenNode2.
425 // If toCreatePoly is true, replace theFace by polygon, else split theFace.
427 void UpdateVolumes (const SMDS_MeshNode* theBetweenNode1,
428 const SMDS_MeshNode* theBetweenNode2,
429 std::list<const SMDS_MeshNode*>& theNodesToInsert);
430 // insert theNodesToInsert into all volumes, containing link
431 // theBetweenNode1 - theBetweenNode2, between theBetweenNode1 and theBetweenNode2.
433 void ConvertToQuadratic(const bool theForce3d, const bool theToBiQuad);
434 void ConvertToQuadratic(const bool theForce3d,
435 TIDSortedElemSet& theElements, const bool theToBiQuad);
436 // Converts all mesh to quadratic or bi-quadratic one, deletes old elements,
437 // replacing them with quadratic or bi-quadratic ones with the same id.
438 // If theForce3d = 1; this results in the medium node lying at the
439 // middle of the line segments connecting start and end node of a mesh element.
440 // If theForce3d = 0; this results in the medium node lying at the
441 // geometrical edge from which the mesh element is built.
443 bool ConvertFromQuadratic();
444 void ConvertFromQuadratic(TIDSortedElemSet& theElements);
445 // Converts all mesh from quadratic to ordinary ones, deletes old quadratic elements, replacing
446 // them with ordinary mesh elements with the same id.
447 // Returns true in case of success, false otherwise.
449 static void AddToSameGroups (const SMDS_MeshElement* elemToAdd,
450 const SMDS_MeshElement* elemInGroups,
451 SMESHDS_Mesh * aMesh);
452 // Add elemToAdd to the all groups the elemInGroups belongs to
454 static void RemoveElemFromGroups (const SMDS_MeshElement* element,
455 SMESHDS_Mesh * aMesh);
456 // remove element from the all groups
458 static void ReplaceElemInGroups (const SMDS_MeshElement* elemToRm,
459 const SMDS_MeshElement* elemToAdd,
460 SMESHDS_Mesh * aMesh);
461 // replace elemToRm by elemToAdd in the all groups
463 static void ReplaceElemInGroups (const SMDS_MeshElement* elemToRm,
464 const std::vector<const SMDS_MeshElement*>& elemToAdd,
465 SMESHDS_Mesh * aMesh);
466 // replace elemToRm by elemToAdd in the all groups
469 * \brief Return nodes linked to the given one in elements of the type
471 static void GetLinkedNodes( const SMDS_MeshNode* node,
472 TIDSortedElemSet & linkedNodes,
473 SMDSAbs_ElementType type = SMDSAbs_All );
476 * \brief Find corresponding nodes in two sets of faces
477 * \param theSide1 - first face set
478 * \param theSide2 - second first face
479 * \param theFirstNode1 - a boundary node of set 1
480 * \param theFirstNode2 - a node of set 2 corresponding to theFirstNode1
481 * \param theSecondNode1 - a boundary node of set 1 linked with theFirstNode1
482 * \param theSecondNode2 - a node of set 2 corresponding to theSecondNode1
483 * \param nReplaceMap - output map of corresponding nodes
484 * \return Sew_Error - is a success or not
486 static Sew_Error FindMatchingNodes(std::set<const SMDS_MeshElement*>& theSide1,
487 std::set<const SMDS_MeshElement*>& theSide2,
488 const SMDS_MeshNode* theFirstNode1,
489 const SMDS_MeshNode* theFirstNode2,
490 const SMDS_MeshNode* theSecondNode1,
491 const SMDS_MeshNode* theSecondNode2,
492 TNodeNodeMap & theNodeReplaceMap);
495 * \brief Returns true if given node is medium
496 * \param n - node to check
497 * \param typeToCheck - type of elements containing the node to ask about node status
498 * \return bool - check result
500 static bool IsMedium(const SMDS_MeshNode* node,
501 const SMDSAbs_ElementType typeToCheck = SMDSAbs_All);
503 int FindShape (const SMDS_MeshElement * theElem);
504 // Return an index of the shape theElem is on
505 // or zero if a shape not found
507 void DoubleElements( const TIDSortedElemSet& theElements );
509 bool DoubleNodes( const std::list< int >& theListOfNodes,
510 const std::list< int >& theListOfModifiedElems );
512 bool DoubleNodes( const TIDSortedElemSet& theElems,
513 const TIDSortedElemSet& theNodesNot,
514 const TIDSortedElemSet& theAffectedElems );
516 bool AffectedElemGroupsInRegion( const TIDSortedElemSet& theElems,
517 const TIDSortedElemSet& theNodesNot,
518 const TopoDS_Shape& theShape,
519 TIDSortedElemSet& theAffectedElems);
521 bool DoubleNodesInRegion( const TIDSortedElemSet& theElems,
522 const TIDSortedElemSet& theNodesNot,
523 const TopoDS_Shape& theShape );
525 double OrientedAngle(const gp_Pnt& p0, const gp_Pnt& p1, const gp_Pnt& g1, const gp_Pnt& g2);
527 bool DoubleNodesOnGroupBoundaries( const std::vector<TIDSortedElemSet>& theElems,
528 bool createJointElems);
530 bool CreateFlatElementsOnFacesGroups( const std::vector<TIDSortedElemSet>& theElems );
532 void CreateHoleSkin(double radius,
533 const TopoDS_Shape& theShape,
534 SMESH_NodeSearcher* theNodeSearcher,
535 const char* groupName,
536 std::vector<double>& nodesCoords,
537 std::vector<std::vector<int> >& listOfListOfNodes);
540 * \brief Generated skin mesh (containing 2D cells) from 3D mesh
541 * The created 2D mesh elements based on nodes of free faces of boundary volumes
542 * \return TRUE if operation has been completed successfully, FALSE otherwise
544 bool Make2DMeshFrom3D();
546 enum Bnd_Dimension { BND_2DFROM3D, BND_1DFROM3D, BND_1DFROM2D };
548 int MakeBoundaryMesh(const TIDSortedElemSet& elements,
549 Bnd_Dimension dimension,
550 SMESH_Group* group = 0,
551 SMESH_Mesh* targetMesh = 0,
552 bool toCopyElements = false,
553 bool toCopyExistingBondary = false,
554 bool toAddExistingBondary = false,
555 bool aroundElements = false);
560 * \brief Convert elements contained in a submesh to quadratic
561 * \return int - nb of checked elements
563 int convertElemToQuadratic(SMESHDS_SubMesh * theSm,
564 SMESH_MesherHelper& theHelper,
565 const bool theForce3d);
568 * \brief Convert quadratic elements to linear ones and remove quadratic nodes
569 * \return nb of checked elements
571 int removeQuadElem( SMESHDS_SubMesh * theSm,
572 SMDS_ElemIteratorPtr theItr,
573 const int theShapeID);
575 * \brief Create groups of elements made during transformation
576 * \param nodeGens - nodes making corresponding myLastCreatedNodes
577 * \param elemGens - elements making corresponding myLastCreatedElems
578 * \param postfix - to append to names of new groups
580 PGroupIDs generateGroups(const SMESH_SequenceOfElemPtr& nodeGens,
581 const SMESH_SequenceOfElemPtr& elemGens,
582 const std::string& postfix,
583 SMESH_Mesh* targetMesh=0);
586 typedef std::map<const SMDS_MeshNode*, std::list<const SMDS_MeshNode*> > TNodeOfNodeListMap;
587 typedef TNodeOfNodeListMap::iterator TNodeOfNodeListMapItr;
588 typedef std::vector<TNodeOfNodeListMapItr> TVecOfNnlmiMap;
589 typedef std::map<const SMDS_MeshElement*, TVecOfNnlmiMap, TIDCompare > TElemOfVecOfNnlmiMap;
592 * \brief Create elements by sweeping an element
593 * \param elem - element to sweep
594 * \param newNodesItVec - nodes generated from each node of the element
595 * \param newElems - generated elements
596 * \param nbSteps - number of sweeping steps
597 * \param srcElements - to append elem for each generated element
599 void sweepElement(const SMDS_MeshElement* elem,
600 const std::vector<TNodeOfNodeListMapItr> & newNodesItVec,
601 std::list<const SMDS_MeshElement*>& newElems,
603 SMESH_SequenceOfElemPtr& srcElements);
606 * \brief Create 1D and 2D elements around swept elements
607 * \param mapNewNodes - source nodes and ones generated from them
608 * \param newElemsMap - source elements and ones generated from them
609 * \param elemNewNodesMap - nodes generated from each node of each element
610 * \param elemSet - all swept elements
611 * \param nbSteps - number of sweeping steps
612 * \param srcElements - to append elem for each generated element
614 void makeWalls (TNodeOfNodeListMap & mapNewNodes,
615 TElemOfElemListMap & newElemsMap,
616 TElemOfVecOfNnlmiMap & elemNewNodesMap,
617 TIDSortedElemSet& elemSet,
619 SMESH_SequenceOfElemPtr& srcElements);
621 struct SMESH_MeshEditor_PathPoint
625 double myAngle, myPrm;
627 SMESH_MeshEditor_PathPoint(): myPnt(99., 99., 99.), myTgt(1.,0.,0.), myAngle(0), myPrm(0) {}
628 void SetPnt (const gp_Pnt& aP3D) { myPnt =aP3D; }
629 void SetTangent (const gp_Dir& aTgt) { myTgt =aTgt; }
630 void SetAngle (const double& aBeta) { myAngle=aBeta; }
631 void SetParameter(const double& aPrm) { myPrm =aPrm; }
632 const gp_Pnt& Pnt ()const { return myPnt; }
633 const gp_Dir& Tangent ()const { return myTgt; }
634 double Angle ()const { return myAngle; }
635 double Parameter ()const { return myPrm; }
637 Extrusion_Error MakeEdgePathPoints(std::list<double>& aPrms,
638 const TopoDS_Edge& aTrackEdge,
640 std::list<SMESH_MeshEditor_PathPoint>& aLPP);
641 Extrusion_Error MakeExtrElements(TIDSortedElemSet& theElements,
642 std::list<SMESH_MeshEditor_PathPoint>& theFullList,
643 const bool theHasAngles,
644 std::list<double>& theAngles,
645 const bool theLinearVariation,
646 const bool theHasRefPoint,
647 const gp_Pnt& theRefPoint,
648 const bool theMakeGroups);
649 void LinearAngleVariation(const int NbSteps,
650 list<double>& theAngles);
652 bool doubleNodes( SMESHDS_Mesh* theMeshDS,
653 const TIDSortedElemSet& theElems,
654 const TIDSortedElemSet& theNodesNot,
655 std::map< const SMDS_MeshNode*, const SMDS_MeshNode* >& theNodeNodeMap,
656 const bool theIsDoubleElem );
662 // Nodes and elements created during last operation
663 SMESH_SequenceOfElemPtr myLastCreatedNodes, myLastCreatedElems;
665 // Description of error/warning occured during last operation
666 SMESH_ComputeErrorPtr myError;