Salome HOME
Mantis issue 0021071: Regression in GetInPlace. A fix by PKV on Partition error.
[modules/geom.git] / src / BasicGUI / BasicGUI_MarkerDlg.cxx
index c73f91728f8defdfcb18222784d9240c337e5fa7..6a2007aefbcbf3989e0bbe959a02f6c9c7469371 100644 (file)
-//  GEOM GEOMGUI : GUI for Geometry component
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  File   : BasicGUI_MarkerDlg.cxx
-//  Author : Sergey LITONIN
-//  Module : GEOM
-//  $Header$
 
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : BasicGUI_MarkerDlg.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S. (sergey.litonin@opencascade.com)
+//
 #include "BasicGUI_MarkerDlg.h"
-#include "DlgRef_SpinBox.h"
-#include "QAD_Desktop.h"
-#include "QAD_RightFrame.h"
-#include "VTKViewer_ViewFrame.h"
-#include "OCCViewer_ViewFrame.h"
-#include "QAD_Config.h"
-#include "GEOMImpl_Types.hxx"
-#include "utilities.h"
 
+#include <DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+
+#include <QLabel>
+
+#include <GEOMImpl_Types.hxx>
+
+// OCCT Includes
+#include <BRep_Tool.hxx>
 #include <TopExp.hxx>
 #include <TopAbs.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Face.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
+#include <Geom_Plane.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
-#include <BRep_Tool.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
 #include <gp_Pnt.hxx>
 #include <gp_Pln.hxx>
-#include <Geom_Plane.hxx>
-#include <GProp_GProps.hxx>
-#include <BRepGProp.hxx>
 
 //=================================================================================
 // class    : BasicGUI_MarkerDlg()
 // purpose  : Constructor
 //=================================================================================
-BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( QWidget* theParent, SALOME_Selection* theSel )
-: GEOMBase_Skeleton( theParent, "BasicGUI_MarkerDlg", theSel, false,
-    WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* theParent )
+  : GEOMBase_Skeleton( theGeometryGUI, theParent, false,
+                       Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
 {
-  QPixmap iconCS1   ( QAD_Desktop::getResourceManager()->loadPixmap( "GEOM", tr( "ICON_MARKER" ) ) );
-  QPixmap iconCS2   ( QAD_Desktop::getResourceManager()->loadPixmap( "GEOM", tr( "ICON_MARKER2" ) ) );
-  QPixmap iconCS3   ( QAD_Desktop::getResourceManager()->loadPixmap( "GEOM", tr( "ICON_MARKER3" ) ) );
-  QPixmap iconSelect( QAD_Desktop::getResourceManager()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
-
-  setCaption( tr( "CAPTION" ) );
-
-  GroupConstructors->setTitle( tr( "LOCALCS" ) );
-  RadioButton1->setPixmap( iconCS1 );
-  RadioButton2->setPixmap( iconCS2 );
-  RadioButton3->setPixmap( iconCS3 );
-
-  Group1 = new DlgRef_1Sel_QTD(this, "Group1");
-  Group1->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
-  Group1->TextLabel1->setText(tr("GEOM_OBJECT"));
-  Group1->PushButton1->setPixmap(iconSelect);
-
-  Group2 = new DlgRef_3Sel_QTD(this, "Group2");
-  Group2->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
-  Group2->TextLabel1->setText(tr("GEOM_POINT"));
-  Group2->TextLabel2->setText(tr("XDIR"));
-  Group2->TextLabel3->setText(tr("YDIR"));
-  Group2->PushButton1->setPixmap(iconSelect);
-  Group2->PushButton2->setPixmap(iconSelect);
-  Group2->PushButton3->setPixmap(iconSelect);
-
-  aMainGrp = new QGroupBox( 1, Qt::Horizontal, this );
-  aMainGrp->setFrameStyle( QFrame::NoFrame );
-  aMainGrp->setInsideMargin( 0 );
-
-  QGroupBox* anOriGrp = new QGroupBox( 1, Qt::Vertical, tr( "ORIGIN" ), aMainGrp );
-  new QLabel( tr( "GEOM_X" ), anOriGrp );
-  myData[ X ] = new DlgRef_SpinBox( anOriGrp );
-  new QLabel( tr( "GEOM_Y" ), anOriGrp );
-  myData[ Y ] = new DlgRef_SpinBox( anOriGrp );
-  new QLabel( tr( "GEOM_Z" ), anOriGrp );
-  myData[ Z ] = new DlgRef_SpinBox( anOriGrp );
-
-  QGroupBox* aXAxisGrp = new QGroupBox( 1, Qt::Vertical, tr( "XDIR" ), aMainGrp );
-  new QLabel( tr( "DX" ), aXAxisGrp );
-  myData[ DX1 ] = new DlgRef_SpinBox( aXAxisGrp );
-  new QLabel( tr( "DY" ), aXAxisGrp );
-  myData[ DY1 ] = new DlgRef_SpinBox( aXAxisGrp );
-  new QLabel( tr( "DZ" ), aXAxisGrp );
-  myData[ DZ1 ] = new DlgRef_SpinBox( aXAxisGrp );
-
-  QGroupBox* anYAxisGrp = new QGroupBox( 1, Qt::Vertical, tr( "YDIR" ), aMainGrp );
-  new QLabel( tr( "DX" ), anYAxisGrp );
-  myData[ DX2 ] = new DlgRef_SpinBox( anYAxisGrp );
-  new QLabel( tr( "DY" ), anYAxisGrp );
-  myData[ DY2 ] = new DlgRef_SpinBox( anYAxisGrp );
-  new QLabel( tr( "DZ" ), anYAxisGrp );
-  myData[ DZ2 ] = new DlgRef_SpinBox( anYAxisGrp );
+  QPixmap iconCS1   ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER" ) ) );
+  QPixmap iconCS2   ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER2" ) ) );
+  QPixmap iconCS3   ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER3" ) ) );
+  QPixmap iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+
+  setWindowTitle( tr( "CAPTION" ) );
+
+  mainFrame()->GroupConstructors->setTitle( tr( "LOCALCS" ) );
+  mainFrame()->RadioButton1->setIcon( iconCS1 );
+  mainFrame()->RadioButton2->setIcon( iconCS2 );
+  mainFrame()->RadioButton3->setIcon( iconCS3 );
+
+  Group1 = new DlgRef_1Sel( centralWidget() );
+
+  Group1->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+  Group1->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
+  Group1->PushButton1->setIcon( iconSelect );
+  Group1->PushButton1->setDown( true );
+
+  Group2 = new DlgRef_3Sel( centralWidget() );
+
+  Group2->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+  Group2->TextLabel1->setText( tr( "GEOM_POINT" ) );
+  Group2->TextLabel2->setText( tr( "XDIR" ) );
+  Group2->TextLabel3->setText( tr( "YDIR" ) );
+  Group2->PushButton1->setIcon( iconSelect );
+  Group2->PushButton2->setIcon( iconSelect );
+  Group2->PushButton3->setIcon( iconSelect );
+  Group2->PushButton1->setDown( true );
+
+  aMainGrp = new QFrame( centralWidget() );
+  aMainGrp->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
+  aMainGrp->setContentsMargins( 0, 0, 0, 0 );
+  QHBoxLayout* aMainGrpLayout = new QHBoxLayout( aMainGrp );
+  aMainGrpLayout->setMargin( 0 );
   
-  Layout1->addWidget( aMainGrp, 2, 0 );
-  Layout1->addWidget( Group1, 2, 0 );
-  Layout1->addWidget( Group2, 2, 0 );
-
-  Init( theSel );
+  QGroupBox* anOriGrp = new QGroupBox( tr( "ORIGIN" ), aMainGrp );
+  QVBoxLayout* anOriGrpLayout = new QVBoxLayout( anOriGrp );
+
+  anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), anOriGrp ) );
+  myData[ X ] = new SalomeApp_DoubleSpinBox( anOriGrp );
+  anOriGrpLayout->addWidget( myData[ X ] );
+  anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Y" ), anOriGrp ) );
+  myData[ Y ] = new SalomeApp_DoubleSpinBox( anOriGrp );
+  anOriGrpLayout->addWidget( myData[ Y ] );
+  anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Z" ), anOriGrp ) );
+  myData[ Z ] = new SalomeApp_DoubleSpinBox( anOriGrp );
+  anOriGrpLayout->addWidget( myData[ Z ] );
+
+  aMainGrpLayout->addWidget( anOriGrp );
+
+  QGroupBox* aXAxisGrp = new QGroupBox( tr( "XDIR" ), aMainGrp );
+  QVBoxLayout* aXAxisGrpLayout = new QVBoxLayout( aXAxisGrp );
+
+  aXAxisGrpLayout->addWidget( new QLabel( tr( "DX" ), aXAxisGrp ) );
+  myData[ DX1 ] = new SalomeApp_DoubleSpinBox( aXAxisGrp );
+  aXAxisGrpLayout->addWidget( myData[ DX1 ] );
+  aXAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), aXAxisGrp ) );
+  myData[ DY1 ] = new SalomeApp_DoubleSpinBox( aXAxisGrp );
+  aXAxisGrpLayout->addWidget( myData[ DY1 ] );
+  aXAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), aXAxisGrp ) );
+  myData[ DZ1 ] = new SalomeApp_DoubleSpinBox( aXAxisGrp );
+  aXAxisGrpLayout->addWidget( myData[ DZ1 ] );
+
+  aMainGrpLayout->addWidget( aXAxisGrp );
+
+  QGroupBox* anYAxisGrp = new QGroupBox( tr( "YDIR" ), aMainGrp );
+  QVBoxLayout* anYAxisGrpLayout = new QVBoxLayout( anYAxisGrp );
+
+  anYAxisGrpLayout->addWidget( new QLabel( tr( "DX" ), anYAxisGrp ) );
+  myData[ DX2 ] = new SalomeApp_DoubleSpinBox( anYAxisGrp );
+  anYAxisGrpLayout->addWidget( myData[ DX2 ] );
+  anYAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), anYAxisGrp ) );
+  myData[ DY2 ] = new SalomeApp_DoubleSpinBox( anYAxisGrp );
+  anYAxisGrpLayout->addWidget( myData[ DY2 ] );
+  anYAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), anYAxisGrp ) );
+  myData[ DZ2 ] = new SalomeApp_DoubleSpinBox( anYAxisGrp );
+  anYAxisGrpLayout->addWidget( myData[ DZ2 ] );
+
+  aMainGrpLayout->addWidget( anYAxisGrp );
+
+  QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+  layout->setMargin( 0 ); layout->setSpacing( 6 );
+  layout->addWidget( aMainGrp );
+  layout->addWidget( Group1 );
+  layout->addWidget( Group2 );
+
+  setHelpFileName( "create_lcs_page.html" );
+
+  Init();
 }
 
 
@@ -133,8 +166,9 @@ BasicGUI_MarkerDlg::~BasicGUI_MarkerDlg()
 // function : Init()
 // purpose  :
 //=================================================================================
-void BasicGUI_MarkerDlg::Init( SALOME_Selection* theSel )
+void BasicGUI_MarkerDlg::Init()
 {
+  myShape = myPoint = myVectorX = myVectorY = GEOM::GEOM_Object::_nil();
   myBlockPreview = false;
   myConstructorId = -1;
   myEditCurrentArgument = Group1->LineEdit1;
@@ -142,61 +176,50 @@ void BasicGUI_MarkerDlg::Init( SALOME_Selection* theSel )
   Group2->LineEdit1->setReadOnly( true );
   Group2->LineEdit2->setReadOnly( true );
   Group2->LineEdit3->setReadOnly( true );
+  Group2->LineEdit1->setEnabled( true );
+  Group2->LineEdit2->setEnabled( false );
+  Group2->LineEdit3->setEnabled( false );
 
-  GeometryGUI* aGeomGUI = GeometryGUI::GetGeomGUI();
+  connect( this,                SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
 
-  connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
-  connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(Group2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(Group2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+  connect( Group1->PushButton1, SIGNAL( clicked() ),      this, SLOT( SetEditCurrentArgument() ) );
+  connect( Group2->PushButton1, SIGNAL( clicked() ),      this, SLOT( SetEditCurrentArgument() ) );
+  connect( Group2->PushButton2, SIGNAL( clicked() ),      this, SLOT( SetEditCurrentArgument() ) );
+  connect( Group2->PushButton3, SIGNAL( clicked() ),      this, SLOT( SetEditCurrentArgument() ) );
 
-  connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  connect(Group2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  connect(Group2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+  connect( Group1->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+  connect( Group2->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+  connect( Group2->LineEdit2,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+  connect( Group2->LineEdit3,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
 
-  connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( onClose() ) );
-  connect( aGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( onDeactivate() ) );
-  connect( aGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( onClose() ) );
+  connect( myGeomGUI,           SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( onDeactivate() ) );
+  connect( myGeomGUI,           SIGNAL( SignalCloseAllDialogs() ),        this, SLOT( ClickOnCancel() ) );
 
-  connect( buttonOk, SIGNAL( clicked() ), this, SLOT( onOk() ) );
-  connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onApply() ) );
+  connect( buttonOk(),          SIGNAL( clicked() ), this, SLOT( onOk() ) );
+  connect( buttonApply(),       SIGNAL( clicked() ), this, SLOT( onApply() ) );
 
-  connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) );
+  connect( myGeomGUI->getApp()->selectionMgr(),
+           SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) );
 
   initName( tr( "LCS_NAME" ) );
 
-  QString aStr = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" );
-  for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
-  {
-    anIter.data()->RangeStepAndValidator( -999.999, 999.999, aStr.toDouble(), 3 );
-    connect( anIter.data(), SIGNAL( valueChanged( double ) ),
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
+
+  for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter ) {
+    initSpinBox( anIter.value(), COORD_MIN, COORD_MAX, step, "length_precision" );
+    connect( anIter.value(), SIGNAL( valueChanged( double ) ),
              this, SLOT( onValueChanged( double ) ) );
   }
-
+  
   myBlockPreview = true;
   for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
-    anIter.data()->SetValue( 0 );
-  myData[ DX1 ]->SetValue( 1 );
-  myData[ DY2 ]->SetValue( 1 );
+    anIter.value()->setValue( 0 );
+  myData[ DX1 ]->setValue( 1 );
+  myData[ DY2 ]->setValue( 1 );
   myBlockPreview = false;
 
   ConstructorsClicked( 0 );
-
-  QAD_ViewFrame* aFrame = QAD_Application::getDesktop()->getActiveApp()->
-    getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame();
-
-  VTKViewer_ViewFrame* aVTKFrame = dynamic_cast<VTKViewer_ViewFrame*>( aFrame );
-  if ( aVTKFrame )
-  {
-    aVTKFrame->AdjustTrihedrons( true );
-    return;
-  }
-
-  OCCViewer_ViewFrame* aOCCFrame = dynamic_cast<OCCViewer_ViewFrame*>( aFrame );
-  if ( aOCCFrame )
-    aOCCFrame->AdjustTrihedrons( true );
 }
 
 //=================================================================================
@@ -205,59 +228,72 @@ void BasicGUI_MarkerDlg::Init( SALOME_Selection* theSel )
 //=================================================================================
 void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
 {
-  if ( myConstructorId == constructorId && myConstructorId == 0 )
-  {
+  if ( myConstructorId == constructorId && myConstructorId == 0 ) {
+    globalSelection(); // close local contexts, if any
     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
     activate( GEOM_MARKER );
-    displayPreview();
     return;
   }
 
   myConstructorId = constructorId;
 
-  disconnect(mySelection, 0, this, 0);
+  disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 );
 
-  switch (constructorId)
-    {
-    case 0:
+  switch ( constructorId ) {
+  case 0:
     {
       Group1->hide();
       Group2->hide();
-      resize(0, 0);
       aMainGrp->show();
+      globalSelection(); // close local contexts, if any
       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
       activate( GEOM_MARKER );
       break;
     }
-    case 1:
-      {
-       Group2->hide();
-       aMainGrp->hide();
-       resize(0, 0);
-       Group1->show();
-
-       globalSelection( GEOM_ALLGEOM );
-       myEditCurrentArgument = Group1->LineEdit1;
-       Group1->LineEdit1->setText("");
-       break;
-      }
-    case 2:
-      {
-       aMainGrp->hide();
-       Group1->show();
-       resize(0, 0);
-       Group2->show();
-
-       globalSelection( GEOM_POINT );
-       myEditCurrentArgument = Group2->LineEdit1;
-       Group2->LineEdit1->setText("");
-       Group2->LineEdit2->setText("");
-       Group2->LineEdit3->setText("");
-       break;
-      }
+  case 1:
+    {
+      aMainGrp->hide();
+      Group2->hide();
+      Group1->show();
+      Group1->PushButton1->setDown( true );
+      globalSelection( GEOM_ALLGEOM );
+      myEditCurrentArgument = Group1->LineEdit1;
+      Group1->LineEdit1->setText( "" );
+      myShape = GEOM::GEOM_Object::_nil();
+      break;
     }
+  case 2:
+    {
+      aMainGrp->hide();
+      Group1->hide();
+      Group2->show();
+      Group2->PushButton1->setDown( true );
+      Group2->PushButton2->setDown( false );
+      Group2->PushButton3->setDown( false );
+      globalSelection(); // close local contexts, if any
+      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      myEditCurrentArgument = Group2->LineEdit1;
+      Group2->LineEdit1->setText( "" );
+      Group2->LineEdit2->setText( "" );
+      Group2->LineEdit3->setText( "" );
+      Group2->LineEdit1->setEnabled( true );
+      Group2->LineEdit2->setEnabled( false );
+      Group2->LineEdit3->setEnabled( false );
+      myPoint = GEOM::GEOM_Object::_nil();
+      myVectorX = GEOM::GEOM_Object::_nil();
+      myVectorY = GEOM::GEOM_Object::_nil();
+      break;
+    }
+  }
+
+  displayPreview();
 
-  connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionDone()));
+  qApp->processEvents();
+  updateGeometry();
+  resize( minimumSizeHint() );
+  
+  connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+           this, SLOT( onSelectionDone() ) );
   onSelectionDone();
 }
 
@@ -268,16 +304,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
 void BasicGUI_MarkerDlg::onOk()
 {
   if ( onApply() )
-    onClose();
-}
-
-//=======================================================================
-// function : onClose()
-// purpose  :
-//=======================================================================
-void BasicGUI_MarkerDlg::onClose()
-{
-  GEOMBase_Skeleton::ClickOnCancel();
+    ClickOnCancel();
 }
 
 //=================================================================================
@@ -291,7 +318,7 @@ bool BasicGUI_MarkerDlg::onApply()
 
   initName();
   ConstructorsClicked( getConstructorId() );
-  
+
   return true;
 }
 
@@ -301,72 +328,65 @@ bool BasicGUI_MarkerDlg::onApply()
 //=================================================================================
 void BasicGUI_MarkerDlg::onSelectionDone0()
 {
-  if ( mySelection->IObjectCount() == 1 )
-  {
+  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+  SALOME_ListIO aSelList;
+  aSelMgr->selectedObjects(aSelList);
 
+  if (aSelList.Extent() == 1) {
     Standard_Boolean aRes = Standard_False;
-    Handle(SALOME_InteractiveObject) anIO = mySelection->firstIObject();
-    GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
-
-    if ( aRes && !aSelectedObj->_is_nil() )
-    {
+    Handle(SALOME_InteractiveObject) anIO = aSelList.First();
+    GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
+    
+    if ( aRes && !aSelectedObj->_is_nil() ) {
       TopoDS_Shape aShape;
-      if ( myGeomBase->GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
-      {
-        if ( aSelectedObj->GetType() == GEOM_MARKER && aShape.ShapeType() == TopAbs_FACE )
-        {
+      if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
+        // Existing LCS selected
+        if ( aSelectedObj->GetType() == GEOM_MARKER && aShape.ShapeType() == TopAbs_FACE ) {
           TopoDS_Face aFace = TopoDS::Face( aShape );
           Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast( BRep_Tool::Surface( aFace ) );
-
-          if ( !aPlane.IsNull() )
-          {
+          
+          if ( !aPlane.IsNull() ) {
             gp_Ax3 anAx3 = aPlane->Pln().Position();
             gp_Pnt aLoc = anAx3.Location();
             gp_Dir aXDir = anAx3.XDirection();
             gp_Dir aYDir = anAx3.YDirection();
-
-            myData[ X ]->SetValue( aLoc.X() );
-            myData[ Y ]->SetValue( aLoc.Y() );
-            myData[ Z ]->SetValue( aLoc.Z() );
-
-            myData[ DX1 ]->SetValue( aXDir.X() );
-            myData[ DY1 ]->SetValue( aXDir.Y() );
-            myData[ DZ1 ]->SetValue( aXDir.Z() );
-
-            myData[ DX2 ]->SetValue( aYDir.X() );
-            myData[ DY2 ]->SetValue( aYDir.Y() );
-            myData[ DZ2 ]->SetValue( aYDir.Z() );
-            //mySelection->ClearIObjects();
+            
+            myData[ X ]->setValue( aLoc.X() );
+            myData[ Y ]->setValue( aLoc.Y() );
+            myData[ Z ]->setValue( aLoc.Z() );
+            
+            myData[ DX1 ]->setValue( aXDir.X() );
+            myData[ DY1 ]->setValue( aXDir.Y() );
+            myData[ DZ1 ]->setValue( aXDir.Z() );
+            
+            myData[ DX2 ]->setValue( aYDir.X() );
+            myData[ DY2 ]->setValue( aYDir.Y() );
+            myData[ DZ2 ]->setValue( aYDir.Z() );
+            aSelMgr->clearSelected();
           }
         }
-        else
-        {
-          if ( mySelection->HasIndex( anIO ) )
-          {
-            TColStd_IndexedMapOfInteger aMap;
-            mySelection->GetIndex( anIO, aMap );
-            if ( aMap.Extent() == 1 )
-            {
-              int anIndex = aMap( 1 );
-              TopTools_IndexedMapOfShape aShapes;
-              TopExp::MapShapes( aShape, aShapes );
-              aShape = aShapes.FindKey( anIndex );
-              //mySelection->ClearIObjects();
-            }
+        else {
+          TColStd_IndexedMapOfInteger aMap;
+          aSelMgr->GetIndexes( anIO, aMap );
+          if ( aMap.Extent() == 1 ) { // Local Selection
+            int anIndex = aMap( 1 );
+            TopTools_IndexedMapOfShape aShapes;
+            TopExp::MapShapes( aShape, aShapes );
+            aShape = aShapes.FindKey( anIndex );
+            aSelMgr->clearSelected(); // ???
           }
 
-          if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
-          {
+          if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) {
             gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
-            myData[ X ]->SetValue( aPnt.X() );
-            myData[ Y ]->SetValue( aPnt.Y() );
-            myData[ Z ]->SetValue( aPnt.Z() );
+            myData[ X ]->setValue( aPnt.X() );
+            myData[ Y ]->setValue( aPnt.Y() );
+            myData[ Z ]->setValue( aPnt.Z() );
           }
         }
       }
     }
   }
-
+  
   displayPreview();
 }
 
@@ -377,120 +397,99 @@ void BasicGUI_MarkerDlg::onSelectionDone0()
 //=================================================================================
 void BasicGUI_MarkerDlg::onSelectionDone()
 {
-  if ( getConstructorId() == 0 )
-  {
+  if ( getConstructorId() == 0 ) {
     onSelectionDone0();
     return;
   }
-    
 
-  myEditCurrentArgument->setText("");
-  QString aName;
+  myEditCurrentArgument->setText( "" );
+
+  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+  SALOME_ListIO aSelList;
+  aSelMgr->selectedObjects(aSelList);
 
-  if ( mySelection->IObjectCount() == 1 ) {
+  if (aSelList.Extent() == 1) {
     Standard_Boolean aRes = Standard_False;
-    Handle(SALOME_InteractiveObject) anIO = mySelection->firstIObject();
+    Handle(SALOME_InteractiveObject) anIO = aSelList.First();
     GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
 
     if ( !CORBA::is_nil( aSelectedObj ) && aRes ) {
-      aName = GEOMBase::GetName( aSelectedObj );
-      TopoDS_Shape aShape;
-      if ( myGeomBase->GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) {
-       GEOM::short_array anIndexes;
-       if ( mySelection->HasIndex( anIO ) ) {
-         TColStd_IndexedMapOfInteger aMap;
-         mySelection->GetIndex( anIO, aMap );
-         int anIndex = aMap( 1 );
-         TopTools_IndexedMapOfShape aShapes;
-         TopExp::MapShapes( aShape, aShapes );
-         aShape = aShapes.FindKey( anIndex );
-       }
-
-  if ( getConstructorId() == 1 ) {
-         if ( !aShape.IsNull() ) {
-           gp_Pnt aPnt;
-           if (aShape.ShapeType() == TopAbs_VERTEX) {
-             aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape));
-           } 
-           else {
-             GProp_GProps aSystem;
-             if (aShape.ShapeType() == TopAbs_EDGE || aShape.ShapeType() == TopAbs_WIRE)
-               BRepGProp::LinearProperties(aShape, aSystem);
-             else if (aShape.ShapeType() == TopAbs_FACE || aShape.ShapeType() == TopAbs_SHELL)
-               BRepGProp::SurfaceProperties(aShape, aSystem);
-             else
-               BRepGProp::VolumeProperties(aShape, aSystem);
-             
-             aPnt = aSystem.CentreOfMass();
-           }
-
-           gp_Ax3 anAx3;
-           anAx3.Transform(aShape.Location().Transformation());
-           if(aShape.ShapeType() == TopAbs_FACE) {
-             Handle(Geom_Surface) aGS = BRep_Tool::Surface( TopoDS::Face( aShape ) );
-             if (!aGS.IsNull() && aGS->IsKind( STANDARD_TYPE( Geom_Plane ) ) ) {
-               Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast( aGS );
-               gp_Pln aPln = aGPlane->Pln();
-               anAx3 = aPln.Position();
-             }
-           }
-
-           gp_Dir aDirX = anAx3.XDirection();
-           gp_Dir aDirY = anAx3.YDirection();
-
-           myData[ X ]->SetValue( aPnt.X() );
-           myData[ Y ]->SetValue( aPnt.Y() );
-           myData[ Z ]->SetValue( aPnt.Z() );
-
-           myData[ DX1 ]->SetValue( aDirX.X() );
-           myData[ DY1 ]->SetValue( aDirX.Y() );
-           myData[ DZ1 ]->SetValue( aDirX.Z() );
-
-           myData[ DX2 ]->SetValue( aDirY.X() );
-           myData[ DY2 ]->SetValue( aDirY.Y() );
-           myData[ DZ2 ]->SetValue( aDirY.Z() );
-
-           myEditCurrentArgument->setText( aName );
-         }
-       }
-       else if ( getConstructorId() == 2 ) {
-         if (myEditCurrentArgument == Group2->LineEdit1) {
-           if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) {
-             gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
-             myData[ X ]->SetValue( aPnt.X() );
-             myData[ Y ]->SetValue( aPnt.Y() );
-             myData[ Z ]->SetValue( aPnt.Z() );
-             myEditCurrentArgument->setText( aName );
-           }
-         }
-         else if (myEditCurrentArgument == Group2->LineEdit2) {
-           if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_EDGE ) {
-             gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(aShape)));
-             gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(aShape)));
-             gp_Dir aDir(gp_Vec(aP1, aP2));
-
-             myData[ DX1 ]->SetValue( aDir.X() );
-             myData[ DY1 ]->SetValue( aDir.Y() );
-             myData[ DZ1 ]->SetValue( aDir.Z() );
-             myEditCurrentArgument->setText( aName );
-           }
-         }
-         else if (myEditCurrentArgument == Group2->LineEdit3) {
-           if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_EDGE ) {
-             gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(aShape)));
-             gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(aShape)));
-             gp_Dir aDir(gp_Vec(aP1, aP2));
-
-             myData[ DX2 ]->SetValue( aDir.X() );
-             myData[ DY2 ]->SetValue( aDir.Y() );
-             myData[ DZ2 ]->SetValue( aDir.Z() );
-             myEditCurrentArgument->setText( aName );
-           }
-         }
-       }
+      QString aName = GEOMBase::GetName( aSelectedObj );
+      
+      if ( getConstructorId() == 1 ) { // by shape position
+        TopoDS_Shape aShape;
+        if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) )
+          myShape = aSelectedObj;
+        myEditCurrentArgument->setText( aName );
+      }
+      else if ( getConstructorId() == 2 ) { // by point and two vectors
+        TopoDS_Shape aShape;
+        if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) {
+          TopAbs_ShapeEnum aNeedType = TopAbs_EDGE;
+          if ( myEditCurrentArgument == Group2->LineEdit1 )
+            aNeedType = TopAbs_VERTEX;
+          
+          TColStd_IndexedMapOfInteger aMap;
+          aSelMgr->GetIndexes( anIO, aMap );
+
+          if ( aMap.Extent() == 1 ) { // Local Selection
+            int anIndex = aMap( 1 );
+            if ( aNeedType == TopAbs_EDGE )
+              aName += QString( ":edge_%1" ).arg( anIndex );
+            else
+              aName += QString( ":vertex_%1" ).arg( anIndex );
+            
+            //Find SubShape Object in Father
+            GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObj, aName );
+            if ( aFindedObject->_is_nil() ) { // Object not found in study
+              GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+              aSelectedObj = aShapesOp->GetSubShape( aSelectedObj, anIndex );
+            } 
+            else {
+              aSelectedObj = aFindedObject; // get Object from study
+            }
+          }
+          else { // Global Selection
+            if ( aShape.ShapeType() != aNeedType ) {
+              aSelectedObj = GEOM::GEOM_Object::_nil();
+              aName = "";
+            }
+          }
+          
+          if ( myEditCurrentArgument == Group2->LineEdit1 ) {
+            myPoint = aSelectedObj;
+            myEditCurrentArgument->setText( aName );
+            if (!myPoint->_is_nil() && Group2->LineEdit2->text() == "")
+                Group2->PushButton2->click();
+          }
+          else if (myEditCurrentArgument == Group2->LineEdit2) {
+            myVectorX = aSelectedObj;
+            myEditCurrentArgument->setText( aName );
+            if (!myVectorX->_is_nil() && Group2->LineEdit3->text() == "")
+              Group2->PushButton3->click();
+          }
+          else if ( myEditCurrentArgument == Group2->LineEdit3 ) {
+            myVectorY = aSelectedObj;
+            myEditCurrentArgument->setText( aName );
+            if (!myVectorX->_is_nil() && Group2->LineEdit1->text() == "")
+                Group2->PushButton1->click();
+          }
+        }
       }
     }
   }
+  else {
+    if ( getConstructorId() == 1 ) {
+      myShape = GEOM::GEOM_Object::_nil();
+    } else if ( getConstructorId() == 2 ) {
+      if ( myEditCurrentArgument == Group2->LineEdit1 )
+        myPoint = GEOM::GEOM_Object::_nil();
+      else if ( myEditCurrentArgument == Group2->LineEdit2 )
+        myVectorX = GEOM::GEOM_Object::_nil();
+      else if ( myEditCurrentArgument == Group2->LineEdit3 )
+        myVectorY = GEOM::GEOM_Object::_nil();
+    }
+  }
 
   displayPreview();
 }
@@ -502,25 +501,42 @@ void BasicGUI_MarkerDlg::onSelectionDone()
 void BasicGUI_MarkerDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-  
-  if(send == Group1->PushButton1) {
+  globalSelection(); // close local contexts, if any
+
+  if ( send == Group1->PushButton1 ) {
     myEditCurrentArgument = Group1->LineEdit1;
     globalSelection( GEOM_ALLGEOM );
   }
-  else if(send == Group2->PushButton1) {
+  else if ( send == Group2->PushButton1 ) {
     myEditCurrentArgument = Group2->LineEdit1;
-    globalSelection( GEOM_POINT );
+    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    Group2->PushButton2->setDown( false );
+    Group2->PushButton3->setDown( false );
+    Group2->LineEdit1->setEnabled( true );
+    Group2->LineEdit2->setEnabled( false );
+    Group2->LineEdit3->setEnabled( false );
   }
-  else if(send == Group2->PushButton2) {
+  else if ( send == Group2->PushButton2 ) {
     myEditCurrentArgument = Group2->LineEdit2;
-      globalSelection( GEOM_LINE );
+    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    Group2->PushButton1->setDown( false );
+    Group2->PushButton3->setDown( false );
+    Group2->LineEdit1->setEnabled( false );
+    Group2->LineEdit2->setEnabled( true );
+    Group2->LineEdit3->setEnabled( false );
   }
-  else if(send == Group2->PushButton3) {
+  else if ( send == Group2->PushButton3 ) {
     myEditCurrentArgument = Group2->LineEdit3;
-    globalSelection( GEOM_LINE );
+    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    Group2->PushButton1->setDown( false );
+    Group2->PushButton2->setDown( false );
+    Group2->LineEdit1->setEnabled( false );
+    Group2->LineEdit2->setEnabled( false );
+    Group2->LineEdit3->setEnabled( true );
   }
   
   myEditCurrentArgument->setFocus();
+  send->setDown(true);
   onSelectionDone();
 }
 
@@ -543,7 +559,8 @@ void BasicGUI_MarkerDlg::LineEditReturnPressed()
 void BasicGUI_MarkerDlg::onActivate()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) );
+  connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+           this, SLOT( onSelectionDone() ) );
 
   ConstructorsClicked( getConstructorId() );
 }
