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

View File

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