INT PAL 0052775: Any dialogue with the selector raises an exception for second viewer

This commit is contained in:
imn 2015-06-09 12:28:15 +03:00
parent b1b19cbc01
commit 5c19bc1e16
56 changed files with 1010 additions and 80 deletions

View File

@ -2264,6 +2264,26 @@ void SMESHGUI::EmitSignalVisibilityChanged()
emit SignalVisibilityChanged(); emit SignalVisibilityChanged();
} }
//=============================================================================
/*!
*
*/
//=============================================================================
void SMESHGUI::EmitSignalCloseView()
{
emit SignalCloseView();
}
//=============================================================================
/*!
*
*/
//=============================================================================
void SMESHGUI::EmitSignalActivatedViewManager()
{
emit SignalActivatedViewManager();
}
//============================================================================= //=============================================================================
/*! /*!
* *
@ -4883,6 +4903,7 @@ void SMESHGUI::onViewManagerActivated( SUIT_ViewManager* mgr )
SUIT_ViewWindow *sf = aViews[i]; SUIT_ViewWindow *sf = aViews[i];
connectView( sf ); connectView( sf );
} }
EmitSignalActivatedViewManager();
} }
} }
@ -6823,6 +6844,7 @@ void SMESHGUI::onViewClosed( SUIT_ViewWindow* pview ) {
//Crear all Plot2d Viewers if need. //Crear all Plot2d Viewers if need.
SMESH::ClearPlot2Viewers(pview); SMESH::ClearPlot2Viewers(pview);
#endif #endif
EmitSignalCloseView();
} }
void SMESHGUI::message( const QString& msg ) void SMESHGUI::message( const QString& msg )

View File

@ -133,6 +133,8 @@ public :
void EmitSignalStudyFrameChanged(); void EmitSignalStudyFrameChanged();
void EmitSignalCloseAllDialogs(); void EmitSignalCloseAllDialogs();
void EmitSignalVisibilityChanged(); void EmitSignalVisibilityChanged();
void EmitSignalCloseView();
void EmitSignalActivatedViewManager();
virtual void contextMenuPopup( const QString&, QMenu*, QString& ); virtual void contextMenuPopup( const QString&, QMenu*, QString& );
virtual void createPreferences(); virtual void createPreferences();
@ -175,6 +177,8 @@ signals:
void SignalStudyFrameChanged(); void SignalStudyFrameChanged();
void SignalCloseAllDialogs(); void SignalCloseAllDialogs();
void SignalVisibilityChanged(); void SignalVisibilityChanged();
void SignalCloseView();
void SignalActivatedViewManager();
protected: protected:
void createSMESHAction( const int, void createSMESHAction( const int,

View File

@ -515,10 +515,13 @@ void SMESHGUI_AddMeshElementDlg::Init()
connect(SelectButtonC1A1,SIGNAL(clicked()), SLOT(SetEditCurrentArgument())); connect(SelectButtonC1A1,SIGNAL(clicked()), SLOT(SetEditCurrentArgument()));
connect(LineEditC1A1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(LineEditC1A1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
/* to close dialog if study frame change */ /* to close dialog if study frame change */
connect(mySMESHGUI, SIGNAL(SignalStudyFrameChanged()), SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalStudyFrameChanged()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT(onCloseView()));
if (Reverse) if (Reverse)
connect(Reverse, SIGNAL(stateChanged(int)), SLOT(CheckBox(int))); connect(Reverse, SIGNAL(stateChanged(int)), SLOT(CheckBox(int)));
@ -942,9 +945,15 @@ void SMESHGUI_AddMeshElementDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void SMESHGUI_AddMeshElementDlg::enterEvent (QEvent*) void SMESHGUI_AddMeshElementDlg::enterEvent (QEvent*)
{ {
if (GroupConstructors->isEnabled()) if ( !GroupConstructors->isEnabled() ) {
return; SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
ActivateThisDialog(); if ( aViewWindow && !mySelector && !mySimulation) {
mySelector = aViewWindow->GetSelector();
mySimulation = new SMESH::TElementSimulation(
dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
}
ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================
@ -979,7 +988,7 @@ void SMESHGUI_AddMeshElementDlg::keyPressEvent( QKeyEvent* e )
} }
//================================================================================= //=================================================================================
// function : isValid // function : onDiameterChanged()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_AddMeshElementDlg::onDiameterChanged(){ void SMESHGUI_AddMeshElementDlg::onDiameterChanged(){
@ -987,7 +996,37 @@ void SMESHGUI_AddMeshElementDlg::onDiameterChanged(){
} }
//================================================================================= //=================================================================================
// function : isValid // function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_AddMeshElementDlg::onOpenView()
{
if ( mySelector && mySimulation ) {
mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
mySimulation = new SMESH::TElementSimulation(
dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_AddMeshElementDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
delete mySimulation;
mySimulation = 0;
}
//=================================================================================
// function : isValid()
// purpose : // purpose :
//================================================================================= //=================================================================================
bool SMESHGUI_AddMeshElementDlg::isValid() bool SMESHGUI_AddMeshElementDlg::isValid()

View File

@ -130,6 +130,8 @@ private slots:
void ActivateThisDialog(); void ActivateThisDialog();
void CheckBox( int ); void CheckBox( int );
void onTextChange( const QString& ); void onTextChange( const QString& );
void onOpenView();
void onCloseView();
}; };
#endif // SMESHGUI_ADDMESHELEMENTDLG_H #endif // SMESHGUI_ADDMESHELEMENTDLG_H

View File

@ -650,6 +650,8 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(reject())); connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(reject())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL (SignalCloseView()), SLOT(onCloseView()));
myCurrentLineEdit = myCornerNodes; myCurrentLineEdit = myCornerNodes;
@ -844,6 +846,35 @@ void SMESHGUI_AddQuadraticElementDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_AddQuadraticElementDlg::onOpenView()
{
if ( mySelector && mySimulation ) {
mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
mySimulation = new SMESH::TElementSimulationQuad(
dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_AddQuadraticElementDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
delete mySimulation;
mySimulation = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -1157,12 +1188,17 @@ void SMESHGUI_AddQuadraticElementDlg::ActivateThisDialog()
// function : enterEvent() // function : enterEvent()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_AddQuadraticElementDlg::enterEvent (QEvent*) void SMESHGUI_AddQuadraticElementDlg::enterEvent (QEvent*)
{ {
if (GroupConstructors->isEnabled()) if ( !GroupConstructors->isEnabled() ) {
return; SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
ActivateThisDialog(); if ( aViewWindow && !mySelector && !mySimulation) {
mySelector = aViewWindow->GetSelector();
mySimulation = new SMESH::TElementSimulationQuad(
dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
}
ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================

View File

@ -142,6 +142,8 @@ private slots:
void SelectionIntoArgument(); void SelectionIntoArgument();
void DeactivateActiveDialog(); void DeactivateActiveDialog();
void ActivateThisDialog(); void ActivateThisDialog();
void onOpenView();
void onCloseView();
}; };
#endif // SMESHGUI_ADDQUADRATICELEMENTDLG_H #endif // SMESHGUI_ADDQUADRATICELEMENTDLG_H

View File

@ -234,6 +234,10 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule )
this, SLOT (SelectionIntoArgument())); this, SLOT (SelectionIntoArgument()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */
this, SLOT (reject())); this, SLOT (reject()));
connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()),
this, SLOT (onOpenView()));
connect(mySMESHGUI, SIGNAL (SignalCloseView()),
this, SLOT (onCloseView()));
connect(myLineEditElements, SIGNAL(textChanged(const QString&)), connect(myLineEditElements, SIGNAL(textChanged(const QString&)),
this, SLOT (onTextChange(const QString&))); this, SLOT (onTextChange(const QString&)));
@ -381,6 +385,31 @@ void SMESHGUI_CopyMeshDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_CopyMeshDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_CopyMeshDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -602,16 +631,21 @@ void SMESHGUI_CopyMeshDlg::ActivateThisDialog()
SelectionIntoArgument(); SelectionIntoArgument();
} }
//================================================================================= //=================================================================================
// function : enterEvent() // function : enterEvent()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_CopyMeshDlg::enterEvent (QEvent*) void SMESHGUI_CopyMeshDlg::enterEvent (QEvent*)
{ {
if (!ConstructorsBox->isEnabled()) if ( !ConstructorsBox->isEnabled() ) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector ) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================
// function : keyPressEvent() // function : keyPressEvent()
// purpose : // purpose :

View File

@ -125,6 +125,8 @@ private slots:
void onTextChange( const QString& ); void onTextChange( const QString& );
void onSelectIdSource( bool ); void onSelectIdSource( bool );
void setFilters(); void setFilters();
void onOpenView();
void onCloseView();
}; };
#endif // SMESHGUI_CopyMeshDLG_H #endif // SMESHGUI_CopyMeshDLG_H

