Back to index

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

#include <GenerationGUI_FillingDlg.h>

List of all members.

Public Member Functions

 GenerationGUI_FillingDlg (GeometryGUI *, QWidget *=0, bool=false, Qt::WindowFlags=0)
 ~GenerationGUI_FillingDlg ()

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 ()
void ValueChangedInSpinBox (double)
void MethodChanged ()
void ApproxChanged ()
void SetDoubleSpinBoxStep (double)

Private Member Functions

void Init ()
void enterEvent (QEvent *)

Private Attributes

GEOM::GeomObjPtr myCompound
DlgRef_1Sel5Spin1Check * GroupPoints

Detailed Description

Definition at line 39 of file GenerationGUI_FillingDlg.h.


Constructor & Destructor Documentation

GenerationGUI_FillingDlg::GenerationGUI_FillingDlg ( GeometryGUI *  theGeometryGUI,
QWidget *  parent = 0,
bool  modal = false,
Qt::WindowFlags  fl = 0 
)

Definition at line 48 of file GenerationGUI_FillingDlg.cxx.

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

  setWindowTitle( tr( "GEOM_FILLING_TITLE" ) );

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

  GroupPoints = new DlgRef_1Sel5Spin1Check( centralWidget() );
  GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
  GroupPoints->TextLabel1->setText( tr( "GEOM_FILLING_COMPOUND" ) );
  GroupPoints->TextLabel2->setText( tr( "GEOM_FILLING_MIN_DEG" ) );
  GroupPoints->TextLabel3->setText( tr( "GEOM_FILLING_TOL_2D" ) );
  GroupPoints->TextLabel4->setText( tr( "GEOM_FILLING_NB_ITER" ) );
  GroupPoints->TextLabel5->setText( tr( "GEOM_FILLING_MAX_DEG" ) );
  GroupPoints->TextLabel6->setText( tr( "GEOM_FILLING_TOL_3D" ) );
  GroupPoints->CheckBox1->setText( tr( "GEOM_FILLING_APPROX" ) );
  GroupPoints->TextLabel7->setText( tr( "GEOM_FILLING_METHOD" ) );
  GroupPoints->PushButton1->setIcon( image1 );
  GroupPoints->LineEdit1->setReadOnly( true );

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

  setHelpFileName( "create_filling_page.html" );

  /* Initialisations */
  Init();
}

Here is the call graph for this function:

Definition at line 93 of file GenerationGUI_FillingDlg.cxx.

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

Member Function Documentation

Definition at line 242 of file GenerationGUI_FillingDlg.cxx.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void GenerationGUI_FillingDlg::ApproxChanged ( ) [private, slot]

Definition at line 285 of file GenerationGUI_FillingDlg.cxx.

{
  processPreview();
}

Here is the caller graph for this function:

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

Definition at line 185 of file GenerationGUI_FillingDlg.cxx.

{
  if ( !onAccept() )
    return false;

  initName();
  return true;
}

Here is the caller graph for this function:

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

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

Definition at line 295 of file GenerationGUI_FillingDlg.cxx.

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

Definition at line 256 of file GenerationGUI_FillingDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 319 of file GenerationGUI_FillingDlg.cxx.

{
  GEOM::GEOM_I3DPrimOperations_var anOper =
    GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());

  GEOM::filling_oper_method aMethod;
  switch (GroupPoints->ComboBox1->currentIndex())
  {
    case 0:  aMethod = GEOM::FOM_Default; break;
    case 1:  aMethod = GEOM::FOM_UseOri; break;
    case 2:  aMethod = GEOM::FOM_AutoCorrect; break;
    default: break;
  }

  GEOM::GEOM_Object_var anObj =
    anOper->MakeFilling( myCompound.get(), 
                      GroupPoints->SpinBox1->value(), 
                      GroupPoints->SpinBox4->value(), 
                      GroupPoints->SpinBox2->value(),
                      GroupPoints->SpinBox5->value(),
                         GroupPoints->SpinBox3->value(), 
                      aMethod,
                      GroupPoints->CheckBox1->isChecked() );
  if ( !anObj->_is_nil() )
  {
    if ( !IsPreview() )
    {
      QStringList aParameters;
      aParameters << GroupPoints->SpinBox1->text();
      aParameters << GroupPoints->SpinBox2->text();
      aParameters << GroupPoints->SpinBox3->text();
      aParameters << GroupPoints->SpinBox4->text();
      aParameters << GroupPoints->SpinBox5->text();
      anObj->SetParameters(aParameters.join(":").toLatin1().constData());
    }
    objects.push_back( anObj._retn() );
  }

  return true;
}

Here is the call graph for this function:

void GenerationGUI_FillingDlg::Init ( ) [private]

