// File : GHS3DPluginGUI_HypothesisCreator.cxx
// Author : Michael Zorin
// Module : GHS3DPlugin
-// $Header:
//
#include "GHS3DPluginGUI_HypothesisCreator.h"
-// #include "GHS3DPluginGUI_EnforcedDelegates.h"
#include "GHS3DPluginGUI_Enums.h"
-#include "GeometryGUI.h"
+#include <GeometryGUI.h>
#include <SMESHGUI_Utils.h>
#include <SMESHGUI_SpinBox.h>
void EnforcedMeshTableWidgetDelegate::setEditorData(QWidget *editor,
const QModelIndex &index) const
{
- QItemDelegate::setEditorData(editor, index);
+ QItemDelegate::setEditorData(editor, index);
}
void EnforcedMeshTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
}
myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), myStdGroup );
- aStdLayout->addWidget( myToMeshHolesCheck, row++, 0, 1, 2 );
+ aStdLayout->addWidget( myToMeshHolesCheck, row, 0, 1, 1 );
+ myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), myStdGroup );
+ aStdLayout->addWidget( myToMakeGroupsOfDomains, row++, 1, 1, 1 );
aStdLayout->addWidget( new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), myStdGroup ), row, 0, 1, 1 );
myOptimizationLevelCombo = new QComboBox( myStdGroup );
tab->setCurrentIndex( STD_TAB );
// connections
+ connect( myToMeshHolesCheck, SIGNAL( toggled( bool ) ), this, SLOT( onToMeshHoles(bool)));
connect( myMaximumMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
connect( myInitialMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
connect( myBoundaryRecoveryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
myEnforcedTableWidget->selectionModel()->clearSelection();
}
+void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn)
+{
+ myToMakeGroupsOfDomains->setEnabled( isOn );
+ if ( !isOn )
+ myToMakeGroupsOfDomains->setChecked( false );
+}
+
void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
{
QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myWorkingDir->text(), QString() );
void GHS3DPluginGUI_HypothesisCreator::updateWidgets()
{
+ myToMakeGroupsOfDomains->setEnabled( myToMeshHolesCheck->isChecked() );
myMaximumMemorySpin->setEnabled( myMaximumMemoryCheck->isChecked() );
myInitialMemoryCheck->setEnabled( !myBoundaryRecoveryCheck->isChecked() );
myInitialMemorySpin->setEnabled( myInitialMemoryCheck->isChecked() && !myBoundaryRecoveryCheck->isChecked() );
myName->setText( data.myName );
myToMeshHolesCheck ->setChecked ( data.myToMeshHoles );
+ myToMakeGroupsOfDomains ->setChecked ( data.myToMakeGroupsOfDomains );
myOptimizationLevelCombo ->setCurrentIndex( data.myOptimizationLevel );
myMaximumMemoryCheck ->setChecked ( data.myMaximumMemory > 0 );
myMaximumMemorySpin ->setValue ( qMax( data.myMaximumMemory,
h_data.myName = isCreation() && data ? hypName() : "";
h_data.myToMeshHoles = h->GetToMeshHoles();
+ h_data.myToMakeGroupsOfDomains = h->GetToMeshHoles() && h->GetToMakeGroupsOfDomains();
h_data.myMaximumMemory = h->GetMaximumMemory();
h_data.myInitialMemory = h->GetInitialMemory();
h_data.myInitialMemory = h->GetInitialMemory();
if ( h->GetToMeshHoles() != h_data.myToMeshHoles ) // avoid duplication of DumpPython commands
h->SetToMeshHoles ( h_data.myToMeshHoles );
+ if ( h->GetToMakeGroupsOfDomains() != h_data.myToMakeGroupsOfDomains )
+ h->SetToMakeGroupsOfDomains( h_data.myToMakeGroupsOfDomains );
if ( h->GetMaximumMemory() != h_data.myMaximumMemory )
h->SetMaximumMemory ( h_data.myMaximumMemory );
if ( h->GetInitialMemory() != h_data.myInitialMemory )
MESSAGE("GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets");
h_data.myName = myName ? myName->text() : "";
h_data.myToMeshHoles = myToMeshHolesCheck->isChecked();
+ h_data.myToMakeGroupsOfDomains = myToMakeGroupsOfDomains->isChecked();
h_data.myMaximumMemory = myMaximumMemoryCheck->isChecked() ? myMaximumMemorySpin->value() : -1;
h_data.myInitialMemory = myInitialMemoryCheck->isChecked() ? myInitialMemorySpin->value() : -1;
h_data.myOptimizationLevel = myOptimizationLevelCombo->currentIndex();