View File

@ -105,9 +105,6 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule,
aDlgLay->setStretchFactor( aMainFrame, 1 ); aDlgLay->setStretchFactor( aMainFrame, 1 );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
mySelector = aViewWindow->GetSelector();
myHelpFileName = "pattern_mapping_page.html"; myHelpFileName = "pattern_mapping_page.html";
Init( theType ); Init( theType );

View File

@ -115,7 +115,6 @@ private:
QCheckBox* myProjectChk; QCheckBox* myProjectChk;
SMESHGUI* mySMESHGUI; SMESHGUI* mySMESHGUI;
SVTK_Selector* mySelector;
LightApp_SelectionMgr* mySelectionMgr; LightApp_SelectionMgr* mySelectionMgr;
int myType; int myType;

View File

@ -353,8 +353,9 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init()
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool))); connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool)));
/* to close dialog if study change */ /* to close dialog if study change */
connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( reject() ) ); connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
connect( mySMESHGUI, SIGNAL ( SignalActivatedViewManager() ), this, SLOT( onOpenView() ) );
connect( mySMESHGUI, SIGNAL ( SignalCloseView() ), this, SLOT( onCloseView() ) );
ConstructorsClicked(0); ConstructorsClicked(0);
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -613,6 +614,36 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_CreatePolyhedralVolumeDlg::onOpenView()
{
if ( mySelector && mySimulation ) {
mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
mySimulation = new SMESH::TPolySimulation(
dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_CreatePolyhedralVolumeDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
delete mySimulation;
mySimulation = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -1027,16 +1058,21 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ActivateThisDialog()
SelectionIntoArgument(); SelectionIntoArgument();
} }
//================================================================================= //=================================================================================
// function : enterEvent() // function : enterEvent()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent(QEvent* e) void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent (QEvent*)
{ {
if ( ConstructorsBox->isEnabled() ) if ( !ConstructorsBox->isEnabled() ) {
return; SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
ActivateThisDialog(); if ( aViewWindow && !mySelector && !mySimulation) {
mySelector = aViewWindow->GetSelector();
mySimulation = new SMESH::TPolySimulation(
dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
}
ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================

View File

@ -138,6 +138,8 @@ private slots:
void ActivateThisDialog(); void ActivateThisDialog();
void onTextChange( const QString& ); void onTextChange( const QString& );
void onListSelectionChanged(); void onListSelectionChanged();
void onOpenView();
void onCloseView();
}; };
#endif // SMESHGUI_CREATEPOLYHEDRALVOLUMEDLG_H #endif // SMESHGUI_CREATEPOLYHEDRALVOLUMEDLG_H

View File

@ -309,6 +309,8 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
connect(BasePointGrp, SIGNAL(toggled(bool)), this, SLOT(SetEditCurrentArgument())); connect(BasePointGrp, SIGNAL(toggled(bool)), this, SLOT(SetEditCurrentArgument()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT(onCloseView()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation())); connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation()));
@ -587,6 +589,31 @@ void SMESHGUI_ExtrusionAlongPathDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_ExtrusionAlongPathDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_ExtrusionAlongPathDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//======================================================================= //=======================================================================
// function : onTextChange() // function : onTextChange()
// purpose : // purpose :
@ -865,12 +892,17 @@ void SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
// function : enterEvent() // function : enterEvent()
// purpose : Mouse enter event // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_ExtrusionAlongPathDlg::enterEvent (QEvent*) void SMESHGUI_ExtrusionAlongPathDlg::enterEvent (QEvent*)
{ {
if (!GroupButtons->isEnabled()) if ( !GroupButtons->isEnabled() ) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//======================================================================= //=======================================================================

View File

@ -140,6 +140,8 @@ private slots:
void onTextChange( const QString& ); void onTextChange( const QString& );
void OnAngleAdded(); void OnAngleAdded();
void OnAngleRemoved(); void OnAngleRemoved();
void onOpenView();
void onCloseView();
}; };
#endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H #endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H

View File

@ -777,7 +777,9 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation())); connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation()));
connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable())); connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView()));
connect(SpinBox_Dx, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation())); connect(SpinBox_Dx, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
connect(SpinBox_Dy, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation())); connect(SpinBox_Dy, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
@ -1119,6 +1121,31 @@ void SMESHGUI_ExtrusionDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_ExtrusionDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_ExtrusionDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -1240,12 +1267,17 @@ void SMESHGUI_ExtrusionDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
// function : enterEvent() // function : enterEvent()
// purpose : Mouse enter event // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_ExtrusionDlg::enterEvent (QEvent*) void SMESHGUI_ExtrusionDlg::enterEvent (QEvent*)
{ {
if (!GroupButtons->isEnabled()) if ( !GroupButtons->isEnabled() ) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================

View File

@ -203,6 +203,9 @@ private slots:
void SelectionIntoArgument(); void SelectionIntoArgument();
void DeactivateActiveDialog(); void DeactivateActiveDialog();
void ActivateThisDialog(); void ActivateThisDialog();
void onOpenView();
void onCloseView();
}; };
#endif // SMESHGUI_EXTRUSIONDLG_H #endif // SMESHGUI_EXTRUSIONDLG_H

View File

@ -2925,6 +2925,8 @@ void SMESHGUI_FilterDlg::Init (const QList<int>& theTypes, const bool setInViewe
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT(onCloseView()));
updateMainButtons(); updateMainButtons();
updateSelection(); updateSelection();
@ -3010,6 +3012,29 @@ void SMESHGUI_FilterDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_FilterDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_FilterDlg::onCloseView()
{
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : onHelp() // function : onHelp()
// purpose : // purpose :

View File

@ -255,6 +255,8 @@ private slots:
void onCriterionChanged( const int, const int ); void onCriterionChanged( const int, const int );
void onThresholdChanged( const int, const int ); void onThresholdChanged( const int, const int );
void onCurrentChanged( int, int ); void onCurrentChanged( int, int );
void onOpenView();
void onCloseView();
private: private:

View File

@ -238,6 +238,7 @@ SMESHGUI_FindElemByPointOp::SMESHGUI_FindElemByPointOp()
:SMESHGUI_SelectionOp() :SMESHGUI_SelectionOp()
{ {
mySimulation = 0; mySimulation = 0;
mySMESHGUI = 0;
myDlg = new SMESHGUI_FindElemByPointDlg; myDlg = new SMESHGUI_FindElemByPointDlg;
myHelpFileName = "find_element_by_point_page.html"; myHelpFileName = "find_element_by_point_page.html";
@ -279,7 +280,10 @@ void SMESHGUI_FindElemByPointOp::startOperation()
{ {
// init simulation with a current View // init simulation with a current View
if ( mySimulation ) delete mySimulation; if ( mySimulation ) delete mySimulation;
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( getSMESHGUI() )); mySMESHGUI = getSMESHGUI();
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ) );
connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
vtkProperty* aProp = vtkProperty::New(); vtkProperty* aProp = vtkProperty::New();
aProp->SetRepresentationToWireframe(); aProp->SetRepresentationToWireframe();
aProp->SetColor(250, 0, 250); aProp->SetColor(250, 0, 250);
@ -309,10 +313,37 @@ void SMESHGUI_FindElemByPointOp::stopOperation()
delete mySimulation; delete mySimulation;
mySimulation = 0; mySimulation = 0;
} }
disconnect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
selectionMgr()->removeFilter( myFilter ); selectionMgr()->removeFilter( myFilter );
SMESHGUI_SelectionOp::stopOperation(); SMESHGUI_SelectionOp::stopOperation();
} }
//=================================================================================
/*!
* \brief SLOT called when the viewer opened
*/
//=================================================================================
void SMESHGUI_FindElemByPointOp::onOpenView()
{
if ( mySimulation ) {
mySimulation->SetVisibility(false);
}
else {
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
}
}
//=================================================================================
/*!
* \brief SLOT called when the viewer closed
*/
//=================================================================================
void SMESHGUI_FindElemByPointOp::onCloseView()
{
delete mySimulation;
mySimulation = 0;
}
//================================================================================ //================================================================================
/*! /*!
* \brief hilight found selected elements * \brief hilight found selected elements
@ -503,7 +534,8 @@ void SMESHGUI_FindElemByPointOp::redisplayPreview()
myPreview->nodesXYZ[0].x = myDlg->myX->GetValue(); myPreview->nodesXYZ[0].x = myDlg->myX->GetValue();
myPreview->nodesXYZ[0].y = myDlg->myY->GetValue(); myPreview->nodesXYZ[0].y = myDlg->myY->GetValue();
myPreview->nodesXYZ[0].z = myDlg->myZ->GetValue(); myPreview->nodesXYZ[0].z = myDlg->myZ->GetValue();
if (!mySimulation)
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
mySimulation->SetData(&myPreview.in()); mySimulation->SetData(&myPreview.in());
} }

View File

@ -68,11 +68,14 @@ private slots:
void onElemSelected(); void onElemSelected();
void onElemTypeChange(int); void onElemTypeChange(int);
void redisplayPreview(); void redisplayPreview();
void onOpenView();
void onCloseView();
private: private:
SMESHGUI_FindElemByPointDlg* myDlg; SMESHGUI_FindElemByPointDlg* myDlg;
SUIT_SelectionFilter* myFilter; SUIT_SelectionFilter* myFilter;
SMESHGUI* mySMESHGUI;
SMESHGUI_MeshEditPreview* mySimulation; // to show point coordinates SMESHGUI_MeshEditPreview* mySimulation; // to show point coordinates
SMESH::SMESH_IDSource_var myMeshOrPart; SMESH::SMESH_IDSource_var myMeshOrPart;
SMESH::MeshPreviewStruct_var myPreview; SMESH::MeshPreviewStruct_var myPreview;

View File

@ -462,7 +462,8 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged()));
connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()), this, SLOT(onVisibilityChanged())); connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()), this, SLOT(onVisibilityChanged()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView()));
rb1->setChecked(true); // VSR !!! rb1->setChecked(true); // VSR !!!
onGrpTypeChanged(0); // VSR!!! onGrpTypeChanged(0); // VSR!!!
@ -2248,6 +2249,32 @@ void SMESHGUI_GroupDlg::reject()
if ( myFilterDlg ) myFilterDlg->UnRegisterFilters(); if ( myFilterDlg ) myFilterDlg->UnRegisterFilters();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_GroupDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true);
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_GroupDlg::onCloseView()
{
onDeactivate();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : onHelp() // function : onHelp()
// purpose : // purpose :
@ -2289,6 +2316,10 @@ void SMESHGUI_GroupDlg::onDeactivate()
void SMESHGUI_GroupDlg::enterEvent (QEvent*) void SMESHGUI_GroupDlg::enterEvent (QEvent*)
{ {
if (!isEnabled()) { if (!isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
mySMESHGUI->EmitSignalDeactivateDialog(); mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true); setEnabled(true);
mySelectionMode = grpNoSelection; mySelectionMode = grpNoSelection;

View File

@ -120,6 +120,9 @@ private slots:
void onPublishShapeByMeshDlg( SUIT_Operation* ); void onPublishShapeByMeshDlg( SUIT_Operation* );
void onCloseShapeByMeshDlg( SUIT_Operation* ); void onCloseShapeByMeshDlg( SUIT_Operation* );
void onOpenView();
void onCloseView();
private: private:
void initDialog( bool ); void initDialog( bool );
void init( SMESH::SMESH_Mesh_ptr ); void init( SMESH::SMESH_Mesh_ptr );

View File

@ -225,6 +225,8 @@ void SMESHGUI_GroupOpDlg::Init()
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT(onCloseView()));
// set selection mode // set selection mode
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
@ -331,6 +333,32 @@ void SMESHGUI_GroupOpDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_GroupOpDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true);
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_GroupOpDlg::onCloseView()
{
onDeactivate();
mySelector = 0;
}
/*! /*!
\brief SLOT called when "Help" button pressed shows "Help" page \brief SLOT called when "Help" button pressed shows "Help" page
*/ */
@ -459,8 +487,12 @@ void SMESHGUI_GroupOpDlg::enterEvent(QEvent*)
{ {
mySMESHGUI->EmitSignalDeactivateDialog(); mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true); setEnabled(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow ) {
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
if (!mySelector)
mySelector = aViewWindow->GetSelector();
}
mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP)); mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
} }
@ -496,7 +528,7 @@ void SMESHGUI_GroupOpDlg::setName( const QString& theName )
} }
/*! /*!
\brief Provides reaction on F1 button pressing \brief Provides reaction on <EFBFBD>F1<EFBFBD> button pressing
\param e key press event \param e key press event
*/ */
void SMESHGUI_GroupOpDlg::keyPressEvent( QKeyEvent* e ) void SMESHGUI_GroupOpDlg::keyPressEvent( QKeyEvent* e )

