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

SMESHGUI_ComputeDlg Class Reference

Dialog to compute a mesh and show computation errors. More...

#include <SMESHGUI_ComputeDlg.h>

Inheritance diagram for SMESHGUI_ComputeDlg:
Inheritance graph
[legend]

Public Member Functions

 SMESHGUI_ComputeDlg (QWidget *, bool)
 Dialog to compute a mesh and show computation errors.
virtual ~SMESHGUI_ComputeDlg ()
 Destructor.
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

QFramecreateMainFrame (QWidget *, bool)
SUIT_Desktop * desktop () const
 find desktop of active application
SUIT_ResourceMgr * resourceMgr () const
 gets resource manager

Protected Attributes

QLabel * myMeshName
QGroupBoxmyMemoryLackGroup
QGroupBoxmyCompErrorGroup
QGroupBoxmyHypErrorGroup
QLabel * myHypErrorLabel
QTableWidgetmyTable
QPushButton * myShowBtn
QPushButton * myPublishBtn
QPushButton * myBadMeshBtn
SMESHGUI_MeshInfosBoxmyBriefInfo
SMESHGUI_MeshInfosBoxmyFullInfo

Friends

class SMESHGUI_BaseComputeOp
class SMESHGUI_PrecomputeOp

Detailed Description

Dialog to compute a mesh and show computation errors.

Definition at line 208 of file SMESHGUI_ComputeDlg.h.


Constructor & Destructor Documentation

SMESHGUI_ComputeDlg::SMESHGUI_ComputeDlg ( QWidget parent,
bool  ForEval 
)

Dialog to compute a mesh and show computation errors.

Definition at line 467 of file SMESHGUI_ComputeDlg.cxx.

References createMainFrame(), and SPACING.

 : SMESHGUI_Dialog( parent, false, true, Close/* | Help*/ )
{
  QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame());
  aDlgLay->setMargin( 0 );
  aDlgLay->setSpacing( SPACING );

  QFrame* aMainFrame = createMainFrame(mainFrame(),ForEval);

  aDlgLay->addWidget(aMainFrame);

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

Destructor.

Definition at line 487 of file SMESHGUI_ComputeDlg.cxx.

{
}

Member Function Documentation

QFrame * SMESHGUI_ComputeDlg::createMainFrame ( QWidget theParent,
bool  ForEval 
) [protected]

Definition at line 496 of file SMESHGUI_ComputeDlg.cxx.

References COL_BAD_MESH, COL_ERROR, COL_PUBLISHED, COL_SHAPEID, MARGIN, myBadMeshBtn, myBriefInfo, myCompErrorGroup, myFullInfo, myHypErrorGroup, myHypErrorLabel, myMemoryLackGroup, myMeshName, myPublishBtn, myShowBtn, myTable, NB_COLUMNS, SMESHGUI_Dialog.resourceMgr(), and SPACING.

Referenced by SMESHGUI_ComputeDlg().

