Back to index

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

#include <OperationGUI_GetSharedShapesDlg.h>

List of all members.

Public Member Functions

 OperationGUI_GetSharedShapesDlg (GeometryGUI *, QWidget *=0)
 ~OperationGUI_GetSharedShapesDlg ()

Protected Member Functions

virtual GEOM::GEOM_IOperations_ptr createOperation ()
virtual bool isValid (QString &)
virtual bool execute (ObjectList &)
virtual GEOM::GEOM_Object_ptr getFather (GEOM::GEOM_Object_ptr)
QString getPrefixByType () const

Private Slots

void ClickOnOk ()
bool ClickOnApply ()
void ActivateThisDialog ()
void SelectionIntoArgument ()
void SetEditCurrentArgument ()
void ConstructorsClicked (int)
void ComboTextChanged ()

Private Member Functions

void Init ()
void enterEvent (QEvent *)
int GetType () const

Private Attributes

GEOM::ListOfGO myListShapes
DlgRef_2Sel1List1Check * GroupPoints

Detailed Description

Definition at line 36 of file OperationGUI_GetSharedShapesDlg.h.


Constructor & Destructor Documentation

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

Definition at line 51 of file OperationGUI_GetSharedShapesDlg.cxx.

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

  setWindowTitle(tr("GEOM_SHARED_SHAPES_TITLE"));

  /***************************************************************/
  mainFrame()->GroupConstructors->setTitle(tr("GEOM_GET_SHARED_SHAPES"));
  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_2Sel1List1Check(centralWidget());
  GroupPoints->GroupBox1->setTitle(tr("GEOM_SHARED_SHAPES_INPUT"));
  GroupPoints->TextLabel1->setText(tr("GEOM_SHAPES"));
  GroupPoints->TextLabel2->hide();
  GroupPoints->TextLabel3->setText(tr("GEOM_SUBSHAPE_TYPE"));
  GroupPoints->PushButton1->setIcon(image2);
  GroupPoints->PushButton2->hide();
  GroupPoints->LineEdit1->setReadOnly(true);
  GroupPoints->LineEdit2->hide();
  GroupPoints->LineEdit1->setEnabled(true);
  GroupPoints->CheckButton1->hide();

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

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

  setHelpFileName("shared_shapes_page.html");

  Init();
}

Definition at line 95 of file OperationGUI_GetSharedShapesDlg.cxx.

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

Member Function Documentation

Definition at line 244 of file OperationGUI_GetSharedShapesDlg.cxx.

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

  ConstructorsClicked(getConstructorId());
  processPreview();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 182 of file OperationGUI_GetSharedShapesDlg.cxx.

{
  if (!onAccept())
    return false;

  //initName(getNewObjectName());
  initName(getPrefixByType());

  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 171 of file OperationGUI_GetSharedShapesDlg.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 268 of file OperationGUI_GetSharedShapesDlg.cxx.

{
  //initName(getNewObjectName());
  initName(getPrefixByType());
  processPreview();
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 144 of file OperationGUI_GetSharedShapesDlg.cxx.

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

  myListShapes.length(0);

  GroupPoints->ComboBox1->setCurrentIndex(0);
  GroupPoints->PushButton1->setDown(true);

  myEditCurrentArgument = GroupPoints->LineEdit1;
  GroupPoints->LineEdit1->clear();

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 300 of file OperationGUI_GetSharedShapesDlg.cxx.

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

Definition at line 258 of file OperationGUI_GetSharedShapesDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 322 of file OperationGUI_GetSharedShapesDlg.cxx.

{
  GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
  GEOM::ListOfGO_var aList = anOper->GetSharedShapesMulti(myListShapes, GetType());

  if (!aList->length())
    return false;

  if (aList->length() > 1)
    myMainFrame->ResultName->setText(getPrefixByType());

  for (int i = 0, n = aList->length(); i < n; i++)
    objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));

  return objects.size();
}

Here is the call graph for this function:

