Back to index

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

#include <OperationGUI_GetShapesOnShapeDlg.h>

List of all members.

Public Member Functions

 OperationGUI_GetShapesOnShapeDlg (GeometryGUI *theGeometryGUI, QWidget *parent=0)
 ~OperationGUI_GetShapesOnShapeDlg ()

Protected Member Functions

virtual GEOM::GEOM_IOperations_ptr createOperation ()
virtual bool isValid (QString &)
virtual bool execute (ObjectList &)

Private Slots

void ClickOnOk ()
bool ClickOnApply ()
void SetEditCurrentArgument ()
void SelectionIntoArgument ()
void LineEditReturnPressed ()
void ActivateThisDialog ()
void ComboTextChanged ()

Private Member Functions

void Init ()
void enterEvent (QEvent *)

Private Attributes

GEOM::GEOM_Object_var myObject1
GEOM::GEOM_Object_var myObject2
int myShapeType
GEOMAlgo_State myState
DlgRef_2Sel2List * GroupPoints

Detailed Description

Definition at line 36 of file OperationGUI_GetShapesOnShapeDlg.h.


Constructor & Destructor Documentation

OperationGUI_GetShapesOnShapeDlg::OperationGUI_GetShapesOnShapeDlg ( GeometryGUI *  theGeometryGUI,
QWidget *  parent = 0 
)

Definition at line 42 of file OperationGUI_GetShapesOnShapeDlg.cxx.

  : GEOMBase_Skeleton(theGeometryGUI, parent, false)
{
  SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
  QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_SHAPES_ON_SHAPE")));
  QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));

  setWindowTitle(tr("GEOM_SHAPES_ON_SHAPE_TITLE"));

  /***************************************************************/
  mainFrame()->GroupConstructors->setTitle(tr("GEOM_SHAPES_ON_SHAPE"));
  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_2Sel2List(centralWidget());
  //GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION"));
  GroupPoints->GroupBox1->setTitle("Input data");
  GroupPoints->TextLabel1->setText(tr("GEOM_SHAPES_ON_SHAPE_ESHAPE"));
  GroupPoints->TextLabel2->setText(tr("GEOM_SHAPES_ON_SHAPE_CSHAPE"));
  GroupPoints->TextLabel3->setText(tr("GEOM_RECONSTRUCTION_LIMIT"));
  GroupPoints->TextLabel4->setText(tr("GEOM_SHAPES_ON_SHAPE_STATE"));
  GroupPoints->PushButton1->setIcon(image2);
  GroupPoints->PushButton2->setIcon(image2);
  GroupPoints->LineEdit1->setReadOnly(true);
  GroupPoints->LineEdit2->setReadOnly(true);

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

  setHelpFileName("shapesonshape_page.html");

  Init();
}

Here is the call graph for this function:

Definition at line 86 of file OperationGUI_GetShapesOnShapeDlg.cxx.

{
}

Member Function Documentation

Definition at line 266 of file OperationGUI_GetShapesOnShapeDlg.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:

Definition at line 165 of file OperationGUI_GetShapesOnShapeDlg.cxx.

