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

SMESHGUI_GroupOnShapeDlg Class Reference

#include <SMESHGUI_GroupOnShapeDlg.h>

Inheritance diagram for SMESHGUI_GroupOnShapeDlg:
Inheritance graph
[legend]

Public Slots

void updateButtons ()
 slot to enable/diable [Apply]
void init ()
 initialization

Public Member Functions

 SMESHGUI_GroupOnShapeDlg ()
virtual ~SMESHGUI_GroupOnShapeDlg ()
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 Attributes

QPushButton * myMeshBtn
QLineEdit * myMeshLine
QPushButton * myElemGeomBtn
QListWidget * myElemGeomList
QPushButton * myNodeGeomBtn
QListWidget * myNodeGeomList

Friends

class SMESHGUI_GroupOnShapeOp

Detailed Description

Definition at line 91 of file SMESHGUI_GroupOnShapeDlg.h.


Constructor & Destructor Documentation

SMESHGUI_GroupOnShapeDlg::SMESHGUI_GroupOnShapeDlg ( )

Definition at line 60 of file SMESHGUI_GroupOnShapeDlg.cxx.

References MARGIN, myElemGeomBtn, myElemGeomList, myMeshBtn, myMeshLine, myNodeGeomBtn, myNodeGeomList, SMESHGUI_Dialog.resourceMgr(), and SPACING.

  : SMESHGUI_Dialog( 0, false, true )
{
  QPixmap image (resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));

  // Name
  //QLabel* nameLabel = new QLabel( tr( "SMESH_NAME" ), mainFrame() );
  //myGrpNameLine = new QLineEdit( mainFrame() );

  // Mesh
  QLabel* meshLabel = new QLabel( tr( "SMESH_OBJECT_MESH" ), mainFrame() );
  myMeshBtn = new QPushButton( mainFrame() );
  myMeshBtn->setCheckable(true);
  myMeshBtn->setIcon(image);
  myMeshLine = new QLineEdit( mainFrame() );
  myMeshLine->setReadOnly(true);

  // Elem geom

  QGroupBox* elemsGrp = new QGroupBox( tr( "SMESH_ELEMENTS" ), mainFrame() );
  QLabel* label = new QLabel( tr( "SMESH_GEOM" ), elemsGrp );
  myElemGeomBtn = new QPushButton( elemsGrp );
  myElemGeomBtn->setCheckable(true);
  myElemGeomBtn->setIcon(image);
  myElemGeomList = new QListWidget( elemsGrp );
  myElemGeomList->setSelectionMode(QListWidget::NoSelection);

  QGridLayout* elemLay = new QGridLayout(elemsGrp);
  elemLay->setSpacing( SPACING );
  elemLay->setMargin( MARGIN );
  elemLay->setRowStretch( 1, 1 );
  elemLay->addWidget( label, 0, 0 );
  elemLay->addWidget( myElemGeomBtn, 0, 1 );
  elemLay->addWidget( myElemGeomList, 0, 2, 2, 1);

  // Node geom

  QGroupBox* nodesGrp = new QGroupBox( tr( "SMESH_NODES" ), mainFrame() );

  label = new QLabel( tr( "SMESH_GEOM" ), nodesGrp );
  myNodeGeomBtn = new QPushButton( nodesGrp );
  myNodeGeomBtn->setCheckable(true);
  myNodeGeomBtn->setIcon(image);
  myNodeGeomList = new QListWidget( nodesGrp );
  myNodeGeomList->setSelectionMode(QListWidget::NoSelection);

  QGridLayout* nodeLay = new QGridLayout(nodesGrp);
  nodeLay->setSpacing( SPACING );
  nodeLay->setMargin( MARGIN );
  nodeLay->setRowStretch( 1, 1 );
  nodeLay->addWidget( label, 0, 0 );
  nodeLay->addWidget( myNodeGeomBtn, 0, 1 );
  nodeLay->addWidget(myNodeGeomList, 0, 2, 2, 1);

  // Fill layout
  QGridLayout* aLay = new QGridLayout( mainFrame());
  aLay->setSpacing( SPACING );
  aLay->setMargin( MARGIN );
  //aLay->addWidget( nameLabel, 0, 0 );
  //aLay->addWidget( myGrpNameLine, 0, 2 );
  aLay->addWidget( meshLabel, 1, 0 );
  aLay->addWidget( myMeshBtn, 1, 1 );
  aLay->addWidget( myMeshLine,1, 2 );
  aLay->addWidget( elemsGrp, 2, 1, 1, 3 );
  aLay->addWidget( nodesGrp, 3, 1, 1, 3 );

  setWindowTitle( tr( "SMESH_CREATE_GROUP_FROM_GEOM" ) );
}
SMESHGUI_GroupOnShapeDlg::~SMESHGUI_GroupOnShapeDlg ( ) [virtual]

Definition at line 129 of file SMESHGUI_GroupOnShapeDlg.cxx.

{
}

Member Function Documentation

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;
}
void SMESHGUI_GroupOnShapeDlg::init ( ) [slot]

initialization

Definition at line 154 of file SMESHGUI_GroupOnShapeDlg.cxx.

References myElemGeomBtn, myElemGeomList, myMeshBtn, myMeshLine, myNodeGeomBtn, myNodeGeomList, and updateButtons().

Referenced by SMESHGUI_GroupOnShapeOp.init().

{
  //myGrpNameLine->setText("");

  myMeshBtn->setChecked( true );
  myMeshLine->setText("");

  myElemGeomBtn->setChecked(false);
  myElemGeomBtn->setEnabled(false);
  myElemGeomList->clear();
  myNodeGeomBtn->setChecked(false);
  myNodeGeomBtn->setEnabled(false);
  myNodeGeomList->clear();

  updateButtons();
}
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().

{
  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]
void SMESHGUI_GroupOnShapeDlg::updateButtons ( ) [slot]

slot to enable/diable [Apply]

myGrpNameLine->text().isEmpty() &&

Definition at line 139 of file SMESHGUI_GroupOnShapeDlg.cxx.

References myElemGeomList, and myNodeGeomList.

Referenced by init(), SMESHGUI_GroupOnShapeOp.onApply(), and SMESHGUI_GroupOnShapeOp.selectionDone().

{
  bool enable = myElemGeomList->count() + myNodeGeomList->count();

  button(Apply)->setEnabled( enable );
  button(OK)->setEnabled( enable );
}

Friends And Related Function Documentation

friend class SMESHGUI_GroupOnShapeOp [friend]

Definition at line 123 of file SMESHGUI_GroupOnShapeDlg.h.


Field Documentation

QPushButton* SMESHGUI_GroupOnShapeDlg.myMeshBtn [private]
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