Back to index

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

#include <RepairGUI_LimitToleranceDlg.h>

List of all members.

Public Member Functions

 RepairGUI_LimitToleranceDlg (GeometryGUI *, QWidget *=0, bool=false)
 ~RepairGUI_LimitToleranceDlg ()

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 LineEditReturnPressed ()
void SelectionIntoArgument ()
void SetEditCurrentArgument ()
void ConstructorsClicked (int)

Private Member Functions

void Init ()
void enterEvent (QEvent *)
void initSelection ()
bool onAcceptLocal ()
void activateSelection ()
void updateButtonState ()

Private Attributes

GEOM::GEOM_Object_var myObject
DlgRef_1SelExt * GroupPoints
SalomeApp_DoubleSpinBox * myTolEdt

Detailed Description

Definition at line 38 of file RepairGUI_LimitToleranceDlg.h.


Constructor & Destructor Documentation

RepairGUI_LimitToleranceDlg::RepairGUI_LimitToleranceDlg ( GeometryGUI *  theGeometryGUI,
QWidget *  parent = 0,
bool  modal = false 
)

Definition at line 58 of file RepairGUI_LimitToleranceDlg.cxx.

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

  setWindowTitle(tr("GEOM_LIMIT_TOLERANCE_TITLE"));

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

  GroupPoints = new DlgRef_1SelExt(centralWidget());
  GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
  GroupPoints->TextLabel1->setText(tr("GEOM_SELECTED_SHAPE"));
  GroupPoints->PushButton1->setIcon(image1);
  GroupPoints->LineEdit1->setReadOnly(true);

  QLabel* aTolLab = new QLabel(tr("GEOM_TOLERANCE"), GroupPoints->Box);
  myTolEdt = new SalomeApp_DoubleSpinBox(GroupPoints->Box);
  initSpinBox(myTolEdt, 0., 100., DEFAULT_TOLERANCE_VALUE, "len_tol_precision");
  myTolEdt->setValue(DEFAULT_TOLERANCE_VALUE);

  QGridLayout* boxLayout = new QGridLayout(GroupPoints->Box);
  boxLayout->setMargin(0); boxLayout->setSpacing(6);
  boxLayout->addWidget(aTolLab,  0, 0);
  boxLayout->addWidget(myTolEdt, 0, 2);

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

  setHelpFileName("limit_tolerance_operation_page.html");

  Init();
}

Here is the call graph for this function:

Definition at line 105 of file RepairGUI_LimitToleranceDlg.cxx.

{
}

Member Function Documentation

Definition at line 404 of file RepairGUI_LimitToleranceDlg.cxx.

{
  disconnect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
             this, SLOT(SelectionIntoArgument()));

  globalSelection(GEOM_ALLSHAPES);
  if (myObject->_is_nil())
    SelectionIntoArgument();

  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
          this, SLOT(SelectionIntoArgument()));
  updateViewer();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 252 of file RepairGUI_LimitToleranceDlg.cxx.

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

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 188 of file RepairGUI_LimitToleranceDlg.cxx.

