Back to index

salome-geom  6.5.0
Public Member Functions | Private Slots | Private Member Functions | Private Attributes
RepairGUI_FreeBoundDlg Class Reference

#include <RepairGUI_FreeBoundDlg.h>

List of all members.

Public Member Functions

 RepairGUI_FreeBoundDlg (GeometryGUI *, QWidget *)
 Class : RepairGUI_FreeBoundDlg Description : Dialog for displaying free boundaries of selected face, shell or solid.
 ~RepairGUI_FreeBoundDlg ()

Private Slots

void onClose ()
void onHelp ()
void onDeactivate ()
void onActivate ()
void onSelectionDone ()

Private Member Functions

void Init ()
void enterEvent (QEvent *)
void closeEvent (QCloseEvent *)
void keyPressEvent (QKeyEvent *)
void activateSelection ()
virtual GEOM::GEOM_IOperations_ptr createOperation ()
virtual bool execute (ObjectList &)
virtual bool isValid (QString &)

Private Attributes

QLineEdit * myEdit
QLabel * myClosedLbl
QLabel * myOpenLbl
GEOM::GEOM_Object_var myObj
GeometryGUI * myGeomGUI
int myNbClosed
int myNbOpen
QString myHelpFileName

Detailed Description

Definition at line 41 of file RepairGUI_FreeBoundDlg.h.


Constructor & Destructor Documentation

RepairGUI_FreeBoundDlg::RepairGUI_FreeBoundDlg ( GeometryGUI *  theGUI,
QWidget *  theParent 
)

Class : RepairGUI_FreeBoundDlg Description : Dialog for displaying free boundaries of selected face, shell or solid.

Definition at line 65 of file RepairGUI_FreeBoundDlg.cxx.

  : QDialog( theParent, 0 ),
    GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( theParent ) ),
    myGeomGUI( theGUI )
{
  setAttribute( Qt::WA_DeleteOnClose );

  setWindowTitle( tr( "CAPTION" ) );

  QPixmap iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
  
  QGroupBox* aMainGrp = new QGroupBox( tr( "FREE_BOUND" ), this );
  
  QLabel* lab = new QLabel( tr( "GEOM_OBJECT" ), aMainGrp );
  QPushButton* btn = new QPushButton( aMainGrp );
  btn->setIcon( iconSelect );
  myEdit = new QLineEdit( aMainGrp );
  myEdit->setReadOnly( true );
  myEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );

  myClosedLbl = new QLabel( tr( "NUMBER_CLOSED" ), aMainGrp );
  myOpenLbl   = new QLabel( tr( "NUMBER_OPEN" ),   aMainGrp );
  myClosedLbl->setMinimumWidth( 150 );
  myOpenLbl->setMinimumWidth( 150 );
  
  QGridLayout* aMainGrpLayout = new QGridLayout( aMainGrp );
  aMainGrpLayout->setMargin( MARGIN ); aMainGrpLayout->setSpacing( SPACING );
  aMainGrpLayout->addWidget( lab,    0, 0 );
  aMainGrpLayout->addWidget( btn,    0, 1 );
  aMainGrpLayout->addWidget( myEdit, 0, 2 );
  aMainGrpLayout->addWidget( myClosedLbl, 1, 0, 1, 3 );
  aMainGrpLayout->addWidget( myOpenLbl,   2, 0, 1, 3 );

  QFrame* aFrame = new QFrame( this );
  aFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
  QPushButton* aCloseBtn = new QPushButton( tr( "GEOM_BUT_CLOSE" ), aFrame );
  QPushButton* aHelpBtn = new QPushButton( tr( "GEOM_BUT_HELP" ), aFrame );
  QHBoxLayout* aBtnLay = new QHBoxLayout( aFrame );
  aBtnLay->setMargin( MARGIN ); aBtnLay->setSpacing( SPACING );
  aBtnLay->addWidget( aCloseBtn );
  aBtnLay->addSpacing( SPACING ); aBtnLay->addStretch();
  aBtnLay->addWidget( aHelpBtn );

  QVBoxLayout* aLay = new QVBoxLayout( this );
  aLay->setSpacing( SPACING );
  aLay->setMargin( MARGIN );
  aLay->addWidget( aMainGrp );
  aLay->addWidget( aFrame );

  myHelpFileName = "using_measurement_tools_page.html#boundaries_anchor";

  connect( aCloseBtn, SIGNAL( clicked() ), SLOT( onClose() ) );
  connect( aHelpBtn,  SIGNAL( clicked() ), SLOT( onHelp() ) );

  Init();
}

