X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FDriverMED%2FDriverMED_Family.h;h=d102b87a9ffa791080f1876de566e1f7e87e2512;hp=1cd35e27194c7ee6b4c761872425b28234bd837e;hb=a274ade365bd0f0e19d56c577acc4a13aa1972a7;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce diff --git a/src/DriverMED/DriverMED_Family.h b/src/DriverMED/DriverMED_Family.h index 1cd35e271..d102b87a9 100644 --- a/src/DriverMED/DriverMED_Family.h +++ b/src/DriverMED/DriverMED_Family.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,20 +24,22 @@ // File : DriverMED_Family.hxx // Author : Julia DOROVSKIKH // Module : SMESH -// $Header$ // #ifndef _INCLUDE_DRIVERMED_FAMILY #define _INCLUDE_DRIVERMED_FAMILY #include "SMESH_DriverMED.hxx" +#include "DriverMED.hxx" #include "SMDS_Mesh.hxx" #include "SMESHDS_GroupBase.hxx" #include "SMESHDS_SubMesh.hxx" #include "MED_Common.hxx" +#include #include #include +#include #define REST_NODES_FAMILY 1 #define FIRST_NODE_FAMILY 2 @@ -49,12 +51,19 @@ #define REST_BALL_FAMILY -5 #define FIRST_ELEM_FAMILY -6 -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; +// Not In Group families +#define NIG_EDGES_FAMILY INT_MAX-1 +#define NIG_FACES_FAMILY INT_MAX-2 +#define NIG_VOLS_FAMILY INT_MAX-3 +#define NIG_0DELEM_FAMILY INT_MAX-4 +#define NIG_BALL_FAMILY INT_MAX-5 +#define NIG_GROUP_PREFIX "NOT_IN_GRP" + +typedef std::list DriverMED_FamilyPtrList; +typedef std::map SMESHDS_SubMeshPtrMap; +typedef std::list SMESHDS_GroupBasePtrList; +typedef std::set ElementsSet; +typedef boost::container::flat_set< SMDSAbs_ElementType > ElemTypeSet; class MESHDRIVERMED_EXPORT DriverMED_Family { @@ -71,14 +80,15 @@ class MESHDRIVERMED_EXPORT DriverMED_Family */ static DriverMED_FamilyPtrList - MakeFamilies (const SMESHDS_SubMeshPtrMap& theSubMeshes, + MakeFamilies (SMESHDS_SubMeshIteratorPtr theSubMeshes, const SMESHDS_GroupBasePtrList& theGroups, const bool doGroupOfNodes, const bool doGroupOfEdges, const bool doGroupOfFaces, const bool doGroupOfVolumes, const bool doGroupOf0DElems, - const bool doGroupOfBalls); + const bool doGroupOfBalls, + const bool doAllInGroups); //! Create TFamilyInfo for this family MED::PFamilyInfo @@ -105,22 +115,23 @@ class MESHDRIVERMED_EXPORT DriverMED_Family void SetType(const SMDSAbs_ElementType theType); SMDSAbs_ElementType GetType(); - const std::set< SMDSAbs_ElementType >& GetTypes() const; + const ElemTypeSet& GetTypes() const; bool MemberOf(std::string theGroupName) const; - int GetGroupAttributVal() const; + int GetGroupAttributVal() const; void SetGroupAttributVal( int theValue); + size_t NbElements( SMDSAbs_ElementType ) const; + private: //! Initialize the tool by SMESHDS_GroupBase void Init (SMESHDS_GroupBase* group); //! Split on some parts (families) on the basis of the elements type. static - DriverMED_FamilyPtrList - SplitByType(SMESHDS_SubMesh* theSubMesh, - const int theId); + DriverMED_FamilyPtrList SplitByType(SMESHDS_SubMesh* theSubMesh, + const int theId); /*! Remove from elements, common with , @@ -135,12 +146,12 @@ class MESHDRIVERMED_EXPORT DriverMED_Family private: - int myId; - SMDSAbs_ElementType myType; - ElementsSet myElements; - MED::TStringSet myGroupNames; - int myGroupAttributVal; - std::set myTypes; // Issue 0020576 + int myId; + SMDSAbs_ElementType myType; + ElementsSet myElements; + MED::TStringSet myGroupNames; + int myGroupAttributVal; + ElemTypeSet myTypes; // Issue 0020576 }; #endif