]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
untabify
authoreap <eap@opencascade.com>
Thu, 26 Sep 2013 08:44:08 +0000 (08:44 +0000)
committereap <eap@opencascade.com>
Thu, 26 Sep 2013 08:44:08 +0000 (08:44 +0000)
src/OBJECT/SMESH_Object.cxx
src/OBJECT/SMESH_SVTKActor.cxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_ScaleDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESH_I/SMESH_Measurements_i.cxx
src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx

index 466b9af6483a19faa7fa49f2664209759f5444b5..94cf59d5fed22152a22ca40ad3e87d85dde2f79c 100644 (file)
@@ -281,8 +281,8 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid)
         //MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
         //MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<<myGrid->GetNumberOfPoints() );
         if( MYDEBUGWITHFILES ) {
-         SMESH::WriteUnstructuredGrid( myGrid,"myPrs.vtu" );
-       }
+          SMESH::WriteUnstructuredGrid( myGrid,"myPrs.vtu" );
+        }
   }
 }
 
@@ -486,17 +486,17 @@ void SMESH_VisualObjDef::buildElemPrs()
         }
         vtkIdType aCurId = aConnectivity->InsertNextCell( anIdList );
         aCellTypesArray->InsertNextValue( vtkElemType );
-       
-       //Store diameters of the balls
-       if(aScalars) {
-         double aDiam = 0;
-         if(aType == SMDSAbs_Ball) {
-           if (const SMDS_BallElement* ball = dynamic_cast<const SMDS_BallElement*>(anElem) ) {
-             aDiam = ball->GetDiameter();
-           }
-         }
-         aScalars->SetTuple(aCurId,&aDiam);
-       }
+        
+        //Store diameters of the balls
+        if(aScalars) {
+          double aDiam = 0;
+          if(aType == SMDSAbs_Ball) {
+            if (const SMDS_BallElement* ball = dynamic_cast<const SMDS_BallElement*>(anElem) ) {
+              aDiam = ball->GetDiameter();
+            }
+          }
+          aScalars->SetTuple(aCurId,&aDiam);
+        }
 
         iElem++;
       }
index 8d8f5a51360cd02582bb653f432e6ac42fd3de93..ca1d4ba5767a2e93ed2c32e3e400f66a79a10f9b 100644 (file)
@@ -144,10 +144,10 @@ SMESH_SVTKActor
         if(aCell->GetCellType() == VTK_VERTEX ) {
           my0DGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
         } else if(aCell->GetCellType() == VTK_POLY_VERTEX ) {
-         vtkIdType newCellId = myBallGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
-         if(myVisualObj) {
-           outputCD->CopyData(cd, myVisualObj->GetElemVTKId(aPartId), newCellId);
-         }
+          vtkIdType newCellId = myBallGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+          if(myVisualObj) {
+            outputCD->CopyData(cd, myVisualObj->GetElemVTKId(aPartId), newCellId);
+          }
         } else {
           myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
         }
