X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMImpl%2FGEOMImpl_IGroupOperations.cxx;h=cf81ed23c84d85a8e4b2e4748f05b2f233549665;hb=3059f9d5521dd7c91c35c50afbd6beb18b8826fd;hp=f9c99baa182c34ce6241d04fc41f84f2fef93e59;hpb=239f8109c64fa0c5a2e1d87a420bad5529b57f48;p=modules%2Fgeom.git diff --git a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx index f9c99baa1..cf81ed23c 100644 --- a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx @@ -1,22 +1,23 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE // -// 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. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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 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. // -// 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 +// 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. // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// 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 #include @@ -145,8 +146,8 @@ void GEOMImpl_IGroupOperations::AddObject(Handle(GEOM_Object) theGroup, int theS for(Standard_Integer i = 1; i<=aLength; i++) { aNewSeq->SetValue(i, aSeq->Value(i)); if(aSeq->Value(i) == theSubShapeID) { - SetErrorCode(ALREADY_PRESENT); - return; // + SetErrorCode(ALREADY_PRESENT); + return; // } } aNewSeq->SetValue(aLength+1, theSubShapeID); @@ -248,7 +249,8 @@ void GEOMImpl_IGroupOperations::UnionList (Handle(GEOM_Object) theGroup, Standard_Integer aLen = theSubShapes->Length(); if (aLen < 1) { - SetErrorCode("The list is empty"); + //SetErrorCode("The list is empty"); + SetErrorCode(OK); return; } @@ -566,13 +568,17 @@ void GEOMImpl_IGroupOperations::UnionIDs (Handle(GEOM_Object) theGroup, TopTools_IndexedMapOfShape mapIndices; TopExp::MapShapes(aMainShape, mapIndices); + // Get group type + TopAbs_ShapeEnum aType = GetType(theGroup); + // Get IDs of sub-shapes to add Standard_Integer i, new_id; for (i = 1; i <= aLen; i++) { new_id = theSubShapes->Value(i); if (0 < new_id && new_id <= mapIndices.Extent()) { - if (mapIDs.Add(new_id)) { + //if (mapIDs.Add(new_id)) { IPAL21297. Why we ignore invalid ids silently? + if (mapIDs.Add(new_id) && mapIndices(new_id).ShapeType()==aType ) { aNewIDs.Append(new_id); } } @@ -732,8 +738,8 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::GetMainShape (Handle(GEOM_Object) if (aMainShape.IsNull()) return NULL; //Make a Python command - GEOM::TPythonDump(aGroupFunction, /*append=*/true) - << aMainShape << " = geompy.GetMainShape(" << theGroup << ")"; + //GEOM::TPythonDump(aGroupFunction, /*append=*/true) + // << aMainShape << " = geompy.GetMainShape(" << theGroup << ")"; SetErrorCode(OK); return aMainShape;