Back to index

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

#include <OperationGUI_ArchimedeDlg.h>

List of all members.

Public Member Functions

 OperationGUI_ArchimedeDlg (GeometryGUI *, QWidget *)
 ~OperationGUI_ArchimedeDlg ()

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 LineEditReturnPressed ()
void SelectionIntoArgument ()
void SetDoubleSpinBoxStep (double)
void ValueChangedInSpinBox (double)

Private Member Functions

void Init ()
void enterEvent (QEvent *)

Private Attributes

GEOM::GEOM_Object_var myShape
DlgRef_1Sel3Spin * GroupPoints
double myStep

Detailed Description

Definition at line 38 of file OperationGUI_ArchimedeDlg.h.


Constructor & Destructor Documentation

OperationGUI_ArchimedeDlg::OperationGUI_ArchimedeDlg ( GeometryGUI *  theGeometryGUI,
QWidget *  parent 
)

Definition at line 46 of file OperationGUI_ArchimedeDlg.cxx.

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

  /***************************************************************/
  mainFrame()->GroupConstructors->setTitle( tr( "GEOM_ARCHIMEDE" ) );
  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_1Sel3Spin( centralWidget() );
  GroupPoints->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
  GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
  GroupPoints->TextLabel2->setText( tr( "GEOM_WEIGHT" ) );
  GroupPoints->TextLabel3->setText( tr( "GEOM_WATER_DENSITY" ) );
  GroupPoints->TextLabel4->setText( tr( "GEOM_MESHING_DEFLECTION" ) );
  GroupPoints->PushButton1->setIcon( image1 );
  GroupPoints->LineEdit1->setReadOnly( true );

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

  /***************************************************************/

  setHelpFileName( "archimede_page.html" );

  /* Initialisations */
  Init();
}

Here is the call graph for this function:

Definition at line 88 of file OperationGUI_ArchimedeDlg.cxx.

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

Member Function Documentation

Definition at line 228 of file OperationGUI_ArchimedeDlg.cxx.

{
  GEOMBase_Skeleton::ActivateThisDialog();
  globalSelection( GEOM_ALLSHAPES );
  connect( myGeomGUI->getApp()->selectionMgr(),
           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
  processPreview();
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 174 of file OperationGUI_ArchimedeDlg.cxx.

{
  if ( !onAccept() )
    return false;

  initName();
  return true;
}

Here is the caller graph for this function:

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

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

Definition at line 254 of file OperationGUI_ArchimedeDlg.cxx.

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

Definition at line 242 of file OperationGUI_ArchimedeDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 276 of file OperationGUI_ArchimedeDlg.cxx.

{
  double aWeight         = GroupPoints->SpinBox_DX->value();
  double aWaterDensity   = GroupPoints->SpinBox_DY->value();
  double aMeshDeflection = GroupPoints->SpinBox_DZ->value();
  
  GEOM::GEOM_ILocalOperations_var anOper = GEOM::GEOM_ILocalOperations::_narrow(getOperation());
  GEOM::GEOM_Object_var anObj = anOper->MakeArchimede( myShape, aWeight, aWaterDensity, aMeshDeflection );

  if ( !anObj->_is_nil() )
  {
    if ( !IsPreview() )
    {
      QStringList aParameters;
      aParameters << GroupPoints->SpinBox_DX->text();
      aParameters << GroupPoints->SpinBox_DY->text();
      aParameters << GroupPoints->SpinBox_DZ->text();
      anObj->SetParameters(aParameters.join(":").toLatin1().constData());
    }
    objects.push_back( anObj._retn() );
  }

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

Definition at line 98 of file OperationGUI_ArchimedeDlg.cxx.

{
  /* init variables */
  myEditCurrentArgument = GroupPoints->LineEdit1;

  /* Get setting of myStep value from file configuration */
  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
  double myStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );

  double SpecificStep1 = 0.1;
  double SpecificStep2 = 0.01;
  /* min, max, myStep and decimals for spin boxes & initial values */
  initSpinBox( GroupPoints->SpinBox_DX, 0.001, COORD_MAX, myStep, "weight_precision" );
  initSpinBox( GroupPoints->SpinBox_DY, 0.001, COORD_MAX, SpecificStep1, "density_precision" );
  initSpinBox( GroupPoints->SpinBox_DZ, 0.001, COORD_MAX, SpecificStep2, "parametric_precision" );

  showOnlyPreviewControl();

  GroupPoints->SpinBox_DX->setValue( 100.0 );
  GroupPoints->SpinBox_DY->setValue( 1.0 );
  GroupPoints->SpinBox_DZ->setValue( 0.01 );

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

  connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );

  connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
  
  connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
           this, SLOT( SelectionIntoArgument() ) );


  connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
  connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
  connect(GroupPoints->SpinBox_DZ, SIGNAL(valueChanged( double )), this, SLOT(ValueChangedInSpinBox(double)));
  
  initName( tr( "GEOM_ARCHIMEDE" ) );
  
  globalSelection( GEOM_ALLSHAPES );

  SelectionIntoArgument();
  resize(100,100);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 263 of file OperationGUI_ArchimedeDlg.cxx.

{
  bool ok = true;
  ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
  ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
  ok = GroupPoints->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
  return !myShape->_is_nil() && ok;
}

Definition at line 213 of file OperationGUI_ArchimedeDlg.cxx.

{
  QLineEdit* send = (QLineEdit*)sender();
  if ( send == GroupPoints->LineEdit1 )
    myEditCurrentArgument = GroupPoints->LineEdit1;
  else
    return;

  GEOMBase_Skeleton::LineEditReturnPressed();
}

Here is the caller graph for this function:

Definition at line 187 of file OperationGUI_ArchimedeDlg.cxx.

{
  myEditCurrentArgument->setText("");
  myShape = GEOM::GEOM_Object::_nil();

  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
  SALOME_ListIO aSelList;
  aSelMgr->selectedObjects(aSelList);

  if (aSelList.Extent() != 1)
    return;

  myShape = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );

  if ( !GEOMBase::IsShape(myShape) ) {
    myShape = GEOM::GEOM_Object::_nil();
    return;
  }
  myEditCurrentArgument->setText(GEOMBase::GetName(myShape));
  processPreview();
}

Here is the caller graph for this function:

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

Definition at line 149 of file OperationGUI_ArchimedeDlg.cxx.

{
  GroupPoints->SpinBox_DX->setSingleStep(step);
  
  // san: Commented so as not to override specific step settings
  //GroupPoints->SpinBox_DY->setSingleStep(step);
  //GroupPoints->SpinBox_DZ->setSingleStep(step);
}

Here is the caller graph for this function:

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

Definition at line 305 of file OperationGUI_ArchimedeDlg.cxx.

{
  processPreview();
}

Here is the caller graph for this function:


Member Data Documentation

DlgRef_1Sel3Spin* OperationGUI_ArchimedeDlg::GroupPoints [private]

Definition at line 58 of file OperationGUI_ArchimedeDlg.h.

GEOM::GEOM_Object_var OperationGUI_ArchimedeDlg::myShape [private]

Definition at line 57 of file OperationGUI_ArchimedeDlg.h.

Definition at line 59 of file OperationGUI_ArchimedeDlg.h.


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