index fe435204003ff2777ca92f2f1babea6ae71de86f..17c51c068309f19047c6a579c36e6c5b3295e4e3 100644 (file)
@@ -2018,7 +2018,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh,
     if ( nbOdElems > 0 ) {
       if ( total + nbOdElems > updateLimit ) {
         *entities = *entities & ~SMESH_Actor::e0DElements;
-       *hidden = *hidden | SMESH_Actor::e0DElements;
+        *hidden = *hidden | SMESH_Actor::e0DElements;
       }
       else
         exceeded = false;
@@ -2028,7 +2028,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh,
     if ( nbEdges > 0 ) {
       if ( total + nbEdges > updateLimit ) {
         *entities = *entities & ~SMESH_Actor::eEdges;
-       *hidden = *hidden | SMESH_Actor::eEdges;
+        *hidden = *hidden | SMESH_Actor::eEdges;
       }
       else
         exceeded = false;
@@ -2038,7 +2038,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh,
     if ( nbFaces > 0 ) {
       if ( total + nbFaces > updateLimit ) {
         *entities = *entities & ~SMESH_Actor::eFaces;
-       *hidden = *hidden | SMESH_Actor::eFaces;
+        *hidden = *hidden | SMESH_Actor::eFaces;
       }
       else
         exceeded = false;
@@ -2048,7 +2048,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh,
     if ( nbVolumes > 0 ) {
       if ( total + nbVolumes > updateLimit ) {
         *entities = *entities & ~SMESH_Actor::eVolumes;
-       *hidden = *hidden | SMESH_Actor::eVolumes;
+        *hidden = *hidden | SMESH_Actor::eVolumes;
       }
       else
         exceeded = false;
@@ -2058,7 +2058,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh,
     if ( nbBalls > 0 ) {
       if ( total + nbBalls > updateLimit ) {
         *entities = *entities & ~SMESH_Actor::eBallElem;
-       *hidden = *hidden | SMESH_Actor::eBallElem;
+        *hidden = *hidden | SMESH_Actor::eBallElem;
       }
       else
         exceeded = false;
@@ -3549,13 +3549,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       int page = SMESHGUI_MeasureDlg::MinDistance;
       if ( theCommandID == 502 )
-       page = SMESHGUI_MeasureDlg::BoundingBox;
+        page = SMESHGUI_MeasureDlg::BoundingBox;
       else if ( theCommandID == 503 )
-       page = SMESHGUI_MeasureDlg::Length;
+        page = SMESHGUI_MeasureDlg::Length;
       else if ( theCommandID == 504 )
-       page = SMESHGUI_MeasureDlg::Area;
+        page = SMESHGUI_MeasureDlg::Area;
       else if ( theCommandID == 505 )
-       page = SMESHGUI_MeasureDlg::Volume;
+        page = SMESHGUI_MeasureDlg::Volume;
 
       EmitSignalDeactivateDialog();
       SMESHGUI_MeasureDlg* dlg = new SMESHGUI_MeasureDlg( SMESHGUI::desktop(), page );
index 067f35b9bad716f8de6737f6e9de99818c2f1c37..87c9b0ba785aa9bebc9a9b641a4087a13880bcf3 100644 (file)
@@ -229,10 +229,10 @@ namespace SMESH
       anIds->SetNumberOfIds(1);
       for (int i = 0, iEnd = theIds.size(); i < iEnd; i++){
         anIds->InsertId(0,theIds[i]);
-       vtkIdType anId = myBallPolyData->InsertNextCell(VTK_POLY_VERTEX,anIds);
-       double d = theDiameter;
-       aScalars->SetTuple(anId,&d);
-       anIds->Reset();
+        vtkIdType anId = myBallPolyData->InsertNextCell(VTK_POLY_VERTEX,anIds);
+        double d = theDiameter;
+        aScalars->SetTuple(anId,&d);
+        anIds->Reset();
       }
       
       anIds->Delete();
@@ -258,7 +258,7 @@ namespace SMESH
       if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
         myVTKViewWindow->RemoveActor(myPreviewActor,false,false);
         myVTKViewWindow->RemoveActor(myFaceOrientation,false,false);
-       myVTKViewWindow->RemoveActor(myBallActor,false,false);
+        myVTKViewWindow->RemoveActor(myBallActor,false,false);
       }
 
       myMapper->Delete();
index 26180bedb0f5776844a86e39b1240c9dba024f6b..41d4e2cf88561716ac3642769ec8dcc3c4b5ad90 100644 (file)
@@ -915,12 +915,12 @@ void SMESHGUI_BaseComputeOp::computeMesh()
 
             if ( limitExceeded )
             {
-             QStringList hiddenMsg;
-             if ( hidden & SMESH_Actor::e0DElements ) hiddenMsg << tr( "SMESH_ELEMS0D" );
-             if ( hidden & SMESH_Actor::eEdges )      hiddenMsg << tr( "SMESH_EDGES" );
-             if ( hidden & SMESH_Actor::eFaces )      hiddenMsg << tr( "SMESH_FACES" );
-             if ( hidden & SMESH_Actor::eVolumes )    hiddenMsg << tr( "SMESH_VOLUMES" );
-             if ( hidden & SMESH_Actor::eBallElem )   hiddenMsg << tr( "SMESH_BALLS" );
+              QStringList hiddenMsg;
+              if ( hidden & SMESH_Actor::e0DElements ) hiddenMsg << tr( "SMESH_ELEMS0D" );
+              if ( hidden & SMESH_Actor::eEdges )      hiddenMsg << tr( "SMESH_EDGES" );
+              if ( hidden & SMESH_Actor::eFaces )      hiddenMsg << tr( "SMESH_FACES" );
+              if ( hidden & SMESH_Actor::eVolumes )    hiddenMsg << tr( "SMESH_VOLUMES" );
+              if ( hidden & SMESH_Actor::eBallElem )   hiddenMsg << tr( "SMESH_BALLS" );
               SUIT_MessageBox::warning( desktop(),
                                         tr( "SMESH_WRN_WARNING" ),
                                         tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( myMesh->NbElements() ).arg( limitSize ).arg( hiddenMsg.join(", ") ) );
index 1c0e05abd4ed64f49f4e6f4b23233bc59e99a2d5..d86fd4b541aa21fa4bb82d3b78a2adaa2c98fe55 100644 (file)
@@ -685,13 +685,13 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview()
               double y = aXYZ->operator[](1);
               double z = aXYZ->operator[](2);
 
-             if ( myUpdateDestination ) {
-               myDlg->myX->SetValue(x);
-               myDlg->myY->SetValue(y);
-               myDlg->myZ->SetValue(z);
-             }
+              if ( myUpdateDestination ) {
+                myDlg->myX->SetValue(x);
+                myDlg->myY->SetValue(y);
+                myDlg->myZ->SetValue(z);
+              }
 
-             double dx = myDlg->myX->GetValue() - x;
+              double dx = myDlg->myX->GetValue() - x;
               double dy = myDlg->myY->GetValue() - y;
               double dz = myDlg->myZ->GetValue() - z;
               myDlg->myCurrentX->SetValue(x);
index c53aa66cbcfa1d39ee9f26c603a75401d7124916..18aabb74cd3a30580050eed98ec2da2214205b96 100644 (file)
@@ -436,74 +436,74 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
       switch ( actionButton ) {
       case MOVE_ELEMS_BUTTON:
         if(CheckBoxMesh->isChecked()) {
-         for ( int i = 0; i < myObjects.count(); i++ ) {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-           myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-           aMeshEditor->RotateObject(myObjects[i], anAxis, anAngle, false);
-         }
-       }
-       else {
-         SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
-         myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-         aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
-       }
+          for ( int i = 0; i < myObjects.count(); i++ ) {
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+            myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            aMeshEditor->RotateObject(myObjects[i], anAxis, anAngle, false);
+          }
+        }
+        else {
+          SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+          myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+          aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
+        }
         break;
       case COPY_ELEMS_BUTTON:
         if ( makeGroups ) {
           SMESH::ListOfGroups_var groups;
           if(CheckBoxMesh->isChecked()) {
-           for ( int i = 0; i < myObjects.count(); i++ ) {
-             SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-             myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-             groups = aMeshEditor->RotateObjectMakeGroups(myObjects[i], anAxis, anAngle);
-           }
-         }
+            for ( int i = 0; i < myObjects.count(); i++ ) {
+              SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+              myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+              groups = aMeshEditor->RotateObjectMakeGroups(myObjects[i], anAxis, anAngle);
+            }
+          }
           else {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
-           myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+            myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
             groups = aMeshEditor->RotateMakeGroups(anElementsId, anAxis, anAngle);
-         }
+          }
         }
         else {
           if(CheckBoxMesh->isChecked()) {
-           for ( int i = 0; i < myObjects.count(); i++ ) {
-             SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-             myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-             aMeshEditor->RotateObject(myObjects[i], anAxis, anAngle, true);
-           }
-         }
+            for ( int i = 0; i < myObjects.count(); i++ ) {
+              SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+              myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+              aMeshEditor->RotateObject(myObjects[i], anAxis, anAngle, true);
+            }
+          }
           else {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
-           myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-           aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
-         }
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+            myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
+          }
         }
         break;
       case MAKE_MESH_BUTTON: {
         SMESH::SMESH_Mesh_var mesh;
         if (CheckBoxMesh->isChecked()) {
-         for ( int i = 0; i < myObjects.count(); i++ ) {
-           QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) );
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-           myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-           mesh = aMeshEditor->RotateObjectMakeMesh(myObjects[i], anAxis, anAngle, makeGroups,
-                                                    aName.toLatin1().data());
-           if (!mesh->_is_nil()) {
-             if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
-               anEntryList.append( aSObject->GetID().c_str() );
-           }
-         }
-       }
+          for ( int i = 0; i < myObjects.count(); i++ ) {
+            QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) );
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+            myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            mesh = aMeshEditor->RotateObjectMakeMesh(myObjects[i], anAxis, anAngle, makeGroups,
+                                                     aName.toLatin1().data());
+            if (!mesh->_is_nil()) {
+              if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
+                anEntryList.append( aSObject->GetID().c_str() );
+            }
+          }
+        }
         else {
-         SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
-         myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+          SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+          myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
           mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
                                              LineEditNewMesh->text().toLatin1().data());
