X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_MeshEditor.hxx;h=677d9c033596a54021628fd99c3ebe8e4c13fa25;hb=fedc148b815f83c4bbb19b83254a879e90ed8df0;hp=10b7f9fa991d41545f33e110743bd99b4744520b;hpb=e4737e85f0da6d3f90fd08f6be1c2825195fe16f;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index 10b7f9fa9..677d9c033 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -41,6 +41,7 @@ class SMDS_MeshFace; class SMDS_MeshNode; class gp_Ax1; class gp_Vec; +class gp_Pnt; class SMESH_MeshEditor { public: @@ -69,9 +70,8 @@ class SMESH_MeshEditor { // with a quadrangle built on the same 4 nodes. // Return false if proper faces not found - bool Reorient (const SMDS_MeshElement * theFace); - // Reverse the normal of theFace - // Return false if theFace is null + bool Reorient (const SMDS_MeshElement * theElement); + // Reverse theElement orientation bool TriToQuad (std::set & theElems, @@ -121,18 +121,38 @@ class SMESH_MeshEditor { // Generate new elements by extrusion of theElements // by theStep by theNbSteps + enum Extrusion_Error { + EXTR_OK, + EXTR_NO_ELEMENTS, + EXTR_PATH_NOT_EDGE, + EXTR_BAD_PATH_SHAPE, + EXTR_BAD_STARTING_NODE, + EXTR_BAD_ANGLES_NUMBER, + EXTR_CANT_GET_TANGENT + }; + + Extrusion_Error ExtrusionAlongTrack (std::set & theElements, + SMESH_subMesh* theTrackPattern, + const SMDS_MeshNode* theNodeStart, + const bool theHasAngles, + std::list& theAngles, + const bool theHasRefPoint, + const gp_Pnt& theRefPoint); + // Generate new elements by extrusion of theElements along path given by theTrackPattern, + // theHasAngles are the rotation angles, base point can be given by theRefPoint void Transform (std::set & theElements, const gp_Trsf& theTrsf, const bool theCopy); // Move or copy theElements applying theTrsf to their nodes - typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes; - void FindCoincidentNodes (const double theTolerance, - TListOfListOfNodes & theGroupsOfNodes); - // Return list of group of nodes close to each other within theTolerance + void FindCoincidentNodes (std::set & theNodes, + const double theTolerance, + TListOfListOfNodes & theGroupsOfNodes); + // Return list of group of nodes close to each other within theTolerance. + // Search among theNodes or in the whole mesh if theNodes is empty. void MergeNodes (TListOfListOfNodes & theNodeGroups); // In each group, the cdr of nodes are substituted by the first one @@ -220,7 +240,20 @@ class SMESH_MeshEditor { int theNodeIds[] ); // Set 8 nodes of a hexahedron in a good order. // Return success status - + + static void AddToSameGroups (const SMDS_MeshElement* elemToAdd, + const SMDS_MeshElement* elemInGroups, + SMESHDS_Mesh * aMesh); + // Add elemToAdd to the groups the elemInGroups belongs to + + static const SMDS_MeshElement* + FindFaceInSet(const SMDS_MeshNode* n1, + const SMDS_MeshNode* n2, + const std::set& elemSet, + const std::set& avoidSet); + // Return a face having linked nodes n1 and n2 and which is + // - not in avoidSet, + // - in elemSet provided that !elemSet.empty() int FindShape (const SMDS_MeshElement * theElem); // Return an index of the shape theElem is on