Issue 0019928: EDF 771 SMESH : Extrusion (Revolution) with normal to a face

Additional modifications
This commit is contained in:
dmv 2009-06-26 12:10:16 +00:00
parent 996a005965
commit b5b677e66c
2 changed files with 36 additions and 32 deletions

View File

@ -93,7 +93,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myVectorDefinition(NONE_SELECT),
myFilterDlg( 0 ),
mySelectedObject(SMESH::SMESH_IDSource::_nil())
mySelectedObject(SMESH::SMESH_IDSource::_nil()),
myActor(0)
{
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
@ -548,6 +549,7 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
}
SMESH::UpdateView();
SMESH::Update(myIO, SMESH::eDisplay);
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
mySMESHGUI->updateObjBrowser(true); // new groups may appear
Init(false);
@ -575,19 +577,14 @@ void SMESHGUI_RevolutionDlg::ClickOnOk()
//=================================================================================
void SMESHGUI_RevolutionDlg::ClickOnCancel()
{
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
//mySelectionMgr->clearSelected();
if (SMESH::GetCurrentVtkView()) {
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
SMESH::SetPointRepresentation(false);
}
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
reject();
}
void SMESHGUI_RevolutionDlg::reject()
{
close();
}
//=================================================================================
// function : ClickOnHelp()
// purpose :
@ -688,7 +685,6 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
if (myBusy) return;
// clear
myActor = 0;
QString aString = "";
myBusy = true;
@ -711,20 +707,23 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
return;
Handle(SALOME_InteractiveObject) IO = aList.First();
myMesh = SMESH::GetMeshByIO(IO);
if (myMesh->_is_nil())
SMESH::SMESH_Mesh_var aMeshVar = SMESH::GetMeshByIO(IO);
if (aMeshVar->_is_nil())
return;
myActor = SMESH::FindActorByObject(myMesh);
if (!myActor)
myActor = SMESH::FindActorByEntry(IO->getEntry());
if (!myActor)
SMESH_Actor* anActor = SMESH::FindActorByObject(aMeshVar);
if (!anActor)
anActor = SMESH::FindActorByEntry(IO->getEntry());
if (!anActor)
return;
int aNbUnits = 0;
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
myElementsId = "";
myMesh = aMeshVar;
myActor = anActor;
myIO = IO;
// MakeGroups is available if there are groups
if ( myMesh->NbGroups() == 0 ) {
@ -750,7 +749,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
myNbOkElements = true;
} else {
SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();
if (!aMesh)
return;
@ -839,7 +838,6 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument()
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
int aConstructorId = GetConstructorId();
myEditCurrentArgument = (QWidget*)SpinBox_X;
if (aConstructorId == 0)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
@ -913,17 +911,16 @@ void SMESHGUI_RevolutionDlg::enterEvent (QEvent*)
void SMESHGUI_RevolutionDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
ClickOnCancel();
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
//mySelectionMgr->clearSelected();
if (SMESH::GetCurrentVtkView()) {
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
SMESH::SetPointRepresentation(false);
}
//=======================================================================
// function : hideEvent()
// purpose : caused by ESC key
//=======================================================================
void SMESHGUI_RevolutionDlg::hideEvent (QHideEvent*)
{
if (!isMinimized())
ClickOnCancel();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
}
//=======================================================================
@ -1127,6 +1124,8 @@ void SMESHGUI_RevolutionDlg::onSelectVectorMenu( QAction* action){
if(!action)
return;
disconnect(mySelectionMgr, 0, this, 0);
switch(myMenuActions[action]) {
case POINT_SELECT:
SMESH::SetPointRepresentation(true);

View File

@ -29,6 +29,9 @@
// SMESH includes
#include "SMESH_SMESHGUI.hxx"
// SALOME GUI includes
#include <SALOME_InteractiveObject.hxx>
// Qt includes
#include <QDialog>
#include <QMap>
@ -70,13 +73,14 @@ public:
SMESHGUI_RevolutionDlg( SMESHGUI* );
~SMESHGUI_RevolutionDlg();
void reject();
private:
enum {NONE_SELECT, POINT_SELECT, FACE_SELECT};
void Init( bool = true);
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
int GetConstructorId();
bool IsAxisOk();
@ -90,6 +94,7 @@ private:
QString myElementsId;
QWidget* myEditCurrentArgument; /* Current argument */
SVTK_Selector* mySelector;
Handle(SALOME_InteractiveObject) myIO;
SMESH::SMESH_IDSource_var mySelectedObject;