Salome HOME
PAL10196. Make SetId() public
[modules/smesh.git] / src / DriverMED / DriverMED_Family.h
index cca2bf0756ee8309b60276bc14556279ff6a9890..1632ccb3b71cc57069ead253065b99bd35d727be 100644 (file)
 #define _INCLUDE_DRIVERMED_FAMILY
 
 #include "SMDS_Mesh.hxx"
-#include "SMESHDS_Group.hxx"
+#include "SMESHDS_GroupBase.hxx"
 #include "SMESHDS_SubMesh.hxx"
-#include "MEDA_Wrapper.hxx"
+#include "MED_Common.hxx"
 
 #include <boost/shared_ptr.hpp>
 #include <set>
 
-using namespace std;
-
 #define REST_NODES_FAMILY 1
 #define REST_EDGES_FAMILY -1
 #define REST_FACES_FAMILY -2
@@ -54,21 +52,22 @@ class DriverMED_Family
 
   // Methods for groups storing to MED
 
-  static list<DriverMED_FamilyPtr> MakeFamilies (const map <int, SMESHDS_SubMesh*>& theSubMeshes,
-                                                const list<SMESHDS_Group*>& theGroups,
-                                                const bool doGroupOfNodes,
-                                                const bool doGroupOfEdges,
-                                                const bool doGroupOfFaces,
-                                                const bool doGroupOfVolumes);
+  static std::list<DriverMED_FamilyPtr> MakeFamilies (const std::map <int, SMESHDS_SubMesh*>& theSubMeshes,
+                                                     const std::list<SMESHDS_GroupBase*>& theGroups,
+                                                     const bool doGroupOfNodes,
+                                                     const bool doGroupOfEdges,
+                                                     const bool doGroupOfFaces,
+                                                     const bool doGroupOfVolumes);
   // Split each group from list <theGroups> and each sub-mesh from list <theSubMeshes>
   // on some parts (families) on the basis of the elements membership in other groups
   // from <theGroups> and other sub-meshes from <theSubMeshes>.
   // Resulting families have no common elements.
 
-  MEDA::PFamilyInfo GetFamilyInfo (const MEDA::PMeshInfo& theMeshInfo) const;
+  MED::PFamilyInfo GetFamilyInfo (const MED::PWrapper& theWrapper, 
+                                 const MED::PMeshInfo& theMeshInfo) const;
   // Create TFamilyInfo for this family
 
-  const set<const SMDS_MeshElement *>& GetElements () const { return myElements; }
+  const std::set<const SMDS_MeshElement *>& GetElements () const { return myElements; }
   // Returns elements of this family
 
   int GetId () const { return myId; }
@@ -80,22 +79,25 @@ class DriverMED_Family
 
   void AddElement (const SMDS_MeshElement* theElement) { myElements.insert(theElement); }
 
-  void AddGroupName (string theGroupName) { myGroupNames.insert(theGroupName); }
+  void AddGroupName (std::string theGroupName) { myGroupNames.insert(theGroupName); }
 
   void SetType (const SMDSAbs_ElementType theType) { myType = theType; }
   SMDSAbs_ElementType GetType () { return myType; }
 
-  bool MemberOf (string theGroupName) const
+  bool MemberOf (std::string theGroupName) const
     { return (myGroupNames.find(theGroupName) != myGroupNames.end()); }
 
   const MED::TStringSet& GetGroupNames () const { return myGroupNames; }
 
+  void SetId (const int theId) { myId = theId; }
+  // Sets a family ID
+
  private:
-  void Init (SMESHDS_Group* group);
-  // Initialize the tool by SMESHDS_Group
+  void Init (SMESHDS_GroupBase* group);
+  // Initialize the tool by SMESHDS_GroupBase
 
-  static list<DriverMED_FamilyPtr> SplitByType (SMESHDS_SubMesh* theSubMesh,
-                                               const int        theId);
+  static std::list<DriverMED_FamilyPtr> SplitByType (SMESHDS_SubMesh* theSubMesh,
+                                                    const int        theId);
   // Split <theSubMesh> on some parts (families)
   // on the basis of the elements type.
 
@@ -105,16 +107,13 @@ class DriverMED_Family
   // Remove from <by> elements, common with <Elements>,
   // Create family <common> from common elements, with combined groups list.
 
-  void SetId (const int theId) { myId = theId; }
-  // Sets a family ID
-
   bool IsEmpty () const { return myElements.empty(); }
   // Check, if this family has empty list of elements
 
  private:
   int                           myId;
   SMDSAbs_ElementType           myType;
-  set<const SMDS_MeshElement *> myElements;
+  std::set<const SMDS_MeshElement *> myElements;
   MED::TStringSet               myGroupNames;
 };