X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Pattern.hxx;h=670578ce459d1e04bfb6eab8028309fb57c9d848;hb=fa397b27d14c143edc9b3bb38ddbabbfec9ab229;hp=9358fae472122de0bdfb69a72636297efdf952cc;hpb=ed456586bfb1411c5bff73b221658766689a6253;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Pattern.hxx b/src/SMESH/SMESH_Pattern.hxx index 9358fae47..670578ce4 100644 --- a/src/SMESH/SMESH_Pattern.hxx +++ b/src/SMESH/SMESH_Pattern.hxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -35,6 +36,10 @@ #include #include +class SMDS_MeshElement; +class SMDS_MeshFace; +class SMDS_MeshVolume; +class SMDS_MeshNode; class SMESH_Mesh; class TopoDS_Shell; class TopoDS_Vertex; @@ -56,7 +61,7 @@ class SMESH_Pattern { // clear fields bool Load (const char* theFileContents); - // Load a pattern from + // Load a pattern from bool Load (SMESH_Mesh* theMesh, const TopoDS_Face& theFace, @@ -88,7 +93,39 @@ class SMESH_Pattern { // will be mapped into . The // (0,0,1) key-point will be mapped into . - bool GetMappedPoints ( std::list & thePoints ); + bool Apply (const SMDS_MeshFace* theFace, + 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 (std::set theFaces, + 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 (const SMDS_MeshVolume* theVolume, + const int theNode000Index, + const int theNode001Index); + // Compute nodes coordinates applying + // the loaded pattern to . The (0,0,0) key-point + // will be mapped into -th node. The + // (0,0,1) key-point will be mapped into -th + // node. + + bool Apply (std::set theVolumes, + const int theNode000Index, + const int theNode001Index); + // Compute nodes coordinates applying + // the loaded pattern to . The (0,0,0) key-point + // will be mapped into -th node. The + // (0,0,1) key-point will be mapped into -th + // node. + + bool GetMappedPoints ( std::list & thePoints ) const; // Return nodes coordinates computed by Apply() method bool MakeMesh(SMESH_Mesh* theMesh); @@ -131,6 +168,8 @@ class SMESH_Pattern { ERR_APPLF_INTERNAL_EEROR, // program error // Apply(volume) ERR_APPLV_BAD_SHAPE, // volume is not a brick of 6 faces + // Apply(mesh_face) + ERR_APPLF_BAD_FACE_GEOM, // bad face geometry // MakeMesh ERR_MAKEM_NOT_COMPUTED // mapping failed }; @@ -151,8 +190,8 @@ class SMESH_Pattern { // Return indices of key-points within the sequences returned by // GetPoints() and GetMappedPoints() - const std::list< std::list< int > >& GetElementPointIDs () const - { return myElemPointIDs; } + const std::list< std::list< int > >& GetElementPointIDs (bool applied) const + { return myElemXYZIDs.empty() || !applied ? myElemPointIDs : myElemXYZIDs; } // Return nodal connectivity of the elements of the pattern void DumpPoints() const; @@ -230,7 +269,14 @@ class SMESH_Pattern { // of boundaries; after sorting, edges in the wires are put // in a good order, point UVs on edges are computed and points // are appended to theEdgesPointsList - + + typedef std::set TNodeSet; + void mergePoints (std::map > >& xyzIndGroups, + std::map< int, std::list< std::list< int >* > >& reverseConnectivity); + // Look for coincident points between myXYZs indexed with + // list of each element of xyzIndGroups. Coincident indices + // are merged in myElemXYZIDs using reverseConnectivity. + private: // fields @@ -245,12 +291,21 @@ class SMESH_Pattern { TopoDS_Shape myShape; // all functions assure that shapes are indexed so that first go - // ordered vertices, then ordered edge, then faces and a shell + // ordered vertices, then ordered edge, then faces and maybe a shell TopTools_IndexedMapOfOrientedShape myShapeIDMap; //TopTools_IndexedMapOfShape myShapeIDMap; std::map< int, list< TPoint* > > myShapeIDToPointsMap; - std::list< int > myNbKeyPntInBoundary; //for the 2d case + // for the 2d case: + // nb of key-points in each of pattern boundaries + std::list< int > myNbKeyPntInBoundary; + + // to compute while applying to mesh elements, not to shapes + std::vector myXYZ; + std::list< std::list< int > > myElemXYZIDs; + std::map< int, const SMDS_MeshNode*> myXYZIdToNodeMap; // map id to node of a refined element + std::vector myElements; // refined elements + std::vector myOrderedNodes; };