-         if (!mesh->_is_nil()) {
-           if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
-             anEntryList.append( aSObject->GetID().c_str() );
-         }
-       }
+          if (!mesh->_is_nil()) {
+            if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
+              anEntryList.append( aSObject->GetID().c_str() );
+          }
+        }
         break;
       }
       }
@@ -682,25 +682,25 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument()
       Handle(SALOME_InteractiveObject) IO = it.Value();
       SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO );
       if ( aMesh->_is_nil() )
-       return;
+        return;
       
       myActor = SMESH::FindActorByObject( aMesh );
       if ( !myActor )
-       myActor = SMESH::FindActorByEntry( IO->getEntry() );
+        myActor = SMESH::FindActorByEntry( IO->getEntry() );
       if ( !myActor && !CheckBoxMesh->isChecked() )
-       return;
+        return;
       
       if ( !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO )->_is_nil() ) {
-       if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) {
-         _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) );
-         _PTR(GenericAttribute) anAttr;
-         if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
-           _PTR(AttributeName) aNameAttr( anAttr );
-           myObjects << SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
-           myObjectsNames << aNameAttr->Value().c_str();
-           myMeshes << aMesh;
-         }
-       }
+        if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) {
+          _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) );
+          _PTR(GenericAttribute) anAttr;
+          if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
+            _PTR(AttributeName) aNameAttr( anAttr );
+            myObjects << SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
+            myObjectsNames << aNameAttr->Value().c_str();
+            myMeshes << aMesh;
+          }
+        }
       }
     }
 
