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

SMESHGUI_ShapeByMeshDlg Class Reference

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

#include <SMESHGUI_ShapeByMeshDlg.h>

Inheritance diagram for SMESHGUI_ShapeByMeshDlg:
Inheritance graph
[legend]

Public Member Functions

 SMESHGUI_ShapeByMeshDlg ()
 Dialog to publish a sub-shape of the mesh main shape by selecting mesh elements.
virtual ~SMESHGUI_ShapeByMeshDlg ()
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 Member Functions

QFramecreateMainFrame (QWidget *)
void setMultipleAllowed (bool)

Private Attributes

QGroupBoxmyElemTypeBox
QButtonGroup * myElemTypeGroup
QLineEdit * myElementId
QLineEdit * myGeomName
bool myIsMultipleAllowed

Friends

class SMESHGUI_ShapeByMeshOp

Detailed Description

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

Definition at line 49 of file SMESHGUI_ShapeByMeshDlg.h.


Constructor & Destructor Documentation

SMESHGUI_ShapeByMeshDlg::SMESHGUI_ShapeByMeshDlg ( )

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

Definition at line 83 of file SMESHGUI_ShapeByMeshDlg.cxx.

References createMainFrame(), MARGIN, and SPACING.

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

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

  QFrame* aMainFrame = createMainFrame  (mainFrame());

  aDlgLay->addWidget(aMainFrame);

  aDlgLay->setStretchFactor(aMainFrame, 1);
}
SMESHGUI_ShapeByMeshDlg::~SMESHGUI_ShapeByMeshDlg ( ) [virtual]

Definition at line 152 of file SMESHGUI_ShapeByMeshDlg.cxx.

{
}

Member Function Documentation

QFrame * SMESHGUI_ShapeByMeshDlg::createMainFrame ( QWidget theParent) [private]

Definition at line 103 of file SMESHGUI_ShapeByMeshDlg.cxx.

References MARGIN, myElementId, myElemTypeBox, myElemTypeGroup, myGeomName, myIsMultipleAllowed, and SPACING.

Referenced by SMESHGUI_ShapeByMeshDlg().

{
  QFrame* aMainGrp = new QFrame(theParent);
  QGridLayout* aLayout = new QGridLayout(aMainGrp);
  aLayout->setMargin(0);
  aLayout->setSpacing(SPACING);

  // elem type
  myElemTypeBox = new QGroupBox(tr("SMESH_ELEMENT_TYPE"), aMainGrp);
  myElemTypeGroup = new QButtonGroup(aMainGrp);
  QHBoxLayout* myElemTypeBoxLayout = new QHBoxLayout(myElemTypeBox);
  myElemTypeBoxLayout->setMargin(MARGIN);
  myElemTypeBoxLayout->setSpacing(SPACING);

  QRadioButton* aEdgeRb   = new QRadioButton( tr("SMESH_EDGE"),   myElemTypeBox);
  QRadioButton* aFaceRb   = new QRadioButton( tr("SMESH_FACE"),   myElemTypeBox);
  QRadioButton* aVolumeRb = new QRadioButton( tr("SMESH_VOLUME"), myElemTypeBox);
  
  myElemTypeBoxLayout->addWidget(aEdgeRb);
  myElemTypeBoxLayout->addWidget(aFaceRb);
  myElemTypeBoxLayout->addWidget(aVolumeRb);
  myElemTypeGroup->addButton(aEdgeRb, 0);
  myElemTypeGroup->addButton(aFaceRb, 1);
  myElemTypeGroup->addButton(aVolumeRb, 2);
  aEdgeRb->setChecked(true);
  
  // element id
  QLabel* anIdLabel = new QLabel( tr("ELEMENT_ID"), aMainGrp );
  myElementId = new QLineEdit( aMainGrp );
  myElementId->setValidator( new SMESHGUI_IdValidator( theParent, 
                                                       !myIsMultipleAllowed ? 1 : 0 ) ); // 0 for any number of entities

  // shape name
  QLabel* aNameLabel = new QLabel( tr("GEOMETRY_NAME"), aMainGrp );
  myGeomName = new QLineEdit( aMainGrp );

  aLayout->addWidget(myElemTypeBox, 0, 0, 1, 2);
  aLayout->addWidget(anIdLabel,   1, 0);
  aLayout->addWidget(myElementId, 1, 1);
  aLayout->addWidget(aNameLabel,  2, 0);
  aLayout->addWidget(myGeomName,  2, 1);

  return aMainGrp;
}
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_ShapeByMeshDlg::setMultipleAllowed ( bool  isAllowed) [private]

Definition at line 156 of file SMESHGUI_ShapeByMeshDlg.cxx.

References myIsMultipleAllowed.

Referenced by SMESHGUI_ShapeByMeshOp.SMESHGUI_ShapeByMeshOp().

{
  myIsMultipleAllowed = isAllowed;
}
void SMESHGUI_Dialog::show ( ) [virtual, inherited]

Friends And Related Function Documentation

friend class SMESHGUI_ShapeByMeshOp [friend]

Definition at line 68 of file SMESHGUI_ShapeByMeshDlg.h.


Field Documentation

Definition at line 60 of file SMESHGUI_ShapeByMeshDlg.h.

Referenced by createMainFrame().

QButtonGroup* SMESHGUI_ShapeByMeshDlg.myElemTypeGroup [private]
QLineEdit* SMESHGUI_ShapeByMeshDlg.myGeomName [private]

Definition at line 65 of file SMESHGUI_ShapeByMeshDlg.h.

Referenced by createMainFrame(), and setMultipleAllowed().

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