Back to index

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

#include <BuildGUI_FaceDlg.h>

List of all members.

Public Member Functions

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

Protected Member Functions

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

Private Slots

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

Private Member Functions

void Init ()
void enterEvent (QEvent *)

Private Attributes

QList< GEOM::GeomObjPtrmyWires
DlgRef_1Sel1Check * GroupWire

Detailed Description

Definition at line 39 of file BuildGUI_FaceDlg.h.


Constructor & Destructor Documentation

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

Definition at line 51 of file BuildGUI_FaceDlg.cxx.

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

  setWindowTitle( tr( "GEOM_FACE_TITLE" ) );

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

  GroupWire = new DlgRef_1Sel1Check( centralWidget() );

  GroupWire->GroupBox1->setTitle( tr( "GEOM_FACE_FFW" ) );
  GroupWire->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
  GroupWire->CheckButton1->setText( tr( "GEOM_FACE_OPT" ) );
  GroupWire->PushButton1->setIcon( image1 );

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

  setHelpFileName("create_face_page.html");

  /* Initialisations */
  Init();
}

Here is the call graph for this function:

Definition at line 90 of file BuildGUI_FaceDlg.cxx.

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

Member Function Documentation

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

Definition at line 198 of file BuildGUI_FaceDlg.cxx.

{
  GEOMBase_Skeleton::ActivateThisDialog();
  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
  TColStd_MapOfInteger aMap;
  aMap.Add( GEOM_EDGE );
  aMap.Add( GEOM_WIRE );
  globalSelection( aMap );
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 143 of file BuildGUI_FaceDlg.cxx.

{
  if ( !onAccept() )
    return false;

  initName();
  return true;
}

Here is the caller graph for this function:

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

Definition at line 131 of file BuildGUI_FaceDlg.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_FaceDlg::createOperation ( ) [protected, virtual]

Definition at line 224 of file BuildGUI_FaceDlg.cxx.

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

Definition at line 214 of file BuildGUI_FaceDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 242 of file BuildGUI_FaceDlg.cxx.

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

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

  GEOM::GEOM_Object_var anObj = anOper->MakeFaceWires( objlist.in(), GroupWire->CheckButton1->isChecked() );

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

    if (!anOper->IsDone() && QString(anOper->GetErrorCode()) == "MAKE_FACE_TOLERANCE_TOO_BIG") {
      SUIT_OverrideCursor wc;
      wc.suspend();
      QString msgw = QObject::tr(anOper->GetErrorCode());
      SUIT_MessageBox::warning(this, tr("WRN_WARNING"), msgw, tr("BUT_OK"));
      anOper->SetErrorCode("PAL_NO_ERROR");
    }
  }

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

Definition at line 100 of file BuildGUI_FaceDlg.cxx.

{
  /* init variables */
  myEditCurrentArgument = GroupWire->LineEdit1;
  GroupWire->LineEdit1->setReadOnly( true );

  GroupWire->CheckButton1->setChecked( true );
  myWires.clear();

  TColStd_MapOfInteger aMap;
  aMap.Add( GEOM_EDGE );
  aMap.Add( GEOM_WIRE );
  globalSelection( aMap );

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 233 of file BuildGUI_FaceDlg.cxx.

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

Definition at line 157 of file BuildGUI_FaceDlg.cxx.

{
  myEditCurrentArgument->setText( "" );

  QList<TopAbs_ShapeEnum> types;
  types << TopAbs_EDGE << TopAbs_WIRE;
  myWires = getSelected( types, -1 );

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

Here is the caller graph for this function:

void BuildGUI_FaceDlg::SetEditCurrentArgument ( ) [private, slot]

Definition at line 176 of file BuildGUI_FaceDlg.cxx.

{
  QPushButton* send = (QPushButton*)sender();
  if ( send != GroupWire->PushButton1 )
    return;
  
  TColStd_MapOfInteger aMap;
  aMap.Add( GEOM_EDGE );
  aMap.Add( GEOM_WIRE );
  globalSelection( aMap );

  myEditCurrentArgument = GroupWire->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_FaceDlg::GroupWire [private]

Definition at line 60 of file BuildGUI_FaceDlg.h.

Definition at line 58 of file BuildGUI_FaceDlg.h.


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