Here is the call graph for this function:

Definition at line 126 of file RepairGUI_FreeBoundDlg.cxx.

{
}

Member Function Documentation

Definition at line 257 of file RepairGUI_FreeBoundDlg.cxx.

{
  TColStd_MapOfInteger aMap;
  aMap.Add( GEOM_FACE );
  aMap.Add( GEOM_SHELL );
  aMap.Add( GEOM_SOLID );
  aMap.Add( GEOM_COMPOUND );
  globalSelection( aMap );
}

Here is the caller graph for this function:

void RepairGUI_FreeBoundDlg::closeEvent ( QCloseEvent *  ) [private]

Definition at line 248 of file RepairGUI_FreeBoundDlg.cxx.

{
  onClose();
}

Here is the call graph for this function:

GEOM::GEOM_IOperations_ptr RepairGUI_FreeBoundDlg::createOperation ( ) [private, virtual]

Definition at line 271 of file RepairGUI_FreeBoundDlg.cxx.

{
  return getGeomEngine()->GetIHealingOperations( getStudyId() );
}
void RepairGUI_FreeBoundDlg::enterEvent ( QEvent *  ) [private]

Definition at line 239 of file RepairGUI_FreeBoundDlg.cxx.

{
  onActivate();
}

Here is the call graph for this function:

bool RepairGUI_FreeBoundDlg::execute ( ObjectList objects) [private, virtual]

Definition at line 289 of file RepairGUI_FreeBoundDlg.cxx.

{
  if ( !IsPreview() || myObj->_is_nil() )
    return false;

  GEOM::ListOfGO_var aClosed, anOpen;

  GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow( getOperation() );
  bool result = anOper->GetFreeBoundary( myObj, aClosed, anOpen );

  if ( result ) {
    myNbClosed = aClosed->length();
    myNbOpen = anOpen->length();
    int i;
    for ( i = 0; i < myNbClosed; i++ )
      objects.push_back( aClosed[i]._retn() );
    for ( i = 0; i < myNbOpen; i++ )
      objects.push_back( anOpen[i]._retn() );

    myEdit->setText( GEOMBase::GetName( myObj ) );
    QString aLabelText = tr( "NUMBER_CLOSED" ) + QString( "%1" ).arg( myNbClosed );
    myClosedLbl->setText( aLabelText );
    aLabelText = tr( "NUMBER_OPEN" ) + QString( "%1" ).arg( myNbOpen );
    myOpenLbl->setText( aLabelText );
  }
  else {
    myEdit->setText( GEOMBase::GetName( myObj ) );
    myClosedLbl->setText( tr( "NUMBER_CLOSED" ) );
    myOpenLbl->setText( tr( "NUMBER_OPEN" ) );
  }

  return result;
}
void RepairGUI_FreeBoundDlg::Init ( ) [private]

Definition at line 222 of file RepairGUI_FreeBoundDlg.cxx.

{
  myNbClosed = myNbOpen = 0;
  myObj = GEOM::GEOM_Object::_nil();

  connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT  ( onDeactivate() ) );
  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 
           SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );

  activateSelection();
  onSelectionDone();
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool RepairGUI_FreeBoundDlg::isValid ( QString &  ) [private, virtual]

