//MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
//MESSAGE( "Update - myGrid->GetNumberOfPoints() = "<<myGrid->GetNumberOfPoints() );
if( MYDEBUGWITHFILES ) {
- SMESH::WriteUnstructuredGrid( myGrid,"myPrs.vtu" );
- }
+ SMESH::WriteUnstructuredGrid( myGrid,"myPrs.vtu" );
+ }
}
}
}
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++;
}
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());
}
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;
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;
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;
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;
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;
{
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 );
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();
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();
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(", ") ) );
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);
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;
}
}
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;
+ }
+ }
}
}
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
if ( myMeshes.isEmpty() )
- return;
+ return;
// get IDs from mesh
/*
SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
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();
}
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() );
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;
+ }
+ }
}
}
if (CheckBoxMesh->isChecked()) {
SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
if (myMeshes.isEmpty())
- return;
+ return;
// get IDs from mesh
/*
SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
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();
}
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;
}
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);
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
if ( myObjects.isEmpty() )
- return;
+ return;
// get IDs from mesh
/*
SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
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();
}
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] );
}
}
}
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)