Definition at line 102 of file GenerationGUI_FillingDlg.cxx.

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

  globalSelection( GEOM_COMPOUND );

  int SpecificStep1 = 1;
  double SpecificStep2 = 0.0001;
  /* min, max, step and decimals for spin boxes & initial values */
  initSpinBox( GroupPoints->SpinBox1, 2, MAX_NUMBER,  SpecificStep1 );
  initSpinBox( GroupPoints->SpinBox2, 0.00001, 10000.0, SpecificStep2, "len_tol_precision" );
  initSpinBox( GroupPoints->SpinBox3, 0, MAX_NUMBER,  SpecificStep1 );
  initSpinBox( GroupPoints->SpinBox4, 1, MAX_NUMBER,  SpecificStep1 );
  initSpinBox( GroupPoints->SpinBox5, 0.00001, 10000.0, SpecificStep2, "len_tol_precision" );

  GroupPoints->SpinBox1->setValue( 2 );
  GroupPoints->SpinBox2->setValue( 0.0001 );
  GroupPoints->SpinBox3->setValue( 0 );
  GroupPoints->SpinBox4->setValue( 5 );
  GroupPoints->SpinBox5->setValue( 0.0001 );

  GroupPoints->ComboBox1->addItem(tr("GEOM_FILLING_DEFAULT"));
  GroupPoints->ComboBox1->addItem(tr("GEOM_FILLING_USEORI"));
  GroupPoints->ComboBox1->addItem(tr("GEOM_FILLING_AUTO"));

  showOnlyPreviewControl();

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

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

  connect( GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(MethodChanged()));

  connect( GroupPoints->SpinBox1, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
  connect( GroupPoints->SpinBox2, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
  connect( GroupPoints->SpinBox3, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
  connect( GroupPoints->SpinBox4, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
  connect( GroupPoints->SpinBox5, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );

  connect( GroupPoints->CheckBox1, SIGNAL( stateChanged( int ) ),
           this, SLOT( ApproxChanged() ) );

  // san: Commented, as all spin boxes here either are integer or use specific non-default step value
  //connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );

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

  initName( tr( "GEOM_FILLING" ) );
  resize(100,100);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 304 of file GenerationGUI_FillingDlg.cxx.

{
  bool ok = GroupPoints->SpinBox1->isValid( msg, !IsPreview() ) &&
            GroupPoints->SpinBox2->isValid( msg, !IsPreview() ) &&
            GroupPoints->SpinBox3->isValid( msg, !IsPreview() ) &&
            GroupPoints->SpinBox4->isValid( msg, !IsPreview() ) &&
            GroupPoints->SpinBox5->isValid( msg, !IsPreview() ) &&
            myCompound;
  return ok;
}
void GenerationGUI_FillingDlg::MethodChanged ( ) [private, slot]

Definition at line 276 of file GenerationGUI_FillingDlg.cxx.

{
  processPreview();
}

Here is the caller graph for this function:

Definition at line 199 of file GenerationGUI_FillingDlg.cxx.

{
  erasePreview();
  myEditCurrentArgument->setText("");

  if (myEditCurrentArgument == GroupPoints->LineEdit1) {
    myCompound = getSelected( TopAbs_COMPOUND );
    if ( myCompound ) {
      if ( myCompound->GetMaxShapeType() < GEOM::WIRE || myCompound->GetMinShapeType() > GEOM::EDGE ) {
       myCompound.nullify();
      }
      else {
       QString aName = GEOMBase::GetName( myCompound.get() );
       myEditCurrentArgument->setText( aName );
      }
    }
  }

  processPreview();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GenerationGUI_FillingDlg::SetDoubleSpinBoxStep ( double  step) [private, slot]

Definition at line 162 of file GenerationGUI_FillingDlg.cxx.

{
  GroupPoints->SpinBox2->setSingleStep(step);
  GroupPoints->SpinBox5->setSingleStep(step);
}

Definition at line 224 of file GenerationGUI_FillingDlg.cxx.

{
  QPushButton* send = (QPushButton*)sender();
  globalSelection( GEOM_ALLSHAPES );

  if ( send == GroupPoints->PushButton1 ) {
    GroupPoints->LineEdit1->setFocus();
    myEditCurrentArgument = GroupPoints->LineEdit1;
    globalSelection( GEOM_COMPOUND );
    this->SelectionIntoArgument();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GenerationGUI_FillingDlg::ValueChangedInSpinBox ( double  newValue) [private, slot]

Definition at line 267 of file GenerationGUI_FillingDlg.cxx.

{
  processPreview();
}

Here is the caller graph for this function:


Member Data Documentation

DlgRef_1Sel5Spin1Check* GenerationGUI_FillingDlg::GroupPoints [private]

Definition at line 59 of file GenerationGUI_FillingDlg.h.

Definition at line 58 of file GenerationGUI_FillingDlg.h.


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