Back to index

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

#include <RepairGUI_RemoveIntWiresDlg.h>

List of all members.

Public Member Functions

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

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 SetEditCurrentArgument ()
void onRemoveAllClicked ()

Private Member Functions

void Init ()
void enterEvent (QEvent *)
void initSelection ()

Private Attributes

GEOM::GEOM_Object_var myObject
GEOM::short_array_var myWiresInd
DlgRef_1Sel1Check1Sel * GroupPoints

Detailed Description

Definition at line 38 of file RepairGUI_RemoveIntWiresDlg.h.


Constructor & Destructor Documentation

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

Definition at line 52 of file RepairGUI_RemoveIntWiresDlg.cxx.

  : GEOMBase_Skeleton(theGeometryGUI, parent, modal)
{
  QPixmap image0 (myGeomGUI->getApp()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_SUPPRESS_INT_WIRES")));
  QPixmap image1 (myGeomGUI->getApp()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));

  setWindowTitle(tr("GEOM_REMOVE_INTERNAL_WIRES_TITLE"));

  /***************************************************************/
  mainFrame()->GroupConstructors->setTitle(tr("GEOM_REMOVE_INTERNAL_WIRES_TITLE"));
  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_1Sel1Check1Sel(centralWidget());
  GroupPoints->GroupBox1->setTitle(tr("GEOM_INTERNAL_WIRES"));
  GroupPoints->TextLabel1->setText(tr("GEOM_SELECTED_FACE"));
  GroupPoints->PushButton1->setIcon(image1);
  GroupPoints->LineEdit1->setReadOnly(true);
  GroupPoints->CheckButton1->setText(tr("GEOM_REMOVE_ALL_INT_WIRES"));
  GroupPoints->TextLabel2->setText(tr("GEOM_WIRES_TO_REMOVE"));
  GroupPoints->PushButton2->setIcon(image1);
  GroupPoints->LineEdit2->setReadOnly(true);

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

  setHelpFileName("suppress_internal_wires_operation_page.html");

  Init();
}

Here is the call graph for this function:

Definition at line 93 of file RepairGUI_RemoveIntWiresDlg.cxx.

{
}

Member Function Documentation

Definition at line 260 of file RepairGUI_RemoveIntWiresDlg.cxx.

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

  myEditCurrentArgument = GroupPoints->LineEdit1;
  myEditCurrentArgument->setText( "" );
  GroupPoints->LineEdit2->setText( "" );
  myObject = GEOM::GEOM_Object::_nil();
  myWiresInd->length( 0 );

  //myGeomGUI->SetState( 0 );
  initSelection();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 144 of file RepairGUI_RemoveIntWiresDlg.cxx.

{
  if (!onAccept())
    return false;

  initName();
  // activate first line edit
  GroupPoints->PushButton1->click();
  return true;
}

Here is the caller graph for this function:

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

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

Definition at line 290 of file RepairGUI_RemoveIntWiresDlg.cxx.

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

Definition at line 280 of file RepairGUI_RemoveIntWiresDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 308 of file RepairGUI_RemoveIntWiresDlg.cxx.

{
  GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow(getOperation());
  GEOM::GEOM_Object_var anObj = anOper->RemoveIntWires(myObject, myWiresInd);

  bool aResult = !anObj->_is_nil();
  if (aResult)
    objects.push_back(anObj._retn());

  return aResult;
}

Definition at line 101 of file RepairGUI_RemoveIntWiresDlg.cxx.

{
  // init variables
  GroupPoints->LineEdit1->clear();
  GroupPoints->LineEdit2->clear();
  myObject = GEOM::GEOM_Object::_nil();
  myWiresInd = new GEOM::short_array();
  myWiresInd->length(0);

  // 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->PushButton2, SIGNAL(clicked()),       this, SLOT(SetEditCurrentArgument()));

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

  connect(GroupPoints->CheckButton1, SIGNAL(clicked()), this, SLOT(onRemoveAllClicked()));

  initName(tr("REMOVE_INT_WIRES_NEW_OBJ_NAME"));

  GroupPoints->PushButton1->click();
  SelectionIntoArgument();
  resize(100,100);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 340 of file RepairGUI_RemoveIntWiresDlg.cxx.

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

  if (myEditCurrentArgument == GroupPoints->LineEdit1) {
    TColStd_MapOfInteger aTypes;
    aTypes.Add(GEOM_COMPOUND);
    aTypes.Add(GEOM_SOLID);
    aTypes.Add(GEOM_SHELL);
    aTypes.Add(GEOM_FACE);

    globalSelection(aTypes);
  }
  else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
    //localSelection(myObject, TopAbs_EDGE);
    localSelection(myObject, TopAbs_WIRE);
  }

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 299 of file RepairGUI_RemoveIntWiresDlg.cxx.

