Back to index

salome-gui  6.5.0
Public Member Functions | Protected Slots | Protected Attributes
SVTK_NonIsometricDlg Class Reference

#include <SVTK_NonIsometricDlg.h>

Collaboration diagram for SVTK_NonIsometricDlg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SVTK_NonIsometricDlg (QtxAction *theAction, SVTK_ViewWindow *theParent, const char *theName)
 Constructor.
 ~SVTK_NonIsometricDlg ()
void Update ()

Protected Slots

void onClickApply ()
void onClickReset ()
void onClickOk ()
void onClickClose ()

Protected Attributes

SVTK_ViewWindow * m_MainWindow
QtxDoubleSpinBoxm_sbXcoeff
QtxDoubleSpinBoxm_sbYcoeff
QtxDoubleSpinBoxm_sbZcoeff
QPushButton * m_bReset

Detailed Description

Definition at line 40 of file SVTK_NonIsometricDlg.h.


Constructor & Destructor Documentation

SVTK_NonIsometricDlg::SVTK_NonIsometricDlg ( QtxAction theAction,
SVTK_ViewWindow *  theParent,
const char *  theName 
)

Constructor.

Definition at line 43 of file SVTK_NonIsometricDlg.cxx.

                                           :
  ViewerTools_DialogBase(theAction,
                         theParent, 
                         theName),
  m_MainWindow(theParent)
{
  setWindowTitle(tr("DLG_TITLE"));
  setSizeGripEnabled(TRUE);

  // Create layout for this dialog
  QGridLayout* layoutDlg = new QGridLayout (this);
  layoutDlg->setSpacing(6);
  layoutDlg->setMargin(11);

  // Create croup box with grid layout
  QGroupBox* aGroupBox = new QGroupBox(this);
  aGroupBox->setObjectName("GroupBox");
  QHBoxLayout* aHBoxLayout = new QHBoxLayout(aGroupBox);
  aHBoxLayout->setMargin(11);
  aHBoxLayout->setSpacing(6);

  // "X" scaling
  QLabel* TextLabelX = new QLabel (tr("LBL_X"), aGroupBox);
  TextLabelX->setObjectName("TextLabelX");
  TextLabelX->setFixedWidth(15);
  m_sbXcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
  m_sbXcoeff->setMinimumWidth(80);
  m_sbXcoeff->setValue(1.0);

  // "Y" scaling
  QLabel* TextLabelY = new QLabel (tr("LBL_Y"), aGroupBox);
  TextLabelY->setObjectName("TextLabelY");
  TextLabelY->setFixedWidth(15);
  m_sbYcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
  m_sbYcoeff->setMinimumWidth(80);
  m_sbYcoeff->setValue(1.0);

  // "Z" scaling
  QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), aGroupBox);
  TextLabelZ->setObjectName("TextLabelZ");
  TextLabelZ->setFixedWidth(15);
  m_sbZcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
  m_sbZcoeff->setMinimumWidth(80);
  m_sbZcoeff->setValue(1.0);

  // Create <Reset> button
  m_bReset = new QPushButton(tr("&Reset"), aGroupBox);
  m_bReset->setObjectName("m_bReset");

  // Layout widgets in the group box
  aHBoxLayout->addWidget(TextLabelX);
  aHBoxLayout->addWidget(m_sbXcoeff);
  aHBoxLayout->addWidget(TextLabelY);
  aHBoxLayout->addWidget(m_sbYcoeff);
  aHBoxLayout->addWidget(TextLabelZ);
  aHBoxLayout->addWidget(m_sbZcoeff);
  //aHBoxLayout->addStretch();
  aHBoxLayout->addWidget(m_bReset);

  // OK, CANCEL, Apply button
  QGroupBox* aGroupBox2 = new QGroupBox(this);
  QHBoxLayout* aHBoxLayout2 = new QHBoxLayout(aGroupBox2);
  aHBoxLayout2->setMargin(11);
  aHBoxLayout2->setSpacing(6);
  // Create <OK> button
  QPushButton* m_bOk = new QPushButton(tr("O&K"), aGroupBox2);
  m_bOk->setObjectName("m_bOk");
  m_bOk->setDefault(TRUE);
  m_bOk->setAutoDefault(TRUE);
  // Create <Apply> button
  QPushButton* m_bApply = new QPushButton(tr("&Apply"), aGroupBox2);
  m_bApply->setObjectName("m_bApply");
  m_bApply->setAutoDefault(TRUE);
  // Create <Cancel> button
  QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aGroupBox2);
  m_bCancel->setObjectName("m_bCancel");
  m_bCancel->setAutoDefault(TRUE);

  // Layout buttons
  aHBoxLayout2->addWidget(m_bOk);
  aHBoxLayout2->addWidget(m_bApply);
  aHBoxLayout2->addStretch();
  aHBoxLayout2->addWidget(m_bCancel);

  // Layout top level widgets
  layoutDlg->addWidget(aGroupBox,0,0);
  layoutDlg->addWidget(aGroupBox2,1,0);

  // signals and slots connections
  connect(m_bCancel, SIGNAL(clicked()), this, SLOT(onClickClose()));
  connect(m_bOk,     SIGNAL(clicked()), this, SLOT(onClickOk()));
  connect(m_bApply,  SIGNAL(clicked()), this, SLOT(onClickApply()));
  connect(m_bReset,  SIGNAL(clicked()), this, SLOT(onClickReset()));

  this->resize(100, this->sizeHint().height());
}

Definition at line 146 of file SVTK_NonIsometricDlg.cxx.

{
  // no need to delete child widgets, Qt does it all for us
}

Member Function Documentation

Definition at line 175 of file SVTK_NonIsometricDlg.cxx.

{
  double aScale[3] = {m_sbXcoeff->value(), m_sbYcoeff->value(), m_sbZcoeff->value()};
  m_MainWindow->SetScale(aScale);
}

Definition at line 193 of file SVTK_NonIsometricDlg.cxx.

{
  reject();
}
void SVTK_NonIsometricDlg::onClickOk ( ) [protected, slot]

Definition at line 165 of file SVTK_NonIsometricDlg.cxx.

{
  //apply changes
  onClickApply();
  //Close dialog
  accept();
}

Definition at line 183 of file SVTK_NonIsometricDlg.cxx.

{
  m_bReset->setFocus();
  m_sbXcoeff->setValue(1.0);
  m_sbYcoeff->setValue(1.0);
  m_sbZcoeff->setValue(1.0);
}

Definition at line 153 of file SVTK_NonIsometricDlg.cxx.

{
  // Get values from the VTK view
  double aScaleFactor[3];
  m_MainWindow->GetScale(aScaleFactor);
  m_sbXcoeff->setValue(aScaleFactor[0]);
  m_sbYcoeff->setValue(aScaleFactor[1]);
  m_sbZcoeff->setValue(aScaleFactor[2]);
}

Member Data Documentation

QPushButton* SVTK_NonIsometricDlg::m_bReset [protected]

Definition at line 59 of file SVTK_NonIsometricDlg.h.

SVTK_ViewWindow* SVTK_NonIsometricDlg::m_MainWindow [protected]

Definition at line 54 of file SVTK_NonIsometricDlg.h.

Definition at line 56 of file SVTK_NonIsometricDlg.h.

Definition at line 57 of file SVTK_NonIsometricDlg.h.

Definition at line 58 of file SVTK_NonIsometricDlg.h.


The documentation for this class was generated from the following files: