// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : VisuGUI_MagnitudeDlg.cxx
-// Author : Laurent CORNABE & Hubert ROLLAND
+// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
// $Header$
using namespace std;
/*!
- Constructor
-*/
+ * Constructor
+ */
VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg(QWidget* parent)
- : QDialog( parent, "VisuGUI_DeformedShapeDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+ : QDialog(parent, "VisuGUI_DeformedShapeDlg", true, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
setCaption(tr("DLG_TITLE"));
- setSizeGripEnabled( TRUE );
-
- QVBoxLayout* TopLayout = new QVBoxLayout( this );
- TopLayout->setSpacing( 6 );
- TopLayout->setMargin( 11 );
-
- QTabWidget* aTabBox = new QTabWidget(this);
-
- QVBox* aBox = new QVBox(this);
- aBox->setMargin( 11 );
- QFrame* TopGroup = new QFrame( aBox, "TopGroup" );
+ setSizeGripEnabled(TRUE);
+
+ QVBoxLayout* TopLayout = new QVBoxLayout (this);
+ TopLayout->setSpacing(6);
+ TopLayout->setMargin(11);
+
+ QTabWidget* aTabBox = new QTabWidget (this);
+
+ // Deformed shape pane
+ QVBox* aBox = new QVBox (this);
+ aBox->setMargin(11);
+ QFrame* TopGroup = new QFrame (aBox, "TopGroup");
TopGroup->setFrameStyle(QFrame::Box | QFrame::Sunken);
TopGroup->setLineWidth(1);
- QGridLayout* TopGroupLayout = new QGridLayout( TopGroup );
- TopGroupLayout->setAlignment( Qt::AlignTop | Qt::AlignCenter );
- TopGroupLayout->setSpacing( 6 );
- TopGroupLayout->setMargin( 11 );
+ QGridLayout* TopGroupLayout = new QGridLayout (TopGroup);
+ TopGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ TopGroupLayout->setSpacing(6);
+ TopGroupLayout->setMargin(11);
+ // Scale factor
QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup, "ScaleLabel");
- TopGroupLayout->addWidget( ScaleLabel, 0, 0 );
+ TopGroupLayout->addWidget(ScaleLabel, 0, 0);
- ScalFact = new QtxDblSpinBox( 0.0, 1.0E+38, 0.1, TopGroup);
+ ScalFact = new QtxDblSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
+ ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
ScalFact->setPrecision(5);
- ScalFact->setValue( 0.1 );
- TopGroupLayout->addWidget( ScalFact, 0, 1 );
+ ScalFact->setValue(0.1);
+ TopGroupLayout->addWidget(ScalFact, 0, 1);
+ // Magnitude coloring
UseMagn = new QCheckBox (tr("MAGNITUDE_COLORING"), TopGroup, "UseMagn");
UseMagn->setChecked(true);
TopGroupLayout->addMultiCellWidget(UseMagn, 1, 1, 0, 1);
- //if (!enableUM)
- // UseMagn->hide();
+
aTabBox->addTab(aBox, tr("DEFORMED_SHAPE_TAB"));
-
- myScalarPane = new VisuGUI_ScalarBarPane(this, false);
- myScalarPane->setMargin( 5 );
- aTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB"));
+ // Scalar bar pane
+ myScalarPane = new VisuGUI_ScalarBarPane (this, false);
+ myScalarPane->setMargin(5);
+
+ aTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB"));
- QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
- GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
- GroupButtons->setColumnLayout(0, Qt::Vertical );
- GroupButtons->layout()->setSpacing( 0 );
- GroupButtons->layout()->setMargin( 0 );
- QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
- GroupButtonsLayout->setAlignment( Qt::AlignTop );
- GroupButtonsLayout->setSpacing( 6 );
- GroupButtonsLayout->setMargin( 11 );
-
- QPushButton* buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" );
- buttonOk->setAutoDefault( TRUE );
- buttonOk->setDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
- GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
- QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" );
- buttonCancel->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
-
- TopLayout->addWidget( aTabBox );
- TopLayout->addWidget( GroupButtons );
+ // Buttons
+ QGroupBox* GroupButtons = new QGroupBox (this, "GroupButtons");
+ GroupButtons->setGeometry(QRect(10, 10, 281, 48));
+ GroupButtons->setColumnLayout(0, Qt::Vertical);
+ GroupButtons->layout()->setSpacing(0);
+ GroupButtons->layout()->setMargin(0);
+ QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons->layout());
+ GroupButtonsLayout->setAlignment(Qt::AlignTop);
+ GroupButtonsLayout->setSpacing(6);
+ GroupButtonsLayout->setMargin(11);
+
+ QPushButton* buttonOk = new QPushButton (tr("&OK"), GroupButtons, "buttonOk");
+ buttonOk->setAutoDefault(TRUE);
+ buttonOk->setDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonOk, 0, 0);
+
+ GroupButtonsLayout->addItem(new QSpacerItem (5, 5, QSizePolicy::Expanding,
+ QSizePolicy::Minimum), 0, 1);
+
+ QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel");
+ buttonCancel->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+
+ // Add Tab box and Buttons to the top layout
+ TopLayout->addWidget(aTabBox);
+ TopLayout->addWidget(GroupButtons);
// signals and slots connections
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
}
-
-void VisuGUI_DeformedShapeDlg::initFromPrsObject(VISU::DeformedShape_i* thePrs) {
+void VisuGUI_DeformedShapeDlg::initFromPrsObject (VISU::DeformedShape_i* thePrs)
+{
myScalarPane->initFromPrsObject(thePrs);
setFactor(thePrs->GetScale());
UseMagn->setChecked(thePrs->IsColored());
}
-
int VisuGUI_DeformedShapeDlg::storeToPrsObject(VISU::DeformedShape_i* thePrs) {
myScalarPane->storeToPrsObject(thePrs);
thePrs->SetScale(getFactor());
return 1;
}
-
void VisuGUI_DeformedShapeDlg::accept() {
if (myScalarPane->check()) QDialog::accept();
}
-