]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOMImpl/GEOMImpl_IGroupOperations.cxx
Salome HOME
Merge branch 'master' of https://git.salome-platform.org/git/modules/geom
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IGroupOperations.cxx
index 78a0548e86cca2dacb274cd84ede7f0e84b3785c..e603adc90ad2a5fbf72d70075ffa1f0d93e401f6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  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
@@ -18,6 +18,7 @@
 // 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 <Standard_Stream.hxx>
 
@@ -82,7 +83,7 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::CreateGroup
 
   if ( theShapeType != TopAbs_VERTEX && theShapeType != TopAbs_EDGE &&
        theShapeType != TopAbs_FACE && theShapeType != TopAbs_SOLID ) {
-    SetErrorCode( "Error: You could create group only next type: vertex, edge, face or solid" );
+    SetErrorCode( "Error: You could create group of only next type: vertex, edge, face or solid" );
     return NULL;
   }
 
@@ -1151,8 +1152,8 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::UnionListOfGroups
   for (i = 1; i <= aLen; i++) {
     Handle(GEOM_Object) aGr_i = Handle(GEOM_Object)::DownCast(theGList->Value(i));
     if ( aGr_i->GetType() != GEOM_GROUP ) {
-         SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
-         return NULL;
+      SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+      return NULL;
     }
     // Get group type
     aType_i = GetType(aGr_i);
@@ -1582,11 +1583,13 @@ Handle(GEOM_Object) GEOMImpl_IGroupOperations::GetMainShape (Handle(GEOM_Object)
 {
   SetErrorCode(KO);
 
-  if(theGroup.IsNull()) return NULL;
-  if ( theGroup->GetType() != GEOM_GROUP ) {
-    SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+  if (theGroup.IsNull()) return NULL;
+  if (theGroup->GetType() != GEOM_GROUP &&
+      theGroup->GetType() != GEOM_SUBSHAPE) {
+    SetErrorCode("Error: You could perform this operation only with a group or a sub-shape.");
     return NULL;
   }
+
   Handle(GEOM_Function) aGroupFunction = theGroup->GetFunction(1);
   if (aGroupFunction.IsNull()) return NULL;