Back to index

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

#include <BuildGUI_SolidDlg.h>

List of all members.

Public Member Functions

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

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 ()
void EnableNameField (bool)

Private Member Functions

void Init ()
void enterEvent (QEvent *)

Private Attributes

QList< GEOM::GeomObjPtrmyShells
DlgRef_1Sel1Check * GroupSolid

Detailed Description

Definition at line 39 of file BuildGUI_SolidDlg.h.


Constructor & Destructor Documentation

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

Definition at line 50 of file BuildGUI_SolidDlg.cxx.

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

  setWindowTitle( tr( "GEOM_SOLID_TITLE" ) );

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

  GroupSolid = new DlgRef_1Sel1Check( centralWidget() );

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

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

  setHelpFileName("create_solid_page.html");

  /* Initialisations */
  Init();
}

Here is the call graph for this function:

Definition at line 90 of file BuildGUI_SolidDlg.cxx.

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

Member Function Documentation

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

Definition at line 205 of file BuildGUI_SolidDlg.cxx.

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

  //globalSelection( GEOM_SHELL );
  TColStd_MapOfInteger aMap;
  aMap.Add( GEOM_SHELL );
  aMap.Add( GEOM_COMPOUNDFILTER );
  QList<int> aSubShapes;
  aSubShapes.append( GEOM_SHELL );
  globalSelection( aMap, aSubShapes );
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 147 of file BuildGUI_SolidDlg.cxx.

{
  if ( !onAccept() )
    return false;

  initName();
  return true;
}

Here is the caller graph for this function:

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

Definition at line 136 of file BuildGUI_SolidDlg.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_SolidDlg::createOperation ( ) [protected, virtual]

Definition at line 245 of file BuildGUI_SolidDlg.cxx.

{
  return getGeomEngine()->GetIShapesOperations( getStudyId() );
}
void BuildGUI_SolidDlg::EnableNameField ( bool  toEnable) [private, slot]

Definition at line 236 of file BuildGUI_SolidDlg.cxx.

{
  mainFrame()->GroupBoxName->setEnabled( toEnable );
}

Here is the caller graph for this function:

void BuildGUI_SolidDlg::enterEvent ( QEvent *  ) [private]

Definition at line 225 of file BuildGUI_SolidDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 313 of file BuildGUI_SolidDlg.cxx.

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

  if ( GroupSolid->CheckButton1->isChecked() ) {
    GEOM::ListOfGO_var objlist = new GEOM::ListOfGO();
    objlist->length( myShells.count() );
    for ( int i = 0; i < myShells.count(); i++ )
      objlist[i] = myShells[i].copy();

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

    if ( !anObj->_is_nil() )
      objects.push_back( anObj._retn() );
  }
  else {
    for ( int i = 0, n = myShells.count(); i< n; i++ ) {
      GEOM::GEOM_Object_var anObj = anOper->MakeSolidShell( myShells[ i ].get() );

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

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

Definition at line 100 of file BuildGUI_SolidDlg.cxx.

{
  /* init variables */
  myEditCurrentArgument = GroupSolid->LineEdit1;
  GroupSolid->LineEdit1->setReadOnly( true );
  GroupSolid->CheckButton1->setChecked( true );

  myShells.clear();

  //globalSelection( GEOM_SHELL );
  TColStd_MapOfInteger aMap;
  aMap.Add( GEOM_SHELL );
  aMap.Add( GEOM_COMPOUNDFILTER );
  QList<int> aSubShapes;
  aSubShapes.append( GEOM_SHELL );
  globalSelection( aMap, aSubShapes );

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

  connect( GroupSolid->PushButton1,  SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
  connect( GroupSolid->CheckButton1, SIGNAL( toggled( bool ) ), this, SLOT( EnableNameField( bool ) ) );

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 254 of file BuildGUI_SolidDlg.cxx.

{
  bool ok = !myShells.isEmpty();

  GEOM::MeasureOpPtr anOp;
  anOp.take(myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId()));

  for ( int i = 0, n = myShells.count(); i < n && ok; i++ ) {
    CORBA::String_var aRes = anOp->IsGoodForSolid(myShells[i].get());
    if (strlen(aRes.in())) {
      msg = QObject::tr(aRes.in()).arg(GEOMBase::GetName(myShells[i].get()));
      ok = false;
    }
  }
  return ok;
}

Here is the call graph for this function:

void BuildGUI_SolidDlg::SelectionIntoArgument ( ) [private, slot]

Definition at line 161 of file BuildGUI_SolidDlg.cxx.

{
  myEditCurrentArgument->setText( "" );

  //myShells = getSelected( TopAbs_SHELL, -1 );
  QList<TopAbs_ShapeEnum> types;
  types << TopAbs_SHELL << TopAbs_COMPOUND;
  myShells = getSelected( types, -1 );

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

Here is the caller graph for this function:

Definition at line 180 of file BuildGUI_SolidDlg.cxx.

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

  //globalSelection( GEOM_SHELL );
  TColStd_MapOfInteger aMap;
  aMap.Add( GEOM_SHELL );
  aMap.Add( GEOM_COMPOUNDFILTER );
  QList<int> aSubShapes;
  aSubShapes.append( GEOM_SHELL );
  globalSelection( aMap, aSubShapes );

  myEditCurrentArgument = GroupSolid->LineEdit1;

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

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

DlgRef_1Sel1Check* BuildGUI_SolidDlg::GroupSolid [private]

Definition at line 61 of file BuildGUI_SolidDlg.h.

Definition at line 59 of file BuildGUI_SolidDlg.h.


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