From 4bca79af7df56a895c56b0a3d6dc636489bd0989 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 8 Nov 2006 10:20:41 +0000 Subject: [PATCH] VisuGUI_InputPane added --- src/VISUGUI/VISU_msg_en.po | 12 +++++ src/VISUGUI/VisuGUI_CutLinesDlg.cxx | 29 +++++++++-- src/VISUGUI/VisuGUI_CutLinesDlg.h | 4 ++ src/VISUGUI/VisuGUI_CutPlanesDlg.cxx | 32 ++++++++++--- src/VISUGUI/VisuGUI_CutPlanesDlg.h | 4 ++ src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx | 31 ++++++++++-- src/VISUGUI/VisuGUI_DeformedShapeDlg.h | 4 ++ src/VISUGUI/VisuGUI_GaussPointsDlg.cxx | 34 ++++++++++--- src/VISUGUI/VisuGUI_GaussPointsDlg.h | 5 ++ src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx | 42 ++++++++++++++-- src/VISUGUI/VisuGUI_IsoSurfacesDlg.h | 11 +++-- src/VISUGUI/VisuGUI_Plot3DDlg.cxx | 48 +++++++++++++++++-- src/VISUGUI/VisuGUI_Plot3DDlg.h | 11 +++-- src/VISUGUI/VisuGUI_ScalarBarDlg.cxx | 7 +-- .../VisuGUI_ScalarMapOnDeformedShapeDlg.cxx | 27 +++++++++-- .../VisuGUI_ScalarMapOnDeformedShapeDlg.h | 4 ++ src/VISUGUI/VisuGUI_StreamLinesDlg.cxx | 28 +++++++++-- src/VISUGUI/VisuGUI_StreamLinesDlg.h | 4 ++ src/VISUGUI/VisuGUI_VectorsDlg.cxx | 27 +++++++++-- src/VISUGUI/VisuGUI_VectorsDlg.h | 5 ++ 20 files changed, 312 insertions(+), 57 deletions(-) diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index 63a9c4cd..3dde5df0 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -572,6 +572,9 @@ msgstr "Deformed Shape" msgid "VisuGUI_DeformedShapeDlg::SCALAR_BAR_TAB" msgstr "Scalar Bar" +msgid "VisuGUI_DeformedShapeDlg::INPUT_TAB" +msgstr "Input" + msgid "VisuGUI_DeformedShapeDlg::MAGNITUDE_COLORING" msgstr "Magnitude coloring" @@ -596,6 +599,9 @@ msgstr "Scalar Map on Deformed Shape" msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALAR_BAR_TAB" msgstr "Scalar Bar" +msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::INPUT_TAB" +msgstr "Input" + msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALE_FACTOR" msgstr "Scale Factor:" @@ -1073,6 +1079,9 @@ msgstr "Plot 3D" msgid "VisuGUI_Plot3DDlg::SCALAR_BAR_TAB_TITLE" msgstr "Scalar Bar" +msgid "VisuGUI_Plot3DDlg::INPUT_TAB_TITLE" +msgstr "Input" + msgid "VisuGUI_Plot3DPane::ORIENTATION" msgstr "Orientation" @@ -1858,6 +1867,9 @@ msgstr "Gauss Points" msgid "VisuGUI_GaussPointsDlg::SCALAR_BAR_TAB" msgstr "Scalar Bar" +msgid "VisuGUI_GaussPointsDlg::INPUT_TAB" +msgstr "Input" + msgid "VisuGUI_GaussPointsDlg::PRS_TITLE" msgstr "Presentation" diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx index fad1a6ae..0b79b5ff 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx @@ -26,6 +26,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" +#include "VisuGUI_InputPane.h" #include "VISU_Gen_i.hh" #include "VISU_CutLines_i.hh" @@ -79,7 +80,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) hasInit = false; // Tab pane - QTabWidget* aTabPane = new QTabWidget(this); + myTabBox = new QTabWidget(this); // Plane of lines QFrame* aPlanePane = new QFrame(this); @@ -153,7 +154,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) aPlaneLayout->addStretch(); - aTabPane->addTab( aPlanePane, tr("LBL_LINES_PLANE") ); + myTabBox->addTab( aPlanePane, tr("LBL_LINES_PLANE") ); // Number of lines QFrame* aLinesPane = new QFrame(this); @@ -209,13 +210,15 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) aLinesLayout->addWidget( aPosBox2 ); aLinesLayout->addStretch(); - aTabPane->addTab( aLinesPane, tr("LBL_LINES_CUT") ); + myTabBox->addTab( aLinesPane, tr("LBL_LINES_CUT") ); myScalarPane = new VisuGUI_ScalarBarPane(this, false); myScalarPane->setMargin( 5 ); - aTabPane->addTab(myScalarPane, "Scalar Bar"); + myInputPane = new VisuGUI_InputPane(theModule, this); + myTabBox->addTab(myScalarPane, "Scalar Bar"); + myTabBox->addTab(myInputPane, "Input"); - aMainLayout->addWidget(aTabPane); + aMainLayout->addWidget(myTabBox); // Dialog buttons QHBox* aBtnBox = new QHBox(this); @@ -289,6 +292,15 @@ void VisuGUI_CutLinesDlg::initFromPrsObject (VISU::CutLines_i* thePrs) myPrs = thePrs; myScalarPane->initFromPrsObject(thePrs); + if( thePrs->IsTimeStampFixed() ) + myTabBox->removePage( myInputPane ); + else + { + myInputPane->initFromPrsObject( thePrs ); + myTabBox->showPage( myInputPane ); + } + myTabBox->setCurrentPage( 0 ); + myRotXSpn->setValue(thePrs->GetRotateX()*180./PI); myRotYSpn->setValue(thePrs->GetRotateY()*180./PI); myPosSpn->setValue(thePrs->GetDisplacement()); @@ -321,6 +333,13 @@ int VisuGUI_CutLinesDlg::storeToPrsObject (VISU::CutLines_i* thePrs) { myScalarPane->storeToPrsObject(thePrs); + if( !thePrs->IsTimeStampFixed() ) + { + if( !myInputPane->check() ) + return 0; + myInputPane->storeToPrsObject( thePrs ); + } + thePrs->SetOrientation(getOrientaion(), myRotXSpn->value()*PI/180., myRotYSpn->value()*PI/180.); diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.h b/src/VISUGUI/VisuGUI_CutLinesDlg.h index 8b0e1da4..0894d5ad 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.h +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.h @@ -28,9 +28,11 @@ #include #include +#include class SUIT_ViewManager; class SalomeApp_Module; +class VisuGUI_InputPane; namespace VISU{ class CutLines_i; @@ -100,7 +102,9 @@ private: QDoubleValidator *mydvalidator; VISU::CutLines_i* myCutLines; + QTabWidget* myTabBox; VisuGUI_ScalarBarPane* myScalarPane; + VisuGUI_InputPane* myInputPane; VISU::CutPlanes::Orientation getOrientaion (bool IsBasePlane = true); void setOrientation (const VISU::CutPlanes::Orientation orient); diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index d7b4aeb7..bc0e0ec4 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -31,6 +31,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" +#include "VisuGUI_InputPane.h" #include "VISU_CutPlanes_i.hh" #include "VISU_CutPlanesPL.hxx" @@ -480,14 +481,16 @@ VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule) TopLayout->setMargin(11); // Tab pane - QTabWidget* aTabBox = new QTabWidget(this); + myTabBox = new QTabWidget(this); myCutPane = new VisuGUI_CutPlanesPane(this/*, myMgr*/); - aTabBox->addTab(myCutPane, "Cut Planes"); + myTabBox->addTab(myCutPane, "Cut Planes"); myScalarPane = new VisuGUI_ScalarBarPane(this, false); myScalarPane->setMargin(5); - aTabBox->addTab(myScalarPane, "Scalar Bar"); + myInputPane = new VisuGUI_InputPane(theModule, this); + myTabBox->addTab(myScalarPane, "Scalar Bar"); + myTabBox->addTab(myInputPane, "Input"); - TopLayout->addWidget(aTabBox); + TopLayout->addWidget(myTabBox); QGroupBox* GroupButtons = new QGroupBox(this, "GroupButtons"); GroupButtons->setGeometry(QRect(10, 10, 281, 48)); @@ -530,12 +533,29 @@ void VisuGUI_CutPlanesDlg::initFromPrsObject (VISU::CutPlanes_i* thePrs) myPrs = thePrs; myScalarPane->initFromPrsObject(thePrs); myCutPane->initFromPrsObject(thePrs); + + if( thePrs->IsTimeStampFixed() ) + myTabBox->removePage( myInputPane ); + else + { + myInputPane->initFromPrsObject( thePrs ); + myTabBox->showPage( myInputPane ); + } + myTabBox->setCurrentPage( 0 ); } int VisuGUI_CutPlanesDlg::storeToPrsObject (VISU::CutPlanes_i* thePrs) { - return (myScalarPane->storeToPrsObject(thePrs) && - myCutPane->storeToPrsObject(thePrs)); + int ok = 1; + if( !thePrs->IsTimeStampFixed() ) + { + if( !myInputPane->check() ) + return 0; + + ok = myInputPane->storeToPrsObject( thePrs ); + } + + return ok && myScalarPane->storeToPrsObject(thePrs) && myCutPane->storeToPrsObject(thePrs); } void VisuGUI_CutPlanesDlg::accept() diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.h b/src/VISUGUI/VisuGUI_CutPlanesDlg.h index b7f9e4cf..2cd58c97 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.h +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.h @@ -36,6 +36,7 @@ #include #include +#include #include "SALOMEconfig.h" #include CORBA_CLIENT_HEADER(VISU_Gen) @@ -44,6 +45,7 @@ class QtxDblSpinBox; class SUIT_ViewWindow; class SUIT_ViewManager; class SalomeApp_Module; +class VisuGUI_InputPane; class VisuGUI_CutPlanesPane : public QFrame @@ -121,8 +123,10 @@ protected slots: void onHelp(); private: + QTabWidget* myTabBox; VisuGUI_CutPlanesPane* myCutPane; VisuGUI_ScalarBarPane* myScalarPane; + VisuGUI_InputPane* myInputPane; VISU::CutPlanes_i* myPrs; }; diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index 2a092922..8149ef89 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -30,6 +30,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_InputPane.h" #include "VISU_DeformedShape_i.hh" @@ -49,7 +50,7 @@ using namespace std; * Constructor */ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) - : QDialog(VISU::GetDesktop(theModule), "VisuGUI_DeformedShapeDlg", true, + : QDialog(VISU::GetDesktop(theModule), "VisuGUI_DeformedShapeDlg", false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { setCaption(tr("DLG_TITLE")); @@ -59,7 +60,7 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) TopLayout->setSpacing(6); TopLayout->setMargin(11); - QTabWidget* aTabBox = new QTabWidget (this); + myTabBox = new QTabWidget (this); // Deformed shape pane QVBox* aBox = new QVBox (this); @@ -87,13 +88,15 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) UseMagn->setChecked(true); TopGroupLayout->addMultiCellWidget(UseMagn, 1, 1, 0, 1); - aTabBox->addTab(aBox, tr("DEFORMED_SHAPE_TAB")); + myTabBox->addTab(aBox, tr("DEFORMED_SHAPE_TAB")); // Scalar bar pane myScalarPane = new VisuGUI_ScalarBarPane (this, false); myScalarPane->setMargin(5); + myInputPane = new VisuGUI_InputPane(theModule, this); - aTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB")); + myTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB")); + myTabBox->addTab(myInputPane, tr("INPUT_TAB")); // Buttons QGroupBox* GroupButtons = new QGroupBox (this, "GroupButtons"); @@ -123,7 +126,7 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) GroupButtonsLayout->addWidget(buttonHelp, 0, 3); // Add Tab box and Buttons to the top layout - TopLayout->addWidget(aTabBox); + TopLayout->addWidget(myTabBox); TopLayout->addWidget(GroupButtons); // signals and slots connections @@ -135,12 +138,30 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) void VisuGUI_DeformedShapeDlg::initFromPrsObject (VISU::DeformedShape_i* thePrs) { myScalarPane->initFromPrsObject(thePrs); + + if( thePrs->IsTimeStampFixed() ) + myTabBox->removePage( myInputPane ); + else + { + myInputPane->initFromPrsObject( thePrs ); + myTabBox->showPage( myInputPane ); + } + myTabBox->setCurrentPage( 0 ); + setFactor(thePrs->GetScale()); UseMagn->setChecked(thePrs->IsColored()); } int VisuGUI_DeformedShapeDlg::storeToPrsObject(VISU::DeformedShape_i* thePrs) { myScalarPane->storeToPrsObject(thePrs); + + if( !thePrs->IsTimeStampFixed() ) + { + if( !myInputPane->check() ) + return 0; + myInputPane->storeToPrsObject( thePrs ); + } + thePrs->SetScale(getFactor()); thePrs->ShowColored(isColored()); return 1; diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h index 32c10f4c..f23aa192 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h @@ -38,8 +38,10 @@ #include #include #include +#include class SalomeApp_Module; +class VisuGUI_InputPane; namespace VISU{ class DeformedShape_i; @@ -75,7 +77,9 @@ protected slots: private: QtxDblSpinBox* ScalFact; QCheckBox* UseMagn; + QTabWidget* myTabBox; VisuGUI_ScalarBarPane* myScalarPane; + VisuGUI_InputPane* myInputPane; }; #endif // VISUGUI_DEFORMEDSHAPEDLS_H diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index 0459eef8..25ea6eb4 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -30,6 +30,7 @@ #include "VISUConfig.hh" #include "VisuGUI_Tools.h" +#include "VisuGUI_InputPane.h" #include "VISU_GaussPoints_i.hh" #include "VISU_GaussPointsPL.hxx" @@ -507,7 +508,7 @@ void VisuGUI_GaussScalarBarPane::onTextPref() */ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool SetPref): QDialog(VISU::GetDesktop(theModule), - "VisuGUI_GaussPointsDlg", true, + "VisuGUI_GaussPointsDlg", false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), myPrs(NULL) { @@ -530,7 +531,7 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool myGeometryButton = new QRadioButton( tr( "GEOMETRY" ), PrsGroup ); myDefShapeButton = new QRadioButton( tr( "DEFORMED_SHAPE" ), PrsGroup ); - QTabWidget* aTabBox = new QTabWidget (this); + myTabBox = new QTabWidget (this); // Gauss points pane QVBox* aBox = new QVBox (this); @@ -564,6 +565,8 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool myScalarPane = new VisuGUI_GaussScalarBarPane(this, SetPref); myScalarPane->setMargin(5); + // Input pane + myInputPane = new VisuGUI_InputPane(theModule, this); connect( myResultsButton, SIGNAL( clicked() ), mySizeBox, SLOT( onToggleResults() ) ); connect( myResultsButton, SIGNAL( toggled( bool ) ), myScalarPane, SLOT( setEnabled( bool ) ) ); @@ -571,8 +574,9 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool connect( myDefShapeButton, SIGNAL( toggled( bool ) ), this, SLOT( onToggleDefShape( bool ) ) ); connect( myDefShapeButton, SIGNAL( toggled( bool ) ), myScalarPane, SLOT( setEnabled( bool ) ) ); - aTabBox->addTab(aBox, tr("GAUSS_POINTS_TAB")); - aTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB")); + myTabBox->addTab(aBox, tr("GAUSS_POINTS_TAB")); + myTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB")); + myTabBox->addTab(myInputPane, tr("INPUT_TAB")); // Common buttons =========================================================== QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); @@ -599,7 +603,7 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); TopLayout->addWidget( PrsGroup ); - TopLayout->addWidget( aTabBox ); + TopLayout->addWidget( myTabBox ); TopLayout->addWidget( GroupButtons ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); @@ -638,6 +642,15 @@ void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::GaussPoints_i* thePrs ) myScalarPane->initFromPrsObject(thePrs); + if( thePrs->IsTimeStampFixed() ) + myTabBox->removePage( myInputPane ); + else + { + myInputPane->initFromPrsObject( thePrs ); + myTabBox->showPage( myInputPane ); + } + myTabBox->setCurrentPage( 0 ); + myPrs = thePrs; } @@ -680,7 +693,16 @@ int VisuGUI_GaussPointsDlg::storeToPrsObject( VISU::GaussPoints_i* thePrs ) thePrs->SetMagnification( mySizeBox->getMagnification() ); thePrs->SetMagnificationIncrement( mySizeBox->getIncrement() ); - return myScalarPane->storeToPrsObject(thePrs); + int ok = 1; + if( !thePrs->IsTimeStampFixed() ) + { + if( !myInputPane->check() ) + return 0; + + ok = myInputPane->storeToPrsObject( thePrs ); + } + + return ok && myScalarPane->storeToPrsObject(thePrs); } void VisuGUI_GaussPointsDlg::onToggleDefShape( bool on ) diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.h b/src/VISUGUI/VisuGUI_GaussPointsDlg.h index 1ce86e43..44d16e86 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.h +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.h @@ -42,11 +42,13 @@ #include #include #include +#include class SalomeApp_Module; class VVTK_PrimitiveBox; class VVTK_SizeBox; class VisuGUI_TextPrefDlg; +class VisuGUI_InputPane; namespace VISU { @@ -150,7 +152,10 @@ protected slots: private: VISU::GaussPoints_i* myPrs; + + QTabWidget* myTabBox; VisuGUI_GaussScalarBarPane* myScalarPane; + VisuGUI_InputPane* myInputPane; QRadioButton* myResultsButton; QRadioButton* myGeometryButton; diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx index 909c730d..34156ba5 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx @@ -30,6 +30,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_InputPane.h" #include "LightApp_Application.h" @@ -164,7 +165,7 @@ bool VisuGUI_IsoSurfPane::check() Constructor */ VisuGUI_IsoSurfacesDlg::VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule) - : QDialog(VISU::GetDesktop(theModule), "VisuGUI_IsoSurfacesDlg", true, + : QDialog(VISU::GetDesktop(theModule), "VisuGUI_IsoSurfacesDlg", false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { setCaption(tr("DEFINE_ISOSURFACES")); @@ -174,16 +175,18 @@ VisuGUI_IsoSurfacesDlg::VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule) TopLayout->setSpacing( 6 ); TopLayout->setMargin(11); - QTabWidget* aTabBox = new QTabWidget(this); + myTabBox = new QTabWidget(this); myIsoPane = new VisuGUI_IsoSurfPane(this); myIsoPane->setMargin( 5 ); - aTabBox->addTab(myIsoPane, "Iso Surface"); + myTabBox->addTab(myIsoPane, "Iso Surface"); myScalarPane = new VisuGUI_ScalarBarPane(this, false); myIsoPane->setScalarBarPane(myScalarPane); myScalarPane->setMargin( 5 ); - aTabBox->addTab(myScalarPane, "Scalar Bar"); + myInputPane = new VisuGUI_InputPane(theModule, this); + myTabBox->addTab(myScalarPane, "Scalar Bar"); + myTabBox->addTab(myInputPane, "Input"); - TopLayout->addWidget(aTabBox); + TopLayout->addWidget(myTabBox); QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); @@ -230,6 +233,35 @@ void VisuGUI_IsoSurfacesDlg::reject() QDialog::reject(); } +void VisuGUI_IsoSurfacesDlg::initFromPrsObject(VISU::IsoSurfaces_i* thePrs) +{ + myScalarPane->initFromPrsObject(thePrs); + myIsoPane->initFromPrsObject(thePrs); + + if( thePrs->IsTimeStampFixed() ) + myTabBox->removePage( myInputPane ); + else + { + myInputPane->initFromPrsObject( thePrs ); + myTabBox->showPage( myInputPane ); + } + myTabBox->setCurrentPage( 0 ); +} + +int VisuGUI_IsoSurfacesDlg::storeToPrsObject(VISU::IsoSurfaces_i* thePrs) +{ + int ok = 1; + if( !thePrs->IsTimeStampFixed() ) + { + if( !myInputPane->check() ) + return 0; + + ok = myInputPane->storeToPrsObject( thePrs ); + } + + return ok && myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs); +} + void VisuGUI_IsoSurfacesDlg::onHelp() { QString aHelpFileName = "/files/iso_surfaces_presentation.htm"; diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h index 385fa646..e97cae7a 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h @@ -39,8 +39,10 @@ #include #include #include +#include class SalomeApp_Module; +class VisuGUI_InputPane; class VisuGUI_IsoSurfPane : public QVBox { @@ -77,11 +79,8 @@ class VisuGUI_IsoSurfacesDlg : public QDialog VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule); ~VisuGUI_IsoSurfacesDlg() {}; - void initFromPrsObject(VISU::IsoSurfaces_i* thePrs) - {myScalarPane->initFromPrsObject(thePrs); myIsoPane->initFromPrsObject(thePrs);} - - int storeToPrsObject(VISU::IsoSurfaces_i* thePrs) - {return myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs);} + void initFromPrsObject(VISU::IsoSurfaces_i* thePrs); + int storeToPrsObject(VISU::IsoSurfaces_i* thePrs); private: void keyPressEvent( QKeyEvent* e ); @@ -92,8 +91,10 @@ class VisuGUI_IsoSurfacesDlg : public QDialog void onHelp(); private: + QTabWidget* myTabBox; VisuGUI_IsoSurfPane* myIsoPane; VisuGUI_ScalarBarPane* myScalarPane; + VisuGUI_InputPane* myInputPane; }; #endif // VISUGUI_ISOSURFACESDLG_H diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index a46e9730..b5e3768c 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -31,6 +31,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" +#include "VisuGUI_InputPane.h" #include "VISU_ViewManager_i.hh" #include "VISU_Plot3DPL.hxx" @@ -552,15 +553,17 @@ VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg (SalomeApp_Module* theModule) TopLayout->setSpacing(6); TopLayout->setMargin(11); - QTabWidget* aTabBox = new QTabWidget (this); + myTabBox = new QTabWidget (this); myIsoPane = new VisuGUI_Plot3DPane (this); myIsoPane->setMargin(5); - aTabBox->addTab(myIsoPane, tr("PLOT3D_TAB_TITLE")); + myTabBox->addTab(myIsoPane, tr("PLOT3D_TAB_TITLE")); myScalarPane = new VisuGUI_ScalarBarPane (this, false); myScalarPane->setMargin(5); - aTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB_TITLE")); + myInputPane = new VisuGUI_InputPane(theModule, this); + myTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB_TITLE")); + myTabBox->addTab(myInputPane, tr("INPUT_TAB_TITLE")); - TopLayout->addWidget(aTabBox); + TopLayout->addWidget(myTabBox); QGroupBox* GroupButtons = new QGroupBox (this, "GroupButtons"); GroupButtons->setGeometry(QRect(10, 10, 281, 48)); @@ -617,6 +620,43 @@ void VisuGUI_Plot3DDlg::reject() QDialog::reject(); } +//======================================================================= +//function : initFromPrsObject +//purpose : +//======================================================================= +void VisuGUI_Plot3DDlg::initFromPrsObject (VISU::Plot3D_i* thePrs) +{ + myScalarPane->initFromPrsObject(thePrs); + myIsoPane->initFromPrsObject(thePrs); + + if( thePrs->IsTimeStampFixed() ) + myTabBox->removePage( myInputPane ); + else + { + myInputPane->initFromPrsObject( thePrs ); + myTabBox->showPage( myInputPane ); + } + myTabBox->setCurrentPage( 0 ); +} + +//======================================================================= +//function : storeToPrsObject +//purpose : +//======================================================================= +int VisuGUI_Plot3DDlg::storeToPrsObject (VISU::Plot3D_i* thePrs) +{ + int ok = 1; + if( !thePrs->IsTimeStampFixed() ) + { + if( !myInputPane->check() ) + return 0; + + ok = myInputPane->storeToPrsObject( thePrs ); + } + + return ok && myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs); +} + //======================================================================= //function : onHelp //purpose : diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.h b/src/VISUGUI/VisuGUI_Plot3DDlg.h index 230df000..980ef980 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.h +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.h @@ -34,8 +34,10 @@ #include "VISU_Plot3D_i.hh" #include +#include class SalomeApp_Module; +class VisuGUI_InputPane; namespace VISU { class Plot3D_i; @@ -103,11 +105,8 @@ class VisuGUI_Plot3DDlg : public QDialog VisuGUI_Plot3DDlg (SalomeApp_Module* theModule); ~VisuGUI_Plot3DDlg() {}; - void initFromPrsObject (VISU::Plot3D_i* thePrs) - { myScalarPane->initFromPrsObject(thePrs); myIsoPane->initFromPrsObject(thePrs); } - - int storeToPrsObject (VISU::Plot3D_i* thePrs) - { return myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs); } + void initFromPrsObject (VISU::Plot3D_i* thePrs); + int storeToPrsObject (VISU::Plot3D_i* thePrs); void setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos); @@ -120,8 +119,10 @@ class VisuGUI_Plot3DDlg : public QDialog void onHelp(); private: + QTabWidget* myTabBox; VisuGUI_Plot3DPane* myIsoPane; VisuGUI_ScalarBarPane* myScalarPane; + VisuGUI_InputPane* myInputPane; }; #endif // VISUGUI_PLOT3D_H diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index 88ef543d..a3a60f98 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -28,11 +28,10 @@ #include "VisuGUI_ScalarBarDlg.h" -#include "VisuGUI_InputPane.h" - #include "VisuGUI.h" #include "VisuGUI_Tools.h" #include "VisuGUI_ViewTools.h" +#include "VisuGUI_InputPane.h" #include "SVTK_ViewWindow.h" #include "SVTK_FontWidget.h" @@ -1178,10 +1177,12 @@ void VisuGUI_ScalarBarDlg::initFromPrsObject(VISU::ScalarMap_i* thePrs) myInputPane->initFromPrsObject( thePrs ); myTabBox->showPage( myInputPane ); } - myTabBox->setCurrentPage( 0 ); } +/*! + Store dialog to the presentation +*/ int VisuGUI_ScalarBarDlg::storeToPrsObject(VISU::ScalarMap_i* thePrs) { int ok = 1; diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx index 27e8b5bf..90b62a8d 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx @@ -28,6 +28,7 @@ #include "VisuGUI_ScalarMapOnDeformedShapeDlg.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_InputPane.h" #include "VISU_Result_i.hh" #include "VISU_ScalarMapOnDeformedShape_i.hh" @@ -74,7 +75,7 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome TopLayout->setSpacing(6); TopLayout->setMargin(11); - QTabWidget* aTabBox = new QTabWidget (this); + myTabBox = new QTabWidget (this); // Scalar Map on Deformed shape pane QVBox* aBox = new QVBox (this); @@ -112,13 +113,15 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome TopGroupLayout->addWidget(myTimeStampsCombo,2,1); // - aTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB")); + myTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB")); // Scalar bar pane myScalarPane = new VisuGUI_ScalarBarPane (this, false); myScalarPane->setMargin(5); + myInputPane = new VisuGUI_InputPane(theModule, this); - aTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB")); + myTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB")); + myTabBox->addTab(myInputPane, tr("INPUT_TAB")); // Buttons QGroupBox* GroupButtons = new QGroupBox (this, "GroupButtons"); @@ -148,7 +151,7 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome GroupButtonsLayout->addWidget(buttonHelp, 0, 3); // Add Tab box and Buttons to the top layout - TopLayout->addWidget(aTabBox); + TopLayout->addWidget(myTabBox); TopLayout->addWidget(GroupButtons); // signals and slots connections @@ -297,6 +300,15 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject SetScalarField( false ); myScalarPane->initFromPrsObject(myPrs); + + if( thePrs->IsTimeStampFixed() ) + myTabBox->removePage( myInputPane ); + else + { + myInputPane->initFromPrsObject( thePrs ); + myTabBox->showPage( myInputPane ); + } + myTabBox->setCurrentPage( 0 ); } int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject @@ -321,6 +333,13 @@ int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject myScalarPane->storeToPrsObject(thePrs); + if( !thePrs->IsTimeStampFixed() ) + { + if( !myInputPane->check() ) + return 0; + myInputPane->storeToPrsObject( thePrs ); + } + myPrs = thePrs; return 1; diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h index 3151bd93..cb7c9c6f 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h @@ -37,10 +37,12 @@ #include #include #include +#include #include class SalomeApp_Module; +class VisuGUI_InputPane; class QComboBox; class QString; @@ -85,7 +87,9 @@ private slots: private: QtxDblSpinBox* ScalFact; + QTabWidget* myTabBox; VisuGUI_ScalarBarPane* myScalarPane; + VisuGUI_InputPane* myInputPane; QComboBox *myFieldsCombo; QComboBox *myTimeStampsCombo; diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx index 4f81711e..129e96a7 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx @@ -25,6 +25,7 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_InputPane.h" #include "VISU_Mesh_i.hh" #include "VISU_Gen_i.hh" @@ -68,7 +69,7 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) aBoxLayout->setSpacing( 6 ); aBoxLayout->setMargin( 11 ); - QTabWidget* aTabBox = new QTabWidget(this); + myTabBox = new QTabWidget(this); QFrame* aTopBox = new QFrame(this); aTopBox->setMargin( 11 ); @@ -266,12 +267,14 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) connect( SelColor, SIGNAL( clicked() ), this, SLOT( setVColor() ) ); TopLayout->addWidget( SelColor, 5, 1); - aTabBox->addTab(aTopBox, "Stream Lines"); + myTabBox->addTab(aTopBox, "Stream Lines"); myScalarPane = new VisuGUI_ScalarBarPane(this, false); myScalarPane->setMargin( 5 ); - aTabBox->addTab(myScalarPane, "Scalar Bar"); + myInputPane = new VisuGUI_InputPane(theModule, this); + myTabBox->addTab(myScalarPane, "Scalar Bar"); + myTabBox->addTab(myInputPane, "Input"); - aBoxLayout->addWidget(aTabBox); + aBoxLayout->addWidget(myTabBox); QGroupBox* aGroupButtons = new QGroupBox( this, "GroupButtons" ); aGroupButtons->setColumnLayout(0, Qt::Vertical ); @@ -311,6 +314,15 @@ void VisuGUI_StreamLinesDlg::initFromPrsObject (VISU::StreamLines_i* thePrs) { myScalarPane->initFromPrsObject(thePrs); + if( thePrs->IsTimeStampFixed() ) + myTabBox->removePage( myInputPane ); + else + { + myInputPane->initFromPrsObject( thePrs ); + myTabBox->showPage( myInputPane ); + } + myTabBox->setCurrentPage( 0 ); + myPrs = thePrs; static int aNbOfSteps = 30; VISU_StreamLinesPL* aStreamLinesPL = thePrs->GetSpecificPL(); @@ -379,6 +391,14 @@ void VisuGUI_StreamLinesDlg::initFromPrsObject (VISU::StreamLines_i* thePrs) int VisuGUI_StreamLinesDlg::storeToPrsObject (VISU::StreamLines_i* thePrs) { bool isAccepted = myScalarPane->storeToPrsObject(thePrs); + + if( isAccepted && !thePrs->IsTimeStampFixed() ) + { + if( !myInputPane->check() ) + return 0; + isAccepted = myInputPane->storeToPrsObject( thePrs ); + } + if (isAccepted) { thePrs->ShowColored(myUseScalar->isChecked()); if (!thePrs->IsColored()) { diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.h b/src/VISUGUI/VisuGUI_StreamLinesDlg.h index 263ef4be..f40a16f5 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.h +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.h @@ -30,8 +30,10 @@ #include #include #include +#include class SalomeApp_Module; +class VisuGUI_InputPane; class QtxDblSpinBox; namespace VISU{ @@ -80,7 +82,9 @@ private: QtxDblSpinBox* myPntPercent; QComboBox* mySrcCombo; + QTabWidget* myTabBox; VisuGUI_ScalarBarPane* myScalarPane; + VisuGUI_InputPane* myInputPane; QValueList myPrsList; QValueList myEntityList; diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.cxx b/src/VISUGUI/VisuGUI_VectorsDlg.cxx index b9c660c0..8f1a4094 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.cxx +++ b/src/VISUGUI/VisuGUI_VectorsDlg.cxx @@ -31,6 +31,7 @@ #include "VisuGUI.h" //#include "VisuGUI_Selection.h" #include "VisuGUI_Tools.h" +#include "VisuGUI_InputPane.h" #include "VISU_Vectors_i.hh" #include "LightApp_Application.h" @@ -51,7 +52,7 @@ using namespace std; Constructor */ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) - : QDialog(VISU::GetDesktop(theModule), "VisuGUI_VectorsDlg", true, + : QDialog(VISU::GetDesktop(theModule), "VisuGUI_VectorsDlg", false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { setCaption(tr("DLG_TITLE")); @@ -61,7 +62,7 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) TopLayout->setSpacing( 6 ); TopLayout->setMargin( 11 ); - QTabWidget* aTabBox = new QTabWidget(this); + myTabBox = new QTabWidget(this); QVBox* aBox = new QVBox(this); aBox->setMargin( 11 ); @@ -171,12 +172,14 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); // top layout - aTabBox->addTab(aBox, "Vectors"); + myTabBox->addTab(aBox, "Vectors"); myScalarPane = new VisuGUI_ScalarBarPane(this, false); myScalarPane->setMargin( 5 ); - aTabBox->addTab(myScalarPane, "Scalar Bar"); + myInputPane = new VisuGUI_InputPane(theModule, this); + myTabBox->addTab(myScalarPane, "Scalar Bar"); + myTabBox->addTab(myInputPane, "Input"); - TopLayout->addWidget( aTabBox ); + TopLayout->addWidget( myTabBox ); TopLayout->addWidget( GroupButtons ); // signals and slots connections @@ -201,6 +204,14 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) void VisuGUI_VectorsDlg::initFromPrsObject(VISU::Vectors_i* thePrs) { myScalarPane->initFromPrsObject(thePrs); + if( thePrs->IsTimeStampFixed() ) + myTabBox->removePage( myInputPane ); + else + { + myInputPane->initFromPrsObject( thePrs ); + myTabBox->showPage( myInputPane ); + } + myTabBox->setCurrentPage( 0 ); setScaleFactor(thePrs->GetScale()); setLineWidth((int)thePrs->GetLineWidth()); setUseMagnColor(thePrs->IsColored()); @@ -221,6 +232,12 @@ void VisuGUI_VectorsDlg::initFromPrsObject(VISU::Vectors_i* thePrs) { int VisuGUI_VectorsDlg::storeToPrsObject(VISU::Vectors_i* thePrs) { myScalarPane->storeToPrsObject(thePrs); + if( !thePrs->IsTimeStampFixed() ) + { + if( !myInputPane->check() ) + return 0; + myInputPane->storeToPrsObject( thePrs ); + } thePrs->SetScale(getScaleFactor()); thePrs->SetLineWidth(getLineWidth()); thePrs->ShowColored(getUseMagnColor()); diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.h b/src/VISUGUI/VisuGUI_VectorsDlg.h index 091fec4d..437538f8 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.h +++ b/src/VISUGUI/VisuGUI_VectorsDlg.h @@ -40,11 +40,13 @@ #include #include #include +#include #include "SALOMEconfig.h" #include CORBA_CLIENT_HEADER(VISU_Gen) class SalomeApp_Module; +class VisuGUI_InputPane; namespace VISU{ class Vectors_i; @@ -112,7 +114,10 @@ private: QPushButton* buttonHelp; QColor myColor; + QTabWidget* myTabBox; + VisuGUI_ScalarBarPane* myScalarPane; + VisuGUI_InputPane* myInputPane; private slots: void enableGlyphType(); -- 2.39.2