-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH SMESHGUI : GUI for SMESH component
-// File : SMESHGUI_RotationDlg.cxx
-// Author : Michael ZORIN, Open CASCADE S.A.S.
-// SMESH includes
-//
+// SMESH SMESHGUI : GUI for SMESH component
+// File : SMESHGUI_RotationDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
+// SMESH includes
+
#include "SMESHGUI_RotationDlg.h"
#include "SMESHGUI.h"
#define SPACING 8
#define MARGIN 11
+//To disable automatic genericobj management, the following line should be commented.
+//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx
+#define WITHGENERICOBJ
+
//=================================================================================
// class : SMESHGUI_RotationDlg()
// purpose :
SelectElementsButton->setIcon(image1);
LineEditElements = new QLineEdit(GroupArguments);
LineEditElements->setValidator(myIdValidator);
+ LineEditElements->setMaxLength(-1);
myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
SMESHGUI_RotationDlgLayout->addWidget(GroupButtons);
/* Initialisations */
- SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
+ SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+ SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
- SpinBox_Angle->RangeStepAndValidator(-360.0, +360.0, 5.0, 3);
+ SpinBox_Angle->RangeStepAndValidator(-360.0, +360.0, 5.0, "angle_precision");
myConstructorId = 0;
RadioButton1->setChecked(true);
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
else
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
- if( !myMesh->_is_nil())
- myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+ if( !myMesh->_is_nil())
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case COPY_ELEMS_BUTTON:
if ( makeGroups ) {
else {
if(CheckBoxMesh->isChecked())
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, true);
- else
+ else
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
}
- if( !myMesh->_is_nil())
- myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+ if( !myMesh->_is_nil())
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
- case MAKE_MESH_BUTTON:
+ case MAKE_MESH_BUTTON: {
SMESH::SMESH_Mesh_var mesh;
- if(CheckBoxMesh->isChecked())
+ if (CheckBoxMesh->isChecked())
mesh = aMeshEditor->RotateObjectMakeMesh(mySelectedObject, anAxis, anAngle, makeGroups,
LineEditNewMesh->text().toLatin1().data());
- else
+ else
mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
LineEditNewMesh->text().toLatin1().data());
- if( !mesh->_is_nil())
- mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+ if (!mesh->_is_nil()) {
+ mesh->SetParameters(aParameters.join(":").toLatin1().constData());
+#ifdef WITHGENERICOBJ
+ // obj has been published in study. Its refcount has been incremented.
+ // It is safe to decrement its refcount
+ // so that it will be destroyed when the entry in study will be removed
+ mesh->Destroy();
+#endif
+ }
+ break;
+ }
}
} catch (...) {
}
Init(false);
mySelectedObject = SMESH::SMESH_IDSource::_nil();
SelectionIntoArgument();
+
+ SMESHGUI::Modified();
}
return true;
void SMESHGUI_RotationDlg::ClickOnHelp()
{
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
+ if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
QString platform;
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if (aMesh) {
if (send == LineEditElements) {
Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
-
+
TColStd_MapOfInteger newIndices;
-
+
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
- const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
- if (e)
- newIndices.Add(e->GetID());
- myNbOkElements++;
+ const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+ if (e)
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
}
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( anIO, true, true );
-
+ aViewWindow->highlight( anIO, true, true );
+
myElementsId = theNewText;
}
}
myActor = SMESH::FindActorByObject(myMesh);
if (!myActor)
myActor = SMESH::FindActorByEntry(IO->getEntry());
- if (!myActor)
+ if (!myActor && !CheckBoxMesh->isChecked())
return;
int aNbUnits = 0;
} else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
// get submesh
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
-
+
// get IDs from submesh
SMESH::long_array_var anElementsIds = new SMESH::long_array;
anElementsIds = aSubMesh->GetElementsId();
LineEditElements->setText(aString);
LineEditElements->repaint();
LineEditElements->setEnabled(false); // to update lineedit IPAL 19809
- LineEditElements->setEnabled(true);
+ LineEditElements->setEnabled(true);
setNewMeshName();
}
myBusy = false;
myEditCurrentArgument = (QWidget*)LineEditElements;
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
- if ( aViewWindow )
- aViewWindow->SetSelectionMode(ActorSelection);
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
- if ( aViewWindow )
- aViewWindow->SetSelectionMode( CellSelection );
- }
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode( CellSelection );
+ }
} else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X;
SMESH::SetPointRepresentation(true);
- if ( aViewWindow )
- aViewWindow->SetSelectionMode( NodeSelection );
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode( NodeSelection );
} else if (send == SelectVectorButton) {
myEditCurrentArgument = (QWidget*)SpinBox_DX;
SMESH::SetPointRepresentation(true);
- if ( aViewWindow )
- aViewWindow->SetSelectionMode( NodeSelection );
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode( NodeSelection );
}
break;
}
bool SMESHGUI_RotationDlg::IsAxisOk()
{
return (SpinBox_DX->GetValue() != 0 ||
- SpinBox_DY->GetValue() != 0 ||
- SpinBox_DZ->GetValue() != 0);
+ SpinBox_DY->GetValue() != 0 ||
+ SpinBox_DZ->GetValue() != 0);
}
//=================================================================================
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )