Version: 6.3.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | Friends

SMESHGUI_MakeNodeAtPointDlg Class Reference

Dialog to make a mesh pass through a point. More...

#include <SMESHGUI_MakeNodeAtPointDlg.h>

Inheritance diagram for SMESHGUI_MakeNodeAtPointDlg:
Inheritance graph
[legend]

Public Member Functions

 SMESHGUI_MakeNodeAtPointDlg ()
 Dialog to publish a sub-shape of the mesh main shape by selecting mesh elements.
virtual void show ()
virtual void setContentActive (const bool)
 set all content to enable (parameter is true) or disable state

Static Public Member Functions

static int prefix (const QString &)
 Return hard-coded prefix using to differ overlapping types.

Protected Member Functions

SUIT_Desktop * desktop () const
 find desktop of active application
SUIT_ResourceMgr * resourceMgr () const
 gets resource manager

Private Slots

void ButtonToggled (bool)
 SLOT called when any button is toggled.

Private Member Functions

QWidgetcreateMainFrame (QWidget *)

Private Attributes

QPushButton * myCoordBtn
SMESHGUI_SpinBoxmyX
SMESHGUI_SpinBoxmyY
SMESHGUI_SpinBoxmyZ
QGroupBoxmyNodeToMoveGrp
QPushButton * myIdBtn
QLineEdit * myId
SMESHGUI_SpinBoxmyCurrentX
SMESHGUI_SpinBoxmyCurrentY
SMESHGUI_SpinBoxmyCurrentZ
SMESHGUI_SpinBoxmyDX
SMESHGUI_SpinBoxmyDY
SMESHGUI_SpinBoxmyDZ
QCheckBox * myAutoSearchChkBox
QCheckBox * myPreviewChkBox
QString myHelpFileName

Friends

class SMESHGUI_MakeNodeAtPointOp

Detailed Description

Dialog to make a mesh pass through a point.

Definition at line 86 of file SMESHGUI_MakeNodeAtPointDlg.h.


Constructor & Destructor Documentation

SMESHGUI_MakeNodeAtPointDlg::SMESHGUI_MakeNodeAtPointDlg ( )

Dialog to publish a sub-shape of the mesh main shape by selecting mesh elements.

Definition at line 89 of file SMESHGUI_MakeNodeAtPointDlg.cxx.

References createMainFrame(), and SPACING.

  : SMESHGUI_Dialog( 0, false, true )
{
  setWindowTitle(tr("CAPTION"));

  QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame());
  aDlgLay->setMargin(0);
  aDlgLay->setSpacing(SPACING);

  QWidget* aMainFrame = createMainFrame  (mainFrame());

  aDlgLay->addWidget(aMainFrame);

  aDlgLay->setStretchFactor(aMainFrame, 1);
}

Member Function Documentation

void SMESHGUI_MakeNodeAtPointDlg::ButtonToggled ( bool  on) [private, slot]

SLOT called when any button is toggled.

Parameters:
bool- on or off

Definition at line 271 of file SMESHGUI_MakeNodeAtPointDlg.cxx.

References myAutoSearchChkBox, myCoordBtn, myCurrentX, myCurrentY, myCurrentZ, myDX, myDY, myDZ, myId, myIdBtn, and SMESHGUI_SpinBox.SetValue().

Referenced by createMainFrame().

{
  const QObject* aSender = sender();
  if ( on ) {
    if ( aSender == myCoordBtn ) // button to set coord by node selection
    {
      if ( myIdBtn->isEnabled() )
        myIdBtn->setChecked( !on );
    }
    else if ( aSender == myIdBtn ) // button to select a node to move
    {
      myCoordBtn->setChecked( !on );
    }
  }      
  if ( aSender == myAutoSearchChkBox ) // automatic node search
  {
    if ( on ) {
      myCurrentX->SetValue(0);
      myCurrentY->SetValue(0);
      myCurrentZ->SetValue(0);
      myDX->SetValue(0);
      myDY->SetValue(0);
      myDZ->SetValue(0);
      myId->setText("");
      myId->setReadOnly ( true );
      myIdBtn->setChecked( false );
      myIdBtn->setEnabled( false );
      myCoordBtn->setChecked( true );
    }
    else {
      myId->setReadOnly ( false );
      myIdBtn->setEnabled( true );
    }
  }
}
QWidget * SMESHGUI_MakeNodeAtPointDlg::createMainFrame ( QWidget theParent) [private]

Definition at line 109 of file SMESHGUI_MakeNodeAtPointDlg.cxx.

References ButtonToggled(), COORD_MAX, COORD_MIN, SMESH.GetResourceMgr(), SMESHGUI.GetSMESHGUI(), MARGIN, myAutoSearchChkBox, myCoordBtn, myCurrentX, myCurrentY, myCurrentZ, myDX, myDY, myDZ, myId, myIdBtn, myNodeToMoveGrp, myPreviewChkBox, myX, myY, myZ, SMESHGUI_SpinBox.RangeStepAndValidator(), and SPACING.

Referenced by SMESHGUI_MakeNodeAtPointDlg().

{
  QWidget* aFrame = new QWidget(theParent);

  SUIT_ResourceMgr* rm = SMESH::GetResourceMgr( SMESHGUI::GetSMESHGUI() );
  QPixmap iconMoveNode (rm->loadPixmap("SMESH", tr("ICON_DLG_MOVE_NODE")));
  QPixmap iconSelect   (rm->loadPixmap("SMESH", tr("ICON_SELECT")));

  // constructor

  QGroupBox* aPixGrp = new QGroupBox(tr("MOVE_NODE"), aFrame);
  QButtonGroup* aBtnGrp = new QButtonGroup(this);
  QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp);
  aPixGrpLayout->setMargin(MARGIN);
  aPixGrpLayout->setSpacing(SPACING);

  QRadioButton* aRBut = new QRadioButton(aPixGrp);
  aRBut->setIcon(iconMoveNode);
  aRBut->setChecked(true);
  aPixGrpLayout->addWidget(aRBut);
  aBtnGrp->addButton(aRBut, 0);

  // coordinates

  QGroupBox* aCoordGrp = new QGroupBox(tr("DESTINATION"), aFrame);
  QHBoxLayout* aCoordGrpLayout = new QHBoxLayout(aCoordGrp);
  aCoordGrpLayout->setMargin(MARGIN);
  aCoordGrpLayout->setSpacing(SPACING);

  myCoordBtn = new QPushButton(aCoordGrp);
  myCoordBtn->setIcon(iconSelect);
  myCoordBtn->setCheckable(true);

  QLabel* aXLabel = new QLabel(tr("SMESH_X"), aCoordGrp);
  myX = new SMESHGUI_SpinBox(aCoordGrp);

  QLabel* aYLabel = new QLabel(tr("SMESH_Y"), aCoordGrp);
  myY = new SMESHGUI_SpinBox(aCoordGrp);

  QLabel* aZLabel = new QLabel(tr("SMESH_Z"), aCoordGrp);
  myZ = new SMESHGUI_SpinBox(aCoordGrp);

  myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");

  aCoordGrpLayout->addWidget(myCoordBtn);
  aCoordGrpLayout->addWidget(aXLabel);
  aCoordGrpLayout->addWidget(myX);
  aCoordGrpLayout->addWidget(aYLabel);
  aCoordGrpLayout->addWidget(myY);
  aCoordGrpLayout->addWidget(aZLabel);
  aCoordGrpLayout->addWidget(myZ);
  aCoordGrpLayout->setStretchFactor(myX, 1);
  aCoordGrpLayout->setStretchFactor(myY, 1);
  aCoordGrpLayout->setStretchFactor(myZ, 1);

  // node ID

  myNodeToMoveGrp = new QGroupBox(tr("NODE_2MOVE"), aFrame);

  QLabel* idLabel = new QLabel(tr("NODE_2MOVE_ID"), myNodeToMoveGrp);
  myIdBtn = new QPushButton(myNodeToMoveGrp);
  myIdBtn->setIcon(iconSelect);
  myIdBtn->setCheckable(true);
  myId = new QLineEdit(myNodeToMoveGrp);
  myId->setValidator(new SMESHGUI_IdValidator(this, 1));

  QWidget* aCoordWidget = new QWidget(myNodeToMoveGrp);

  QLabel* aCurrentXLabel = new QLabel(tr("SMESH_X"), aCoordWidget);
  myCurrentX = new SMESHGUI_SpinBox(aCoordWidget);
  myCurrentX->setButtonSymbols(QAbstractSpinBox::NoButtons);
  myCurrentX->setReadOnly(true);

  QLabel* aCurrentYLabel = new QLabel(tr("SMESH_Y"), aCoordWidget);
  myCurrentY = new SMESHGUI_SpinBox(aCoordWidget);
  myCurrentY->setButtonSymbols(QAbstractSpinBox::NoButtons);
  myCurrentY->setReadOnly(true);

  QLabel* aCurrentZLabel = new QLabel(tr("SMESH_Z"), aCoordWidget);
  myCurrentZ = new SMESHGUI_SpinBox(aCoordWidget);
  myCurrentZ->setButtonSymbols(QAbstractSpinBox::NoButtons);
  myCurrentZ->setReadOnly(true);

  QLabel* aDXLabel = new QLabel(tr("SMESH_DX"), aCoordWidget);
  myDX = new SMESHGUI_SpinBox(aCoordWidget);
  myDX->setButtonSymbols(QAbstractSpinBox::NoButtons);
  myDX->setReadOnly(true);

  QLabel* aDYLabel = new QLabel(tr("SMESH_DY"), aCoordWidget);
  myDY = new SMESHGUI_SpinBox(aCoordWidget);
  myDY->setButtonSymbols(QAbstractSpinBox::NoButtons);
  myDY->setReadOnly(true);

  QLabel* aDZLabel = new QLabel(tr("SMESH_DZ"), aCoordWidget);
  myDZ = new SMESHGUI_SpinBox(aCoordWidget);
  myDZ->setButtonSymbols(QAbstractSpinBox::NoButtons);
  myDZ->setReadOnly(true);

  myCurrentX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  myCurrentY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  myCurrentZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  myDX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  myDY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  myDZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");

  QGridLayout* aCoordLayout = new QGridLayout(aCoordWidget);
  aCoordLayout->setMargin(0);
  aCoordLayout->setSpacing(SPACING);
  aCoordLayout->addWidget(aCurrentXLabel, 0, 0);
  aCoordLayout->addWidget(myCurrentX,     0, 1);
  aCoordLayout->addWidget(aCurrentYLabel, 0, 2);
  aCoordLayout->addWidget(myCurrentY,     0, 3);
  aCoordLayout->addWidget(aCurrentZLabel, 0, 4);
  aCoordLayout->addWidget(myCurrentZ,     0, 5);
  aCoordLayout->addWidget(aDXLabel,       1, 0);
  aCoordLayout->addWidget(myDX,           1, 1);
  aCoordLayout->addWidget(aDYLabel,       1, 2);
  aCoordLayout->addWidget(myDY,           1, 3);
  aCoordLayout->addWidget(aDZLabel,       1, 4);
  aCoordLayout->addWidget(myDZ,           1, 5);
  aCoordLayout->setColumnStretch(1, 1);
  aCoordLayout->setColumnStretch(3, 1);
  aCoordLayout->setColumnStretch(5, 1);

  myAutoSearchChkBox = new QCheckBox( tr("AUTO_SEARCH"), myNodeToMoveGrp);
  myPreviewChkBox = new QCheckBox( tr("PREVIEW"), myNodeToMoveGrp);

  QGridLayout* myNodeToMoveGrpLayout = new QGridLayout(myNodeToMoveGrp);
  myNodeToMoveGrpLayout->setSpacing(SPACING);
  myNodeToMoveGrpLayout->setMargin(MARGIN);

  myNodeToMoveGrpLayout->addWidget( idLabel, 0, 0 );
  myNodeToMoveGrpLayout->addWidget( myIdBtn, 0, 1 );
  myNodeToMoveGrpLayout->addWidget( myId,    0, 2 );
  myNodeToMoveGrpLayout->addWidget( aCoordWidget,       1, 0, 1, 3 );
  myNodeToMoveGrpLayout->addWidget( myAutoSearchChkBox, 2, 0, 1, 3 );
  myNodeToMoveGrpLayout->addWidget( myPreviewChkBox,    3, 0, 1, 3 );

  QVBoxLayout* aLay = new QVBoxLayout(aFrame);
  aLay->addWidget(aPixGrp);
  aLay->addWidget(aCoordGrp);
  aLay->addWidget(myNodeToMoveGrp);

  connect(myCoordBtn,         SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
  connect(myIdBtn,            SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
  connect(myAutoSearchChkBox, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));

  myIdBtn->setChecked(true);
  myAutoSearchChkBox->setChecked(true);

  return aFrame;
}
SUIT_Desktop * SMESHGUI_Dialog::desktop ( ) const [protected, inherited]

find desktop of active application

Definition at line 93 of file SMESHGUI_Dialog.cxx.

References ex13_hole1partial.d.

{
  SUIT_Desktop* d = 0;
  SUIT_Session* s = SUIT_Session::session();
  if( s )
  {
    SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( s->activeApplication() );
    if( app )
      d = app->desktop();
  }
  return d;
}
int SMESHGUI_Dialog::prefix ( const QString &  name) [static, inherited]

Return hard-coded prefix using to differ overlapping types.

Definition at line 110 of file SMESHGUI_Dialog.cxx.

Referenced by SMESHGUI_Dialog.SMESHGUI_Dialog(), and SMESHGUI_SelectionOp.typeById().

{
  if( name == "GEOM" )
    return 100;
  else if( name == "SMESH" )
    return 200;
  else if( name == "SMESH element" )
    return 300;
  else
    return 0;
}
SUIT_ResourceMgr * SMESHGUI_Dialog::resourceMgr ( ) const [protected, inherited]

gets resource manager

Definition at line 126 of file SMESHGUI_Dialog.cxx.

Referenced by SMESHGUI_ComputeDlg.createMainFrame(), and SMESHGUI_GroupOnShapeDlg.SMESHGUI_GroupOnShapeDlg().

{
  return SUIT_Session::session()->resourceMgr();
}
void SMESHGUI_Dialog::setContentActive ( const bool  active) [virtual, inherited]

set all content to enable (parameter is true) or disable state

Definition at line 79 of file SMESHGUI_Dialog.cxx.

Referenced by SMESHGUI_Operation.setDialogActive().

{
  mainFrame()->setEnabled( active );
  setButtonEnabled( active, OK );
  setButtonEnabled( active, Apply );
  setButtonEnabled( active, Cancel );
  setButtonEnabled( active, Close );
  setButtonEnabled( active, Help );
}
void SMESHGUI_Dialog::show ( ) [virtual, inherited]

Friends And Related Function Documentation

friend class SMESHGUI_MakeNodeAtPointOp [friend]

Definition at line 114 of file SMESHGUI_MakeNodeAtPointDlg.h.


Field Documentation

Definition at line 112 of file SMESHGUI_MakeNodeAtPointDlg.h.

QLineEdit* SMESHGUI_MakeNodeAtPointDlg.myId [private]
QPushButton* SMESHGUI_MakeNodeAtPointDlg.myIdBtn [private]

Definition at line 100 of file SMESHGUI_MakeNodeAtPointDlg.h.

Referenced by createMainFrame().

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS