Back to index

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

#include <TransformationGUI_ProjectionDlg.h>

List of all members.

Public Member Functions

 TransformationGUI_ProjectionDlg (GeometryGUI *, QWidget *=0, bool=false, Qt::WindowFlags=0)
 ~TransformationGUI_ProjectionDlg ()

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 ActivateThisDialog ()

Private Member Functions

void Init ()
void enterEvent (QEvent *)

Private Attributes

GEOM::GeomObjPtr myObject1
GEOM::GeomObjPtr myObject2
DlgRef_2Sel * myGroup

Detailed Description

Definition at line 38 of file TransformationGUI_ProjectionDlg.h.


Constructor & Destructor Documentation

TransformationGUI_ProjectionDlg::TransformationGUI_ProjectionDlg ( GeometryGUI *  theGeometryGUI,
QWidget *  parent = 0,
bool  modal = false,
Qt::WindowFlags  fl = 0 
)

Definition at line 48 of file TransformationGUI_ProjectionDlg.cxx.

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

  setWindowTitle(tr("GEOM_PROJECTION_TITLE"));

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

  myGroup = new DlgRef_2Sel (centralWidget());

  myGroup->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
  myGroup->TextLabel1->setText(tr("GEOM_SOURCE_OBJECT"));
  myGroup->TextLabel2->setText(tr("GEOM_TARGET_OBJECT"));
  myGroup->PushButton1->setIcon(image1);
  myGroup->PushButton2->setIcon(image1);
  myGroup->LineEdit1->setReadOnly(true);
  myGroup->LineEdit2->setReadOnly(true);

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

  setHelpFileName("projection_operation_page.html");

  // Initialisation
  Init();
}

Here is the call graph for this function:

Definition at line 88 of file TransformationGUI_ProjectionDlg.cxx.

{
}

Member Function Documentation

Definition at line 238 of file TransformationGUI_ProjectionDlg.cxx.

{
  GEOMBase_Skeleton::ActivateThisDialog();

  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 150 of file TransformationGUI_ProjectionDlg.cxx.

{
  if (!onAccept())
    return false;

  initName();
  // activate selection and connect selection manager
  myGroup->PushButton1->click();
  return true;
}

Here is the caller graph for this function:

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

Definition at line 261 of file TransformationGUI_ProjectionDlg.cxx.

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

Definition at line 251 of file TransformationGUI_ProjectionDlg.cxx.

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

Here is the call graph for this function:

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

Definition at line 279 of file TransformationGUI_ProjectionDlg.cxx.

{
  GEOM::GEOM_Object_var anObj;

  GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
  anObj = anOper->ProjectShapeCopy(myObject1.get(), myObject2.get());
  if (!anObj->_is_nil())
    objects.push_back(anObj._retn());

  return true;
}

Here is the call graph for this function:

Definition at line 96 of file TransformationGUI_ProjectionDlg.cxx.

{
  mainFrame()->GroupBoxPublish->show();

  // init variables
  myEditCurrentArgument = myGroup->LineEdit1;

  myGroup->LineEdit1->setText("");
  myGroup->LineEdit2->setText("");
  myObject1.nullify();
  myObject2.nullify();

  showOnlyPreviewControl();
 
  // signals and slots connections
  connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
  connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));

  connect(myGroup->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
  connect(myGroup->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));

  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));

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

  setTabOrder(mainFrame()->GroupConstructors, mainFrame()->GroupBoxName);
  setTabOrder(mainFrame()->GroupBoxName, mainFrame()->GroupMedium);
  setTabOrder(mainFrame()->GroupMedium, mainFrame()->GroupButtons);

  mainFrame()->RadioButton1->setFocus();

  globalSelection(GEOM_ALLSHAPES);

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 270 of file TransformationGUI_ProjectionDlg.cxx.

{
  return myObject1 && myObject2;
}

Definition at line 165 of file TransformationGUI_ProjectionDlg.cxx.

{
  myEditCurrentArgument->setText("");

  GEOM::GeomObjPtr aSelectedObject = getSelected(TopAbs_SHAPE);
  TopoDS_Shape aShape;
  if (aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull()) {
    QString aName = GEOMBase::GetName(aSelectedObject.get());
    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 == myGroup->LineEdit1) {
      myObject1 = aSelectedObject;
      if (!myObject2)
        myGroup->PushButton2->click();
    }
    else if (myEditCurrentArgument == myGroup->LineEdit2) {
      myObject2 = aSelectedObject;
      if (!myObject1)
        myGroup->PushButton1->click();
    }
  }
  else {
    if      (myEditCurrentArgument == myGroup->LineEdit1) myObject1.nullify();
    else if (myEditCurrentArgument == myGroup->LineEdit2) myObject2.nullify();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 202 of file TransformationGUI_ProjectionDlg.cxx.

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

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

    myGroup->PushButton2->setDown(false);
    myGroup->LineEdit2->setEnabled(false);

    TColStd_MapOfInteger aMap;
    aMap.Add( GEOM_POINT );
    aMap.Add( GEOM_EDGE );
    aMap.Add( GEOM_WIRE );
    globalSelection( aMap );
  }
  else if (send == myGroup->PushButton2) {
    myEditCurrentArgument = myGroup->LineEdit2;

    myGroup->PushButton1->setDown(false);
    myGroup->LineEdit1->setEnabled(false);

    globalSelection( GEOM_FACE );
  }

  // 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

Definition at line 61 of file TransformationGUI_ProjectionDlg.h.

Definition at line 58 of file TransformationGUI_ProjectionDlg.h.

Definition at line 59 of file TransformationGUI_ProjectionDlg.h.


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