std::string anEntry = SO->GetID();
/** Erase graphical object **/
- if(SO->FindAttribute(anAttr, "AttributeIOR")){
- ViewManagerList aViewMenegers = anApp->viewManagers();
- ViewManagerList::const_iterator it = aViewMenegers.begin();
- for( ; it != aViewMenegers.end(); it++) {
- SUIT_ViewManager* vm = *it;
- int nbSf = vm ? vm->getViewsCount() : 0;
- if(vm) {
+ if(SO->FindAttribute(anAttr, "AttributeIOR")){
+ ViewManagerList aViewMenegers = anApp->viewManagers();
+ ViewManagerList::const_iterator it = aViewMenegers.begin();
+ for( ; it != aViewMenegers.end(); it++) {
+ SUIT_ViewManager* vm = *it;
+ int nbSf = vm ? vm->getViewsCount() : 0;
+ if(vm) {
QVector<SUIT_ViewWindow*> aViews = vm->getViews();
for(int i = 0; i < nbSf; i++){
SUIT_ViewWindow *sf = aViews[i];
}
}
}
- }
- }
+ }
+ }
/** Remove an object from data structures **/
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( SO ));
for ( anIter->InitEx(true); anIter->More(); anIter->Next() )
{
_PTR(SObject) so = anIter->Value();
- SMESH::RemoveVisualObjectWithActors(so->GetID().c_str(), true);
+ SMESH::RemoveVisualObjectWithActors(so->GetID().c_str(), true);
}
}
catch (const SALOME::SALOME_Exception& S_ex){
// get base point
SMESH::PointStruct aBasePoint;
if (BasePointGrp->isChecked()) {
- aBasePoint.x = XSpin->GetValue();
- aBasePoint.y = YSpin->GetValue();
- aBasePoint.z = ZSpin->GetValue();
+ aBasePoint.x = XSpin->GetValue();
+ aBasePoint.y = YSpin->GetValue();
+ aBasePoint.z = ZSpin->GetValue();
}
bool bOk;
long aNodeStart = StartPointLineEdit->text().toLong(&bOk);
if (bOk) {
-
- try {
- SUIT_OverrideCursor wc;
-
- SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
- bool NeedGroups = false;
- SMESH::ElementType ElemType = SMESH::FACE;
- if( GetConstructorId() == 0 )
- ElemType = SMESH::EDGE;
- if( !MeshCheck->isChecked() ) {
- aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
- anAngles, LinearAnglesCheck->isChecked(),
- BasePointGrp->isChecked(), aBasePoint,
- NeedGroups, ElemType, retVal);
- }
- else {
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
- anAngles, LinearAnglesCheck->isChecked(),
- BasePointGrp->isChecked(), aBasePoint,
- NeedGroups, ElemType, retVal);
- }
-
- wc.suspend();
- if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK ) {
- SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
- mySimulation->SetData(aMeshPreviewStruct._retn());
- } else {
- hidePreview();
- }
-
- } catch (...) {
- hidePreview();
- }
+
+ try {
+ SUIT_OverrideCursor wc;
+
+ SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
+ bool NeedGroups = false;
+ SMESH::ElementType ElemType = SMESH::FACE;
+ if( GetConstructorId() == 0 )
+ ElemType = SMESH::EDGE;
+ if( !MeshCheck->isChecked() ) {
+ aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
+ anAngles, LinearAnglesCheck->isChecked(),
+ BasePointGrp->isChecked(), aBasePoint,
+ NeedGroups, ElemType, retVal);
+ }
+ else {
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
+ anAngles, LinearAnglesCheck->isChecked(),
+ BasePointGrp->isChecked(), aBasePoint,
+ NeedGroups, ElemType, retVal);
+ }
+
+ wc.suspend();
+ if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK ) {
+ SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
+ mySimulation->SetData(aMeshPreviewStruct._retn());
+ } else {
+ hidePreview();
+ }
+
+ } catch (...) {
+ hidePreview();
+ }
} else {
- hidePreview();
+ hidePreview();
}
} else {
bool bOk;
int j = 0;
for (int i = 0; i < aListElementsId.count(); i++) {
- long ind = aListElementsId[ i ].toLong(&bOk);
- if (bOk) {
- const SMDS_MeshElement* e = aMesh->FindElement(ind);
- if (e) {
- bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
- Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
- if (typeMatch)
- anElementsId[ j++ ] = ind;
- }
- }
+ long ind = aListElementsId[ i ].toLong(&bOk);
+ if (bOk) {
+ const SMDS_MeshElement* e = aMesh->FindElement(ind);
+ if (e) {
+ bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
+ Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
+ if (typeMatch)
+ anElementsId[ j++ ] = ind;
+ }
+ }
}
anElementsId->length(j);
}
long aNbSteps = (long)SpinBox_NbSteps->value();
try {
- SUIT_OverrideCursor aWaitCursor;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
+ SUIT_OverrideCursor aWaitCursor;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
if( CheckBoxMesh->isChecked() ) {
if( GetConstructorId() == 0 )
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
}
else
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
-
+
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
mySimulation->SetData(aMeshPreviewStruct._retn());
} catch (...) {
- hidePreview();
+ hidePreview();
}
} else {
hidePreview();
if ( RadioButton3->isChecked() ) {
aVector.PS.x = SpinBox_Dx->GetValue();
aVector.PS.y = SpinBox_Dy->GetValue();
- aVector.PS.z = SpinBox_Dz->GetValue();
+ aVector.PS.z = SpinBox_Dz->GetValue();
} else if ( RadioButton4->isChecked() ) {
gp_XYZ aNormale(SpinBox_Vx->GetValue(),
- SpinBox_Vy->GetValue(),
- SpinBox_Vz->GetValue());
+ SpinBox_Vy->GetValue(),
+ SpinBox_Vz->GetValue());
aNormale /= aNormale.Modulus();
myScalarBarActor->GetDistributionColor(oldRgb);
colorChanged = (rgb[0] != oldRgb[0] || rgb[1] != oldRgb[1] || rgb[2] != oldRgb[2]);
if(colorChanged)
- myScalarBarActor->SetDistributionColor(rgb);
+ myScalarBarActor->SetDistributionColor(rgb);
}
}
myMonoColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
if ( coloringType == SMESH_MONOCOLOR_TYPE ) {
myDMonoColor->setChecked(true);
- onDistributionChanged(myDistribColorGrp->id(myDMonoColor));
+ onDistributionChanged(myDistribColorGrp->id(myDMonoColor));
} else {
myDMultiColor->setChecked(true);
onDistributionChanged(myDistribColorGrp->id(myDMultiColor));
}
myDistributionGrp->setChecked((bool)myScalarBarActor->GetDistributionVisibility());
- onDistributionActivated(myScalarBarActor->GetDistributionVisibility());
-
-
+ onDistributionActivated(myScalarBarActor->GetDistributionVisibility());
+
+
myRangeGrp->setEnabled( true );
myFontGrp->setEnabled( true );
myLabColorGrp->setEnabled( true );
myOriginDimGrp->setEnabled( true );
myOkBtn->setEnabled( true );
myApplyBtn->setEnabled( true );
- myDistributionGrp->setEnabled( true );
+ myDistributionGrp->setEnabled( true );
return;
}
}
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
- anElementsId[i] = aListElementsId[i].toInt();
+ anElementsId[i] = aListElementsId[i].toInt();
SMESH::AxisStruct anAxis;
double anAngle = (SpinBox_Angle->GetValue())*PI/180;
try {
- SUIT_OverrideCursor aWaitCursor;
- bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
- if(CheckBoxMesh->isChecked())
- aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, copy);
- else
- aMeshEditor->Rotate(anElementsId, anAxis, anAngle, copy);
+ SUIT_OverrideCursor aWaitCursor;
+ bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
+ if(CheckBoxMesh->isChecked())
+ aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, copy);
+ else
+ aMeshEditor->Rotate(anElementsId, anAxis, anAngle, copy);
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
- mySimulation->SetData(aMeshPreviewStruct._retn());
+ mySimulation->SetData(aMeshPreviewStruct._retn());
} catch (...) {
- hidePreview();
+ hidePreview();
}
}
else {
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
- anElementsId[i] = aListElementsId[i].toInt();
+ anElementsId[i] = aListElementsId[i].toInt();
SMESH::PointStruct aPoint;
SMESH::double_array_var aScaleFact = new SMESH::double_array;
getScale(aPoint, aScaleFact);
try {
- bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
- SUIT_OverrideCursor aWaitCursor;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
- SMESH::SMESH_IDSource_var obj;
- if ( CheckBoxMesh->isChecked() )
- obj = mySelectedObject;
- else
- obj = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
- aMeshEditor->Scale(obj, aPoint, aScaleFact, copy);
+ bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
+ SUIT_OverrideCursor aWaitCursor;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
+ SMESH::SMESH_IDSource_var obj;
+ if ( CheckBoxMesh->isChecked() )
+ obj = mySelectedObject;
+ else
+ obj = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
+ aMeshEditor->Scale(obj, aPoint, aScaleFact, copy);
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
- mySimulation->SetData(aMeshPreviewStruct._retn());
+ mySimulation->SetData(aMeshPreviewStruct._retn());
} catch (...) {
- hidePreview();
+ hidePreview();
}
} else {
hidePreview();
bool isValid();
void getScale( SMESH::PointStruct& thePoint,
- SMESH::double_array_var& theScaleFact);
+ SMESH::double_array_var& theScaleFact);
SMESHGUI_IdValidator* myIdValidator;
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
for (int i = 0; i < aListId.count(); i++) {
int id = aListId[ i ].toInt();
if ( id > 0 ) {
- bool validId = aMesh ? ( aMesh->FindElement( id ) != 0 ) : ( myMesh->GetElementType( id, true ) != SMESH::EDGE );
+ bool validId = aMesh ? ( aMesh->FindElement( id ) != 0 ) : ( myMesh->GetElementType( id, true ) != SMESH::EDGE );
if ( validId )
- newIndices.Add( id );
+ newIndices.Add( id );
}
myNbOkElements = newIndices.Extent();
mySelector->AddOrRemoveIndex(myIO, newIndices, false);
for (int i = 0; i < aListId.count(); i++) {
int id = aListId[ i ].toInt();
if ( id > 0 ) {
- bool validId = aMesh ? ( aMesh->FindNode( id ) != 0 ) : ( myMesh->GetElementType( id, false ) != SMESH::EDGE );
+ bool validId = aMesh ? ( aMesh->FindNode( id ) != 0 ) : ( myMesh->GetElementType( id, false ) != SMESH::EDGE );
if ( validId )
- newIndices.Add( id );
+ newIndices.Add( id );
}
myNbOkNodes = newIndices.Extent();
mySelector->AddOrRemoveIndex(myIO, newIndices, false);
QStringList elements;
for ( int i = 0; i < myNbOkElements; ++i )
- elements << QString::number( aMapIndex( i+1 ) );
+ elements << QString::number( aMapIndex( i+1 ) );
aString = elements.join(" ");
}
} else if (myEditCurrentArgument == LineEditNodes && !myMesh->_is_nil() && myIO == IO ) {
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
- anElementsId[i] = aListElementsId[i].toInt();
+ anElementsId[i] = aListElementsId[i].toInt();
SMESH::AxisStruct aMirror;
SMESH::SMESH_MeshEditor::MirrorType aMirrorType;
getMirror(aMirror,aMirrorType);
try {
- bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
- SUIT_OverrideCursor aWaitCursor;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
+ bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
+ SUIT_OverrideCursor aWaitCursor;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
if(CheckBoxMesh->isChecked())
aMeshEditor->MirrorObject(mySelectedObject, aMirror, aMirrorType, copy );
else
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, copy );
-
+
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
mySimulation->SetData(aMeshPreviewStruct._retn());
} catch (...) {
- hidePreview();
+ hidePreview();
}
} else {
hidePreview();
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
- anElementsId[i] = aListElementsId[i].toInt();
+ anElementsId[i] = aListElementsId[i].toInt();
SMESH::DirStruct aVector;
if (GetConstructorId() == 0) {
- aVector.PS.x = SpinBox2_1->GetValue() - SpinBox1_1->GetValue();
- aVector.PS.y = SpinBox2_2->GetValue() - SpinBox1_2->GetValue();
- aVector.PS.z = SpinBox2_3->GetValue() - SpinBox1_3->GetValue();
+ aVector.PS.x = SpinBox2_1->GetValue() - SpinBox1_1->GetValue();
+ aVector.PS.y = SpinBox2_2->GetValue() - SpinBox1_2->GetValue();
+ aVector.PS.z = SpinBox2_3->GetValue() - SpinBox1_3->GetValue();
} else if (GetConstructorId() == 1) {
- aVector.PS.x = SpinBox1_1->GetValue();
- aVector.PS.y = SpinBox1_2->GetValue();
- aVector.PS.z = SpinBox1_3->GetValue();
+ aVector.PS.x = SpinBox1_1->GetValue();
+ aVector.PS.y = SpinBox1_2->GetValue();
+ aVector.PS.z = SpinBox1_3->GetValue();
}
try {
- bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
- SUIT_OverrideCursor aWaitCursor;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
- if(CheckBoxMesh->isChecked())
- aMeshEditor->TranslateObject(mySelectedObject, aVector, copy);
- else
- aMeshEditor->Translate(anElementsId, aVector, copy);
-
+ bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON;
+ SUIT_OverrideCursor aWaitCursor;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
+ if(CheckBoxMesh->isChecked())
+ aMeshEditor->TranslateObject(mySelectedObject, aVector, copy);
+ else
+ aMeshEditor->Translate(anElementsId, aVector, copy);
+
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
- mySimulation->SetData(aMeshPreviewStruct._retn());
+ mySimulation->SetData(aMeshPreviewStruct._retn());
} catch (...) {
-
+
}
}
else {
} else {
SUIT_ViewManager* aVM = app->getViewManager(SVTK_Viewer::Type(), true);
if(aVM)
- aList.append(aVM);
+ aList.append(aVM);
}
bool actorRemoved = false;
ViewManagerList::ConstIterator it = aList.begin();
aViewManager = *it;
QVector<SUIT_ViewWindow*> views = aViewManager->getViews();
for ( int iV = 0; iV < views.count(); ++iV ) {
- if ( SMESH_Actor* actor = FindActorByEntry( views[iV], theEntry)) {
- if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
- vtkWnd->RemoveActor(actor);
- actorRemoved = true;
- }
- actor->Delete();
- }
+ if ( SMESH_Actor* actor = FindActorByEntry( views[iV], theEntry)) {
+ if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
+ vtkWnd->RemoveActor(actor);
+ actorRemoved = true;
+ }
+ actor->Delete();
+ }
}
}
TVisualObjCont::key_type aKey(aStudyId,theEntry);
TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
if(anIter != VISUAL_OBJ_CONT.end()) {
- // for unknown reason, object destructor is not called, so clear object manually
- anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
- anIter->second->GetUnstructuredGrid()->SetPoints(0);
+ // for unknown reason, object destructor is not called, so clear object manually
+ anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
+ anIter->second->GetUnstructuredGrid()->SetPoints(0);
}
VISUAL_OBJ_CONT.erase(aKey);
}
MESSAGE("--- display " << anActor);
anActor->SetVisibility(true);
- if(anActor->hasIO()){
- Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
- if(anIO->hasEntry()){
- aStudy->setVisibilityState(anIO->getEntry(), Qtx::ShownState);
- }
- }
+ if(anActor->hasIO()){
+ Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
+ if(anIO->hasEntry()){
+ aStudy->setVisibilityState(anIO->getEntry(), Qtx::ShownState);
+ }
+ }
}
}
break;
anActor->SetVisibility(false);
}
}
- aStudy->setVisibilityStateForAll(Qtx::HiddenState);
+ aStudy->setVisibilityStateForAll(Qtx::HiddenState);
}
default: {
if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) {
case eDisplay:
case eDisplayOnly:
//MESSAGE("--- display " << anActor);
- anActor->Update();
+ anActor->Update();
anActor->SetVisibility(true);
if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
- aStudy->setVisibilityState(theEntry, Qtx::ShownState);
+ aStudy->setVisibilityState(theEntry, Qtx::ShownState);
break;
case eErase:
//MESSAGE("--- erase " << anActor);
anActor->SetVisibility(false);
- aStudy->setVisibilityState(theEntry, Qtx::HiddenState);
+ aStudy->setVisibilityState(theEntry, Qtx::HiddenState);
break;
}
} else {
if ((anActor = CreateActor(aDocument,theEntry,true))) {
bool needFitAll = noSmeshActors(theWnd); // fit for the first object only
DisplayActor(theWnd,anActor);
- aStudy->setVisibilityState(theEntry, Qtx::ShownState);
+ aStudy->setVisibilityState(theEntry, Qtx::ShownState);
// FitAll(); - PAL16770(Display of a group performs an automatic fit all)
if (needFitAll) FitAll();
} else {