X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FDriverMED%2FDriverMED_Family.h;h=6a362275582a0b43aa44f56f39cf242d386bc818;hp=1632ccb3b71cc57069ead253065b99bd35d727be;hb=4ff5bd61540272713e48de1eee75625028c32155;hpb=50eb85fb3d790dcf6607bb1eb63a9fd68bcaadba diff --git a/src/DriverMED/DriverMED_Family.h b/src/DriverMED/DriverMED_Family.h index 1632ccb3b..6a3622755 100644 --- a/src/DriverMED/DriverMED_Family.h +++ b/src/DriverMED/DriverMED_Family.h @@ -45,76 +45,92 @@ class DriverMED_Family; typedef boost::shared_ptr DriverMED_FamilyPtr; +typedef std::list DriverMED_FamilyPtrList; +typedef std::map SMESHDS_SubMeshPtrMap; +typedef std::list SMESHDS_GroupBasePtrList; +typedef std::set ElementsSet; class DriverMED_Family { public: - // Methods for groups storing to MED - - static std::list MakeFamilies (const std::map & theSubMeshes, - const std::list& theGroups, - const bool doGroupOfNodes, - const bool doGroupOfEdges, - const bool doGroupOfFaces, - const bool doGroupOfVolumes); - // Split each group from list and each sub-mesh from list - // on some parts (families) on the basis of the elements membership in other groups - // from and other sub-meshes from . - // Resulting families have no common elements. - - MED::PFamilyInfo GetFamilyInfo (const MED::PWrapper& theWrapper, - const MED::PMeshInfo& theMeshInfo) const; - // Create TFamilyInfo for this family - - const std::set& GetElements () const { return myElements; } - // Returns elements of this family - - int GetId () const { return myId; } - // Returns a family ID + DriverMED_Family(); + + //! Methods for groups storing to MED + /*! + Split each group from list and each sub-mesh from list + on some parts (families) on the basis of the elements membership in other groups + from and other sub-meshes from . + Resulting families have no common elements. + */ + static + DriverMED_FamilyPtrList + MakeFamilies (const SMESHDS_SubMeshPtrMap& theSubMeshes, + const SMESHDS_GroupBasePtrList& theGroups, + const bool doGroupOfNodes, + const bool doGroupOfEdges, + const bool doGroupOfFaces, + const bool doGroupOfVolumes); + + //! Create TFamilyInfo for this family + MED::PFamilyInfo + GetFamilyInfo (const MED::PWrapper& theWrapper, + const MED::PMeshInfo& theMeshInfo) const; + + //! Returns elements of this family + const ElementsSet& GetElements () const; + + //! Returns a family ID + int GetId () const; + + //! Sets a family ID + void SetId (const int theId); public: // Methods for groups reading from MED - void AddElement (const SMDS_MeshElement* theElement) { myElements.insert(theElement); } + void AddElement(const SMDS_MeshElement* theElement); - void AddGroupName (std::string theGroupName) { myGroupNames.insert(theGroupName); } + const MED::TStringSet& GetGroupNames() const; + void AddGroupName(std::string theGroupName); - void SetType (const SMDSAbs_ElementType theType) { myType = theType; } - SMDSAbs_ElementType GetType () { return myType; } + void SetType(const SMDSAbs_ElementType theType); + SMDSAbs_ElementType GetType(); - bool MemberOf (std::string theGroupName) const - { return (myGroupNames.find(theGroupName) != myGroupNames.end()); } + bool MemberOf(std::string theGroupName) const; - const MED::TStringSet& GetGroupNames () const { return myGroupNames; } - - void SetId (const int theId) { myId = theId; } - // Sets a family ID + int GetGroupAttributVal() const; + void SetGroupAttributVal( int theValue); private: + //! Initialize the tool by SMESHDS_GroupBase void Init (SMESHDS_GroupBase* group); - // Initialize the tool by SMESHDS_GroupBase - static std::list SplitByType (SMESHDS_SubMesh* theSubMesh, - const int theId); - // Split on some parts (families) - // on the basis of the elements type. + //! Split on some parts (families) on the basis of the elements type. + static + DriverMED_FamilyPtrList + SplitByType(SMESHDS_SubMesh* theSubMesh, + const int theId); + + /*! Remove from elements, common with , + Remove from elements, common with , + Create family from common elements, with combined groups list. + */ void Split (DriverMED_FamilyPtr by, DriverMED_FamilyPtr common); - // Remove from elements, common with , - // Remove from elements, common with , - // Create family from common elements, with combined groups list. - bool IsEmpty () const { return myElements.empty(); } - // Check, if this family has empty list of elements + //! Check, if this family has empty list of elements + bool IsEmpty () const; + private: int myId; SMDSAbs_ElementType myType; - std::set myElements; + ElementsSet myElements; MED::TStringSet myGroupNames; + int myGroupAttributVal; }; #endif