From db4fd22d08c1c2f80e854c94f0cc86fa3e052cf8 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 26 Sep 2013 08:44:08 +0000 Subject: [PATCH] untabify --- src/OBJECT/SMESH_Object.cxx | 26 ++-- src/OBJECT/SMESH_SVTKActor.cxx | 8 +- src/SMESHGUI/SMESHGUI.cxx | 18 +-- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx | 10 +- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 12 +- src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx | 12 +- src/SMESHGUI/SMESHGUI_RotationDlg.cxx | 148 +++++++++--------- src/SMESHGUI/SMESHGUI_ScaleDlg.cxx | 156 +++++++++---------- src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 122 +++++++-------- src/SMESH_I/SMESH_Measurements_i.cxx | 2 +- src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx | 6 +- 11 files changed, 260 insertions(+), 260 deletions(-) diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 466b9af64..94cf59d5f 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -281,8 +281,8 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid) //MESSAGE( "Update - myGrid->GetNumberOfCells() = "<GetNumberOfCells() ); //MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<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(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(anElem) ) { + aDiam = ball->GetDiameter(); + } + } + aScalars->SetTuple(aCurId,&aDiam); + } iElem++; } diff --git a/src/OBJECT/SMESH_SVTKActor.cxx b/src/OBJECT/SMESH_SVTKActor.cxx index 8d8f5a513..ca1d4ba57 100644 --- a/src/OBJECT/SMESH_SVTKActor.cxx +++ b/src/OBJECT/SMESH_SVTKActor.cxx @@ -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()); } diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index fe4352040..17c51c068 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -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 ); diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index 067f35b9b..87c9b0ba7 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -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(); diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 26180bedb..41d4e2cf8 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -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(", ") ) ); diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx index 1c0e05abd..d86fd4b54 100644 --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx @@ -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); diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index c53aa66cb..18aabb74c 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -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( 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( 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( 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 aMeshPreviewStruct; + QList 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(); } diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index 83a793fb1..09a941be6 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -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( 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( 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( 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 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 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(); } diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 66b70585b..869026ab0 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -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( 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( 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( 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 aMeshPreviewStruct; + QList 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(); } diff --git a/src/SMESH_I/SMESH_Measurements_i.cxx b/src/SMESH_I/SMESH_Measurements_i.cxx index 9bb687fc3..5107e5b2b 100644 --- a/src/SMESH_I/SMESH_Measurements_i.cxx +++ b/src/SMESH_I/SMESH_Measurements_i.cxx @@ -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] ); } } } diff --git a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx index 593855b72..5aa7e1aed 100644 --- a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx +++ b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx @@ -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) -- 2.30.2