Definition at line 280 of file RepairGUI_FreeBoundDlg.cxx.

{
  return !myObj->_is_nil();
}
void RepairGUI_FreeBoundDlg::keyPressEvent ( QKeyEvent *  e) [private]

Definition at line 327 of file RepairGUI_FreeBoundDlg.cxx.

{
  QDialog::keyPressEvent( e );
  if ( e->isAccepted() )
    return;

  if ( e->key() == Qt::Key_F1 ) {
    e->accept();
    onHelp();
  }
}

Here is the call graph for this function:

void RepairGUI_FreeBoundDlg::onActivate ( ) [private, slot]

Definition at line 183 of file RepairGUI_FreeBoundDlg.cxx.

{
  myGeomGUI->EmitSignalDeactivateDialog();
  setEnabled( true );
  myGeomGUI->SetActiveDialogBox( this );
  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 
           SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
  activateSelection();
  onSelectionDone();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_FreeBoundDlg::onClose ( ) [private, slot]

Definition at line 134 of file RepairGUI_FreeBoundDlg.cxx.

{
  globalSelection();
  disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
  myGeomGUI->SetActiveDialogBox( 0 );
  reject();
  erasePreview();
}

Here is the caller graph for this function:

void RepairGUI_FreeBoundDlg::onDeactivate ( ) [private, slot]

Definition at line 171 of file RepairGUI_FreeBoundDlg.cxx.

{
  setEnabled( false );
  globalSelection();
  disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 );
  myGeomGUI->SetActiveDialogBox( 0 );
}

Here is the caller graph for this function:

void RepairGUI_FreeBoundDlg::onHelp ( ) [private, slot]

Definition at line 147 of file RepairGUI_FreeBoundDlg.cxx.

{
  LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
  if ( app )
    app->onHelpContextModule( myGeomGUI ? app->moduleName( myGeomGUI->moduleName() ) : QString(""), myHelpFileName );
  else {
    QString platform;
#ifdef WIN32
    platform = "winapplication";
#else
    platform = "application";
#endif
    SUIT_MessageBox::warning( this, 
                              tr( "WRN_WARNING" ), 
                              tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
                              arg( app->resourceMgr()->stringValue( "ExternalBrowser", 
                                                                    platform ) ).arg( myHelpFileName ) );
  }
}

Here is the caller graph for this function:

void RepairGUI_FreeBoundDlg::onSelectionDone ( ) [private, slot]

Definition at line 198 of file RepairGUI_FreeBoundDlg.cxx.

{
  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
  SALOME_ListIO aSelList;
  aSelMgr->selectedObjects(aSelList);

  if ( aSelList.Extent() != 1 )
    return;

  GEOM::GEOM_Object_var anObj =
    GEOMBase::ConvertIOinGEOMObject( aSelList.First() );

  if ( !GEOMBase::IsShape( anObj ) )
    return;
  else {
    myObj = anObj;
    displayPreview( true, false, true, true, 3 );
  }
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 70 of file RepairGUI_FreeBoundDlg.h.

QLineEdit* RepairGUI_FreeBoundDlg::myEdit [private]

Definition at line 69 of file RepairGUI_FreeBoundDlg.h.

GeometryGUI* RepairGUI_FreeBoundDlg::myGeomGUI [private]

Definition at line 73 of file RepairGUI_FreeBoundDlg.h.

Definition at line 76 of file RepairGUI_FreeBoundDlg.h.

Definition at line 74 of file RepairGUI_FreeBoundDlg.h.

Definition at line 75 of file RepairGUI_FreeBoundDlg.h.

GEOM::GEOM_Object_var RepairGUI_FreeBoundDlg::myObj [private]

Definition at line 72 of file RepairGUI_FreeBoundDlg.h.

Definition at line 71 of file RepairGUI_FreeBoundDlg.h.


The documentation for this class was generated from the following files: