X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHFiltersSelection%2FSMESH_TypeFilter.cxx;h=7ce2a045940bdbd678a0d7894bac7b97fefcef1d;hb=f89c0586c1d18c14cf772fa64a7fe6cc680376d1;hp=bfede041871ced4d17e2c54e8208ce7b03b0be04;hpb=9357f5c87098aff2b95b754d69f66c76d2df9c24;p=modules%2Fsmesh.git diff --git a/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx b/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx index bfede0418..7ce2a0459 100644 --- a/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx @@ -1,23 +1,23 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2013 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 +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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. +// 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. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "SMESH_TypeFilter.hxx" @@ -30,7 +30,7 @@ #include #include CORBA_CLIENT_HEADER(SMESH_Gen) -SMESH_TypeFilter::SMESH_TypeFilter (MeshObjectType theType) +SMESH_TypeFilter::SMESH_TypeFilter (SMESH::MeshObjectType theType) { myType = theType; } @@ -81,13 +81,14 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const // 4 | |- Applied algorithms ( selectable in Use Case Browser ) // 5 | |- Regular 1D // |- Group Of Nodes + // |- Group 1 if (aLevel <= 0) return false; switch (myType) { - case HYPOTHESIS: + case SMESH::HYPOTHESIS: { if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_HypothesisRoot)) // hypo definition @@ -100,7 +101,7 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const Ok = true; break; } - case ALGORITHM: + case SMESH::ALGORITHM: { if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_AlgorithmsRoot)) // algo definition @@ -113,13 +114,13 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const Ok = true; break; } - case MESH: + case SMESH::MESH: { if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot)) Ok = true; break; } - case SUBMESH: + case SMESH::SUBMESH: { // see SMESH_Gen_i.cxx for tag numbers if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstSubMesh && @@ -127,7 +128,7 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const Ok = true; break; } - case MESHorSUBMESH: + case SMESH::MESHorSUBMESH: { if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot)) Ok = true; // mesh @@ -136,48 +137,90 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const Ok = true; break; } - case SUBMESH_VERTEX: // Label "SubMeshes on vertexes" + case SMESH::SUBMESH_VERTEX: // Label "SubMeshes on vertexes" { if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnVertex)) Ok = true; break; } - case SUBMESH_EDGE: + case SMESH::SUBMESH_EDGE: { if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnEdge)) Ok = true; break; } - case SUBMESH_FACE: + case SMESH::SUBMESH_FACE: { if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnFace)) Ok = true; break; } - case SUBMESH_SOLID: + case SMESH::SUBMESH_SOLID: { if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnSolid)) Ok = true; break; } - case SUBMESH_COMPOUND: + case SMESH::SUBMESH_COMPOUND: { if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnCompound)) Ok = true; break; } - case GROUP: + case SMESH::GROUP: { if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstGroup)) Ok = true; break; } + case SMESH::GROUP_NODE: + { + if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_NodeGroups)) + Ok = true; + break; + } + case SMESH::GROUP_EDGE: + { + if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_EdgeGroups)) + Ok = true; + break; + } + case SMESH::GROUP_FACE: + { + if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_FaceGroups)) + Ok = true; + break; + } + case SMESH::GROUP_VOLUME: + { + if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_VolumeGroups)) + Ok = true; + break; + } + case SMESH::GROUP_0D: + { + if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_0DElementsGroups)) + Ok = true; + break; + } + case SMESH::GROUP_BALL: + { + if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_BallElementsGroups)) + Ok = true; + break; + } + case SMESH::IDSOURCE: + { + Ok = ( SMESH_TypeFilter(SMESH::MESHorSUBMESH).isOk( theDataOwner ) || + SMESH_TypeFilter(SMESH::GROUP) .isOk( theDataOwner )); + break; + } } } return Ok; } -MeshObjectType SMESH_TypeFilter::type() const +SMESH::MeshObjectType SMESH_TypeFilter::type() const { return myType; }