@@ -561,9 +578,9 @@ void BasicGUI_MarkerDlg::onDeactivate()
 // function : enterEvent()
 // purpose  :
 //=================================================================================
-void BasicGUI_MarkerDlg::enterEvent(QEvent* e)
-{                       
-  if ( !GroupConstructors->isEnabled() )
+void BasicGUI_MarkerDlg::enterEvent( QEvent* )
+{
+  if ( !mainFrame()->GroupConstructors->isEnabled() )
     onActivate();
 }
 
@@ -573,7 +590,7 @@ void BasicGUI_MarkerDlg::enterEvent(QEvent* e)
 //=================================================================================
 GEOM::GEOM_IOperations_ptr BasicGUI_MarkerDlg::createOperation()
 {
-  return getGeomEngine()->GetIBasicOperations( getStudyId() );
+  return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
 }
 
 //=================================================================================
@@ -583,19 +600,28 @@ GEOM::GEOM_IOperations_ptr BasicGUI_MarkerDlg::createOperation()
 bool BasicGUI_MarkerDlg::isValid( QString& msg )
 {
   const int id = getConstructorId();
-  gp_Vec v1( myData[ DX1 ]->GetValue(), myData[ DY1 ]->GetValue(), myData[ DZ1 ]->GetValue() ),
-         v2( myData[ DX2 ]->GetValue(), myData[ DY2 ]->GetValue(), myData[ DZ2 ]->GetValue() );
-  bool isOrthogonal = v1.IsNormal( v2, Precision::Confusion() );
-  switch ( id )
-  {
-    case 0:
-      return isOrthogonal;
+  switch ( id ) {
+    case 0: {
+      gp_Vec v1( myData[ DX1 ]->value(), myData[ DY1 ]->value(), myData[ DZ1 ]->value() ),
+        v2( myData[ DX2 ]->value(), myData[ DY2 ]->value(), myData[ DZ2 ]->value() );
+      
+      bool isOk = false;
+      // we will got exception if the magnitude of any of the 2 vectors <= gp::Resolution()
+      // Vectors shouldn't be checked for being orthogonal here!
+      if ( v1.Magnitude() > gp::Resolution() && v2.Magnitude() > gp::Resolution() ) {
+        isOk = !v1.IsParallel( v2, Precision::Angular() );
+        if ( !isOk )
+          msg += tr( "VEC_PARALLEL" );
+      }
+      bool ok = true;
+      for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
+        ok = anIter.value()->isValid( msg, !IsPreview()) && ok;
+      return isOk && ok;
+    }
     case 1:
-      return !Group1->LineEdit1->text().isEmpty() && isOrthogonal;
+      return !myShape->_is_nil();
     case 2:
-      return !Group2->LineEdit1->text().isEmpty() && 
-            !Group2->LineEdit2->text().isEmpty() && 
-            !Group2->LineEdit3->text().isEmpty() && isOrthogonal;
+      return !myPoint->_is_nil() && !myVectorX->_is_nil() && !myVectorY->_is_nil();
   }
   return false;
 }
@@ -606,26 +632,40 @@ bool BasicGUI_MarkerDlg::isValid( QString& msg )
 //=================================================================================
 bool BasicGUI_MarkerDlg::execute( ObjectList& objects )
 {
-  GEOM::GEOM_Object_var anObj = GEOM::GEOM_IBasicOperations::_narrow(
-    getOperation() )->MakeMarker( myData[ X   ]->GetValue(), myData[ Y   ]->GetValue(), myData[ Z   ]->GetValue(),
-                                  myData[ DX1 ]->GetValue(), myData[ DY1 ]->GetValue(), myData[ DZ1 ]->GetValue(),
-                                  myData[ DX2 ]->GetValue(), myData[ DY2 ]->GetValue(), myData[ DZ2 ]->GetValue() );
-
-  if ( !anObj->_is_nil() )
+  GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
+  GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_nil();
+  QStringList aParameters;
+  const int id = getConstructorId();
+  if (id == 0) {
+    anObj = anOper->MakeMarker( myData[ X   ]->value(), myData[ Y   ]->value(), 
+                                myData[ Z   ]->value(), myData[ DX1 ]->value(),
+                                myData[ DY1 ]->value(), myData[ DZ1 ]->value(),
+                                myData[ DX2 ]->value(), myData[ DY2 ]->value(),
+                                myData[ DZ2 ]->value() );
+    aParameters<<myData[X]->text();
+    aParameters<<myData[Y]->text();
+    aParameters<<myData[Z]->text();
+    aParameters<<myData[ DX1 ]->text(); 
+    aParameters<<myData[ DY1 ]->text(); 
+    aParameters<<myData[ DZ1 ]->text();
+    aParameters<<myData[ DX2 ]->text();
+    aParameters<<myData[ DY2 ]->text();
+    aParameters<<myData[ DZ2 ]->text();
+  } else if (id == 1) {
+    anObj = anOper->MakeMarkerFromShape( myShape ); 
+  } else if (id == 2) {
+    anObj = anOper->MakeMarkerPntTwoVec( myPoint, myVectorX, myVectorY ); 
+  }
+  
+  if ( !anObj->_is_nil() ) {
+    if ( !IsPreview() && id == 0)
+      anObj->SetParameters(aParameters.join(":").toLatin1().constData());
     objects.push_back( anObj._retn() );
+  }
 
   return true;
 }
 
-//=================================================================================
-// function : closeEvent
-// purpose  :
-//=================================================================================
-void BasicGUI_MarkerDlg::closeEvent( QCloseEvent* e )
-{
-  GEOMBase_Skeleton::closeEvent( e );
-}
-
 //=================================================================================
 // function : onValueChanged
 // purpose  :
@@ -644,26 +684,9 @@ void BasicGUI_MarkerDlg::displayPreview ( const bool   activate,
                                           const bool   toRemoveFromEngine,
                                           const double lineWidth )
 {
-  if ( !myBlockPreview )
-  {
+  if ( !myBlockPreview ) {
     GEOMBase_Skeleton::displayPreview( activate, update, toRemoveFromEngine, lineWidth );
     if ( myConstructorId == 0 )
-    {
       GEOMBase_Skeleton::activate( GEOM_MARKER );
-    }
   }
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-