{
  if (!onAcceptLocal())
    return false;

  initName();

  ConstructorsClicked(0);

  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 177 of file RepairGUI_LimitToleranceDlg.cxx.

{
  setIsApplyAndClose( true );
  if (ClickOnApply())
    ClickOnCancel();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_LimitToleranceDlg::ConstructorsClicked ( int  constructorId) [private, slot]

Definition at line 151 of file RepairGUI_LimitToleranceDlg.cxx.

{
  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);

  GroupPoints->show();
  GroupPoints->LineEdit1->setText("");
  myEditCurrentArgument = GroupPoints->LineEdit1;
  myEditCurrentArgument->setFocus();

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

  qApp->processEvents();
  updateGeometry();
  resize(minimumSizeHint());

  updateButtonState();
  activateSelection();
  SelectionIntoArgument();
}

Here is the call graph for this function:

Here is the caller graph for this function:

GEOM::GEOM_IOperations_ptr RepairGUI_LimitToleranceDlg::createOperation ( ) [protected, virtual]

Definition at line 274 of file RepairGUI_LimitToleranceDlg.cxx.

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

Definition at line 264 of file RepairGUI_LimitToleranceDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 294 of file RepairGUI_LimitToleranceDlg.cxx.

{
  bool aResult = false;
  objects.clear();

  GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow(getOperation());
  GEOM::GEOM_Object_var anObj = anOper->LimitTolerance(myObject, myTolEdt->value());
  aResult = !anObj->_is_nil();
  if (aResult) {
    QStringList aParameters;
    aParameters << myTolEdt->text();
    anObj->SetParameters(aParameters.join(":").toLatin1().constData());
    objects.push_back(anObj._retn());
  }

  return aResult;
}

Here is the caller graph for this function:

Definition at line 114 of file RepairGUI_LimitToleranceDlg.cxx.

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

  myObject = GEOM::GEOM_Object::_nil();

  //myGeomGUI->SetState(0);
  //globalSelection(GEOM_COMPOUND);

  mainFrame()->GroupBoxPublish->show();
  //Hide preview checkbox
  mainFrame()->CheckBoxPreview->hide();

  /* 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->LineEdit1,    SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));

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

  initName(tr("LIMIT_TOLERANCE_NEW_OBJ_NAME"));

  ConstructorsClicked(0);

  activateSelection();
  updateButtonState();
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 283 of file RepairGUI_LimitToleranceDlg.cxx.

{
  double v = myTolEdt->value();
  bool ok = myTolEdt->isValid(msg, true);
  return !myObject->_is_nil() && (v > 0.) && ok;
}

Here is the caller graph for this function:

Definition at line 239 of file RepairGUI_LimitToleranceDlg.cxx.

{
  const QObject* send = sender();
  if (send == GroupPoints->LineEdit1) {
    myEditCurrentArgument = GroupPoints->LineEdit1;
    GEOMBase_Skeleton::LineEditReturnPressed();
  }
}

Here is the caller graph for this function:

Definition at line 318 of file RepairGUI_LimitToleranceDlg.cxx.

{
  if (!getStudy() || !(getStudy()->studyDS()))
    return false;

  _PTR(Study) aStudy = getStudy()->studyDS();

  bool aLocked = aStudy->GetProperties()->IsLocked();
  if (aLocked) {
    MESSAGE("GEOMBase_Helper::onAccept - ActiveStudy is locked");
    SUIT_MessageBox::warning(this, tr("WRN_WARNING"), tr("WRN_STUDY_LOCKED"), tr("BUT_OK"));
    return false;
  }

  QString msg;
  if (!isValid(msg)) {
    showError(msg);
    return false;
  }

  try {
    if (openCommand()) {
      SUIT_OverrideCursor wc;

      myGeomGUI->getApp()->putInfo("");
      ObjectList objects;

      if (!execute(objects)) {
        wc.suspend();
        abortCommand();
        showError();
      }
      else {
        const int nbObjs = objects.size();
        for (ObjectList::iterator it = objects.begin(); it != objects.end(); ++it) {
          QString aName = getNewObjectName();
          if (nbObjs > 1) {
            if (aName.isEmpty())
              aName = getPrefix(*it);
            aName = GEOMBase::GetDefaultName(aName);
          }
          else {
            // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
            if (aName.isEmpty())
              aName = GEOMBase::GetDefaultName(getPrefix(*it));
          }
          addInStudy(*it, aName.toLatin1().data());
          display(*it, false);
        }

        if (nbObjs) {
          commitCommand();
          updateObjBrowser();
          myGeomGUI->getApp()->putInfo(QObject::tr("GEOM_PRP_DONE"));
        }
        else {
          abortCommand();
        }

        // JFA 28.12.2004 BEGIN // To enable warnings
        GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow(getOperation());
        if (!CORBA::is_nil(anOper) && !anOper->IsDone()) {
          wc.suspend();
          QString msgw = QObject::tr(anOper->GetErrorCode());
          SUIT_MessageBox::warning(this, tr("WRN_WARNING"), msgw, tr("BUT_OK"));
        }
        // JFA 28.12.2004 END
      }
    }
  }
  catch(const SALOME::SALOME_Exception& e) {
    SalomeApp_Tools::QtCatchCorbaException(e);
    abortCommand();
  }

  updateViewer();
  activateSelection();
  updateButtonState();

  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_LimitToleranceDlg::restoreSubShapes ( SALOMEDS::Study_ptr  theStudy,
SALOMEDS::SObject_ptr  theSObject 
) [protected, virtual]

Definition at line 433 of file RepairGUI_LimitToleranceDlg.cxx.

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

Definition at line 204 of file RepairGUI_LimitToleranceDlg.cxx.

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

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

  if (aSelList.Extent() == 1) {
    Handle(SALOME_InteractiveObject) anIO = aSelList.First();
    myObject = GEOMBase::ConvertIOinGEOMObject( anIO );
    if ( !CORBA::is_nil( myObject ) )
      myEditCurrentArgument->setText(GEOMBase::GetName(myObject));
  }
  updateButtonState();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 226 of file RepairGUI_LimitToleranceDlg.cxx.

{
  const QObject* send = sender();
  if (send == GroupPoints->PushButton1)  {
    myEditCurrentArgument->setFocus();
    SelectionIntoArgument();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 422 of file RepairGUI_LimitToleranceDlg.cxx.

{
  bool hasMainObj = !myObject->_is_nil();
  buttonOk()->setEnabled(hasMainObj);
  buttonApply()->setEnabled(hasMainObj);
}

Here is the caller graph for this function:


Member Data Documentation

DlgRef_1SelExt* RepairGUI_LimitToleranceDlg::GroupPoints [private]

Definition at line 66 of file RepairGUI_LimitToleranceDlg.h.

GEOM::GEOM_Object_var RepairGUI_LimitToleranceDlg::myObject [private]

Definition at line 64 of file RepairGUI_LimitToleranceDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_LimitToleranceDlg::myTolEdt [private]

Definition at line 67 of file RepairGUI_LimitToleranceDlg.h.


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