mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-17 00:30:36 +05:00
Fix for Bug IPAL11293
SMESH: application crashes with wrong parameters of extrusion
This commit is contained in:
parent
55c24afc42
commit
2eac35a1cf
@ -253,8 +253,13 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule,
|
|||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
|
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
|
||||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
|
|
||||||
|
|
||||||
|
// to update state of the Ok & Apply buttons
|
||||||
|
connect(SpinBox_Dx, SIGNAL(valueChanged(double)), SLOT(CheckIsEnable()));
|
||||||
|
connect(SpinBox_Dy, SIGNAL(valueChanged(double)), SLOT(CheckIsEnable()));
|
||||||
|
connect(SpinBox_Dz, SIGNAL(valueChanged(double)), SLOT(CheckIsEnable()));
|
||||||
|
|
||||||
|
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
|
||||||
connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
|
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
|
||||||
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
@ -292,9 +297,6 @@ void SMESHGUI_ExtrusionDlg::Init (bool ResetControls)
|
|||||||
myElementsId = "";
|
myElementsId = "";
|
||||||
myNbOkElements = 0;
|
myNbOkElements = 0;
|
||||||
|
|
||||||
buttonOk->setEnabled(false);
|
|
||||||
buttonApply->setEnabled(false);
|
|
||||||
|
|
||||||
myActor = 0;
|
myActor = 0;
|
||||||
myMesh = SMESH::SMESH_Mesh::_nil();
|
myMesh = SMESH::SMESH_Mesh::_nil();
|
||||||
|
|
||||||
@ -307,6 +309,25 @@ void SMESHGUI_ExtrusionDlg::Init (bool ResetControls)
|
|||||||
CheckBoxMesh->setChecked(false);
|
CheckBoxMesh->setChecked(false);
|
||||||
onSelectMesh(false);
|
onSelectMesh(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CheckIsEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : CheckIsEnable()
|
||||||
|
// purpose : Check whether the Ok and Apply buttons should be enabled or not
|
||||||
|
//=================================================================================
|
||||||
|
void SMESHGUI_ExtrusionDlg::CheckIsEnable()
|
||||||
|
{
|
||||||
|
double aX = SpinBox_Dx->GetValue();
|
||||||
|
double aY = SpinBox_Dy->GetValue();
|
||||||
|
double aZ = SpinBox_Dz->GetValue();
|
||||||
|
double aModule = sqrt(aX*aX + aY*aY + aZ*aZ);
|
||||||
|
|
||||||
|
bool anIsEnable = myNbOkElements > 0 && aModule > 1.0E-38;
|
||||||
|
|
||||||
|
buttonOk->setEnabled(anIsEnable);
|
||||||
|
buttonApply->setEnabled(anIsEnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -434,9 +455,6 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText)
|
|||||||
if (send == LineEditElements)
|
if (send == LineEditElements)
|
||||||
myNbOkElements = 0;
|
myNbOkElements = 0;
|
||||||
|
|
||||||
buttonOk->setEnabled(false);
|
|
||||||
buttonApply->setEnabled(false);
|
|
||||||
|
|
||||||
// hilight entered elements/nodes
|
// hilight entered elements/nodes
|
||||||
SMDS_Mesh* aMesh = 0;
|
SMDS_Mesh* aMesh = 0;
|
||||||
if (myActor)
|
if (myActor)
|
||||||
@ -461,10 +479,7 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myNbOkElements) {
|
CheckIsEnable();
|
||||||
buttonOk->setEnabled(true);
|
|
||||||
buttonApply->setEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
myBusy = false;
|
myBusy = false;
|
||||||
}
|
}
|
||||||
@ -490,8 +505,6 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
myEditCurrentArgument->setText(aString);
|
myEditCurrentArgument->setText(aString);
|
||||||
myNbOkElements = 0;
|
myNbOkElements = 0;
|
||||||
buttonOk->setEnabled(false);
|
|
||||||
buttonApply->setEnabled(false);
|
|
||||||
myBusy = false;
|
myBusy = false;
|
||||||
|
|
||||||
// get selected mesh
|
// get selected mesh
|
||||||
@ -593,10 +606,7 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument()
|
|||||||
myBusy = false;
|
myBusy = false;
|
||||||
|
|
||||||
// OK
|
// OK
|
||||||
if (myNbOkElements) {
|
CheckIsEnable();
|
||||||
buttonOk->setEnabled(true);
|
|
||||||
buttonApply->setEnabled(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
|
@ -114,6 +114,7 @@ private:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ConstructorsClicked (int);
|
void ConstructorsClicked (int);
|
||||||
|
void CheckIsEnable();
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
bool ClickOnApply();
|
bool ClickOnApply();
|
||||||
void ClickOnCancel();
|
void ClickOnCancel();
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "SMESH_Gen_i.hxx"
|
#include "SMESH_Gen_i.hxx"
|
||||||
#include "SMESH_Filter_i.hxx"
|
#include "SMESH_Filter_i.hxx"
|
||||||
#include "SMESH_PythonDump.hxx"
|
#include "SMESH_PythonDump.hxx"
|
||||||
|
#include "CASCatch.hxx"
|
||||||
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
@ -920,6 +921,7 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
|
|||||||
const SMESH::DirStruct & theStepVector,
|
const SMESH::DirStruct & theStepVector,
|
||||||
CORBA::Long theNbOfSteps)
|
CORBA::Long theNbOfSteps)
|
||||||
{
|
{
|
||||||
|
CASCatch_TRY {
|
||||||
SMESHDS_Mesh* aMesh = GetMeshDS();
|
SMESHDS_Mesh* aMesh = GetMeshDS();
|
||||||
|
|
||||||
set<const SMDS_MeshElement*> elements;
|
set<const SMDS_MeshElement*> elements;
|
||||||
@ -933,15 +935,19 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
|
|||||||
const SMESH::PointStruct * P = &theStepVector.PS;
|
const SMESH::PointStruct * P = &theStepVector.PS;
|
||||||
gp_Vec stepVec( P->x, P->y, P->z );
|
gp_Vec stepVec( P->x, P->y, P->z );
|
||||||
|
|
||||||
::SMESH_MeshEditor anEditor( _myMesh );
|
|
||||||
//anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps);
|
|
||||||
TElemOfElemListMap aHystory;
|
TElemOfElemListMap aHystory;
|
||||||
|
::SMESH_MeshEditor anEditor( _myMesh );
|
||||||
anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory);
|
anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory);
|
||||||
|
|
||||||
// Update Python script
|
// Update Python script
|
||||||
TPythonDump() << "stepVector = " << theStepVector;
|
TPythonDump() << "stepVector = " << theStepVector;
|
||||||
TPythonDump() << this << ".ExtrusionSweep( "
|
TPythonDump() << this << ".ExtrusionSweep( "
|
||||||
<< theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
|
<< theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
|
||||||
|
|
||||||
|
}CASCatch_CATCH(Standard_Failure) {
|
||||||
|
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||||
|
INFOS( "SMESH_MeshEditor_i::ExtrusionSweep fails - "<< aFail->GetMessageString() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user