{
  if (!onAccept())
    return false;

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

Here is the caller graph for this function:

Definition at line 154 of file OperationGUI_GetShapesOnShapeDlg.cxx.

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

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 350 of file OperationGUI_GetShapesOnShapeDlg.cxx.

{
  // VRS ???? What is it for ??? commented for a while...
  //bool IsEnabled = GroupPoints->ComboBox1->currentIndex() < 3;
  processPreview();
}

Here is the caller graph for this function:

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

Definition at line 289 of file OperationGUI_GetShapesOnShapeDlg.cxx.

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

Definition at line 279 of file OperationGUI_GetShapesOnShapeDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 312 of file OperationGUI_GetShapesOnShapeDlg.cxx.

{
  int aLimit = GroupPoints->ComboBox1->currentIndex();
  switch (aLimit)
  {
  case 0:  aLimit = GEOM::SOLID ; break;
  case 1:  aLimit = GEOM::FACE  ; break;
  case 2:  aLimit = GEOM::EDGE  ; break;
  case 3:  aLimit = GEOM::VERTEX; break;
  default: aLimit = GEOM::SHAPE ; break;
  }

  GEOM::shape_state aState;
  switch (GroupPoints->ComboBox2->currentIndex())
  {
    case 0:  aState = GEOM::ST_IN;    break;
    case 1:  aState = GEOM::ST_OUT;   break;
    case 2:  aState = GEOM::ST_ON;    break;
    case 3:  aState = GEOM::ST_ONIN;  break;
    case 4:  aState = GEOM::ST_ONOUT; break;
    default: break;
  }

  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
  GEOM::GEOM_Object_var anObj = anOper->GetShapesOnShapeAsCompound(myObject2, myObject1,
                                                                   (CORBA::Short) aLimit,
                                                                   aState);

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

  return objects.size();
}

Definition at line 94 of file OperationGUI_GetShapesOnShapeDlg.cxx.

{
  // type for sub-shape selection
  GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_SOLID"));
  // commented by skl for IPAL19949 - finder isn't allowed such type
  //GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_SHELL"));
  GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_FACE"));
  // commented by skl for IPAL19949 - finder isn't allowed such type
  //GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_WIRE"));
  GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_EDGE"));
  GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_VERTEX"));

  // type for state selection
  GroupPoints->ComboBox2->addItem(tr("GEOM_STATE_IN"));
  GroupPoints->ComboBox2->addItem(tr("GEOM_STATE_OUT"));
  GroupPoints->ComboBox2->addItem(tr("GEOM_STATE_ON"));
  GroupPoints->ComboBox2->addItem(tr("GEOM_STATE_ONIN"));
  GroupPoints->ComboBox2->addItem(tr("GEOM_STATE_ONOUT"));

  GroupPoints->LineEdit1->clear();
  GroupPoints->LineEdit2->clear();
  myObject1 = myObject2 = GEOM::GEOM_Object::_nil();

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

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

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

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

  initName(mainFrame()->GroupConstructors->title());

  GroupPoints->TextLabel3->show();
  GroupPoints->ComboBox1->show();
  GroupPoints->ComboBox1->setCurrentIndex(0);
  GroupPoints->ComboBox2->show();
  GroupPoints->ComboBox2->setCurrentIndex(0);

  globalSelection(GEOM_ALLSHAPES);

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 298 of file OperationGUI_GetShapesOnShapeDlg.cxx.

{
  //Handle(SALOME_InteractiveObject) IO = firstIObject();
  //GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO );
  //if ( anObject->_is_nil() )
  //  return false;

  return !CORBA::is_nil(myObject1) && !CORBA::is_nil(myObject2);
}

Definition at line 252 of file OperationGUI_GetShapesOnShapeDlg.cxx.

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

Here is the caller graph for this function:

Definition at line 180 of file OperationGUI_GetShapesOnShapeDlg.cxx.

{
  myEditCurrentArgument->setText("");

  if      (myEditCurrentArgument == GroupPoints->LineEdit1) myObject1 = GEOM::GEOM_Object::_nil();
  else if (myEditCurrentArgument == GroupPoints->LineEdit2) myObject2 = GEOM::GEOM_Object::_nil();

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

  QString aName = "";
  int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName, true);

  if (nbSel > 0) {
    GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
    if ( GEOMBase::IsShape(aSelectedObject) ) {
      myEditCurrentArgument->setText(aName);

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

      if (myEditCurrentArgument == GroupPoints->LineEdit1) {
        myObject1 = aSelectedObject;
        if (myObject2->_is_nil())
          GroupPoints->PushButton2->click();
      }
      else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
        myObject2 = aSelectedObject;
        if (myObject1->_is_nil())
          GroupPoints->PushButton1->click();
      }
    }
  }
  processPreview();
}

Here is the caller graph for this function:

Definition at line 224 of file OperationGUI_GetShapesOnShapeDlg.cxx.

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

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

    GroupPoints->PushButton2->setDown(false);
    GroupPoints->LineEdit2->setEnabled(false);
  }
  else if (send == GroupPoints->PushButton2) {
    myEditCurrentArgument = GroupPoints->LineEdit2;

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

  // 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 caller graph for this function:


Member Data Documentation

DlgRef_2Sel2List* OperationGUI_GetShapesOnShapeDlg::GroupPoints [private]

Definition at line 60 of file OperationGUI_GetShapesOnShapeDlg.h.

GEOM::GEOM_Object_var OperationGUI_GetShapesOnShapeDlg::myObject1 [private]

Definition at line 55 of file OperationGUI_GetShapesOnShapeDlg.h.

GEOM::GEOM_Object_var OperationGUI_GetShapesOnShapeDlg::myObject2 [private]

Definition at line 56 of file OperationGUI_GetShapesOnShapeDlg.h.

Definition at line 57 of file OperationGUI_GetShapesOnShapeDlg.h.

Definition at line 58 of file OperationGUI_GetShapesOnShapeDlg.h.


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