mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-05 06:10:33 +05:00
PAL16842 (Genertion of groups when a mesh is transformed)
+ QCheckBox* MakeGroupsCheck;
This commit is contained in:
parent
0562181892
commit
e7636315f5
@ -270,6 +270,10 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
AnglesGrpLayout->addWidget( AngleSpin, 0, 2 );
|
AnglesGrpLayout->addWidget( AngleSpin, 0, 2 );
|
||||||
AnglesGrpLayout->setRowStretch(1, 10);
|
AnglesGrpLayout->setRowStretch(1, 10);
|
||||||
|
|
||||||
|
// CheckBox for groups generation
|
||||||
|
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
|
||||||
|
MakeGroupsCheck->setChecked(true);
|
||||||
|
|
||||||
// layouting
|
// layouting
|
||||||
GroupArgumentsLayout->addWidget( ElementsLab, 0, 0 );
|
GroupArgumentsLayout->addWidget( ElementsLab, 0, 0 );
|
||||||
GroupArgumentsLayout->addWidget( SelectElementsButton, 0, 1 );
|
GroupArgumentsLayout->addWidget( SelectElementsButton, 0, 1 );
|
||||||
@ -280,6 +284,7 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
|||||||
GroupArgumentsLayout->addMultiCellWidget(BasePointGrp, 3, 4, 1, 2);
|
GroupArgumentsLayout->addMultiCellWidget(BasePointGrp, 3, 4, 1, 2);
|
||||||
GroupArgumentsLayout->addWidget( AnglesCheck, 5, 0 );
|
GroupArgumentsLayout->addWidget( AnglesCheck, 5, 0 );
|
||||||
GroupArgumentsLayout->addMultiCellWidget(AnglesGrp, 5, 6, 1, 2);
|
GroupArgumentsLayout->addMultiCellWidget(AnglesGrp, 5, 6, 1, 2);
|
||||||
|
GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 7, 7, 0, 2);
|
||||||
GroupArgumentsLayout->setRowStretch(6, 10);
|
GroupArgumentsLayout->setRowStretch(6, 10);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@ -599,10 +604,18 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
SMESH::SMESH_MeshEditor::Extrusion_Error retVal =
|
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
||||||
aMeshEditor->ExtrusionAlongPath(anElementsId.inout(), myPathMesh, myPathShape, aNodeStart,
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
||||||
AnglesCheck->isChecked(), anAngles.inout(),
|
SMESH::ListOfGroups_var groups =
|
||||||
BasePointCheck->isChecked(), aBasePoint);
|
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.stop();
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
@ -652,6 +665,8 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
|
|
||||||
//mySelectionMgr->clearSelected();
|
//mySelectionMgr->clearSelected();
|
||||||
SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() );
|
SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() );
|
||||||
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
||||||
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
//SMESH::UpdateView();
|
//SMESH::UpdateView();
|
||||||
Init(false);
|
Init(false);
|
||||||
ConstructorsClicked(GetConstructorId());
|
ConstructorsClicked(GetConstructorId());
|
||||||
@ -825,6 +840,14 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
|
|||||||
myMesh = SMESH::GetMeshByIO(IO);
|
myMesh = SMESH::GetMeshByIO(IO);
|
||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// MakeGroups is available if there are groups
|
||||||
|
if ( myMesh->NbGroups() == 0 ) {
|
||||||
|
MakeGroupsCheck->setChecked(false);
|
||||||
|
MakeGroupsCheck->setEnabled(false);
|
||||||
|
} else {
|
||||||
|
MakeGroupsCheck->setEnabled(true);
|
||||||
|
}
|
||||||
// find actor
|
// find actor
|
||||||
myMeshActor = SMESH::FindActorByObject(myMesh);
|
myMeshActor = SMESH::FindActorByObject(myMesh);
|
||||||
if (!myMeshActor)
|
if (!myMeshActor)
|
||||||
|
@ -141,6 +141,7 @@ private:
|
|||||||
SMESHGUI_SpinBox* YSpin;
|
SMESHGUI_SpinBox* YSpin;
|
||||||
QLabel* ZLab;
|
QLabel* ZLab;
|
||||||
SMESHGUI_SpinBox* ZSpin;
|
SMESHGUI_SpinBox* ZSpin;
|
||||||
|
QCheckBox* MakeGroupsCheck;
|
||||||
|
|
||||||
QGroupBox* GroupButtons;
|
QGroupBox* GroupButtons;
|
||||||
QPushButton* OkButton;
|
QPushButton* OkButton;
|
||||||
|
@ -225,6 +225,12 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule,
|
|||||||
SpinBox_NbSteps = new QSpinBox(GroupArguments, "SpinBox_NbSteps");
|
SpinBox_NbSteps = new QSpinBox(GroupArguments, "SpinBox_NbSteps");
|
||||||
GroupArgumentsLayout->addMultiCellWidget(SpinBox_NbSteps, 3, 3, 2, 7);
|
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);
|
SMESHGUI_ExtrusionDlgLayout->addWidget(GroupArguments, 1, 0);
|
||||||
|
|
||||||
/* Initialisations */
|
/* Initialisations */
|
||||||
@ -401,12 +407,20 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
try {
|
try {
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
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();
|
QApplication::restoreOverrideCursor();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
||||||
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
Init(false);
|
Init(false);
|
||||||
ConstructorsClicked(GetConstructorId());
|
ConstructorsClicked(GetConstructorId());
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
@ -562,6 +576,14 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument()
|
|||||||
if (myEditCurrentArgument == LineEditElements) {
|
if (myEditCurrentArgument == LineEditElements) {
|
||||||
int aNbElements = 0;
|
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()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
SMESH::ElementType neededType = GetConstructorId() ? SMESH::FACE : SMESH::EDGE;
|
SMESH::ElementType neededType = GetConstructorId() ? SMESH::FACE : SMESH::EDGE;
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ private:
|
|||||||
SMESHGUI_SpinBox* SpinBox_Dz;
|
SMESHGUI_SpinBox* SpinBox_Dz;
|
||||||
QLabel* TextLabelNbSteps;
|
QLabel* TextLabelNbSteps;
|
||||||
QSpinBox* SpinBox_NbSteps;
|
QSpinBox* SpinBox_NbSteps;
|
||||||
|
QCheckBox* MakeGroupsCheck;
|
||||||
|
|
||||||
QGroupBox* GroupButtons;
|
QGroupBox* GroupButtons;
|
||||||
QPushButton* buttonOk;
|
QPushButton* buttonOk;
|
||||||
|
@ -290,6 +290,12 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char*
|
|||||||
SpinBox_Tolerance = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Tolerance");
|
SpinBox_Tolerance = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Tolerance");
|
||||||
GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 5, 2);
|
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);
|
SMESHGUI_RevolutionDlgLayout->addWidget(GroupArguments, 1, 0);
|
||||||
|
|
||||||
/* Initialisations */
|
/* Initialisations */
|
||||||
@ -479,12 +485,21 @@ void SMESHGUI_RevolutionDlg::ClickOnApply()
|
|||||||
try {
|
try {
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
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();
|
QApplication::restoreOverrideCursor();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
||||||
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
Init(false);
|
Init(false);
|
||||||
ConstructorsClicked(GetConstructorId());
|
ConstructorsClicked(GetConstructorId());
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
@ -640,6 +655,14 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
|
|||||||
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
|
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
|
||||||
myElementsId = "";
|
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()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
int aConstructorId = GetConstructorId();
|
int aConstructorId = GetConstructorId();
|
||||||
|
|
||||||
|
@ -110,6 +110,7 @@ private:
|
|||||||
QPushButton* SelectElementsButton;
|
QPushButton* SelectElementsButton;
|
||||||
QLineEdit* LineEditElements;
|
QLineEdit* LineEditElements;
|
||||||
QCheckBox* CheckBoxMesh;
|
QCheckBox* CheckBoxMesh;
|
||||||
|
QCheckBox* MakeGroupsCheck;
|
||||||
|
|
||||||
QLabel* TextLabelPoint;
|
QLabel* TextLabelPoint;
|
||||||
QPushButton* SelectPointButton;
|
QPushButton* SelectPointButton;
|
||||||
|
@ -283,6 +283,10 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam
|
|||||||
CheckBoxCopy->setText(tr("SMESH_CREATE_COPY"));
|
CheckBoxCopy->setText(tr("SMESH_CREATE_COPY"));
|
||||||
GroupArgumentsLayout->addMultiCellWidget(CheckBoxCopy, 4, 4, 0, 2);
|
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);
|
SMESHGUI_RotationDlgLayout->addWidget(GroupArguments, 1, 0);
|
||||||
|
|
||||||
/* Initialisations */
|
/* Initialisations */
|
||||||
@ -339,6 +343,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam
|
|||||||
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
||||||
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
|
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
|
||||||
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
|
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
|
||||||
|
connect(CheckBoxCopy, SIGNAL(toggled(bool)), SLOT(onCopyChecked(bool)));
|
||||||
|
|
||||||
this->show(); /* displays Dialog */
|
this->show(); /* displays Dialog */
|
||||||
|
|
||||||
@ -386,6 +391,8 @@ void SMESHGUI_RotationDlg::Init (bool ResetControls)
|
|||||||
|
|
||||||
CheckBoxCopy->setChecked(false);
|
CheckBoxCopy->setChecked(false);
|
||||||
CheckBoxMesh->setChecked(false);
|
CheckBoxMesh->setChecked(false);
|
||||||
|
MakeGroupsCheck->setChecked(false);
|
||||||
|
MakeGroupsCheck->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelectMesh(CheckBoxMesh->isChecked());
|
onSelectMesh(CheckBoxMesh->isChecked());
|
||||||
@ -432,12 +439,18 @@ void SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
try {
|
try {
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
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();
|
QApplication::restoreOverrideCursor();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
||||||
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
Init(false);
|
Init(false);
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
}
|
}
|
||||||
@ -592,6 +605,14 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument()
|
|||||||
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
|
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
|
||||||
myElementsId = "";
|
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()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
||||||
|
|
||||||
@ -854,6 +875,19 @@ void SMESHGUI_RotationDlg::onVectorChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//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()
|
// function : keyPressEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -129,6 +129,7 @@ private:
|
|||||||
QLabel* TextLabelAngle;
|
QLabel* TextLabelAngle;
|
||||||
SMESHGUI_SpinBox* SpinBox_Angle;
|
SMESHGUI_SpinBox* SpinBox_Angle;
|
||||||
QCheckBox* CheckBoxCopy;
|
QCheckBox* CheckBoxCopy;
|
||||||
|
QCheckBox* MakeGroupsCheck;
|
||||||
|
|
||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
|
|
||||||
@ -146,6 +147,7 @@ private slots:
|
|||||||
void onTextChange (const QString&);
|
void onTextChange (const QString&);
|
||||||
void onSelectMesh (bool toSelectMesh);
|
void onSelectMesh (bool toSelectMesh);
|
||||||
void onVectorChanged();
|
void onVectorChanged();
|
||||||
|
void onCopyChecked(bool isOn);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QGridLayout* SMESHGUI_RotationDlgLayout;
|
QGridLayout* SMESHGUI_RotationDlgLayout;
|
||||||
|
@ -277,6 +277,10 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam
|
|||||||
CheckBoxCopy->setText(tr("SMESH_CREATE_COPY"));
|
CheckBoxCopy->setText(tr("SMESH_CREATE_COPY"));
|
||||||
GroupArgumentsLayout->addMultiCellWidget(CheckBoxCopy, 3, 3, 0, 2);
|
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);
|
SMESHGUI_SymmetryDlgLayout->addWidget(GroupArguments, 1, 0);
|
||||||
|
|
||||||
@ -331,6 +335,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam
|
|||||||
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
||||||
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
|
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
|
||||||
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
|
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
|
||||||
|
connect(CheckBoxCopy, SIGNAL(toggled(bool)), SLOT(onCopyChecked(bool)));
|
||||||
|
|
||||||
this->show(); /* displays Dialog */
|
this->show(); /* displays Dialog */
|
||||||
|
|
||||||
@ -377,6 +382,8 @@ void SMESHGUI_SymmetryDlg::Init (bool ResetControls)
|
|||||||
|
|
||||||
CheckBoxCopy->setChecked(false);
|
CheckBoxCopy->setChecked(false);
|
||||||
CheckBoxMesh->setChecked(false);
|
CheckBoxMesh->setChecked(false);
|
||||||
|
MakeGroupsCheck->setChecked(false);
|
||||||
|
MakeGroupsCheck->setEnabled(false);
|
||||||
onSelectMesh(false);
|
onSelectMesh(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -492,12 +499,18 @@ void SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
try {
|
try {
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
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();
|
QApplication::restoreOverrideCursor();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
||||||
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
Init(false);
|
Init(false);
|
||||||
ConstructorsClicked(GetConstructorId());
|
ConstructorsClicked(GetConstructorId());
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
@ -654,6 +667,14 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument()
|
|||||||
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
|
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
|
||||||
myElementsId = "";
|
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()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
|
||||||
|
|
||||||
@ -927,6 +948,19 @@ void SMESHGUI_SymmetryDlg::onVectorChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//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()
|
// function : keyPressEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -129,6 +129,7 @@ private:
|
|||||||
SMESHGUI_SpinBox* SpinBox_DZ;
|
SMESHGUI_SpinBox* SpinBox_DZ;
|
||||||
|
|
||||||
QCheckBox* CheckBoxCopy;
|
QCheckBox* CheckBoxCopy;
|
||||||
|
QCheckBox* MakeGroupsCheck;
|
||||||
|
|
||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
|
|
||||||
@ -146,7 +147,8 @@ private:
|
|||||||
void onTextChange(const QString&);
|
void onTextChange(const QString&);
|
||||||
void onSelectMesh(bool toSelectMesh);
|
void onSelectMesh(bool toSelectMesh);
|
||||||
void onVectorChanged();
|
void onVectorChanged();
|
||||||
|
void onCopyChecked(bool isOn);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QGridLayout* SMESHGUI_SymmetryDlgLayout;
|
QGridLayout* SMESHGUI_SymmetryDlgLayout;
|
||||||
QGridLayout* GroupConstructorsLayout;
|
QGridLayout* GroupConstructorsLayout;
|
||||||
|
@ -260,6 +260,10 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha
|
|||||||
CheckBoxCopy->setText(tr("SMESH_CREATE_COPY"));
|
CheckBoxCopy->setText(tr("SMESH_CREATE_COPY"));
|
||||||
GroupArgumentsLayout->addMultiCellWidget(CheckBoxCopy, 4, 4, 0, 2);
|
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);
|
SMESHGUI_TranslationDlgLayout->addWidget(GroupArguments, 1, 0);
|
||||||
|
|
||||||
@ -310,6 +314,7 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha
|
|||||||
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
||||||
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
|
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
|
||||||
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
|
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
|
||||||
|
connect(CheckBoxCopy, SIGNAL(toggled(bool)), SLOT(onCopyChecked(bool)));
|
||||||
|
|
||||||
this->show(); /* displays Dialog */
|
this->show(); /* displays Dialog */
|
||||||
|
|
||||||
@ -356,6 +361,8 @@ void SMESHGUI_TranslationDlg::Init (bool ResetControls)
|
|||||||
|
|
||||||
CheckBoxCopy->setChecked(false);
|
CheckBoxCopy->setChecked(false);
|
||||||
CheckBoxMesh->setChecked(false);
|
CheckBoxMesh->setChecked(false);
|
||||||
|
MakeGroupsCheck->setChecked(false);
|
||||||
|
MakeGroupsCheck->setEnabled(false);
|
||||||
onSelectMesh(false);
|
onSelectMesh(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -457,12 +464,18 @@ void SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
try {
|
try {
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
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();
|
QApplication::restoreOverrideCursor();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
||||||
|
mySMESHGUI->updateObjBrowser(true); // new groups may appear
|
||||||
Init(false);
|
Init(false);
|
||||||
ConstructorsClicked(GetConstructorId());
|
ConstructorsClicked(GetConstructorId());
|
||||||
SelectionIntoArgument();
|
SelectionIntoArgument();
|
||||||
@ -619,6 +632,15 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument()
|
|||||||
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
|
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
|
||||||
myElementsId = "";
|
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()) {
|
if (CheckBoxMesh->isChecked()) {
|
||||||
SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
|
SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
|
||||||
|
|
||||||
@ -852,6 +874,19 @@ void SMESHGUI_TranslationDlg::onSelectMesh (bool toSelectMesh)
|
|||||||
SelectionIntoArgument();
|
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()
|
// function : GetConstructorId()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -124,6 +124,7 @@ private:
|
|||||||
QLabel* TextLabel2_3;
|
QLabel* TextLabel2_3;
|
||||||
SMESHGUI_SpinBox* SpinBox2_3;
|
SMESHGUI_SpinBox* SpinBox2_3;
|
||||||
QCheckBox* CheckBoxCopy;
|
QCheckBox* CheckBoxCopy;
|
||||||
|
QCheckBox* MakeGroupsCheck;
|
||||||
|
|
||||||
QString myHelpFileName;
|
QString myHelpFileName;
|
||||||
|
|
||||||
@ -140,6 +141,7 @@ private:
|
|||||||
void ActivateThisDialog() ;
|
void ActivateThisDialog() ;
|
||||||
void onTextChange(const QString&);
|
void onTextChange(const QString&);
|
||||||
void onSelectMesh(bool toSelectMesh);
|
void onSelectMesh(bool toSelectMesh);
|
||||||
|
void onCopyChecked(bool isOn);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QGridLayout* SMESHGUI_TranslationDlgLayout;
|
QGridLayout* SMESHGUI_TranslationDlgLayout;
|
||||||
|
Loading…
Reference in New Issue
Block a user