@@ -719,7 +719,7 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument()
       SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
 
       if ( myMeshes.isEmpty() )
-       return;
+        return;
       // get IDs from mesh
         /*
           SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
@@ -1129,19 +1129,19 @@ void SMESHGUI_RotationDlg::onDisplaySimulation( bool toDisplayPreview ) {
         SUIT_OverrideCursor aWaitCursor;
         bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON  ||
                       ActionGroup->checkedId() == MAKE_MESH_BUTTON );
-       QList<SMESH::MeshPreviewStruct_var> aMeshPreviewStruct;
+        QList<SMESH::MeshPreviewStruct_var> aMeshPreviewStruct;
         if(CheckBoxMesh->isChecked())
-         for ( int i = 0; i < myObjects.count(); i++ ) {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditPreviewer();
-           aMeshEditor->RotateObject(myObjects[i], anAxis, anAngle, copy);
-           aMeshPreviewStruct << aMeshEditor->GetPreviewData();
-         }
-       else {
-         SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer();
+          for ( int i = 0; i < myObjects.count(); i++ ) {
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditPreviewer();
+            aMeshEditor->RotateObject(myObjects[i], anAxis, anAngle, copy);
+            aMeshPreviewStruct << aMeshEditor->GetPreviewData();
+          }
+        else {
+          SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer();
           aMeshEditor->Rotate(anElementsId, anAxis, anAngle, copy);
-         aMeshPreviewStruct << aMeshEditor->GetPreviewData();
-       }
-       setSimulationPreview( aMeshPreviewStruct );
+          aMeshPreviewStruct << aMeshEditor->GetPreviewData();
+        }
+        setSimulationPreview( aMeshPreviewStruct );
       } catch (...) {
         hidePreview();
       }
index 83a793fb19eb27cc1140dd4eb35d68b88367e6d1..09a941be6be6ea6b9609f6e38bbd3bc08b1654bc 100644 (file)
@@ -477,71 +477,71 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
       switch ( actionButton ) {
 
       case MOVE_ELEMS_BUTTON:
-       if ( CheckBoxMesh->isChecked() )
-         for ( int i = 0; i < myObjects.count(); i++ ) {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-           myMeshes[i]->SetParameters( aParameters.join( ":" ).toLatin1().constData() );
-           aMeshEditor->Scale(myObjects[i], aPoint, aScaleFact, false);
-         }
-       else {
-         SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+        if ( CheckBoxMesh->isChecked() )
+          for ( int i = 0; i < myObjects.count(); i++ ) {
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+            myMeshes[i]->SetParameters( aParameters.join( ":" ).toLatin1().constData() );
+            aMeshEditor->Scale(myObjects[i], aPoint, aScaleFact, false);
+          }
+        else {
+          SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
           SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
-         myMeshes[0]->SetParameters( aParameters.join( ":" ).toLatin1().constData() );
-         aMeshEditor->Scale( src, aPoint, aScaleFact, false);
-       }
+          myMeshes[0]->SetParameters( aParameters.join( ":" ).toLatin1().constData() );
+          aMeshEditor->Scale( src, aPoint, aScaleFact, false);
+        }
         break;
 
       case COPY_ELEMS_BUTTON:
         if ( makeGroups ) {
-         SMESH::ListOfGroups_var groups;
-         if(CheckBoxMesh->isChecked())
-           for ( int i = 0; i < myObjects.count(); i++ ) {
-             SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-             myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-             groups = aMeshEditor->ScaleMakeGroups(myObjects[i], aPoint, aScaleFact);
-           }
+          SMESH::ListOfGroups_var groups;
+          if(CheckBoxMesh->isChecked())
+            for ( int i = 0; i < myObjects.count(); i++ ) {
+              SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+              myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+              groups = aMeshEditor->ScaleMakeGroups(myObjects[i], aPoint, aScaleFact);
+            }
           else {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
             SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
-           myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-           groups = aMeshEditor->ScaleMakeGroups( src, aPoint, aScaleFact);
-         }
-       }
+            myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            groups = aMeshEditor->ScaleMakeGroups( src, aPoint, aScaleFact);
+          }
+        }
         else {
-         if(CheckBoxMesh->isChecked()) {
-           for ( int i = 0; i < myObjects.count(); i++ ) {
-             SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-             myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-             aMeshEditor->Scale(myObjects[i], aPoint, aScaleFact, true);
-           }
-         }
+          if(CheckBoxMesh->isChecked()) {
+            for ( int i = 0; i < myObjects.count(); i++ ) {
+              SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+              myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+              aMeshEditor->Scale(myObjects[i], aPoint, aScaleFact, true);
+            }
+          }
           else {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
             SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
-           myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-           aMeshEditor->Scale( src, aPoint, aScaleFact, true);
-         }
-       }
+            myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            aMeshEditor->Scale( src, aPoint, aScaleFact, true);
+          }
+        }
         break;
 
       case MAKE_MESH_BUTTON: {
-       SMESH::SMESH_Mesh_var mesh;
-       if (CheckBoxMesh->isChecked()) {
-         for ( int i = 0; i < myObjects.count(); i++ ) {
-           QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) );
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-           myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-           mesh = aMeshEditor->ScaleMakeMesh(myObjects[i], aPoint, aScaleFact, makeGroups,
-                                             aName.toLatin1().data());
-           if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
-             anEntryList.append( aSObject->GetID().c_str() );
-         }
-       }
-       else {
-         SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
-         myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+        SMESH::SMESH_Mesh_var mesh;
+        if (CheckBoxMesh->isChecked()) {
+          for ( int i = 0; i < myObjects.count(); i++ ) {
+            QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) );
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+            myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            mesh = aMeshEditor->ScaleMakeMesh(myObjects[i], aPoint, aScaleFact, makeGroups,
+                                              aName.toLatin1().data());
+            if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
+              anEntryList.append( aSObject->GetID().c_str() );
+          }
+        }
+        else {
+          SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+          myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
           SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
-         mesh = aMeshEditor->ScaleMakeMesh( src, aPoint, aScaleFact, makeGroups,
+          mesh = aMeshEditor->ScaleMakeMesh( src, aPoint, aScaleFact, makeGroups,
                                              LineEditNewMesh->text().toLatin1().data());
           if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
             anEntryList.append( aSObject->GetID().c_str() );
@@ -722,25 +722,25 @@ void SMESHGUI_ScaleDlg::SelectionIntoArgument()
       Handle(SALOME_InteractiveObject) IO = it.Value();
       SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO );
       if ( aMesh->_is_nil() )
-       return;
+        return;
   
       myActor = SMESH::FindActorByObject( aMesh );
       if ( !myActor )
-       myActor = SMESH::FindActorByEntry( IO->getEntry() );
+        myActor = SMESH::FindActorByEntry( IO->getEntry() );
       if ( !myActor && !CheckBoxMesh->isChecked() )
-       return;
+        return;
 
       if ( !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO )->_is_nil() ) {
-       if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) {
-         _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) );
-         _PTR(GenericAttribute) anAttr;
-         if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
-           _PTR(AttributeName) aNameAttr( anAttr );
-           myObjects << SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
-           myObjectsNames << aNameAttr->Value().c_str();
-           myMeshes << aMesh;
-         }
-       }
+        if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) {
+          _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) );
+          _PTR(GenericAttribute) anAttr;
+          if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
+            _PTR(AttributeName) aNameAttr( anAttr );
+            myObjects << SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
+            myObjectsNames << aNameAttr->Value().c_str();
+            myMeshes << aMesh;
+          }
+        }
       }
     }
       
@@ -760,7 +760,7 @@ void SMESHGUI_ScaleDlg::SelectionIntoArgument()
     if (CheckBoxMesh->isChecked()) {
       SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
       if (myMeshes.isEmpty())
-       return;
+        return;
         // get IDs from mesh
         /*
         SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
@@ -1136,21 +1136,21 @@ void SMESHGUI_ScaleDlg::onDisplaySimulation( bool toDisplayPreview ) {
         bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON ||
                       ActionGroup->checkedId() == MAKE_MESH_BUTTON );
         SUIT_OverrideCursor aWaitCursor;
-       QList<SMESH::MeshPreviewStruct_var> aMeshPreviewStruct;
-
-       if(CheckBoxMesh->isChecked())
-         for ( int i = 0; i < myObjects.count(); i++ ) {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditPreviewer();
-           aMeshEditor->Scale(myObjects[i], aPoint, aScaleFact, copy);
-           aMeshPreviewStruct << aMeshEditor->GetPreviewData();
-         }
+        QList<SMESH::MeshPreviewStruct_var> aMeshPreviewStruct;
+
+        if(CheckBoxMesh->isChecked())
+          for ( int i = 0; i < myObjects.count(); i++ ) {
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditPreviewer();
+            aMeshEditor->Scale(myObjects[i], aPoint, aScaleFact, copy);
+            aMeshPreviewStruct << aMeshEditor->GetPreviewData();
+          }
         else {
-         SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer();
+          SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer();
           SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
-         aMeshEditor->Scale( src, aPoint, aScaleFact, copy);
-         aMeshPreviewStruct << aMeshEditor->GetPreviewData();
-       }
-       setSimulationPreview(aMeshPreviewStruct);
+          aMeshEditor->Scale( src, aPoint, aScaleFact, copy);
+          aMeshPreviewStruct << aMeshEditor->GetPreviewData();
+        }
+        setSimulationPreview(aMeshPreviewStruct);
       } catch (...) {
         hidePreview();
       }
index 66b70585bd810c2e77c4f1ecba079eb7895194dd..869026ab0b8af5a9e718e1152faa4499992ad6a9 100644 (file)
@@ -499,68 +499,68 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
       switch ( actionButton ) {
       case MOVE_ELEMS_BUTTON: {
         if(CheckBoxMesh->isChecked())
-         for ( int i = 0; i < myObjects.count(); i++ ) {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-           myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-           aMeshEditor->MirrorObject(myObjects[i], aMirror, aMirrorType, false );
-         }
+          for ( int i = 0; i < myObjects.count(); i++ ) {
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+            myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            aMeshEditor->MirrorObject(myObjects[i], aMirror, aMirrorType, false );
+          }
         else {
-         SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
-         myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+          SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+          myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
           aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
-       }
+        }
         break;
       }
       case COPY_ELEMS_BUTTON: {
         SMESH::ListOfGroups_var groups;
         if ( makeGroups ) {
           if(CheckBoxMesh->isChecked())
-           for ( int i = 0; i < myObjects.count(); i++ ) {
-             SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-             myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-             groups = aMeshEditor->MirrorObjectMakeGroups(myObjects[i], aMirror, aMirrorType);
-           }
+            for ( int i = 0; i < myObjects.count(); i++ ) {
+              SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+              myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+              groups = aMeshEditor->MirrorObjectMakeGroups(myObjects[i], aMirror, aMirrorType);
+            }
           else {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
-           myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+            myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
             groups = aMeshEditor->MirrorMakeGroups(anElementsId, aMirror, aMirrorType);
-         }
+          }
         }
         else {
           if(CheckBoxMesh->isChecked())
-           for ( int i = 0; i < myObjects.count(); i++ ) {
-             SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-             myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-             aMeshEditor->MirrorObject(myObjects[i], aMirror, aMirrorType, true);
-           }
+            for ( int i = 0; i < myObjects.count(); i++ ) {
+              SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+              myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+              aMeshEditor->MirrorObject(myObjects[i], aMirror, aMirrorType, true);
+            }
           else {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
-           myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+            myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
             aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
-         }
+          }
         }
         break;
         }
       case MAKE_MESH_BUTTON: {
         SMESH::SMESH_Mesh_var mesh;
         if (CheckBoxMesh->isChecked())
-         for ( int i = 0; i < myObjects.count(); i++ ) {
-           QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) );
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
-           myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
-           mesh = aMeshEditor->MirrorObjectMakeMesh(myObjects[i], aMirror, aMirrorType, makeGroups,
-                                                    aName.toLatin1().data());
-           if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
-             anEntryList.append( aSObject->GetID().c_str() );
-         }
+          for ( int i = 0; i < myObjects.count(); i++ ) {
+            QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) );
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
+            myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+            mesh = aMeshEditor->MirrorObjectMakeMesh(myObjects[i], aMirror, aMirrorType, makeGroups,
+                                                     aName.toLatin1().data());
+            if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
+              anEntryList.append( aSObject->GetID().c_str() );
+          }
         else {
-         SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
-         myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
+          SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
+          myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData());
           mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
                                              LineEditNewMesh->text().toLatin1().data());
           if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
             anEntryList.append( aSObject->GetID().c_str() );
-       }
+        }
         }
         break;
       }
@@ -741,32 +741,32 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument()
       
       SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO );
       if( aMesh->_is_nil() )
-       return;
+        return;
 
       myActor = SMESH::FindActorByObject( aMesh );
       if ( !myActor )
-       myActor = SMESH::FindActorByEntry( IO->getEntry() );
+        myActor = SMESH::FindActorByEntry( IO->getEntry() );
       if ( !myActor && !CheckBoxMesh->isChecked() )
-       return;
+        return;
 
       if ( !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO )->_is_nil() ) {
-       if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) {
-         _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) );
-         _PTR(GenericAttribute) anAttr;
-         if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
-           _PTR(AttributeName) aNameAttr( anAttr );
-           myObjects << SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
-           myObjectsNames << aNameAttr->Value().c_str();
-           myMeshes << aMesh;
-         }
-       }
+        if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) {
+          _PTR(SObject) obj = aStudy->FindObjectID( qPrintable( QString( IO->getEntry() ) ) );
+          _PTR(GenericAttribute) anAttr;
+          if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) {
+            _PTR(AttributeName) aNameAttr( anAttr );
+            myObjects << SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
+            myObjectsNames << aNameAttr->Value().c_str();
+            myMeshes << aMesh;
+          }
+        }
       }
     }
 
     // MakeGroups is available if there are groups and "Copy"
       int aNbGroups = 0;
       for ( int i = 0; i < myMeshes.count(); i++ )
-       aNbGroups += myMeshes[i]->NbGroups();
+        aNbGroups += myMeshes[i]->NbGroups();
       
     if ( aNbGroups == 0 ) {
       MakeGroupsCheck->setChecked(false);
@@ -779,7 +779,7 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument()
       SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
 
       if ( myObjects.isEmpty() ) 
-       return;
+        return;
       // get IDs from mesh
       /*
         SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
@@ -1191,19 +1191,19 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) {
         bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON ||
                       ActionGroup->checkedId() == MAKE_MESH_BUTTON );
         SUIT_OverrideCursor aWaitCursor;
-       QList<SMESH::MeshPreviewStruct_var> aMeshPreviewStruct;
+        QList<SMESH::MeshPreviewStruct_var> aMeshPreviewStruct;
         if(CheckBoxMesh->isChecked())
-         for ( int i = 0; i < myMeshes.count(); i++ ) {
-           SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditPreviewer();
-           aMeshEditor->MirrorObject(myObjects[i], aMirror, aMirrorType, copy );
-           aMeshPreviewStruct << aMeshEditor->GetPreviewData();
-         }
+          for ( int i = 0; i < myMeshes.count(); i++ ) {
+            SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditPreviewer();
+            aMeshEditor->MirrorObject(myObjects[i], aMirror, aMirrorType, copy );
+            aMeshPreviewStruct << aMeshEditor->GetPreviewData();
+          }
         else {
-         SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer();
+          SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer();
           aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, copy );        
-         aMeshPreviewStruct << aMeshEditor->GetPreviewData();
-       }
-       setSimulationPreview(aMeshPreviewStruct);
+          aMeshPreviewStruct << aMeshEditor->GetPreviewData();
+        }
+        setSimulationPreview(aMeshPreviewStruct);
       } catch (...) {
         hidePreview();
       }
index 9bb687fc3ccc2f852fb2f4784e7ab75890169471..5107e5b2bf35edc2b10617665afacd44206af6c8 100644 (file)
@@ -143,7 +143,7 @@ static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, SMESH::Cont
       
       SMESH::long_array_var anElementsId = theSource->GetIDs();
       for (int i = 0; i < anElementsId->length(); i++) {
-       value += theFunctor->GetValue( anElementsId[i] );
+        value += theFunctor->GetValue( anElementsId[i] );
       }
     }
   }
index 593855b72672a85df1988740ddcff5c5a41c6fc1..5aa7e1aeda34a1e70e4f06e31c03591d8e9ed223 100644 (file)
@@ -380,9 +380,9 @@ SMESH_Swig::Init(int theStudyID)
         aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
         aPixmap->UnRegister();
 
-       SALOMEDS::UseCaseBuilder_var useCaseBuilder = myStudy->GetUseCaseBuilder();
-       useCaseBuilder->SetRootCurrent();
-       useCaseBuilder->Append( aSComponent.in() );
+        SALOMEDS::UseCaseBuilder_var useCaseBuilder = myStudy->GetUseCaseBuilder();
+        useCaseBuilder->SetRootCurrent();
+        useCaseBuilder->Append( aSComponent.in() );
   
         myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
         if (aLocked)