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

SMESHGUI_PrecomputeDlg Class Reference

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

#include <SMESHGUI_ComputeDlg.h>

Inheritance diagram for SMESHGUI_PrecomputeDlg:
Inheritance graph
[legend]

Signals

void preview ()

Public Member Functions

 SMESHGUI_PrecomputeDlg (QWidget *)
 Constructor.
virtual ~SMESHGUI_PrecomputeDlg ()
 Destructor.
void setPreviewModes (const QList< int > &)
 Sets available preview modes.
int getPreviewMode () const
 Returns current preview mesh mode.
SMESHGUI_MeshOrderBoxgetMeshOrderBox () const
 Returns current preview mesh mode.
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

SMESHGUI_MeshOrderBoxmyOrderBox
QPushButton * myPreviewBtn
QtxComboBox * myPreviewMode

Detailed Description

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

Definition at line 242 of file SMESHGUI_ComputeDlg.h.


Constructor & Destructor Documentation

SMESHGUI_PrecomputeDlg::SMESHGUI_PrecomputeDlg ( QWidget parent)

Constructor.

Definition at line 1745 of file SMESHGUI_ComputeDlg.cxx.

References main(), myOrderBox, myPreviewBtn, myPreviewMode, preview(), and SPACING.

 : SMESHGUI_Dialog( parent, false, false, OK | Cancel | Help ),
   myOrderBox(0)
{
  setWindowTitle( tr( "CAPTION" ) );

  setButtonText( OK, tr( "COMPUTE" ) );
  QFrame* main = mainFrame();

  QVBoxLayout* layout = new QVBoxLayout( main );

  myOrderBox = new SMESHGUI_MeshOrderBox( main );
  layout->addWidget(myOrderBox);

  QFrame* frame = new QFrame( main );
  layout->setMargin(0); layout->setSpacing(0);
  layout->addWidget( frame );

  QHBoxLayout* frameLay = new QHBoxLayout( frame );
  frameLay->setMargin(0); frameLay->setSpacing(SPACING);
  
  myPreviewMode = new QtxComboBox( frame );
  frameLay->addWidget( myPreviewMode );

  myPreviewBtn = new QPushButton( tr( "PREVIEW" ), frame );
  frameLay->addWidget( myPreviewBtn );

  connect( myPreviewBtn, SIGNAL( clicked( bool ) ), this, SIGNAL( preview() ) );
}
SMESHGUI_PrecomputeDlg::~SMESHGUI_PrecomputeDlg ( ) [virtual]

Destructor.

Definition at line 1781 of file SMESHGUI_ComputeDlg.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;
}
SMESHGUI_MeshOrderBox * SMESHGUI_PrecomputeDlg::getMeshOrderBox ( ) const

Returns current preview mesh mode.

Definition at line 1821 of file SMESHGUI_ComputeDlg.cxx.

References myOrderBox.

{
  return myOrderBox;
}
int SMESHGUI_PrecomputeDlg::getPreviewMode ( ) const

Returns current preview mesh mode.

Definition at line 1810 of file SMESHGUI_ComputeDlg.cxx.

References myPreviewMode.

{
  return myPreviewMode->currentId();
}
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;
}
void SMESHGUI_PrecomputeDlg.preview ( ) [signal]

Referenced by SMESHGUI_PrecomputeDlg().

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_PrecomputeDlg::setPreviewModes ( const QList< int > &  theModes)

Sets available preview modes.

Definition at line 1791 of file SMESHGUI_ComputeDlg.cxx.

References myPreviewBtn, and myPreviewMode.

{
  myPreviewMode->clear();
  QList<int>::const_iterator it = theModes.constBegin();
  for ( int i = 0; it != theModes.constEnd(); ++it, i++ )
  {
    QString mode = QString( "PREVIEW_%1" ).arg( *it );
    myPreviewMode->addItem( tr( mode.toLatin1().data() ) );
    myPreviewMode->setId( i, *it );
  }
  myPreviewBtn->setEnabled( !theModes.isEmpty() );
}
void SMESHGUI_Dialog::show ( ) [virtual, inherited]

Field Documentation

Definition at line 259 of file SMESHGUI_ComputeDlg.h.

Referenced by getMeshOrderBox(), and SMESHGUI_PrecomputeDlg().

QPushButton* SMESHGUI_PrecomputeDlg.myPreviewBtn [private]

Definition at line 260 of file SMESHGUI_ComputeDlg.h.

Referenced by setPreviewModes(), and SMESHGUI_PrecomputeDlg().

QtxComboBox* SMESHGUI_PrecomputeDlg.myPreviewMode [private]

Definition at line 261 of file SMESHGUI_ComputeDlg.h.

Referenced by getPreviewMode(), setPreviewModes(), and SMESHGUI_PrecomputeDlg().

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