{
  QFrame* aFrame = new QFrame(theParent);

  SUIT_ResourceMgr* rm = resourceMgr();
  QPixmap iconCompute (rm->loadPixmap("SMESH", tr("ICON_COMPUTE")));

  // constructor

  QGroupBox* aPixGrp;
  if(ForEval) {
    aPixGrp = new QGroupBox(tr("EVAL_DLG"), aFrame);
  }
  else {
    aPixGrp = new QGroupBox(tr("CONSTRUCTOR"), aFrame);
  }
  QButtonGroup* aBtnGrp = new QButtonGroup(this);
  QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp);
  aPixGrpLayout->setMargin(MARGIN); aPixGrpLayout->setSpacing(SPACING);

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

  // Mesh name

  QGroupBox* nameBox = new QGroupBox(tr("SMESH_MESHINFO_NAME"), aFrame );
  QHBoxLayout* nameBoxLayout = new QHBoxLayout(nameBox);
  nameBoxLayout->setMargin(MARGIN); nameBoxLayout->setSpacing(SPACING);
  myMeshName = new QLabel(nameBox);
  nameBoxLayout->addWidget(myMeshName);

  // Mesh Info

  myBriefInfo = new SMESHGUI_MeshInfosBox(false, aFrame);
  myFullInfo  = new SMESHGUI_MeshInfosBox(true,  aFrame);

  // Computation errors

  myCompErrorGroup = new QGroupBox(tr("ERRORS"), aFrame);
  myTable      = new QTableWidget( 1, NB_COLUMNS, myCompErrorGroup);
  myShowBtn    = new QPushButton(tr("SHOW_SHAPE"), myCompErrorGroup);
  myPublishBtn = new QPushButton(tr("PUBLISH_SHAPE"), myCompErrorGroup);
  myBadMeshBtn = new QPushButton(tr("SHOW_BAD_MESH"), myCompErrorGroup);

  //myTable->setReadOnly( true ); // VSR: check
  myTable->setEditTriggers( QAbstractItemView::NoEditTriggers );
  myTable->hideColumn( COL_PUBLISHED );
  myTable->hideColumn( COL_SHAPEID );
  myTable->hideColumn( COL_BAD_MESH );
  myTable->horizontalHeader()->setResizeMode( COL_ERROR, QHeaderView::Interactive );

  QStringList headers;
  headers << tr( "COL_ALGO_HEADER" );
  headers << tr( "COL_SHAPE_HEADER" );
  headers << tr( "COL_ERROR_HEADER" );
  headers << tr( "COL_SHAPEID_HEADER" );
  headers << tr( "COL_PUBLISHED_HEADER" );

  myTable->setHorizontalHeaderLabels( headers );

  // layouting
  QGridLayout* grpLayout = new QGridLayout(myCompErrorGroup);
  grpLayout->setSpacing(SPACING);
  grpLayout->setMargin(MARGIN);
  grpLayout->addWidget( myTable,      0, 0, 4, 1 );
  grpLayout->addWidget( myShowBtn,    0, 1 );
  grpLayout->addWidget( myPublishBtn, 1, 1 );
  grpLayout->addWidget( myBadMeshBtn, 2, 1 );
  grpLayout->setRowStretch( 3, 1 );

  // Hypothesis definition errors

  myHypErrorGroup = new QGroupBox(tr("SMESH_WRN_MISSING_PARAMETERS"), aFrame);
  QHBoxLayout* myHypErrorGroupLayout = new QHBoxLayout(myHypErrorGroup);
  myHypErrorGroupLayout->setMargin(MARGIN);
  myHypErrorGroupLayout->setSpacing(SPACING);
  myHypErrorLabel = new QLabel(myHypErrorGroup);
  myHypErrorGroupLayout->addWidget(myHypErrorLabel);

  // Memory Lack Label

  myMemoryLackGroup = new QGroupBox(tr("ERRORS"), aFrame);
  QVBoxLayout* myMemoryLackGroupLayout = new QVBoxLayout(myMemoryLackGroup);
  myMemoryLackGroupLayout->setMargin(MARGIN);
  myMemoryLackGroupLayout->setSpacing(SPACING);
  QLabel* memLackLabel = new QLabel(tr("MEMORY_LACK"), myMemoryLackGroup);
  QFont bold = memLackLabel->font(); bold.setBold(true);
  memLackLabel->setFont( bold );
  memLackLabel->setMinimumWidth(300);
  myMemoryLackGroupLayout->addWidget(memLackLabel);

  // add all widgets to aFrame
  QVBoxLayout* aLay = new QVBoxLayout(aFrame);
  aLay->setMargin( 0 );
  aLay->setSpacing( 0 );
  aLay->addWidget( aPixGrp );
  aLay->addWidget( nameBox );
  aLay->addWidget( myBriefInfo );
  aLay->addWidget( myFullInfo );
  aLay->addWidget( myHypErrorGroup );
  aLay->addWidget( myCompErrorGroup );
  aLay->addWidget( myMemoryLackGroup );
  aLay->setStretchFactor( myCompErrorGroup, 1 );

  ((QPushButton*) button( OK ))->setDefault( 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 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_BaseComputeOp [friend]

Definition at line 232 of file SMESHGUI_ComputeDlg.h.

friend class SMESHGUI_PrecomputeOp [friend]

Definition at line 233 of file SMESHGUI_ComputeDlg.h.


Field Documentation

QPushButton* SMESHGUI_ComputeDlg.myBadMeshBtn [protected]
QLabel* SMESHGUI_ComputeDlg.myMeshName [protected]

Definition at line 219 of file SMESHGUI_ComputeDlg.h.

Referenced by createMainFrame(), and SMESHGUI_PrecomputeOp.onPreview().

QPushButton* SMESHGUI_ComputeDlg.myPublishBtn [protected]
QPushButton* SMESHGUI_ComputeDlg.myShowBtn [protected]
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