View File

@ -105,6 +105,9 @@ private slots:
void onDeactivate(); void onDeactivate();
void onOpenView();
void onCloseView();
private: private:
QWidget* createButtonFrame( QWidget* ); QWidget* createButtonFrame( QWidget* );
QWidget* createMainFrame ( QWidget* ); QWidget* createMainFrame ( QWidget* );

View File

@ -346,6 +346,7 @@ void SMESHGUI_MakeNodeAtPointDlg::ConstructorsClicked (int constructorId)
SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp() SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp()
{ {
mySimulation = 0; mySimulation = 0;
mySMESHGUI = 0;
myDlg = new SMESHGUI_MakeNodeAtPointDlg; myDlg = new SMESHGUI_MakeNodeAtPointDlg;
myFilter = 0; myFilter = 0;
myHelpFileName = "mesh_through_point_page.html"; myHelpFileName = "mesh_through_point_page.html";
@ -395,7 +396,10 @@ void SMESHGUI_MakeNodeAtPointOp::startOperation()
// init simulation with a current View // init simulation with a current View
if ( mySimulation ) delete mySimulation; if ( mySimulation ) delete mySimulation;
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( getSMESHGUI() )); mySMESHGUI = getSMESHGUI();
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ) );
connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
vtkProperty* aProp = vtkProperty::New(); vtkProperty* aProp = vtkProperty::New();
aProp->SetRepresentationToWireframe(); aProp->SetRepresentationToWireframe();
aProp->SetColor(250, 0, 250); aProp->SetColor(250, 0, 250);
@ -463,12 +467,19 @@ int SMESHGUI_MakeNodeAtPointOp::GetConstructorId()
void SMESHGUI_MakeNodeAtPointOp::stopOperation() void SMESHGUI_MakeNodeAtPointOp::stopOperation()
{ {
myNoPreview = true; myNoPreview = true;
mySimulation->SetVisibility(false); if ( mySimulation )
{
mySimulation->SetVisibility(false);
delete mySimulation;
mySimulation = 0;
}
if ( myMeshActor ) { if ( myMeshActor ) {
myMeshActor->SetPointRepresentation(false); myMeshActor->SetPointRepresentation(false);
SMESH::RepaintCurrentView(); SMESH::RepaintCurrentView();
myMeshActor = 0; myMeshActor = 0;
} }
disconnect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
selectionMgr()->removeFilter( myFilter ); selectionMgr()->removeFilter( myFilter );
SMESHGUI_SelectionOp::stopOperation(); SMESHGUI_SelectionOp::stopOperation();
} }
@ -787,7 +798,8 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview()
aMeshPreviewStruct->elementConnectivities.length(1); aMeshPreviewStruct->elementConnectivities.length(1);
aMeshPreviewStruct->elementConnectivities[0] = 0; aMeshPreviewStruct->elementConnectivities[0] = 0;
} }
if (!mySimulation)
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
// display data // display data
if ( aMeshPreviewStruct.operator->() ) if ( aMeshPreviewStruct.operator->() )
{ {
@ -801,6 +813,33 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview()
myNoPreview = false; myNoPreview = false;
} }
//=================================================================================
/*!
* \brief SLOT called when the viewer opened
*/
//=================================================================================
void SMESHGUI_MakeNodeAtPointOp::onOpenView()
{
if ( mySimulation ) {
mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(false);
}
else {
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
}
}
//=================================================================================
/*!
* \brief SLOT called when the viewer closed
*/
//=================================================================================
void SMESHGUI_MakeNodeAtPointOp::onCloseView()
{
delete mySimulation;
mySimulation = 0;
}
//================================================================================ //================================================================================
/*! /*!
* \brief SLOT called when the node id is manually changed * \brief SLOT called when the node id is manually changed

View File

@ -73,6 +73,8 @@ private slots:
void onTextChange( const QString& ); void onTextChange( const QString& );
void onUpdateDestination(); void onUpdateDestination();
void onDestCoordChanged(); void onDestCoordChanged();
void onOpenView();
void onCloseView();
private: private:
int GetConstructorId(); int GetConstructorId();
@ -81,6 +83,7 @@ private:
SUIT_SelectionFilter* myFilter; SUIT_SelectionFilter* myFilter;
int myMeshOldDisplayMode; int myMeshOldDisplayMode;
SMESHGUI* mySMESHGUI;
SMESHGUI_MeshEditPreview* mySimulation; SMESHGUI_MeshEditPreview* mySimulation;
SMESH_Actor* myMeshActor; SMESH_Actor* myMeshActor;
bool myNoPreview; bool myNoPreview;

View File

@ -570,7 +570,8 @@ void SMESHGUI_MergeDlg::Init()
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
// Init Mesh field from selection // Init Mesh field from selection
SelectionIntoArgument(); SelectionIntoArgument();
@ -721,6 +722,31 @@ void SMESHGUI_MergeDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_MergeDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_MergeDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -1246,10 +1272,15 @@ void SMESHGUI_MergeDlg::ActivateThisDialog()
// function : enterEvent() // function : enterEvent()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_MergeDlg::enterEvent(QEvent*) void SMESHGUI_MergeDlg::enterEvent (QEvent*)
{ {
if (!GroupConstructors->isEnabled()) if ( !GroupConstructors->isEnabled() ) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================

View File

@ -171,6 +171,8 @@ protected slots:
void DeactivateActiveDialog(); void DeactivateActiveDialog();
void ActivateThisDialog(); void ActivateThisDialog();
void onTypeChanged(int); void onTypeChanged(int);
void onOpenView();
void onCloseView();
}; };
#endif // SMESHGUI_MergeDlg_H #endif // SMESHGUI_MergeDlg_H

View File

@ -391,6 +391,8 @@ void SMESHGUI_MeshPatternDlg::Init()
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT( onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT( onCloseView()));
myTypeGrp->button(Type_2d)->setChecked(true); myTypeGrp->button(Type_2d)->setChecked(true);
onTypeChanged(Type_2d); onTypeChanged(Type_2d);
@ -558,6 +560,32 @@ void SMESHGUI_MeshPatternDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_MeshPatternDlg::onOpenView()
{
if(!mySelector) {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true);
activateSelection();
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_MeshPatternDlg::onCloseView()
{
onDeactivate();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : onHelp() // function : onHelp()
// purpose : // purpose :
@ -715,8 +743,13 @@ void SMESHGUI_MeshPatternDlg::enterEvent (QEvent*)
if (myIsCreateDlgOpen) if (myIsCreateDlgOpen)
return; return;
if (myReverseChk->isChecked()) if (myReverseChk->isChecked()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
displayPreview(); displayPreview();
}
mySMESHGUI->EmitSignalDeactivateDialog(); mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true); setEnabled(true);
activateSelection(); activateSelection();

View File

@ -98,6 +98,8 @@ private slots:
void onCloseCreationDlg(); void onCloseCreationDlg();
void onTextChanged( const QString& ); void onTextChanged( const QString& );
void onNodeChanged( int ); void onNodeChanged( int );
void onOpenView();
void onCloseView();
private: private:
QWidget* createButtonFrame( QWidget* ); QWidget* createButtonFrame( QWidget* );

View File

@ -397,6 +397,8 @@ void SMESHGUI_MultiEditDlg::Init()
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT( onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT( onCloseView()));
// dialog controls // dialog controls
connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn() )); connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn() ));
@ -476,6 +478,30 @@ void SMESHGUI_MultiEditDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_MultiEditDlg::onOpenView()
{
if(!mySelector) {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true);
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_MultiEditDlg::onCloseView()
{
onDeactivate();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : onHelp() // function : onHelp()
// purpose : // purpose :
@ -588,6 +614,10 @@ void SMESHGUI_MultiEditDlg::onDeactivate()
void SMESHGUI_MultiEditDlg::enterEvent (QEvent*) void SMESHGUI_MultiEditDlg::enterEvent (QEvent*)
{ {
if (!isEnabled()) { if (!isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
mySMESHGUI->EmitSignalDeactivateDialog(); mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true); setEnabled(true);
setSelectionMode(); setSelectionMode();

View File

@ -102,6 +102,8 @@ protected slots:
virtual void onToAllChk(); virtual void onToAllChk();
void onFilterAccepted(); void onFilterAccepted();
virtual void on3d2dChanged(int); virtual void on3d2dChanged(int);
void onOpenView();
void onCloseView();
SMESH::NumericalFunctor_ptr getNumericalFunctor(); SMESH::NumericalFunctor_ptr getNumericalFunctor();

View File

@ -382,8 +382,9 @@ void SMESHGUI_NodesDlg::Init()
connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) ); connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) );
/* to close dialog if study frame change */ /* to close dialog if study frame change */
connect( mySMESHGUI, SIGNAL( SignalStudyFrameChanged() ), SLOT( reject() ) ); connect( mySMESHGUI, SIGNAL( SignalStudyFrameChanged() ), SLOT( reject() ) );
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), SLOT( reject() ) );
connect( mySMESHGUI, SIGNAL( SignalActivatedViewManager() ), SLOT( onOpenView() ) );
connect( mySMESHGUI, SIGNAL( SignalCloseView() ), SLOT( onCloseView() ) );
// set selection mode // set selection mode
SMESH::SetPointRepresentation( true ); SMESH::SetPointRepresentation( true );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
@ -402,7 +403,6 @@ void SMESHGUI_NodesDlg::ValueChangedInSpinBox( double newValue )
double vx = SpinBox_X->GetValue(); double vx = SpinBox_X->GetValue();
double vy = SpinBox_Y->GetValue(); double vy = SpinBox_Y->GetValue();
double vz = SpinBox_Z->GetValue(); double vz = SpinBox_Z->GetValue();
mySimulation->SetPosition( vx, vy, vz ); mySimulation->SetPosition( vx, vy, vz );
} }
} }
@ -547,7 +547,6 @@ void SMESHGUI_NodesDlg::reject()
disconnect( mySelectionMgr, 0, this, 0 ); disconnect( mySelectionMgr, 0, this, 0 );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
aViewWindow->SetSelectionMode( ActorSelection ); aViewWindow->SetSelectionMode( ActorSelection );
mySimulation->SetVisibility( false ); mySimulation->SetVisibility( false );
SMESH::SetPointRepresentation( false ); SMESH::SetPointRepresentation( false );
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
@ -555,6 +554,36 @@ void SMESHGUI_NodesDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_NodesDlg::onOpenView()
{
if ( mySelector && mySimulation ) {
mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(false);
}
else {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
mySelector = aViewWindow->GetSelector();
mySimulation = new SMESH::TNodeSimulation(aViewWindow);
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_NodesDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
delete mySimulation;
mySimulation = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -644,8 +673,14 @@ void SMESHGUI_NodesDlg::SelectionIntoArgument()
//================================================================================= //=================================================================================
void SMESHGUI_NodesDlg::enterEvent( QEvent* ) void SMESHGUI_NodesDlg::enterEvent( QEvent* )
{ {
if ( !GroupConstructors->isEnabled() ) if ( !GroupConstructors->isEnabled() ) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector && !mySimulation) {
mySelector = aViewWindow->GetSelector();
mySimulation = new SMESH::TNodeSimulation(aViewWindow);
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================
@ -678,7 +713,6 @@ void SMESHGUI_NodesDlg::ActivateThisDialog()
SMESH::SetPointRepresentation( true ); SMESH::SetPointRepresentation( true );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
aViewWindow->SetSelectionMode( NodeSelection ); aViewWindow->SetSelectionMode( NodeSelection );
SelectionIntoArgument(); SelectionIntoArgument();
} }

View File

@ -117,6 +117,8 @@ private slots:
void ActivateThisDialog(); void ActivateThisDialog();
void SelectionIntoArgument(); void SelectionIntoArgument();
void ValueChangedInSpinBox( double ); void ValueChangedInSpinBox( double );
void onOpenView();
void onCloseView();
}; };
#endif // SMESHGUI_NODESDLG_H #endif // SMESHGUI_NODESDLG_H

