From d7cf077d85203f31968965506090b2228664935c Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 8 Jul 2008 11:30:24 +0000 Subject: [PATCH] VISU 2008 - Evolution of the VISU selection functionality --- src/VISUGUI/Makefile.am | 2 + src/VISUGUI/VISU_msg_en.ts | 6 +- src/VISUGUI/VisuGUI.cxx | 71 +------- src/VISUGUI/VisuGUI.h | 8 - src/VISUGUI/VisuGUI_Panel.cxx | 238 +++++++++++++++++++++++++ src/VISUGUI/VisuGUI_Panel.h | 76 ++++++++ src/VISUGUI/VisuGUI_SelectionPanel.cxx | 51 +++--- src/VISUGUI/VisuGUI_SelectionPanel.h | 4 +- 8 files changed, 349 insertions(+), 107 deletions(-) create mode 100755 src/VISUGUI/VisuGUI_Panel.cxx create mode 100755 src/VISUGUI/VisuGUI_Panel.h diff --git a/src/VISUGUI/Makefile.am b/src/VISUGUI/Makefile.am index 9132d0b2..d8166dd7 100644 --- a/src/VISUGUI/Makefile.am +++ b/src/VISUGUI/Makefile.am @@ -42,6 +42,7 @@ dist_libVISU_la_SOURCES= \ VisuGUI_Module.cxx \ VisuGUI_InputPanel.cxx \ VisuGUI_BasePanel.cxx \ + VisuGUI_Panel.cxx \ VisuGUI_SelectionPanel.cxx \ VisuGUI_SelectionPrefDlg.cxx \ VisuGUI_GaussPointsSelectionPane.cxx \ @@ -86,6 +87,7 @@ MOC_FILES= \ VisuGUI_Module_moc.cxx \ VisuGUI_InputPanel_moc.cxx \ VisuGUI_BasePanel_moc.cxx \ + VisuGUI_Panel_moc.cxx \ VisuGUI_SelectionPanel_moc.cxx \ VisuGUI_SelectionPrefDlg_moc.cxx \ VisuGUI_GaussPointsSelectionPane_moc.cxx \ diff --git a/src/VISUGUI/VISU_msg_en.ts b/src/VISUGUI/VISU_msg_en.ts index 3318d679..bf702789 100644 --- a/src/VISUGUI/VISU_msg_en.ts +++ b/src/VISUGUI/VISU_msg_en.ts @@ -1166,10 +1166,6 @@ Please, refer to the documentation. MEN_SELECTION Selection - - MEN_SELECTION_INFO - Selection Info... - MEN_SELECTION_PANEL Selection Panel @@ -3214,7 +3210,7 @@ Please, refer to the documentation. VisuGUI_SelectionPanel WINDOW_TITLE - Selection info + Selection MODE_TITLE diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index cd863a7f..7ba08d0a 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -112,7 +112,6 @@ #include "VisuGUI_Displayer.h" #include "VisuGUI_BuildProgressDlg.h" #include "VisuGUI_TransparencyDlg.h" -#include "VisuGUI_InputPanel.h" #include "VISU_ScalarMap_i.hh" #include "VisuGUI_ScalarBarDlg.h" @@ -175,7 +174,6 @@ VisuGUI ::VisuGUI(): SalomeApp_Module( "VISU" ), myDisplayer( 0 ), - myInputPanel( 0 ), mySelectionPanel( 0 ), mySlider( NULL ), mySweep( NULL ) @@ -1789,21 +1787,6 @@ VisuGUI } } -//---------------------------------------------------------------------------- -void -VisuGUI -::OnSelectionInfo() -{ - if (GetActiveViewWindow(this)) - { - inputPanel()->showPanel( mySelectionPanel ); - } - else - SUIT_MessageBox::warning(GetDesktop(this), - tr("WRN_VISU"), - tr("ERR_ACTIVATE_VIEW3D") ); -} - //---------------------------------------------------------------------------- void VisuGUI @@ -1811,12 +1794,10 @@ VisuGUI { if (GetActiveViewWindow(this)) { - VisuGUI_SelectionPanel* aSelectionPanel = selectionPanel(); - VisuGUI_InputPanel* anInputPanel = inputPanel(); - if( !anInputPanel->isShown( aSelectionPanel ) ) - anInputPanel->showPanel( aSelectionPanel ); + if( mySelectionPanel->isVisible() ) + mySelectionPanel->hide(); else - anInputPanel->hidePanel( aSelectionPanel ); + mySelectionPanel->show(); } else SUIT_MessageBox::warning(GetDesktop(this), @@ -2011,7 +1992,6 @@ VisuGUI createToolBars(); createPopupMenus(); - createInputPanel(); createSelectionPanel(); // tmp @@ -2307,10 +2287,6 @@ VisuGUI tr("MEN_CLIPPING"), "", 0, aParent, false, this, SLOT(OnClippingPlanes())); - createAction( VISU_SELECTION_INFO, tr("MEN_SELECTION_INFO"), QIcon(), - tr("MEN_SELECTION_INFO"), "", 0, aParent, false, - this, SLOT(OnSelectionInfo())); - aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION")); createAction( VISU_PARALLELANIMATION, tr("MEN_PARALLEL_ANIMATION"), QIcon(aPixmap), tr("MEN_PARALLEL_ANIMATION"), "", 0, aParent, false, @@ -2325,17 +2301,7 @@ VisuGUI createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIcon(aPixmap), tr("MEN_ERASE_ALL"), "", 0, aParent, false, this, SLOT(OnEraseAll())); - /* - aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GLOBAL_SELECTION")); - createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIcon(aPixmap), - tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false, - this); - - aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PARTIAL_SELECTION")); - createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIcon(aPixmap), - tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false, - this); - */ + aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SELECTION_PANEL")); createAction( VISU_SELECTION_PANEL, tr("MEN_SELECTION_PANEL"), QIcon(aPixmap), tr("MEN_SELECTION_PANEL"), "", 0, aParent, false, @@ -2423,9 +2389,6 @@ VisuGUI createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d createMenu( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE, aMenuId, 10 ); // scalar map on deformed shape - //aMenuId = createMenu( tr( "MEN_SELECTION" ), -1, -1, 30 ); - //createMenu( VISU_SELECTION_INFO, aMenuId, 10 ); // selection info - aMenuId = createMenu( tr( "MEN_REPRESENTATION" ), -1, -1, 30 ); int parentId = createMenu( tr( "MEN_DISPLAY_SELECTION" ), aMenuId, 10 ); // display selection @@ -2433,8 +2396,6 @@ VisuGUI createMenu( VISU_WIREFRAME, parentId, 10 ); // wireframe createMenu( VISU_SURFACE, parentId, 10 ); // surface createMenu( VISU_ERASE_ALL, aMenuId, 10 ); // erase all - //createMenu( VISU_GLOBAL_SELECTION, aMenuId, 10 ); // global selection - //createMenu( VISU_PARTIAL_SELECTION, aMenuId, 10 ); // partial selection } void @@ -2460,8 +2421,6 @@ VisuGUI createTool( VISU_WIREFRAME, aToolId ); createTool( VISU_SURFACE, aToolId ); createTool( VISU_ERASE_ALL, aToolId ); - //createTool( VISU_GLOBAL_SELECTION, aToolId ); - //createTool( VISU_PARTIAL_SELECTION, aToolId ); aToolId = createTool(tr("TOOL_SELECTION")); createTool( VISU_SELECTION_PANEL, aToolId ); @@ -2586,8 +2545,6 @@ VisuGUI mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties - //mgr->insert( action( VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info - mgr->insert( action( VISU_MULTIPR_FULL_RES ), -1, -1, -1 ); mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 ); mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 ); @@ -2748,10 +2705,6 @@ VisuGUI aRule = "client='VTKViewer' and selcount=1 and ($type in {" + aSimplePrsAll + "})"; mgr->setRule( action( VISU_SWEEP ), aRule ); - // "Selection info" popup item - //aRule = "client='VTKViewer' and selcount=1" + anInsideType; - //mgr->setRule( action( VISU_SELECTION_INFO ), aRule ); - aRule = "client='ObjectBrowser' and selcount>0"; aRule += " and $type in {'VISU::TFIELD'}"; aRule += " and nbTimeStamps>1"; @@ -2792,19 +2745,14 @@ VisuGUI } } -void VisuGUI::createInputPanel() -{ - myInputPanel = new VisuGUI_InputPanel(); - myInputPanel->hide(); - //myInputPanel->resize( getApp()->objectBrowser()->width(), myInputPanel->height() ); - GetDesktop(this)->addDockWidget( Qt::RightDockWidgetArea, myInputPanel ); -} - void VisuGUI::createSelectionPanel() { mySelectionPanel = new VisuGUI_SelectionPanel( this ); - mySelectionPanel->update(); + mySelectionPanel->hide(); + connect( mySelectionPanel, SIGNAL( selectionModeChanged( int ) ), this, SLOT( OnSwitchSelectionMode( int ) ) ); + + GetDesktop(this)->addDockWidget( Qt::RightDockWidgetArea, mySelectionPanel ); } //*************************************************************************** @@ -3022,8 +2970,7 @@ VisuGUI setMenuShown( false ); setToolShown( false ); - myInputPanel->clear(); - myInputPanel->hide(); + mySelectionPanel->hide(); // Unset actions accelerator keys action(VISU_IMPORT_FROM_FILE)->setShortcuts(QKeySequence::UnknownKey); diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index 61351cfa..9d9e6ac3 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -41,7 +41,6 @@ class SUIT_ViewManager; class SVTK_ViewWindow; -class VisuGUI_InputPanel; class VisuGUI_SelectionPanel; class VisuGUI_Slider; class VisuGUI_Sweep; @@ -85,9 +84,6 @@ public: VISU::TViewToPrs3d& getScalarBarsMap(); - VisuGUI_InputPanel* inputPanel() const { return myInputPanel; } - VisuGUI_SelectionPanel* selectionPanel() const { return mySelectionPanel; } - signals: void moduleDeactivated(); void moduleActivated(); @@ -177,8 +173,6 @@ protected slots: void OnCopyPresentation(); - void OnSelectionInfo(); - void OnTranslatePrs(); void OnArrangeActors(); void OnPlot3dFromCutPlane(); @@ -203,11 +197,9 @@ private: void createToolBars(); void createPopupMenus(); - void createInputPanel(); void createSelectionPanel(); private: - VisuGUI_InputPanel* myInputPanel; VisuGUI_SelectionPanel* mySelectionPanel; VisuGUI_Slider* mySlider; VisuGUI_Sweep* mySweep; diff --git a/src/VISUGUI/VisuGUI_Panel.cxx b/src/VISUGUI/VisuGUI_Panel.cxx new file mode 100755 index 00000000..fb846ba9 --- /dev/null +++ b/src/VISUGUI/VisuGUI_Panel.cxx @@ -0,0 +1,238 @@ +// VISU VISUGUI : GUI of VISU component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VisuGUI_Panel.cxx +// Author : Oleg Uvarov +// Module : VISU + +#include "VisuGUI_Panel.h" +#include "VisuGUI_Tools.h" + +#include "SUIT_ResourceMgr.h" + +#include +#include +#include +#include +#include + +/*! + \class MainFrame + \internal + \brief Frame inserted in viewport with redefined sizeHint method + in order to avoid unreasonable increasing of viewport size +*/ +class VisuGUI_Panel::MainFrame : public QFrame +{ +public: + /*! + \brief Constructor. + \param theParent parent widget + */ + MainFrame( QWidget* theParent = 0 ) + : QFrame( theParent ) + { + } + + /*! + \brief Gets frame size hint + \return frame size hint + */ + virtual QSize sizeHint() const + { + return minimumSizeHint(); + } +}; + +/*! + \class VisuGUI_Panel + \brief Base class for VISU interactive dockable panels. + + Set of classes is derived from this class and are intended for representing widgets + (GUI controls) for different operations. VisuGUI_Panel consists of main frame + inserted in scroll view and four push buttons. So all widgets of derived sub-panels + should be inherited from mainframe() instead of “this” pointer. +*/ + +/*! + \brief Constructor creates panels look and feel + \param theName name of the panel + \param theParent parent widget +*/ +VisuGUI_Panel::VisuGUI_Panel( const QString& theName, + QWidget* theParent, + const int theBtns ) + : QtxDockWidget( theName, theParent ), + myOK( 0 ), + myApply( 0 ), + myClose( 0 ), + myHelp( 0 ) +{ + QWidget* aGrp = new QWidget( this ); + setWidget( aGrp ); + + // Create scroll view + myView = new QScrollArea( aGrp ); + + // Create main frame + myMainFrame = new MainFrame( myView ); + myMainFrame->setFrameStyle( QFrame::Plain | QFrame::NoFrame ); + + myView->setWidget( myMainFrame ); + myView->setAlignment( Qt::AlignCenter ); + myView->setWidgetResizable( true ); + myView->setMinimumWidth( myMainFrame->sizeHint().width() + 22 ); + + // Create buttons + QWidget* aBtnWg = new QWidget( aGrp ); + QHBoxLayout* aBtnWgLayout = new QHBoxLayout( aBtnWg ); + //aBtnWgLayout->setSpacing( 5 ); + + aBtnWgLayout->addStretch(); + + if( theBtns & OKBtn ) + { + myOK = new QPushButton( tr( "BUT_OK" ), aBtnWg ); + aBtnWgLayout->addWidget( myOK ); + connect( myOK, SIGNAL( clicked() ), SLOT( onOK() ) ); + } + if( theBtns & ApplyBtn ) + { + myApply = new QPushButton( tr( "BUT_APPLY" ), aBtnWg ); + aBtnWgLayout->addWidget( myApply ); + connect( myApply, SIGNAL( clicked() ), SLOT( onApply() ) ); + } + if( theBtns & CloseBtn ) + { + myClose = new QPushButton( tr( "BUT_CLOSE" ), aBtnWg ); + aBtnWgLayout->addWidget( myClose ); + connect( myClose, SIGNAL( clicked() ), SLOT( onClose() ) ); + } + if( theBtns & HelpBtn ) + { + myHelp = new QPushButton( tr( "BUT_HELP" ), aBtnWg ); + aBtnWgLayout->addWidget( myHelp ); + connect( myHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ); + } + + aBtnWgLayout->addStretch(); + + // fill layout + QVBoxLayout* aLay = new QVBoxLayout( aGrp ); + aLay->setContentsMargins( 0, 0, 0, 0 ); + aLay->addWidget( myView, 1 ); + aLay->addWidget( aBtnWg ); +} + +/*! + \brief Destructor +*/ +VisuGUI_Panel::~VisuGUI_Panel() +{ +} + +/*! + \brief Verifies validity of input data + + This virtual method should be redefined in derived classes. Usually operator + corresponding to the sub-panel calls this method to check validity of input + data when Apply/OK button is pressed. + + \param theErrMsg Error message. + + If data is invalid when panel can return message using this parameter given + clear explanation what is wrong + + \return TRUE if data is valid, FALSE otherwise +*/ +bool VisuGUI_Panel::isValid( QString& /*theErrMsg*/ ) +{ + return true; +} +/*! + \brief Virtual methods should be redefined in derived classes and + clears all GUI controls +*/ +void VisuGUI_Panel::clear() +{ +} + +/*! + \brief Virtual slot called when “OK” button pressed emits corresponding signal. + + This slot moves focus in OK button before emitting signal. Mainly it provides + application with correct moving data from currently edited controls to internal + structure. For example QTable moves data from cell editor to table item when + focus is out. + +*/ +void VisuGUI_Panel::onOK() +{ + if ( myOK ) + { + myOK->setFocus(); + qApp->processEvents(); + } +} + +/*! + \brief Virtual slot called when “Apply” button pressed emits corresponding signal. + \sa onOK +*/ +void VisuGUI_Panel::onApply() +{ + if ( myApply ) + { + myApply->setFocus(); + qApp->processEvents(); + } +} + +/*! + \brief Virtual slot called when “Close” button pressed emits corresponding signal. + \sa onOK +*/ +void VisuGUI_Panel::onClose() +{ + if ( myClose ) + myClose->setFocus(); +} + +/*! + \brief Virtual slot called when “Help” button pressed emits corresponding signal. + \sa onOK +*/ +void VisuGUI_Panel::onHelp() +{ + if ( myHelp ) + myHelp->setFocus(); +} + +/*! + \brief Gets frame inserted in scroll view. All controls of derived + panels should use it as parent + \return QFrame* object +*/ +QFrame* VisuGUI_Panel::mainFrame() +{ + return myMainFrame; +} diff --git a/src/VISUGUI/VisuGUI_Panel.h b/src/VISUGUI/VisuGUI_Panel.h new file mode 100755 index 00000000..989cd523 --- /dev/null +++ b/src/VISUGUI/VisuGUI_Panel.h @@ -0,0 +1,76 @@ +// VISU VISUGUI : GUI of VISU component +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// +// File : VisuGUI_Panel.cxx +// Author : Oleg Uvarov +// Module : VISU + +#ifndef VISUGUI_PANEL_H +#define VISUGUI_PANEL_H + +#include + +class QFrame; +class QScrollArea; +class QPushButton; + +class VisuGUI_Panel : public QtxDockWidget +{ + Q_OBJECT + + class MainFrame; + +public: + enum { OKBtn = 0x0001, + ApplyBtn = 0x0002, + CloseBtn = 0x0004, + HelpBtn = 0x0008, + AllBtn = OKBtn | ApplyBtn | CloseBtn | HelpBtn + }; + +public: + VisuGUI_Panel( const QString& theName, QWidget* theParent, const int theBtns = AllBtn ); + virtual ~VisuGUI_Panel(); + + virtual bool isValid( QString& theMessage ); + virtual void clear(); + +protected slots: + virtual void onOK(); + virtual void onApply(); + virtual void onClose(); + virtual void onHelp(); + +protected: + QFrame* mainFrame(); + +protected: + QScrollArea* myView; + QFrame* myMainFrame; + + QPushButton* myOK; + QPushButton* myApply; + QPushButton* myClose; + QPushButton* myHelp; +}; + +#endif diff --git a/src/VISUGUI/VisuGUI_SelectionPanel.cxx b/src/VISUGUI/VisuGUI_SelectionPanel.cxx index 63d5ff18..e4cc403d 100644 --- a/src/VISUGUI/VisuGUI_SelectionPanel.cxx +++ b/src/VISUGUI/VisuGUI_SelectionPanel.cxx @@ -123,13 +123,12 @@ public: }; VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModule, QWidget* theParent ) : - VisuGUI_BasePanel( tr("WINDOW_TITLE" ), theParent, /*ApplyBtn | */CloseBtn | HelpBtn ), + VisuGUI_Panel( tr("WINDOW_TITLE" ), theParent, CloseBtn | HelpBtn ), myModule( theModule ), mySelectionMgr( 0 ), myPreferencesDlg( 0 ) { QVBoxLayout* TopLayout = new QVBoxLayout ( mainFrame() ); - //TopLayout->setSpacing(6); QWidget* aNamePane = new QWidget (mainFrame()); QGridLayout* aNameLay = new QGridLayout (aNamePane); @@ -156,9 +155,9 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModul aLabels.append( "X" ); aLabels.append( "Y" ); aLabels.append( "Z" ); - aLabels.append( "I" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing - aLabels.append( "J" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing - aLabels.append( "K" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing + aLabels.append( "I" ); + aLabels.append( "J" ); + aLabels.append( "K" ); aLabels.append( tr("DATA_SCALAR_HDR") ); aLabels.append( tr("DATA_VECTOR_HDR") ); @@ -168,7 +167,6 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModul QGroupBox* aDataGrp = new QGroupBox ( tr("POINT_DATA_TITLE"), myPointsPane); QGridLayout* aGridLay = new QGridLayout (aDataGrp); - //aGridLay->setSpacing(6); aGridLay->addWidget( new QLabel (tr("DATA_ID_LBL"), aDataGrp) , 0, 0 ); @@ -194,9 +192,9 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModul myListPoints->setColumnWidth(1, 40); myListPoints->setColumnWidth(2, 40); myListPoints->setColumnWidth(3, 40); - myListPoints->setColumnWidth(4, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing - myListPoints->setColumnWidth(5, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing - myListPoints->setColumnWidth(6, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing + myListPoints->setColumnWidth(4, 40); + myListPoints->setColumnWidth(5, 40); + myListPoints->setColumnWidth(6, 40); myListPoints->setSelectionMode(QAbstractItemView::NoSelection); myListPoints->setHorizontalHeaderLabels( aLabels ); @@ -205,7 +203,6 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModul // Create Cells pane myCellsPane = new QWidget (mainFrame()); QGridLayout* aCellLayout = new QGridLayout (myCellsPane); - //aCellLayout->setSpacing(6); aCellLayout->setRowStretch(0, 0); aCellLayout->setRowStretch(1, 1); @@ -240,9 +237,9 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModul myCellListPoints->setColumnWidth(1, 40); myCellListPoints->setColumnWidth(2, 40); myCellListPoints->setColumnWidth(3, 40); - myCellListPoints->setColumnWidth(4, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing - myCellListPoints->setColumnWidth(5, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing - myCellListPoints->setColumnWidth(6, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing + myCellListPoints->setColumnWidth(4, 40); + myCellListPoints->setColumnWidth(5, 40); + myCellListPoints->setColumnWidth(6, 40); myCellListPoints->setSelectionMode(QAbstractItemView::NoSelection); myCellListPoints->setHorizontalHeaderLabels( aLabels ); @@ -251,11 +248,9 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModul // Actor Pane myActorsPane = new QWidget (mainFrame()); aVBoxLayout = new QVBoxLayout(myActorsPane); - //aVBoxLayout->setSpacing(6); QGroupBox* aPosGrp = new QGroupBox (tr("ACTOR_DATA_POSITION_TITLE"), myActorsPane); aGridLay = new QGridLayout (aPosGrp); - //aGridLay->setSpacing(6); aGridLay->addWidget( new QLabel ("X:", aPosGrp), 0, 0); myXPosLbl = new QLabel ("0", aPosGrp); aGridLay->addWidget( myXPosLbl, 0, 1); @@ -270,7 +265,6 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModul QGroupBox* aSizeGrp = new QGroupBox ( tr("ACTOR_DATA_SIZE_TITLE"), myActorsPane); aGridLay = new QGridLayout (aSizeGrp); - //aGridLay->setSpacing(6); aGridLay->addWidget( new QLabel ("dX:", aSizeGrp ), 0, 0); myDXLbl = new QLabel ("0", aSizeGrp); aGridLay->addWidget( myDXLbl, 0, 1); @@ -315,8 +309,6 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModul mySelectionMgr = anApp->selectionMgr(); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionEvent())); - //connect(visuGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close())); - myFl = false; // Activate Points pane @@ -382,13 +374,13 @@ void VisuGUI_SelectionPanel::onSelectionModeChanged( int theId ) void VisuGUI_SelectionPanel::showEvent( QShowEvent* theEvent ) { - VisuGUI_BasePanel::showEvent(theEvent); + VisuGUI_Panel::showEvent(theEvent); } void VisuGUI_SelectionPanel::closeEvent( QCloseEvent* theEvent ) { onClose(); - VisuGUI_BasePanel::closeEvent(theEvent); + VisuGUI_Panel::closeEvent(theEvent); } template QString getValue(TData* theData, int theId){ @@ -564,7 +556,7 @@ void VisuGUI_SelectionPanel::onSelectionEvent() { for (int i = 0; anIter != aPointCoordsMap.end() && i < aTable->rowCount(); anIter++, i++) { aTable->model()->setHeaderData( i, Qt::Vertical, QVariant(QString::number( i )), Qt::DisplayRole ); vtkIdType aNodeObjId = anIter->first; - //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing + VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(aNodeObjId); QString aI,aJ,aK; aI = "-"; @@ -579,17 +571,16 @@ void VisuGUI_SelectionPanel::onSelectionEvent() { aI = QString::number(aVec[0]); break; } - //ENK: 23.11.2006 - + QAbstractItemModel* aModel = aTable->model(); aModel->setData( aModel->index(i,0), QVariant(QString::number( aNodeObjId )), Qt::DisplayRole ); const TCoordArray& aCoordArray = anIter->second; aModel->setData( aModel->index(i,1), QVariant(QString::number( aCoordArray[0] )), Qt::DisplayRole ); aModel->setData( aModel->index(i,2), QVariant(QString::number( aCoordArray[1] )), Qt::DisplayRole ); aModel->setData( aModel->index(i,3), QVariant(QString::number( aCoordArray[2] )), Qt::DisplayRole ); - aModel->setData( aModel->index(i,4), QVariant( aI ), Qt::DisplayRole );//ENK: 23.11.2006 - PAL13176 - aModel->setData( aModel->index(i,5), QVariant( aJ ), Qt::DisplayRole );//ENK: 23.11.2006 - PAL13176 - aModel->setData( aModel->index(i,6), QVariant( aK ), Qt::DisplayRole );//ENK: 23.11.2006 - PAL13176 + aModel->setData( aModel->index(i,4), QVariant( aI ), Qt::DisplayRole ); + aModel->setData( aModel->index(i,5), QVariant( aJ ), Qt::DisplayRole ); + aModel->setData( aModel->index(i,6), QVariant( aK ), Qt::DisplayRole ); vtkIdType aNodeVTKId = anVISUActor->GetNodeVTKID(aNodeObjId); aModel->setData( aModel->index(i,7), QVariant(getValue(aPntData, aNodeVTKId)), Qt::DisplayRole ); @@ -759,13 +750,13 @@ void VisuGUI_SelectionPanel::onPreferences() void VisuGUI_SelectionPanel::onApply() { - VisuGUI_BasePanel::onApply(); + VisuGUI_Panel::onApply(); } void VisuGUI_SelectionPanel::onClose() { close(); - VisuGUI_BasePanel::onClose(); + VisuGUI_Panel::onClose(); } void VisuGUI_SelectionPanel::onHelp() @@ -786,12 +777,12 @@ void VisuGUI_SelectionPanel::onHelp() arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) ); } - VisuGUI_BasePanel::onHelp(); + VisuGUI_Panel::onHelp(); } void VisuGUI_SelectionPanel::keyPressEvent( QKeyEvent* e ) { - VisuGUI_BasePanel::keyPressEvent( e ); + VisuGUI_Panel::keyPressEvent( e ); if ( e->isAccepted() ) return; diff --git a/src/VISUGUI/VisuGUI_SelectionPanel.h b/src/VISUGUI/VisuGUI_SelectionPanel.h index 3923c4fc..870597ac 100644 --- a/src/VISUGUI/VisuGUI_SelectionPanel.h +++ b/src/VISUGUI/VisuGUI_SelectionPanel.h @@ -29,7 +29,7 @@ #ifndef VISUGUI_SELECTIONPANEL_H #define VISUGUI_SELECTIONPANEL_H -#include +#include #include @@ -47,7 +47,7 @@ class VisuGUI_GaussPointsSelectionPane; class VisuGUI_FindPane; class VisuGUI_SelectionPrefDlg; -class VisuGUI_SelectionPanel: public VisuGUI_BasePanel +class VisuGUI_SelectionPanel: public VisuGUI_Panel { Q_OBJECT -- 2.39.2