GEOM::GEOM_Object_ptr OperationGUI_GetSharedShapesDlg::getFather ( GEOM::GEOM_Object_ptr  ) [protected, virtual]

Definition at line 344 of file OperationGUI_GetSharedShapesDlg.cxx.

{
  if (myListShapes.length() > 0)
    //return myListShapes[0]._retn();
    return myListShapes[0];
  return NULL;
}
QString OperationGUI_GetSharedShapesDlg::getPrefixByType ( ) const [protected]

Definition at line 356 of file OperationGUI_GetSharedShapesDlg.cxx.

{
  QString aPref;

  int aLimit = GroupPoints->ComboBox1->currentIndex();

  switch (aLimit) {
  case 0:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SOLID")) ; break;
  case 1:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHELL")) ; break;
  case 2:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_FACE"))  ; break;
  case 3:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_WIRE"))  ; break;
  case 4:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_EDGE"))  ; break;
  case 5:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_VERTEX")); break;
  default: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHAPE")) ;
  }

  return aPref;
}

Here is the caller graph for this function:

Definition at line 279 of file OperationGUI_GetSharedShapesDlg.cxx.

{
  int aLimit = GroupPoints->ComboBox1->currentIndex();

  switch (aLimit) {
  case 0:  aLimit = GEOM::SOLID ; break;
  case 1:  aLimit = GEOM::SHELL ; break;
  case 2:  aLimit = GEOM::FACE  ; break;
  case 3:  aLimit = GEOM::WIRE  ; break;
  case 4:  aLimit = GEOM::EDGE  ; break;
  case 5:  aLimit = GEOM::VERTEX; break;
  default: aLimit = GEOM::SHAPE ;
  }

  return aLimit;
}

Here is the caller graph for this function:

Definition at line 104 of file OperationGUI_GetSharedShapesDlg.cxx.

{
  /* type for sub-shape selection */
  GroupPoints->ComboBox1->addItem(tr("GEOM_SOLID"));
  GroupPoints->ComboBox1->addItem(tr("GEOM_SHELL"));
  GroupPoints->ComboBox1->addItem(tr("GEOM_FACE"));
  GroupPoints->ComboBox1->addItem(tr("GEOM_WIRE"));
  GroupPoints->ComboBox1->addItem(tr("GEOM_EDGE"));
  GroupPoints->ComboBox1->addItem(tr("GEOM_VERTEX"));

  GroupPoints->ComboBox1->setCurrentIndex(0);

  showOnlyPreviewControl();

  /* 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(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));

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

  //initName(getNewObjectName());
  initName(getPrefixByType());

  ConstructorsClicked(0);
  GroupPoints->PushButton1->click();
}

Here is the call graph for this function:

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

Definition at line 309 of file OperationGUI_GetSharedShapesDlg.cxx.

{
  if (myListShapes.length() < 2) {
    msg = tr("MSG_SHARED_SHAPES_TOO_FEW_SHAPES");
    return false;
  }
  return true;
}

Definition at line 197 of file OperationGUI_GetSharedShapesDlg.cxx.

{
  myEditCurrentArgument->setText("");
  QString aString = "";

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

  int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);

  if (nbSel < 1) {
    myListShapes.length(0);
  }

  GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true);
  if (!myListShapes.length())
    return;

  myEditCurrentArgument->setText(aString);
  processPreview();
}

Here is the caller graph for this function:

Definition at line 224 of file OperationGUI_GetSharedShapesDlg.cxx.

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

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

  globalSelection(GEOM_ALLSHAPES);

  myEditCurrentArgument->setFocus();
  SelectionIntoArgument();
  send->setDown(true);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

DlgRef_2Sel1List1Check* OperationGUI_GetSharedShapesDlg::GroupPoints [private]

Definition at line 60 of file OperationGUI_GetSharedShapesDlg.h.

Definition at line 58 of file OperationGUI_GetSharedShapesDlg.h.


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