void SMESHGUI_CopyMeshDlg::SelectionIntoArgument()
{
if (myBusy) return;
+ if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
+ if (!GroupButtons->isEnabled()) return; // inactive
+
BusyLocker lock( myBusy );
// clear
if ( !myFilterDlg )
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
+ QList<int> types;
+ if ( myMesh->NbEdges() ) types << SMESH::EDGE;
+ if ( myMesh->NbFaces() ) types << SMESH::FACE;
+ if ( myMesh->NbVolumes() ) types << SMESH::VOLUME;
+ if ( myMesh->NbBalls() ) types << SMESH::BALL;
+ if ( myMesh->Nb0DElements()) types << SMESH::ELEM0D;
+ if ( types.count() > 1 ) types << SMESH::ALL;
+
+ myFilterDlg->Init( types );
myFilterDlg->SetSelection();
myFilterDlg->SetMesh( myMesh );
myFilterDlg->SetSourceWg( myLineEditElements );
myDlg->selectObject( names, types, ids );
// enable/desable "new mesh" button
- bool isMesh = true; // EAP - it's sometimes necessary to copy to a new mesh
- // for ( int i = 0; i < ids.count() && isMesh; ++i )
- // {
- // _PTR(SObject) sobj =
- // SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() );
- // mySrcMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( sobj );
- // isMesh = !mySrcMesh->_is_nil();
- // }
+ bool isMesh = true;
+ for ( int i = 0; i < ids.count() && isMesh; ++i )
+ {
+ _PTR(SObject) sobj =
+ SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() );
+ mySrcMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( sobj );
+ //isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh
+ }
myDlg->setNewMeshEnabled( isMesh );
}
catch ( const SALOME::SALOME_Exception& S_ex ) {
void SMESHGUI_RemoveElementsDlg::SelectionIntoArgument()
{
if (myBusy) return; // busy
- if (myFilterDlg && myFilterDlg->isVisible()) return; // filter digl active
+ if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
if (!GroupButtons->isEnabled()) return; // inactive
// clear
void SMESHGUI_RotationDlg::SelectionIntoArgument()
{
if (myBusy) return;
+ if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
// clear
myActor = 0;
if ( !myFilterDlg )
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
+ QList<int> types;
+ if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE;
+ if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE;
+ if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME;
+ if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL;
+ if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D;
+ if ( types.count() > 1 ) types << SMESH::ALL;
+
+ myFilterDlg->Init( types );
myFilterDlg->SetSelection();
myFilterDlg->SetMesh( myMeshes[0] );
myFilterDlg->SetSourceWg( LineEditElements );
void SMESHGUI_ScaleDlg::SelectionIntoArgument()
{
if (myBusy) return;
+ if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
+
BusyLocker lock( myBusy );
// clear
myActor = 0;
if ( !myFilterDlg )
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
+ QList<int> types;
+ if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE;
+ if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE;
+ if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME;
+ if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL;
+ if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D;
+ if ( types.count() > 1 ) types << SMESH::ALL;
+
+ myFilterDlg->Init( types );
myFilterDlg->SetSelection();
myFilterDlg->SetMesh( myMeshes[0] );
myFilterDlg->SetSourceWg( LineEditElements );
void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
{
if (myBusy) return;
+ if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
// clear
QString aString = "";
BusyLocker lock( myBusy );
if (myEditCurrentArgument == LineEditElements ||
- myEditCurrentArgument == LineEditNodes) {
+ myEditCurrentArgument == LineEditNodes)
+ {
myEditCurrentArgument->setText(aString);
if (myEditCurrentArgument == LineEditElements) {
myNbOkElements = 0;
void SMESHGUI_SymmetryDlg::SelectionIntoArgument()
{
if (myBusy) return;
+ if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
// clear
myActor = 0;
if ( !myFilterDlg )
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
+ QList<int> types;
+ if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE;
+ if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE;
+ if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME;
+ if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL;
+ if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D;
+ if ( types.count() > 1 ) types << SMESH::ALL;
+
+ myFilterDlg->Init( types );
myFilterDlg->SetSelection();
myFilterDlg->SetMesh( myMeshes[0] );
myFilterDlg->SetSourceWg( LineEditElements );
// function : onDisplaySimulation
// purpose : Show/Hide preview
//=================================================================================
-void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) {
- if (myPreviewCheckBox->isChecked() && toDisplayPreview) {
- if ( myNbOkElements && isValid() && IsMirrorOk() ) {
- QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
+void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview )
+{
+ if (myPreviewCheckBox->isChecked() && toDisplayPreview)
+ {
+ if ( myNbOkElements && isValid() && IsMirrorOk() )
+ {
+ QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anElementsId = new SMESH::long_array;
anElementsId->length(aListElementsId.count());
SMESH::AxisStruct aMirror;
SMESH::SMESH_MeshEditor::MirrorType aMirrorType;
-
+
getMirror(aMirror,aMirrorType);
try {
}
else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer();
- aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, copy );
+ aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, copy );
aMeshPreviewStruct << aMeshEditor->GetPreviewData();
}
setSimulationPreview(aMeshPreviewStruct);
}
} else {
hidePreview();
- }
+ }
} else {
hidePreview();
}
// function : getMirror
// purpose : return mirror parameters
//=================================================================================
-void SMESHGUI_SymmetryDlg::getMirror(SMESH::AxisStruct& theMirror, SMESH::SMESH_MeshEditor::MirrorType& theMirrorType) {
+void SMESHGUI_SymmetryDlg::getMirror(SMESH::AxisStruct& theMirror,
+ SMESH::SMESH_MeshEditor::MirrorType& theMirrorType)
+{
theMirror.x = SpinBox_X->GetValue();
theMirror.y = SpinBox_Y->GetValue();
theMirror.z = SpinBox_Z->GetValue();
void SMESHGUI_TranslationDlg::SelectionIntoArgument()
{
if (myBusy) return;
+ if (myFilterDlg && myFilterDlg->isVisible()) return; // filter dlg active
+
BusyLocker lock( myBusy );
// clear
myActor = 0;
if ( !myFilterDlg )
myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, SMESH::ALL );
+ QList<int> types;
+ if ( myMeshes[0]->NbEdges() ) types << SMESH::EDGE;
+ if ( myMeshes[0]->NbFaces() ) types << SMESH::FACE;
+ if ( myMeshes[0]->NbVolumes() ) types << SMESH::VOLUME;
+ if ( myMeshes[0]->NbBalls() ) types << SMESH::BALL;
+ if ( myMeshes[0]->Nb0DElements()) types << SMESH::ELEM0D;
+ if ( types.count() > 1 ) types << SMESH::ALL;
+
+ myFilterDlg->Init( types );
myFilterDlg->SetSelection();
myFilterDlg->SetMesh( myMeshes[0] );
myFilterDlg->SetSourceWg( LineEditElements );
//=================================================================================
void SMESHGUI_TranslationDlg::onDisplaySimulation( bool toDisplayPreview )
{
- if (myPreviewCheckBox->isChecked() && toDisplayPreview) {
-
- if (isValid() && myNbOkElements) {
+ if (myPreviewCheckBox->isChecked() && toDisplayPreview)
+ {
+ if (isValid() && myNbOkElements)
+ {
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anElementsId = new SMESH::long_array;