Back to index

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

#include <RepairGUI_GlueDlg.h>

List of all members.

Public Member Functions

 RepairGUI_GlueDlg (GeometryGUI *, QWidget *=0, bool=false, TopAbs_ShapeEnum theGlueMode=TopAbs_FACE)
 ~RepairGUI_GlueDlg ()

Protected Slots

virtual void ClickOnCancel ()

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)
void onDetect ()
void onTolerChanged (double)
void onSubShapesChk ()

Private Member Functions

void Init ()
void enterEvent (QEvent *)
void initSelection ()
void clearTemporary ()
bool onAcceptLocal ()
void clearShapeBufferLocal (GEOM::GEOM_Object_ptr)
void activateSelection ()
void updateButtonState ()
void selectTmpInViewer ()

Private Attributes

GEOM::GEOM_Object_var myObject
QList< GEOM::GeomObjPtrmyTmpObjs
DlgRef_1SelExt * GroupPoints
DlgRef_1SelExt * GroupPoints2
SalomeApp_DoubleSpinBox * myTolEdt
SalomeApp_DoubleSpinBox * myTolEdt2
QPushButton * myDetectBtn
QCheckBox * mySubShapesChk
QCheckBox * myGlueAllEdgesChk
int myCurrConstrId
TopAbs_ShapeEnum myGlueMode

Detailed Description

Definition at line 45 of file RepairGUI_GlueDlg.h.


Constructor & Destructor Documentation

RepairGUI_GlueDlg::RepairGUI_GlueDlg ( GeometryGUI *  theGeometryGUI,
QWidget *  parent = 0,
bool  modal = false,
TopAbs_ShapeEnum  theGlueMode = TopAbs_FACE 
)

Definition at line 61 of file RepairGUI_GlueDlg.cxx.

  : GEOMBase_Skeleton(theGeometryGUI, parent, modal),
    myCurrConstrId(-1), myGlueMode(theGlueMode)
{
  QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
  QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_GLUE_FACES")));
  QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_GLUE_FACES2")));
  QPixmap image3 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_GLUE_EDGES")));
  QPixmap image4 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_GLUE_EDGES2")));

  QString aTitle;
  if (theGlueMode == TopAbs_FACE)
    aTitle = tr("GEOM_GLUE_FACES_TITLE");
  else if (theGlueMode == TopAbs_EDGE)
    aTitle = tr("GEOM_GLUE_EDGES_TITLE");
  setWindowTitle(aTitle);

  /***************************************************************/
  mainFrame()->GroupConstructors->setTitle(aTitle);
  if (theGlueMode == TopAbs_FACE) {
    mainFrame()->RadioButton1->setIcon(image1);
    mainFrame()->RadioButton2->setIcon(image2);
  }
  else if (theGlueMode == TopAbs_EDGE) {
    mainFrame()->RadioButton1->setIcon(image3);
    mainFrame()->RadioButton2->setIcon(image4);
  }
  mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
  mainFrame()->RadioButton3->close();

  GroupPoints = new DlgRef_1SelExt(centralWidget());
  GroupPoints->GroupBox1->setTitle(tr("GEOM_GLUE"));
  GroupPoints->TextLabel1->setText(tr("GEOM_SELECTED_SHAPE"));
  GroupPoints->PushButton1->setIcon(image0);
  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);
  /***************************************************************/

  GroupPoints2 = new DlgRef_1SelExt(centralWidget());
  GroupPoints2->GroupBox1->setTitle(tr("GEOM_GLUE"));
  GroupPoints2->TextLabel1->setText(tr("GEOM_SELECTED_SHAPE"));
  GroupPoints2->PushButton1->setIcon(image0);
  GroupPoints2->LineEdit1->setReadOnly(true);

  QLabel* aTolLab2 = new QLabel(tr("GEOM_TOLERANCE"), GroupPoints2->Box);
  myTolEdt2 = new SalomeApp_DoubleSpinBox(GroupPoints2->Box);
  initSpinBox(myTolEdt2, 0., 100., DEFAULT_TOLERANCE_VALUE, "len_tol_precision");
  myTolEdt2->setValue(DEFAULT_TOLERANCE_VALUE);

  QString aGlueString (" [%1]");
  QString aSelString;
  if (theGlueMode == TopAbs_FACE) {
    aGlueString = aGlueString.arg(tr("GLUE_FACES"));
    aSelString = tr("SELECT_FACES");
  }
  else if (theGlueMode == TopAbs_EDGE) {
    aGlueString = aGlueString.arg(tr("GLUE_EDGES"));
    aSelString = tr("SELECT_EDGES");
  }
  myDetectBtn = new QPushButton (tr("GEOM_DETECT") + aGlueString, GroupPoints2->Box);
  mySubShapesChk = new QCheckBox (aSelString, GroupPoints2->Box);
  myGlueAllEdgesChk = 0;

  boxLayout = new QGridLayout(GroupPoints2->Box);
  boxLayout->setMargin(0); boxLayout->setSpacing(6);
  boxLayout->addWidget(aTolLab2,    0, 0);
  boxLayout->addWidget(myTolEdt2,   0, 2);
  boxLayout->addWidget(myDetectBtn, 1, 0, 1, 3);
  boxLayout->addWidget(mySubShapesChk, 2, 0, 1, 3);

  if (theGlueMode == TopAbs_FACE) {
    myGlueAllEdgesChk = new QCheckBox (tr("GLUE_ALL_EDGES"), GroupPoints2->Box);
    boxLayout->addWidget(myGlueAllEdgesChk, 3, 0, 1, 3);
    myGlueAllEdgesChk->setChecked(false);
  }

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

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

  QString aHelpFileName; 
  switch ( myGlueMode ) {
    case TopAbs_EDGE:
      {
        aHelpFileName = "glue_edges_operation_page.html";
        break;
      }
    case TopAbs_FACE:
      {
        aHelpFileName = "glue_faces_operation_page.html";
        break;
      }
  }
  setHelpFileName(aHelpFileName);

  // Disable second way of gluing if OCC viewer is not active one
  if (myGeomGUI->getApp()->desktop()->activeWindow()->getViewManager()->getType()
       != OCCViewer_Viewer::Type())
    mainFrame()->RadioButton2->setEnabled(false);

  Init();
}