{
  return !myObject->_is_nil() && (GroupPoints->CheckButton1->isChecked() || myWiresInd->length());
}

Definition at line 247 of file RepairGUI_RemoveIntWiresDlg.cxx.

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

Here is the caller graph for this function:

Definition at line 324 of file RepairGUI_RemoveIntWiresDlg.cxx.

{
  bool b = GroupPoints->CheckButton1->isChecked();
  GroupPoints->TextLabel2->setEnabled(!b);
  GroupPoints->PushButton2->setEnabled(!b);
  GroupPoints->LineEdit2->setEnabled(!b);
  if (b) {
    GroupPoints->LineEdit2->setText("");
    myWiresInd->length(0);
  }
}

Here is the caller graph for this function:

Definition at line 159 of file RepairGUI_RemoveIntWiresDlg.cxx.

{
  myEditCurrentArgument->setText("");
  // the second argument depends on the first one
  GroupPoints->LineEdit2->setText("");
  myWiresInd->length(0);

  if (myEditCurrentArgument == GroupPoints->LineEdit1)
    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();

    if (myEditCurrentArgument == GroupPoints->LineEdit1) { // face selection
      myObject = GEOMBase::ConvertIOinGEOMObject( anIO );
      if ( GEOMBase::IsShape(myObject) ) {
        myEditCurrentArgument->setText(GEOMBase::GetName(myObject));

        // clear selection
        disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
        myGeomGUI->getApp()->selectionMgr()->clearSelected();
        connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
                this, SLOT(SelectionIntoArgument()));

        if (!GroupPoints->CheckButton1->isChecked())
          GroupPoints->PushButton2->click();
      }
      else
        myObject = GEOM::GEOM_Object::_nil();
    }
    else if (myEditCurrentArgument == GroupPoints->LineEdit2 &&
             !GroupPoints->CheckButton1->isChecked()) {
      TColStd_IndexedMapOfInteger aMap;
      aSelMgr->GetIndexes(anIO, aMap);
      const int n = aMap.Extent();
      myWiresInd->length(n);
      for (int i = 1; i <= n; i++)
        myWiresInd[i-1] = aMap(i);
      if (n)
        myEditCurrentArgument->setText(QString::number(n) + "_" + tr("GEOM_WIRE") + tr("_S_"));
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 211 of file RepairGUI_RemoveIntWiresDlg.cxx.

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

  bool isEffective = false;

  if (send == GroupPoints->PushButton1) {
    isEffective = true;
    myEditCurrentArgument = GroupPoints->LineEdit1;

    GroupPoints->PushButton2->setDown(false);
    GroupPoints->LineEdit2->setEnabled(false);
  }
  else if (send == GroupPoints->PushButton2 && !myObject->_is_nil()) {
    isEffective = true;
    myEditCurrentArgument = GroupPoints->LineEdit2;

    GroupPoints->PushButton1->setDown(false);
    GroupPoints->LineEdit1->setEnabled(false);
  }

  if (isEffective) {
    initSelection();

    // enable line edit
    myEditCurrentArgument->setEnabled(true);
    myEditCurrentArgument->setFocus();
    // after setFocus(), because it will be setDown(false) when loses focus
    send->setDown(true);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

DlgRef_1Sel1Check1Sel* RepairGUI_RemoveIntWiresDlg::GroupPoints [private]

Definition at line 61 of file RepairGUI_RemoveIntWiresDlg.h.

GEOM::GEOM_Object_var RepairGUI_RemoveIntWiresDlg::myObject [private]

Definition at line 58 of file RepairGUI_RemoveIntWiresDlg.h.

GEOM::short_array_var RepairGUI_RemoveIntWiresDlg::myWiresInd [private]

Definition at line 59 of file RepairGUI_RemoveIntWiresDlg.h.


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