Back to index

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

#include <BuildGUI_CompoundDlg.h>

List of all members.

Public Member Functions

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

Protected Member Functions

virtual GEOM::GEOM_IOperations_ptr createOperation ()
virtual bool isValid (QString &)
virtual bool execute (ObjectList &)
virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr)

Private Slots

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

Private Member Functions

void Init ()
void enterEvent (QEvent *)

Private Attributes

QList< GEOM::GeomObjPtrmyShapes
DlgRef_1Sel * GroupShapes

Detailed Description

Definition at line 39 of file BuildGUI_CompoundDlg.h.


Constructor & Destructor Documentation

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

Definition at line 47 of file BuildGUI_CompoundDlg.cxx.

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

  setWindowTitle( tr( "GEOM_COMPOUND_TITLE" ) );

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

  GroupShapes = new DlgRef_1Sel( centralWidget() );

  GroupShapes->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
  GroupShapes->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
  GroupShapes->PushButton1->setIcon( image1 );
  GroupShapes->LineEdit1->setReadOnly( true );

  QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
  layout->setMargin( 0 ); layout->setSpacing( 6 );
  layout->addWidget( GroupShapes );
  /***************************************************************/

  setHelpFileName("create_compound_page.html");

  /* Initialisations */
  Init();
}

Here is the call graph for this function:

Definition at line 86 of file BuildGUI_CompoundDlg.cxx.

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

Member Function Documentation

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

Definition at line 185 of file BuildGUI_CompoundDlg.cxx.

{
  GEOMBase_Skeleton::ActivateThisDialog();
  globalSelection( GEOM_ALLSHAPES );
  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 137 of file BuildGUI_CompoundDlg.cxx.

{
  if ( !onAccept() )
    return false;

  initName();
  return true;
}

Here is the caller graph for this function:

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

Definition at line 125 of file BuildGUI_CompoundDlg.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_CompoundDlg::createOperation ( ) [protected, virtual]

Definition at line 208 of file BuildGUI_CompoundDlg.cxx.

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

Definition at line 198 of file BuildGUI_CompoundDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 226 of file BuildGUI_CompoundDlg.cxx.

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

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

  GEOM::GEOM_Object_var anObj = anOper->MakeCompound( objlist );

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

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

Definition at line 96 of file BuildGUI_CompoundDlg.cxx.

{
  /* init variables */
  myEditCurrentArgument = GroupShapes->LineEdit1;
  GroupShapes->LineEdit1->setReadOnly( true );
  
  myShapes.clear();

  mainFrame()->GroupBoxPublish->show();
  mainFrame()->CheckBoxPreview->hide();

  /* signals and slots connections */
  connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
  connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
  connect( GroupShapes->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
  connect( ( (SalomeApp_Application*)(SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 
           SIGNAL(currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );

  globalSelection( GEOM_ALLSHAPES );

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 217 of file BuildGUI_CompoundDlg.cxx.

{
  return !myShapes.isEmpty();
}
void BuildGUI_CompoundDlg::restoreSubShapes ( SALOMEDS::Study_ptr  theStudy,
SALOMEDS::SObject_ptr  theSObject 
) [protected, virtual]

Definition at line 247 of file BuildGUI_CompoundDlg.cxx.

{
  if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
    // empty list of arguments means that all arguments should be restored
    getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
                                         /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame
                                         /*theInheritFirstArg=*/false,
                                         mainFrame()->CheckBoxAddPrefix->isChecked() );
  }
}

Definition at line 151 of file BuildGUI_CompoundDlg.cxx.

{
  myEditCurrentArgument->setText( "" );

  myShapes = getSelected( TopAbs_SHAPE, -1 );

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

Here is the caller graph for this function:

Definition at line 168 of file BuildGUI_CompoundDlg.cxx.

{
  QPushButton* send = (QPushButton*)sender();
  if ( send != GroupShapes->PushButton1 )
    return;
  
  myEditCurrentArgument = GroupShapes->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_CompoundDlg::GroupShapes [private]

Definition at line 61 of file BuildGUI_CompoundDlg.h.

Definition at line 59 of file BuildGUI_CompoundDlg.h.


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