Here is the call graph for this function:

Definition at line 181 of file RepairGUI_GlueDlg.cxx.

{
}

Member Function Documentation

Definition at line 731 of file RepairGUI_GlueDlg.cxx.

{
  erasePreview(false);

  int anId = getConstructorId();
  if (anId == 0) {
    // Case of whole gluing
    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()));
  }
  else {
    // Second case of gluing
    if (!mySubShapesChk->isChecked())
      globalSelection(GEOM_ALLSHAPES);
    else {
      displayPreview(true, true, false, false, 2/*line width*/, 1/*display mode*/, Quantity_NOC_RED);
      disconnect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
                  this, SLOT(SelectionIntoArgument())) ;
      globalSelection(GEOM_PREVIEW);
      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:

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

Definition at line 382 of file RepairGUI_GlueDlg.cxx.

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

  //GroupPoints->LineEdit1->setText("");
  //GroupPoints2->LineEdit1->setText("");
  //myObject = GEOM::GEOM_Object::_nil();

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

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_GlueDlg::clearShapeBufferLocal ( GEOM::GEOM_Object_ptr  theObj) [private]

Definition at line 561 of file RepairGUI_GlueDlg.cxx.

{
  if (CORBA::is_nil(theObj))
    return;

  CORBA::String_var IOR = myGeomGUI->getApp()->orb()->object_to_string(theObj);
  TCollection_AsciiString asciiIOR((char *)(IOR.in()));
  myGeomGUI->GetShapeReader().RemoveShapeFromBuffer(asciiIOR);

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

  _PTR(Study) aStudy = getStudy()->studyDS();
  _PTR(SObject) aSObj (aStudy->FindObjectIOR(std::string(IOR.in())));
  if (!aSObj)
    return;

  _PTR(ChildIterator) anIt (aStudy->NewChildIterator(aSObj));
  for (anIt->InitEx(true); anIt->More(); anIt->Next()) {
    _PTR(GenericAttribute) anAttr;
    if (anIt->Value()->FindAttribute(anAttr, "AttributeIOR")) {
      _PTR(AttributeIOR) anIOR (anAttr);
      TCollection_AsciiString asciiIOR((char*)anIOR->Value().c_str());
      myGeomGUI->GetShapeReader().RemoveShapeFromBuffer(asciiIOR);
    }
  }
}

Definition at line 798 of file RepairGUI_GlueDlg.cxx.

{
  myTmpObjs.clear();
}

Here is the caller graph for this function:

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

Definition at line 302 of file RepairGUI_GlueDlg.cxx.

{
  if (!onAcceptLocal())
    return false;

  initName();

  //GroupPoints->LineEdit1->setText("");
  //myObject = GEOM::GEOM_Object::_nil();

  //globalSelection(GEOM_COMPOUND);

  ConstructorsClicked(getConstructorId());

  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_GlueDlg::ClickOnCancel ( ) [protected, virtual, slot]

Definition at line 830 of file RepairGUI_GlueDlg.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 291 of file RepairGUI_GlueDlg.cxx.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 234 of file RepairGUI_GlueDlg.cxx.

{
  if (myCurrConstrId == constructorId)
    return;

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

  switch (constructorId) {
  case 0:
    GroupPoints2->hide();
    GroupPoints->show();
    GroupPoints->LineEdit1->setText("");
    myEditCurrentArgument = GroupPoints->LineEdit1;

    if (myCurrConstrId >= 0) {
      // i.e. it is not initialisation
      // copy tolerance from previous tolerance field
      myTolEdt->setValue(myTolEdt2->value());
    }
    break;
  case 1:
    GroupPoints->hide();
    GroupPoints2->show();
    GroupPoints->LineEdit1->setText("");
    myEditCurrentArgument = GroupPoints2->LineEdit1;

    if (myCurrConstrId >= 0) {
      // i.e. it is not initialisation
      // copy tolerance from previous tolerance field
      myTolEdt2->setValue(myTolEdt->value());
      mySubShapesChk->setChecked(false);
      clearTemporary();
    }
    break;
  }

  myCurrConstrId = constructorId;

  myEditCurrentArgument->setFocus();

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 411 of file RepairGUI_GlueDlg.cxx.

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

Definition at line 401 of file RepairGUI_GlueDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 442 of file RepairGUI_GlueDlg.cxx.

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

  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
  switch (getConstructorId()) {
  case 0:
    {
      GEOM::GEOM_Object_var anObj;
      if (myGlueMode == TopAbs_FACE)
        anObj = anOper->MakeGlueFaces(myObject, myTolEdt->value(), true);
      else if (myGlueMode == TopAbs_EDGE)
        anObj = anOper->MakeGlueEdges(myObject, myTolEdt->value());

      aResult = !anObj->_is_nil();
      if (aResult && !IsPreview())
      {
        QStringList aParameters;
        aParameters << myTolEdt->text();
        anObj->SetParameters(aParameters.join(":").toLatin1().constData());

        objects.push_back(anObj._retn());
      }
      break;
    }
  case 1:
    {
      if (IsPreview()) {
        // if this method is used for displaying preview then we must detect glue faces/edges only
        for (int i = 0; i < myTmpObjs.count(); i++) {
          myTmpObjs[i].get()->Register(); // increment counter, since calling function will call UnRegister()
          objects.push_back(myTmpObjs[i].copy());
        }
        return !myTmpObjs.isEmpty();
      } // IsPreview

      // Make glue faces/edges by list.
      // Iterate through myTmpObjs and verifies where each object is currently selected or not.
      QSet<QString> selected;

      // Get names of selected objects
      LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
      SALOME_ListIO aSelList;
      aSelMgr->selectedObjects(aSelList);

      SALOME_ListIteratorOfListIO it (aSelList);
      for (; it.More(); it.Next())
        selected.insert(it.Value()->getName());

      // Iterate through result and select objects with names from selection
      // ObjectList toRemoveFromEnggine;

      // make glue faces/edges
      GEOM::ListOfGO_var aListForGlue = new GEOM::ListOfGO();
      aListForGlue->length(myTmpObjs.count());
      int added = 0;
      for (int i = 0; i < myTmpObjs.count(); i++) {
        CORBA::String_var tmpior = myGeomGUI->getApp()->orb()->object_to_string(myTmpObjs[i].get());
        if (selected.contains(tmpior.in()))
          aListForGlue[ added++ ] = myTmpObjs[i].copy();
      }
      aListForGlue->length(added);

      GEOM::GEOM_Object_var anObj;
      if (myGlueMode == TopAbs_FACE) {
        bool doGlueAllEdges = myGlueAllEdgesChk->isChecked();
        anObj = anOper->MakeGlueFacesByList(myObject, myTolEdt2->value(), aListForGlue.in(),
                                            true, doGlueAllEdges);
      }
      else if (myGlueMode == TopAbs_EDGE)
        anObj = anOper->MakeGlueEdgesByList(myObject, myTolEdt2->value(), aListForGlue.in());

      aResult = !anObj->_is_nil();

      if (aResult) {
        if (!IsPreview()) {
          QStringList aParameters;
          aParameters << myTolEdt2->text();
          anObj->SetParameters(aParameters.join(":").toLatin1().constData());
        }
        objects.push_back(anObj._retn());
      }

      // Remove from engine useless objects
      clearTemporary();

      updateButtonState();

      break;
    } // case 1
  } // switch

  return aResult;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_GlueDlg::Init ( ) [private]

Definition at line 189 of file RepairGUI_GlueDlg.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(this,          SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));

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

  connect(GroupPoints2->PushButton1, SIGNAL(clicked()),       this, SLOT(SetEditCurrentArgument()));
  connect(GroupPoints2->LineEdit1,   SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
  connect(myTolEdt2, SIGNAL(valueChanged(double)), this, SLOT(onTolerChanged(double)));
  connect(mySubShapesChk, SIGNAL(stateChanged(int)), this, SLOT(onSubShapesChk()));

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

  connect(myDetectBtn, SIGNAL(clicked()), this, SLOT(onDetect()));

  initName(tr("GLUE_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_GlueDlg::isValid ( QString &  msg) [protected, virtual]

Definition at line 420 of file RepairGUI_GlueDlg.cxx.

{
  bool ok = true;
  double v = 0;
  switch (getConstructorId())
  {
  case 0:
    v = myTolEdt->value();
    ok = myTolEdt->isValid(msg, !IsPreview());
    break;
  case 1:
    v = myTolEdt2->value();
    ok = myTolEdt2->isValid(msg, !IsPreview());
    break;
  }
  return !myObject->_is_nil() && (IsPreview() || v > 0.) && ok;
}

Here is the caller graph for this function:

void RepairGUI_GlueDlg::LineEditReturnPressed ( ) [private, slot]

Definition at line 365 of file RepairGUI_GlueDlg.cxx.

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

Here is the caller graph for this function:

Definition at line 595 of file RepairGUI_GlueDlg.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;
  }

  erasePreview(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_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_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_GlueDlg::onDetect ( ) [private, slot]

Definition at line 683 of file RepairGUI_GlueDlg.cxx.

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

  buttonOk()->setEnabled(false);
  buttonApply()->setEnabled(false);
  globalSelection(GEOM_ALLSHAPES);

  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
  GEOM::ListOfGO_var aList;
  if (myGlueMode == TopAbs_FACE)
    aList = anOper->GetGlueFaces(myObject.in(), myTolEdt2->value());
  else if (myGlueMode == TopAbs_EDGE)
    aList = anOper->GetGlueEdges(myObject.in(), myTolEdt2->value());

  for (int i = 0, n = aList->length(); i < n; i++)
    myTmpObjs << GEOM::GeomObjPtr(aList[i].in());

  if (!myTmpObjs.isEmpty()) {
    if (myGlueMode == TopAbs_FACE)
      msg = tr("FACES_FOR_GLUING_ARE_DETECTED").arg(myTmpObjs.count());
    else if (myGlueMode == TopAbs_EDGE)
      msg = tr("EDGES_FOR_GLUING_ARE_DETECTED").arg(myTmpObjs.count());
    mySubShapesChk->setChecked(true);
  }
  else {
    if (myGlueMode == TopAbs_FACE)
      msg = tr("THERE_ARE_NO_FACES_FOR_GLUING");
    else if (myGlueMode == TopAbs_EDGE)
      msg = tr("THERE_ARE_NO_EDGES_FOR_GLUING");
  }

  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
          this, SLOT(SelectionIntoArgument())) ;
  SUIT_MessageBox::information(this, tr("GEOM_FREE_BOUNDS_TLT"), msg, tr("Close"));
  updateButtonState();
  activateSelection();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_GlueDlg::onSubShapesChk ( ) [private, slot]

Definition at line 818 of file RepairGUI_GlueDlg.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_GlueDlg::onTolerChanged ( double  ) [private, slot]

Definition at line 807 of file RepairGUI_GlueDlg.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 542 of file RepairGUI_GlueDlg.cxx.

{
  if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
    GEOM::find_shape_method aFindMethod = GEOM::FSM_GetInPlace;
    if (getConstructorId() == 0) // MakeGlueFaces or MakeGlueEdges
      aFindMethod = GEOM::FSM_GetInPlaceByHistory;

    // empty list of arguments means that all arguments should be restored
    getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
                                         aFindMethod, /*theInheritFirstArg=*/true,
                                         mainFrame()->CheckBoxAddPrefix->isChecked());
  }
}
void RepairGUI_GlueDlg::SelectionIntoArgument ( ) [private, slot]

Definition at line 324 of file RepairGUI_GlueDlg.cxx.

{
  if (mySubShapesChk->isChecked() &&  getConstructorId() == 1) {
    updateButtonState();
    return;
  }

  erasePreview();
  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 352 of file RepairGUI_GlueDlg.cxx.

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

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 768 of file RepairGUI_GlueDlg.cxx.

{
  int anId = getConstructorId();
  bool hasMainObj = !myObject->_is_nil();
  if (anId == 0) {
    buttonOk()->setEnabled(hasMainObj);
    buttonApply()->setEnabled(hasMainObj);
  }
  else
  {
    LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
    SALOME_ListIO aSelList;
    aSelMgr->selectedObjects(aSelList);

    SALOME_ListIteratorOfListIO it (aSelList);
    bool wasSelected = it.More() > 0;
    bool wasDetected = !myTmpObjs.isEmpty();
    buttonOk()->setEnabled(hasMainObj && wasDetected && wasSelected);
    buttonApply()->setEnabled(hasMainObj && wasDetected && wasSelected);
    mySubShapesChk->setEnabled(hasMainObj && wasDetected);
    myDetectBtn->setEnabled(hasMainObj);
    if (!hasMainObj || !wasDetected)
      mySubShapesChk->setChecked(false);
  }
}

Here is the caller graph for this function:


Member Data Documentation

DlgRef_1SelExt* RepairGUI_GlueDlg::GroupPoints [private]

Definition at line 79 of file RepairGUI_GlueDlg.h.

DlgRef_1SelExt* RepairGUI_GlueDlg::GroupPoints2 [private]

Definition at line 80 of file RepairGUI_GlueDlg.h.

Definition at line 87 of file RepairGUI_GlueDlg.h.

QPushButton* RepairGUI_GlueDlg::myDetectBtn [private]

Definition at line 83 of file RepairGUI_GlueDlg.h.

Definition at line 85 of file RepairGUI_GlueDlg.h.

TopAbs_ShapeEnum RepairGUI_GlueDlg::myGlueMode [private]

Definition at line 89 of file RepairGUI_GlueDlg.h.

GEOM::GEOM_Object_var RepairGUI_GlueDlg::myObject [private]

Definition at line 76 of file RepairGUI_GlueDlg.h.

QCheckBox* RepairGUI_GlueDlg::mySubShapesChk [private]

Definition at line 84 of file RepairGUI_GlueDlg.h.

Definition at line 77 of file RepairGUI_GlueDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_GlueDlg::myTolEdt [private]

Definition at line 81 of file RepairGUI_GlueDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_GlueDlg::myTolEdt2 [private]

Definition at line 82 of file RepairGUI_GlueDlg.h.


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