Back to index

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

#include <BuildGUI_ShellDlg.h>

List of all members.

Public Member Functions

 BuildGUI_ShellDlg (GeometryGUI *, QWidget *=0)
 ~BuildGUI_ShellDlg ()

Protected Member Functions

virtual GEOM::GEOM_IOperations_ptr createOperation ()
virtual bool isValid (QString &)
virtual bool execute (ObjectList &)

Private Slots

void ClickOnOk ()
bool ClickOnApply ()
void SetEditCurrentArgument ()
void SelectionIntoArgument ()
void ActivateThisDialog ()

Private Member Functions

void Init ()
void enterEvent (QEvent *)

Private Attributes

QList< GEOM::GeomObjPtrmyFacesAndShells
DlgRef_1Sel * GroupShell

Detailed Description

Definition at line 39 of file BuildGUI_ShellDlg.h.


Constructor & Destructor Documentation

BuildGUI_ShellDlg::BuildGUI_ShellDlg ( GeometryGUI *  theGeometryGUI,
QWidget *  parent = 0 
)

Definition at line 49 of file BuildGUI_ShellDlg.cxx.

  : GEOMBase_Skeleton( theGeometryGUI, parent )
{
  QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BUILD_SHELL" ) ) );
  QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );

  setWindowTitle( tr( "GEOM_SHELL_TITLE" ) );
    
  /***************************************************************/
  mainFrame()->GroupConstructors->setTitle( tr( "GEOM_SHELL" ) );
  mainFrame()->RadioButton1->setIcon( image0 );
  mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
  mainFrame()->RadioButton2->close();
  mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
  mainFrame()->RadioButton3->close();

  GroupShell = new DlgRef_1Sel( centralWidget() );

  GroupShell->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
  GroupShell->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
  GroupShell->PushButton1->setIcon( image1 );
  GroupShell->LineEdit1->setReadOnly( true );
  
  QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
  layout->setMargin( 0 ); layout->setSpacing( 6 );
  layout->addWidget( GroupShell );
  /***************************************************************/

  setHelpFileName("create_shell_page.html");

  /* Initialisations */
  Init();
}

Here is the call graph for this function:

Definition at line 88 of file BuildGUI_ShellDlg.cxx.

{
    // no need to delete child widgets, Qt does it all for us
}

Member Function Documentation

void BuildGUI_ShellDlg::ActivateThisDialog ( ) [private, slot]

Definition at line 204 of file BuildGUI_ShellDlg.cxx.

{
  GEOMBase_Skeleton::ActivateThisDialog();
  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
  TColStd_MapOfInteger aMap;
  aMap.Add( GEOM_SHELL );
  aMap.Add( GEOM_FACE );
  aMap.Add( GEOM_COMPOUNDFILTER );
  
  QList<int> aSubShapes;
  aSubShapes.append( GEOM_FACE );
  globalSelection( aMap, aSubShapes );
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool BuildGUI_ShellDlg::ClickOnApply ( ) [private, slot]

Definition at line 145 of file BuildGUI_ShellDlg.cxx.

{
  if ( !onAccept() )
    return false;

  initName();
  return true;
}

Here is the caller graph for this function:

void BuildGUI_ShellDlg::ClickOnOk ( ) [private, slot]

Definition at line 133 of file BuildGUI_ShellDlg.cxx.

{
  setIsApplyAndClose( true );
  if ( ClickOnApply() )
    ClickOnCancel();
}

Here is the call graph for this function:

Here is the caller graph for this function:

GEOM::GEOM_IOperations_ptr BuildGUI_ShellDlg::createOperation ( ) [protected, virtual]

Definition at line 234 of file BuildGUI_ShellDlg.cxx.

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

Definition at line 224 of file BuildGUI_ShellDlg.cxx.

{
  if ( !mainFrame()->GroupConstructors->isEnabled() )
    ActivateThisDialog();
}

Here is the call graph for this function:

bool BuildGUI_ShellDlg::execute ( ObjectList objects) [protected, virtual]

Definition at line 252 of file BuildGUI_ShellDlg.cxx.

{
  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );

  GEOM::ListOfGO_var objlist = new GEOM::ListOfGO();
  objlist->length( myFacesAndShells.count() );
  for ( int i = 0; i < myFacesAndShells.count(); i++ )
    objlist[i] = myFacesAndShells[i].copy();

  GEOM::GEOM_Object_var anObj = anOper->MakeShell( objlist.in() );

  if ( !anObj->_is_nil() )
    objects.push_back( anObj._retn() );

  return true;
}
void BuildGUI_ShellDlg::Init ( ) [private]

Definition at line 98 of file BuildGUI_ShellDlg.cxx.

{
  /* init variables */
  myEditCurrentArgument = GroupShell->LineEdit1;
  GroupShell->LineEdit1->setReadOnly( true );
  
  myFacesAndShells.clear();
  
  TColStd_MapOfInteger aMap;
  aMap.Add( GEOM_SHELL );
  aMap.Add( GEOM_FACE );
  aMap.Add( GEOM_COMPOUNDFILTER );
  
  QList<int> aSubShapes;
  aSubShapes.append( GEOM_FACE );
  globalSelection( aMap, aSubShapes );

  /* signals and slots connections */
  connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
  connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );

  connect( GroupShell->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );

  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );

  initName( tr( "GEOM_SHELL" ) );
  SelectionIntoArgument();
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool BuildGUI_ShellDlg::isValid ( QString &  ) [protected, virtual]

Definition at line 243 of file BuildGUI_ShellDlg.cxx.

{
  return !myFacesAndShells.isEmpty();
}
void BuildGUI_ShellDlg::SelectionIntoArgument ( ) [private, slot]

Definition at line 159 of file BuildGUI_ShellDlg.cxx.

{
  myEditCurrentArgument->setText( "" );

  QList<TopAbs_ShapeEnum> types;
  types << TopAbs_FACE << TopAbs_SHELL << TopAbs_COMPOUND;
  myFacesAndShells = getSelected( types, -1 );

  if ( !myFacesAndShells.isEmpty() ) {
    QString aName = myFacesAndShells.count() > 1 ? QString( "%1_objects").arg( myFacesAndShells.count() ) : GEOMBase::GetName( myFacesAndShells[0].get() );
    myEditCurrentArgument->setText( aName );
  }
}

Here is the caller graph for this function:

Definition at line 178 of file BuildGUI_ShellDlg.cxx.

{
  QPushButton* send = (QPushButton*)sender();
  if ( send != GroupShell->PushButton1 )
    return;

  TColStd_MapOfInteger aMap;
  aMap.Add( GEOM_SHELL );
  aMap.Add( GEOM_FACE );
  aMap.Add( GEOM_COMPOUNDFILTER );

  QList<int> aSubShapes;
  aSubShapes.append( GEOM_FACE );
  globalSelection( aMap, aSubShapes );
  
  myEditCurrentArgument = GroupShell->LineEdit1;

  myEditCurrentArgument->setFocus();
  SelectionIntoArgument();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

DlgRef_1Sel* BuildGUI_ShellDlg::GroupShell [private]

Definition at line 60 of file BuildGUI_ShellDlg.h.

Definition at line 58 of file BuildGUI_ShellDlg.h.


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