View File

@ -50,6 +50,8 @@ SMESHGUI_PreviewDlg::SMESHGUI_PreviewDlg(SMESHGUI* theModule) :
myIsApplyAndClose( false ) myIsApplyAndClose( false )
{ {
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI )); mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
} }
//================================================================================= //=================================================================================
@ -66,7 +68,7 @@ SMESHGUI_PreviewDlg::~SMESHGUI_PreviewDlg()
// purpose : Show preview in the viewer // purpose : Show preview in the viewer
//================================================================================= //=================================================================================
void SMESHGUI_PreviewDlg::showPreview(){ void SMESHGUI_PreviewDlg::showPreview(){
if(mySimulation) if(mySimulation && mySimulation->GetActor())
mySimulation->SetVisibility(true); mySimulation->SetVisibility(true);
} }
@ -75,7 +77,7 @@ void SMESHGUI_PreviewDlg::showPreview(){
// purpose : Hide preview in the viewer // purpose : Hide preview in the viewer
//================================================================================= //=================================================================================
void SMESHGUI_PreviewDlg::hidePreview(){ void SMESHGUI_PreviewDlg::hidePreview(){
if(mySimulation) if(mySimulation && mySimulation->GetActor())
mySimulation->SetVisibility(false); mySimulation->SetVisibility(false);
} }
@ -87,7 +89,6 @@ void SMESHGUI_PreviewDlg::connectPreviewControl(){
connect(myPreviewCheckBox, SIGNAL(toggled(bool)), this, SLOT(onDisplaySimulation(bool))); connect(myPreviewCheckBox, SIGNAL(toggled(bool)), this, SLOT(onDisplaySimulation(bool)));
} }
//================================================================================= //=================================================================================
// function : toDisplaySimulation // function : toDisplaySimulation
// purpose : // purpose :
@ -124,7 +125,27 @@ bool SMESHGUI_PreviewDlg::isApplyAndClose() const
return myIsApplyAndClose; return myIsApplyAndClose;
} }
//=================================================================================
// function : onCloseView()
// purpose : SLOT called when close view
//=================================================================================
void SMESHGUI_PreviewDlg::onCloseView()
{
if ( mySimulation && mySimulation->GetActor())
mySimulation->SetVisibility(false);
delete mySimulation;
mySimulation=0;
}
//=================================================================================
// function : onOpenView()
// purpose : SLOT called when open view
//=================================================================================
void SMESHGUI_PreviewDlg::onOpenView()
{
if ( !mySimulation)
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
}
//================================================================================= //=================================================================================
// class : SMESHGUI_SMESHGUI_MultiPreviewDlg() // class : SMESHGUI_SMESHGUI_MultiPreviewDlg()
// purpose : // purpose :
@ -134,6 +155,8 @@ SMESHGUI_MultiPreviewDlg::SMESHGUI_MultiPreviewDlg( SMESHGUI* theModule ) :
QDialog( SMESH::GetDesktop( theModule ) ), QDialog( SMESH::GetDesktop( theModule ) ),
myIsApplyAndClose( false ) myIsApplyAndClose( false )
{ {
mySimulationList.clear();
connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView()));
} }
//================================================================================= //=================================================================================
@ -152,7 +175,8 @@ SMESHGUI_MultiPreviewDlg::~SMESHGUI_MultiPreviewDlg()
void SMESHGUI_MultiPreviewDlg::showPreview() void SMESHGUI_MultiPreviewDlg::showPreview()
{ {
for ( int i = 0; i < mySimulationList.count(); i++ ) for ( int i = 0; i < mySimulationList.count(); i++ )
mySimulationList[i]->SetVisibility( true ); if(mySimulationList[i] && mySimulationList[i]->GetActor())
mySimulationList[i]->SetVisibility( true );
} }
//================================================================================= //=================================================================================
@ -162,7 +186,8 @@ void SMESHGUI_MultiPreviewDlg::showPreview()
void SMESHGUI_MultiPreviewDlg::hidePreview() void SMESHGUI_MultiPreviewDlg::hidePreview()
{ {
for ( int i = 0; i < mySimulationList.count(); i++ ) for ( int i = 0; i < mySimulationList.count(); i++ )
mySimulationList[i]->SetVisibility( false ); if(mySimulationList[i] && mySimulationList[i]->GetActor())
mySimulationList[i]->SetVisibility( false );
} }
//================================================================================= //=================================================================================
@ -174,7 +199,6 @@ void SMESHGUI_MultiPreviewDlg::connectPreviewControl()
connect( myPreviewCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( onDisplaySimulation( bool ) ) ); connect( myPreviewCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( onDisplaySimulation( bool ) ) );
} }
//================================================================================= //=================================================================================
// function : toDisplaySimulation // function : toDisplaySimulation
// purpose : // purpose :
@ -227,3 +251,13 @@ void SMESHGUI_MultiPreviewDlg::setSimulationPreview( QList<SMESH::MeshPreviewStr
mySimulationList[i]->SetData( theMeshPreviewStruct[i].operator->() ); mySimulationList[i]->SetData( theMeshPreviewStruct[i].operator->() );
} }
} }
//=================================================================================
// function : onCloseView()
// purpose : SLOT called when close view
//=================================================================================
void SMESHGUI_MultiPreviewDlg::onCloseView()
{
qDeleteAll( mySimulationList );
mySimulationList.clear();
}

View File

@ -58,8 +58,9 @@ protected:
protected slots: protected slots:
void toDisplaySimulation(); void toDisplaySimulation();
void onCloseView();
void onOpenView();
virtual void onDisplaySimulation( bool ); virtual void onDisplaySimulation( bool );
protected: protected:
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
@ -87,6 +88,7 @@ protected:
protected slots: protected slots:
void toDisplaySimulation(); void toDisplaySimulation();
void onCloseView();
virtual void onDisplaySimulation( bool ); virtual void onDisplaySimulation( bool );

View File

@ -204,7 +204,9 @@ void SMESHGUI_RemoveElementsDlg::Init()
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()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)), connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&))); SLOT(onTextChange(const QString&)));
@ -277,6 +279,28 @@ void SMESHGUI_RemoveElementsDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_RemoveElementsDlg::onOpenView()
{
if(!mySelector) {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_RemoveElementsDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -458,8 +482,13 @@ void SMESHGUI_RemoveElementsDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void SMESHGUI_RemoveElementsDlg::enterEvent(QEvent*) void SMESHGUI_RemoveElementsDlg::enterEvent(QEvent*)
{ {
if (!GroupConstructors->isEnabled()) if (!GroupConstructors->isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================

View File

@ -106,6 +106,8 @@ private slots:
void DeactivateActiveDialog(); void DeactivateActiveDialog();
void ActivateThisDialog(); void ActivateThisDialog();
void onTextChange( const QString& ); void onTextChange( const QString& );
void onOpenView();
void onCloseView();
void setFilters(); void setFilters();
void updateButtons(); void updateButtons();
}; };

View File

@ -204,7 +204,9 @@ void SMESHGUI_RemoveNodesDlg::Init()
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()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)), connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&))); SLOT(onTextChange(const QString&)));
@ -283,6 +285,32 @@ void SMESHGUI_RemoveNodesDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_RemoveNodesDlg::onOpenView()
{
if ( mySelector) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_RemoveNodesDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -459,8 +487,13 @@ void SMESHGUI_RemoveNodesDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void SMESHGUI_RemoveNodesDlg::enterEvent(QEvent*) void SMESHGUI_RemoveNodesDlg::enterEvent(QEvent*)
{ {
if (!GroupConstructors->isEnabled()) if (!GroupConstructors->isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================

View File

@ -106,6 +106,8 @@ private slots:
void DeactivateActiveDialog(); void DeactivateActiveDialog();
void ActivateThisDialog(); void ActivateThisDialog();
void onTextChange( const QString& ); void onTextChange( const QString& );
void onOpenView();
void onCloseView();
void setFilters(); void setFilters();
void updateButtons(); void updateButtons();
}; };

View File

@ -296,7 +296,9 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation())); connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation()));
connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable())); connect(SelectorWdg, SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView()));
connect(GroupAngle, SIGNAL(buttonClicked(int)), this, SLOT(toDisplaySimulation())); connect(GroupAngle, SIGNAL(buttonClicked(int)), this, SLOT(toDisplaySimulation()));
connect(SpinBox_Angle, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation())); connect(SpinBox_Angle, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
@ -517,6 +519,32 @@ void SMESHGUI_RevolutionDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_RevolutionDlg::onOpenView()
{
if ( mySelector ) {
mySimulation->SetVisibility(false);
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_RevolutionDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -690,8 +718,13 @@ void SMESHGUI_RevolutionDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void SMESHGUI_RevolutionDlg::enterEvent (QEvent*) void SMESHGUI_RevolutionDlg::enterEvent (QEvent*)
{ {
if (!GroupButtons->isEnabled()) if (!GroupButtons->isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================

View File

@ -151,6 +151,8 @@ private slots:
void onAngleTextChange( const QString& ); void onAngleTextChange( const QString& );
void onSelectVectorMenu( QAction* ); void onSelectVectorMenu( QAction* );
void onSelectVectorButton(); void onSelectVectorButton();
void onOpenView();
void onCloseView();
}; };
#endif // SMESHGUI_REVOLUTIONDLG_H #endif // SMESHGUI_REVOLUTIONDLG_H

View File

@ -309,7 +309,9 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) :
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()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
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(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
@ -560,6 +562,32 @@ void SMESHGUI_RotationDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_RotationDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_RotationDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -912,8 +940,13 @@ void SMESHGUI_RotationDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void SMESHGUI_RotationDlg::enterEvent (QEvent*) void SMESHGUI_RotationDlg::enterEvent (QEvent*)
{ {
if (!GroupConstructors->isEnabled()) if (!GroupConstructors->isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================

View File

@ -148,6 +148,8 @@ private slots:
void onSelectMesh( bool ); void onSelectMesh( bool );
void onVectorChanged(); void onVectorChanged();
void onActionClicked( int ); void onActionClicked( int );
void onOpenView();
void onCloseView();
void setFilters(); void setFilters();
}; };

View File

@ -308,7 +308,10 @@ SMESHGUI_ScaleDlg::SMESHGUI_ScaleDlg( SMESHGUI* theModule ) :
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()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView()));
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(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
@ -605,6 +608,31 @@ void SMESHGUI_ScaleDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_ScaleDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_ScaleDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -944,8 +972,13 @@ void SMESHGUI_ScaleDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void SMESHGUI_ScaleDlg::enterEvent (QEvent*) void SMESHGUI_ScaleDlg::enterEvent (QEvent*)
{ {
if (!ConstructorsBox->isEnabled()) if (!ConstructorsBox->isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//======================================================================= //=======================================================================

View File

@ -144,6 +144,8 @@ private slots:
void onTextChange( const QString& ); void onTextChange( const QString& );
void onSelectMesh( bool ); void onSelectMesh( bool );
void onActionClicked( int ); void onActionClicked( int );
void onOpenView();
void onCloseView();
void setFilters(); void setFilters();
}; };

View File

@ -272,7 +272,9 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule )
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()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView()));
connect(LineEdit1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(LineEdit1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(LineEdit2, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(LineEdit2, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
@ -551,6 +553,31 @@ void SMESHGUI_SewingDlg::ClickOnOk()
reject(); reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_SewingDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_SewingDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : reject() // function : reject()
// purpose : // purpose :
@ -676,7 +703,6 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
isEvenOneExists = true; isEvenOneExists = true;
} }
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true ); aViewWindow->highlight( myActor->getIO(), true, true );
@ -741,7 +767,6 @@ void SMESHGUI_SewingDlg::SelectionIntoArgument (bool isSelectionChanged)
// get selected elements/nodes // get selected elements/nodes
int aNbUnits = 0; int aNbUnits = 0;
if (GetConstructorId() != 3 || if (GetConstructorId() != 3 ||
(myEditCurrentArgument != LineEdit1 && myEditCurrentArgument != LineEdit4)) { (myEditCurrentArgument != LineEdit1 && myEditCurrentArgument != LineEdit4)) {
aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString); aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
@ -869,8 +894,13 @@ void SMESHGUI_SewingDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void SMESHGUI_SewingDlg::enterEvent (QEvent* e) void SMESHGUI_SewingDlg::enterEvent (QEvent* e)
{ {
if (!ConstructorsBox->isEnabled()) if (!ConstructorsBox->isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//================================================================================= //=================================================================================

View File

@ -129,6 +129,8 @@ private slots:
void DeactivateActiveDialog(); void DeactivateActiveDialog();
void ActivateThisDialog(); void ActivateThisDialog();
void onTextChange( const QString& ); void onTextChange( const QString& );
void onOpenView();
void onCloseView();
}; };
#endif // SMESHGUI_SEWINGDLG_H #endif // SMESHGUI_SEWINGDLG_H

View File

@ -223,6 +223,8 @@ void SMESHGUI_SingleEditDlg::Init()
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT(onCloseView()));
connect(myEdge, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(myEdge, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
myOkBtn->setEnabled(false); myOkBtn->setEnabled(false);
@ -444,6 +446,29 @@ void SMESHGUI_SingleEditDlg::onDeactivate()
setEnabled(false); setEnabled(false);
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_SingleEditDlg::onOpenView()
{
if ( !mySelector ) {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true);
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_SingleEditDlg::onCloseView()
{
onDeactivate();
mySelector = 0;
}
//======================================================================= //=======================================================================
// name : enterEvent() // name : enterEvent()
// Purpose : Event filter // Purpose : Event filter
@ -452,8 +477,12 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*)
{ {
if (!isEnabled()) { if (!isEnabled()) {
mySMESHGUI->EmitSignalDeactivateDialog(); mySMESHGUI->EmitSignalDeactivateDialog();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow) {
aViewWindow->SetSelectionMode(EdgeOfCellSelection); aViewWindow->SetSelectionMode(EdgeOfCellSelection);
if (!mySelector)
mySelector = aViewWindow->GetSelector();
}
setEnabled(true); setEnabled(true);
} }
} }

View File

@ -70,6 +70,11 @@ protected slots:
void onSelectionDone(); void onSelectionDone();
void onTextChange( const QString& ); void onTextChange( const QString& );
private slots:
void onOpenView();
void onCloseView();
protected: protected:
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );

View File

@ -284,7 +284,9 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
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()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), connect(LineEditElements, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&))); SLOT(onTextChange(const QString&)));
connect(LineEditNodes, SIGNAL(textChanged(const QString&)), connect(LineEditNodes, SIGNAL(textChanged(const QString&)),
@ -444,6 +446,31 @@ void SMESHGUI_SmoothingDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_SmoothingDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_SmoothingDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -701,8 +728,13 @@ void SMESHGUI_SmoothingDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void SMESHGUI_SmoothingDlg::enterEvent (QEvent*) void SMESHGUI_SmoothingDlg::enterEvent (QEvent*)
{ {
if (!GroupConstructors->isEnabled()) if (!GroupConstructors->isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//======================================================================= //=======================================================================

View File

@ -125,6 +125,7 @@ private:
protected slots: protected slots:
virtual void reject(); virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
bool ClickOnApply(); bool ClickOnApply();
@ -135,6 +136,8 @@ private slots:
void ActivateThisDialog(); void ActivateThisDialog();
void onTextChange( const QString& ); void onTextChange( const QString& );
void onSelectMesh( bool ); void onSelectMesh( bool );
void onOpenView();
void onCloseView();
void setElemFilters(); void setElemFilters();
void setNodeFilters(); void setNodeFilters();
}; };

View File

@ -312,7 +312,10 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
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()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView()));
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(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
@ -619,6 +622,31 @@ void SMESHGUI_SymmetryDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_SymmetryDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_SymmetryDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -968,8 +996,13 @@ void SMESHGUI_SymmetryDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void SMESHGUI_SymmetryDlg::enterEvent (QEvent*) void SMESHGUI_SymmetryDlg::enterEvent (QEvent*)
{ {
if (!ConstructorsBox->isEnabled()) if (!ConstructorsBox->isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//======================================================================= //=======================================================================

View File

@ -139,7 +139,7 @@ private:
protected slots: protected slots:
virtual void onDisplaySimulation( bool ); virtual void onDisplaySimulation( bool );
virtual void reject(); virtual void reject();
private slots: private slots:
void ConstructorsClicked( int ); void ConstructorsClicked( int );
void ClickOnOk(); void ClickOnOk();
@ -153,6 +153,8 @@ private slots:
void onSelectMesh( bool ); void onSelectMesh( bool );
void onVectorChanged(); void onVectorChanged();
void onActionClicked( int ); void onActionClicked( int );
void onOpenView();
void onCloseView();
void setFilters(); void setFilters();
}; };

View File

@ -313,10 +313,13 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule ) :
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()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
connect(SpinBox1_1, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation())); connect(SpinBox1_1, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
connect(SpinBox1_2, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation())); connect(SpinBox1_2, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
@ -628,6 +631,31 @@ void SMESHGUI_TranslationDlg::reject()
QDialog::reject(); QDialog::reject();
} }
//=================================================================================
// function : onOpenView()
// purpose :
//=================================================================================
void SMESHGUI_TranslationDlg::onOpenView()
{
if ( mySelector ) {
SMESH::SetPointRepresentation(false);
}
else {
mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
ActivateThisDialog();
}
}
//=================================================================================
// function : onCloseView()
// purpose :
//=================================================================================
void SMESHGUI_TranslationDlg::onCloseView()
{
DeactivateActiveDialog();
mySelector = 0;
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :
@ -689,7 +717,6 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText)
myNbOkElements++; myNbOkElements++;
} }
} }
mySelector->AddOrRemoveIndex( anIO, newIndices, false ); mySelector->AddOrRemoveIndex( anIO, newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( anIO, true, true ); aViewWindow->highlight( anIO, true, true );
@ -805,7 +832,6 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument()
anActor = SMESH::FindActorByEntry(IO->getEntry()); anActor = SMESH::FindActorByEntry(IO->getEntry());
if (!anActor && !CheckBoxMesh->isChecked()) if (!anActor && !CheckBoxMesh->isChecked())
return; return;
aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString); aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
if (aNbUnits != 1) if (aNbUnits != 1)
return; return;
@ -933,8 +959,13 @@ void SMESHGUI_TranslationDlg::ActivateThisDialog()
//================================================================================= //=================================================================================
void SMESHGUI_TranslationDlg::enterEvent (QEvent*) void SMESHGUI_TranslationDlg::enterEvent (QEvent*)
{ {
if (!ConstructorsBox->isEnabled()) if (!ConstructorsBox->isEnabled()) {
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
if ( aViewWindow && !mySelector) {
mySelector = aViewWindow->GetSelector();
}
ActivateThisDialog(); ActivateThisDialog();
}
} }
//======================================================================= //=======================================================================

View File

@ -146,7 +146,10 @@ private slots:
void onTextChange( const QString& ); void onTextChange( const QString& );
void onSelectMesh( bool ); void onSelectMesh( bool );
void onActionClicked( int ); void onActionClicked( int );
void onOpenView();
void onCloseView();
void setFilters(); void setFilters();
}; };
#endif // SMESHGUI_TRANSLATIONDLG_H #endif // SMESHGUI_TRANSLATIONDLG_H