X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Pattern.hxx;h=3a327891462554c7ed17f898698c0b24f17b753d;hb=79b1ac2b6df9117f16f11d444b1f165d477a1813;hp=373d2ef25a18dda7016eb541fd904bf48776e0b2;hpb=c38c10811a065cf5b13e8807ed71864d92ca7d80;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Pattern.hxx b/src/SMESH/SMESH_Pattern.hxx index 373d2ef25..3a3278914 100644 --- a/src/SMESH/SMESH_Pattern.hxx +++ b/src/SMESH/SMESH_Pattern.hxx @@ -15,15 +15,19 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // File : SMESH_Pattern.hxx // Created : Mon Aug 2 10:30:00 2004 // Author : Edward AGAPOV (eap) +using namespace std; + #ifndef SMESH_Pattern_HeaderFile #define SMESH_Pattern_HeaderFile +#include "SMESH_SMESH.hxx" + #include #include #include @@ -41,6 +45,7 @@ class SMDS_MeshFace; class SMDS_MeshVolume; class SMDS_MeshNode; class SMESH_Mesh; +class SMESHDS_SubMesh; class TopoDS_Shell; class TopoDS_Vertex; class TopoDS_Face; @@ -52,7 +57,7 @@ class TopoDS_Edge; // of 6 faces. // -class SMESH_Pattern { +class SMESH_EXPORT SMESH_Pattern { public: SMESH_Pattern (); @@ -65,7 +70,7 @@ class SMESH_Pattern { bool Load (SMESH_Mesh* theMesh, const TopoDS_Face& theFace, - bool theProject); + bool theProject = false); // Create a pattern from the mesh built on . // ==true makes override nodes positions // on computed by mesher @@ -100,7 +105,17 @@ class SMESH_Pattern { // the loaded pattern to . The first key-point // will be mapped into -th node - bool Apply (std::set& theFaces, + bool Apply (SMESH_Mesh* theMesh, + const SMDS_MeshFace* theFace, + const TopoDS_Shape& theSurface, + const int theNodeIndexOnKeyPoint1, + const bool theReverse); + // Compute nodes coordinates applying + // the loaded pattern to . The first key-point + // will be mapped into -th node + + bool Apply (SMESH_Mesh* theMesh, + std::set& theFaces, const int theNodeIndexOnKeyPoint1, const bool theReverse); // Compute nodes coordinates applying @@ -134,8 +149,9 @@ class SMESH_Pattern { // Create nodes and elements in using nodes // coordinates computed by either of Apply...() methods - + // ---------- // Inquiries + // ---------- enum ErrorCode { ERR_OK, @@ -156,6 +172,7 @@ class SMESH_Pattern { // Load(face) ERR_LOADF_NARROW_FACE, // too narrow face ERR_LOADF_CLOSED_FACE, // closed face + ERR_LOADF_CANT_PROJECT, // impossible to project nodes // Load(volume) ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces ERR_LOADV_COMPUTE_PARAMS, // cant compute point parameters @@ -199,8 +216,18 @@ class SMESH_Pattern { void DumpPoints() const; // Debug + // ----------------------------- + // Utilities for advanced usage + // ----------------------------- - private: + TopoDS_Shape GetSubShape( const int i ) const { + if ( i < 1 || i > myShapeIDMap.Extent() ) return TopoDS_Shape(); + return myShapeIDMap( i ); + } + // Return a shape from myShapeIDMap where shapes are indexed so that first go + // ordered vertices, then ordered edge, then faces and maybe a shell + +private: // private methods struct TPoint { @@ -301,7 +328,14 @@ class SMESH_Pattern { const std::list< int >& theIdsList) const; // check xyz ids order in theIdsList taking into account // theFirstNode on a link - + + void clearMesh(SMESH_Mesh* theMesh) const; + // clear mesh elements existing on myShape in theMesh + + static SMESHDS_SubMesh * getSubmeshWithElements(SMESH_Mesh* theMesh, + const TopoDS_Shape& theShape); + // return submesh containing elements bound to theShape in theMesh + private: // fields