AnglesGrpLayout->addWidget( AngleSpin, 0, 2 );
AnglesGrpLayout->setRowStretch(1, 10);
+ // CheckBox for groups generation
+ MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
+ MakeGroupsCheck->setChecked(true);
+
// layouting
GroupArgumentsLayout->addWidget( ElementsLab, 0, 0 );
GroupArgumentsLayout->addWidget( SelectElementsButton, 0, 1 );
GroupArgumentsLayout->addMultiCellWidget(BasePointGrp, 3, 4, 1, 2);
GroupArgumentsLayout->addWidget( AnglesCheck, 5, 0 );
GroupArgumentsLayout->addMultiCellWidget(AnglesGrp, 5, 6, 1, 2);
+ GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 7, 7, 0, 2);
GroupArgumentsLayout->setRowStretch(6, 10);
/***************************************************************/
try {
SUIT_OverrideCursor wc;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- SMESH::SMESH_MeshEditor::Extrusion_Error retVal =
- aMeshEditor->ExtrusionAlongPath(anElementsId.inout(), myPathMesh, myPathShape, aNodeStart,
- AnglesCheck->isChecked(), anAngles.inout(),
- BasePointCheck->isChecked(), aBasePoint);
+ SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId.inout(), myPathMesh,
+ myPathShape, aNodeStart,
+ AnglesCheck->isChecked(), anAngles.inout(),
+ BasePointCheck->isChecked(), aBasePoint, retVal);
+ else
+ retVal = aMeshEditor->ExtrusionAlongPath(anElementsId.inout(), myPathMesh,
+ myPathShape, aNodeStart,
+ AnglesCheck->isChecked(), anAngles.inout(),
+ BasePointCheck->isChecked(), aBasePoint);
//wc.stop();
wc.suspend();
//mySelectionMgr->clearSelected();
SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() );
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ mySMESHGUI->updateObjBrowser(true); // new groups may appear
//SMESH::UpdateView();
Init(false);
ConstructorsClicked(GetConstructorId());
myMesh = SMESH::GetMeshByIO(IO);
if (myMesh->_is_nil())
return;
+
+ // MakeGroups is available if there are groups
+ if ( myMesh->NbGroups() == 0 ) {
+ MakeGroupsCheck->setChecked(false);
+ MakeGroupsCheck->setEnabled(false);
+ } else {
+ MakeGroupsCheck->setEnabled(true);
+ }
// find actor
myMeshActor = SMESH::FindActorByObject(myMesh);
if (!myMeshActor)
SMESHGUI_SpinBox* YSpin;
QLabel* ZLab;
SMESHGUI_SpinBox* ZSpin;
+ QCheckBox* MakeGroupsCheck;
QGroupBox* GroupButtons;
QPushButton* OkButton;
SpinBox_NbSteps = new QSpinBox(GroupArguments, "SpinBox_NbSteps");
GroupArgumentsLayout->addMultiCellWidget(SpinBox_NbSteps, 3, 3, 2, 7);
+ // CheckBox for groups generation
+ MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
+ MakeGroupsCheck->setChecked(true);
+ GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 4, 4, 0, 7);
+
+
SMESHGUI_ExtrusionDlgLayout->addWidget(GroupArguments, 1, 0);
/* Initialisations */
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
QApplication::setOverrideCursor(Qt::waitCursor);
- aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
+
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
+ else
+ aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
+
QApplication::restoreOverrideCursor();
} catch (...) {
}
SMESH::UpdateView();
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ mySMESHGUI->updateObjBrowser(true); // new groups may appear
Init(false);
ConstructorsClicked(GetConstructorId());
SelectionIntoArgument();
if (myEditCurrentArgument == LineEditElements) {
int aNbElements = 0;
+ // MakeGroups is available if there are groups
+ if ( myMesh->NbGroups() == 0 ) {
+ MakeGroupsCheck->setChecked(false);
+ MakeGroupsCheck->setEnabled(false);
+ } else {
+ MakeGroupsCheck->setEnabled(true);
+ }
+
if (CheckBoxMesh->isChecked()) {
SMESH::ElementType neededType = GetConstructorId() ? SMESH::FACE : SMESH::EDGE;
SMESHGUI_SpinBox* SpinBox_Dz;
QLabel* TextLabelNbSteps;
QSpinBox* SpinBox_NbSteps;
+ QCheckBox* MakeGroupsCheck;
QGroupBox* GroupButtons;
QPushButton* buttonOk;
SpinBox_Tolerance = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Tolerance");
GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 5, 2);
+ // CheckBox for groups generation
+ MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
+ MakeGroupsCheck->setChecked(true);
+ GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 6, 6, 0, 3);
+
+
SMESHGUI_RevolutionDlgLayout->addWidget(GroupArguments, 1, 0);
/* Initialisations */
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
QApplication::setOverrideCursor(Qt::waitCursor);
- aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
+
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
+ anAngle, aNbSteps, aTolerance);
+ else
+ aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
+
QApplication::restoreOverrideCursor();
} catch (...) {
}
SMESH::UpdateView();
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ mySMESHGUI->updateObjBrowser(true); // new groups may appear
Init(false);
ConstructorsClicked(GetConstructorId());
SelectionIntoArgument();
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
myElementsId = "";
+ // MakeGroups is available if there are groups
+ if ( myMesh->NbGroups() == 0 ) {
+ MakeGroupsCheck->setChecked(false);
+ MakeGroupsCheck->setEnabled(false);
+ } else {
+ MakeGroupsCheck->setEnabled(true);
+ }
+
if (CheckBoxMesh->isChecked()) {
int aConstructorId = GetConstructorId();
QPushButton* SelectElementsButton;
QLineEdit* LineEditElements;
QCheckBox* CheckBoxMesh;
+ QCheckBox* MakeGroupsCheck;
QLabel* TextLabelPoint;
QPushButton* SelectPointButton;
CheckBoxCopy->setText(tr("SMESH_CREATE_COPY"));
GroupArgumentsLayout->addMultiCellWidget(CheckBoxCopy, 4, 4, 0, 2);
+ // CheckBox for groups generation
+ MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
+ GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 5, 5, 0, 2);
+
SMESHGUI_RotationDlgLayout->addWidget(GroupArguments, 1, 0);
/* Initialisations */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
+ connect(CheckBoxCopy, SIGNAL(toggled(bool)), SLOT(onCopyChecked(bool)));
this->show(); /* displays Dialog */
CheckBoxCopy->setChecked(false);
CheckBoxMesh->setChecked(false);
+ MakeGroupsCheck->setChecked(false);
+ MakeGroupsCheck->setEnabled(false);
}
onSelectMesh(CheckBoxMesh->isChecked());
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
QApplication::setOverrideCursor(Qt::waitCursor);
- aMeshEditor->Rotate(anElementsId.inout(), anAxis, anAngle, toCreateCopy);
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->RotateMakeGroups(anElementsId.inout(), anAxis, anAngle);
+ else
+ aMeshEditor->Rotate(anElementsId.inout(), anAxis, anAngle, toCreateCopy);
QApplication::restoreOverrideCursor();
} catch (...) {
}
SMESH::UpdateView();
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ mySMESHGUI->updateObjBrowser(true); // new groups may appear
Init(false);
SelectionIntoArgument();
}
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
myElementsId = "";
+ // MakeGroups is available if there are groups and "Copy"
+ if ( myMesh->NbGroups() == 0 ) {
+ MakeGroupsCheck->setChecked(false);
+ MakeGroupsCheck->setEnabled(false);
+ }
+ else if (CheckBoxCopy->isChecked() ) {
+ MakeGroupsCheck->setEnabled(true);
+ }
if (CheckBoxMesh->isChecked()) {
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
}
}
+//=======================================================================
+//function : onCopyChecked
+//purpose : slot called when Copy checkBox is checked
+//=======================================================================
+
+void SMESHGUI_RotationDlg::onCopyChecked(bool isOn)
+{
+ // enable "MakeGroupsCheck"
+ if ( !myMesh->_is_nil() && myMesh->NbGroups() == 0)
+ isOn = false;
+ MakeGroupsCheck->setEnabled(isOn);
+}
+
//=================================================================================
// function : keyPressEvent()
// purpose :
QLabel* TextLabelAngle;
SMESHGUI_SpinBox* SpinBox_Angle;
QCheckBox* CheckBoxCopy;
+ QCheckBox* MakeGroupsCheck;
QString myHelpFileName;
void onTextChange (const QString&);
void onSelectMesh (bool toSelectMesh);
void onVectorChanged();
+ void onCopyChecked(bool isOn);
protected:
QGridLayout* SMESHGUI_RotationDlgLayout;
CheckBoxCopy->setText(tr("SMESH_CREATE_COPY"));
GroupArgumentsLayout->addMultiCellWidget(CheckBoxCopy, 3, 3, 0, 2);
+ // CheckBox for groups generation
+ MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
+ MakeGroupsCheck->setChecked(false);
+ GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 4, 4, 0, 2);
SMESHGUI_SymmetryDlgLayout->addWidget(GroupArguments, 1, 0);
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
+ connect(CheckBoxCopy, SIGNAL(toggled(bool)), SLOT(onCopyChecked(bool)));
this->show(); /* displays Dialog */
CheckBoxCopy->setChecked(false);
CheckBoxMesh->setChecked(false);
+ MakeGroupsCheck->setChecked(false);
+ MakeGroupsCheck->setEnabled(false);
onSelectMesh(false);
}
}
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
QApplication::setOverrideCursor(Qt::waitCursor);
- aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, toCreateCopy);
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->MirrorMakeGroups(anElementsId, aMirror, aMirrorType);
+ else
+ aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, toCreateCopy);
QApplication::restoreOverrideCursor();
} catch (...) {
}
SMESH::UpdateView();
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ mySMESHGUI->updateObjBrowser(true); // new groups may appear
Init(false);
ConstructorsClicked(GetConstructorId());
SelectionIntoArgument();
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
myElementsId = "";
+ // MakeGroups is available if there are groups and "Copy"
+ if ( myMesh->NbGroups() == 0 ) {
+ MakeGroupsCheck->setChecked(false);
+ MakeGroupsCheck->setEnabled(false);
+ }
+ else if (CheckBoxCopy->isChecked() ) {
+ MakeGroupsCheck->setEnabled(true);
+ }
if (CheckBoxMesh->isChecked()) {
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
}
}
+//=======================================================================
+//function : onCopyChecked
+//purpose : slot called when Copy checkBox is checked
+//=======================================================================
+
+void SMESHGUI_SymmetryDlg::onCopyChecked(bool isOn)
+{
+ // enable "MakeGroupsCheck"
+ if ( !myMesh->_is_nil() && myMesh->NbGroups() == 0)
+ isOn = false;
+ MakeGroupsCheck->setEnabled(isOn);
+}
+
//=================================================================================
// function : keyPressEvent()
// purpose :
SMESHGUI_SpinBox* SpinBox_DZ;
QCheckBox* CheckBoxCopy;
+ QCheckBox* MakeGroupsCheck;
QString myHelpFileName;
void onTextChange(const QString&);
void onSelectMesh(bool toSelectMesh);
void onVectorChanged();
-
+ void onCopyChecked(bool isOn);
+
protected:
QGridLayout* SMESHGUI_SymmetryDlgLayout;
QGridLayout* GroupConstructorsLayout;
CheckBoxCopy->setText(tr("SMESH_CREATE_COPY"));
GroupArgumentsLayout->addMultiCellWidget(CheckBoxCopy, 4, 4, 0, 2);
+ // CheckBox for groups generation
+ MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
+ MakeGroupsCheck->setChecked(false);
+ GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 5, 5, 0, 2);
SMESHGUI_TranslationDlgLayout->addWidget(GroupArguments, 1, 0);
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
+ connect(CheckBoxCopy, SIGNAL(toggled(bool)), SLOT(onCopyChecked(bool)));
this->show(); /* displays Dialog */
CheckBoxCopy->setChecked(false);
CheckBoxMesh->setChecked(false);
+ MakeGroupsCheck->setChecked(false);
+ MakeGroupsCheck->setEnabled(false);
onSelectMesh(false);
}
}
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
QApplication::setOverrideCursor(Qt::waitCursor);
- aMeshEditor->Translate(anElementsId.inout(), aVector, toCreateCopy);
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->TranslateMakeGroups(anElementsId.inout(), aVector);
+ else
+ aMeshEditor->Translate(anElementsId.inout(), aVector, toCreateCopy);
QApplication::restoreOverrideCursor();
} catch (...) {
}
SMESH::UpdateView();
+ if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
+ mySMESHGUI->updateObjBrowser(true); // new groups may appear
Init(false);
ConstructorsClicked(GetConstructorId());
SelectionIntoArgument();
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
myElementsId = "";
+ // MakeGroups is available if there are groups and "Copy"
+ if ( myMesh->NbGroups() == 0 ) {
+ MakeGroupsCheck->setChecked(false);
+ MakeGroupsCheck->setEnabled(false);
+ }
+ else if (CheckBoxCopy->isChecked() ) {
+ MakeGroupsCheck->setEnabled(true);
+ }
+
if (CheckBoxMesh->isChecked()) {
SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
SelectionIntoArgument();
}
+//=======================================================================
+//function : onCopyChecked
+//purpose : slot called when Copy checkBox is checked
+//=======================================================================
+
+void SMESHGUI_TranslationDlg::onCopyChecked(bool isOn)
+{
+ // enable "MakeGroupsCheck"
+ if ( !myMesh->_is_nil() && myMesh->NbGroups() == 0)
+ isOn = false;
+ MakeGroupsCheck->setEnabled(isOn);
+}
+
//=================================================================================
// function : GetConstructorId()
// purpose :
QLabel* TextLabel2_3;
SMESHGUI_SpinBox* SpinBox2_3;
QCheckBox* CheckBoxCopy;
+ QCheckBox* MakeGroupsCheck;
QString myHelpFileName;
void ActivateThisDialog() ;
void onTextChange(const QString&);
void onSelectMesh(bool toSelectMesh);
+ void onCopyChecked(bool isOn);
protected:
QGridLayout* SMESHGUI_TranslationDlgLayout;
msgid "SMESH_EXPORT_FAILED"
msgstr "Mesh export failed.\nProbably, there is not enough space on disk."
+# Generate groups at mesh transformation
+msgid "SMESH_MAKE_GROUPS"
+msgstr "Generate groups"
+
#-------------------------------------------------------------------------
# MEN
#-------------------------------------------------------------------------