Salome HOME
PR: synchro V6_main tag mergeto_V7_main_11Feb13
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupOnShapeDlg.cxx
index f4cde4f1b1c3c2323cd9a07ece977c49dbab32ac..c31a07c449810fb5e3026b632a83119023b997f6 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <GeometryGUI.h>
 #include <GEOM_SelectionFilter.h>
+#include <GEOM_wrap.hxx>
 
 #include <SUIT_Session.h>
 #include <SUIT_OverrideCursor.h>
@@ -204,7 +205,7 @@ LightApp_Dialog* SMESHGUI_GroupOnShapeOp::dlg() const
  */
 //================================================================================
 
-static SMESH::ElementType elementType(GEOM::GEOM_Object_var& geom)
+static SMESH::ElementType elementType(GEOM::GEOM_Object_var geom)
 {
   if ( !geom->_is_nil() ) {
     switch ( geom->GetShapeType() ) {
@@ -219,17 +220,18 @@ static SMESH::ElementType elementType(GEOM::GEOM_Object_var& geom)
     default:             return SMESH::ALL;
     }
     _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-    GEOM::GEOM_IShapesOperations_var aShapeOp =
+    GEOM::GEOM_IShapesOperations_wrap aShapeOp =
       SMESH::GetGEOMGen()->GetIShapesOperations(aStudy->StudyId());
 
     if ( geom->GetType() == 37 ) { // geom group
-      GEOM::GEOM_IGroupOperations_var  aGroupOp =
+      GEOM::GEOM_IGroupOperations_wrap aGroupOp =
         SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
       if ( !aGroupOp->_is_nil() ) {
+        // mainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap
         GEOM::GEOM_Object_var mainShape = aGroupOp->GetMainShape( geom );
         GEOM::ListOfLong_var        ids = aGroupOp->GetObjects( geom );
         if ( ids->length() && !mainShape->_is_nil() && !aShapeOp->_is_nil() ) {
-          GEOM::GEOM_Object_var member = aShapeOp->GetSubShape( mainShape, ids[0] );
+          GEOM::GEOM_Object_wrap member = aShapeOp->GetSubShape( mainShape, ids[0] );
           return elementType( member );
         }
       }
@@ -237,7 +239,7 @@ static SMESH::ElementType elementType(GEOM::GEOM_Object_var& geom)
     else if ( !aShapeOp->_is_nil() ) { // just a compoud shape
       GEOM::ListOfLong_var ids = aShapeOp->SubShapeAllIDs( geom, GEOM::SHAPE, false );
       if ( ids->length() ) {
-        GEOM::GEOM_Object_var member = aShapeOp->GetSubShape( geom, ids[0] );
+        GEOM::GEOM_Object_wrap member = aShapeOp->GetSubShape( geom, ids[0] );
         return elementType( member );
       }
     }
@@ -489,13 +491,13 @@ void SMESHGUI_GroupOnShapeOp::selectionDone()
     }
   }
 
-  if ( myDlg->myElemGeomBtn->isChecked() ) // elem geomerty selection
+  if ( myDlg->myElemGeomBtn->isChecked() ) // elem geometry selection
   {
     myDlg->myElemGeomList->clear();
     myDlg->myElemGeomList->addItems( goodNames );
     myElemGeoIDs = goodIds;
   }
-  else if ( myDlg->myNodeGeomBtn->isChecked() ) // Node geomerty selection
+  else if ( myDlg->myNodeGeomBtn->isChecked() ) // Node geometry selection
   {
     myDlg->myNodeGeomList->clear();
     myDlg->myNodeGeomList->addItems( goodNames );