Salome HOME
5fd3838c9f1fa26e8532835d78804de6e20899f6
[modules/geom.git] / src / BasicGUI / BasicGUI_WorkingPlaneDlg.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // GEOM GEOMGUI : GUI for Geometry component
23 // File   : BasicGUI_WorkingPlaneDlg.cxx
24 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
25 //
26 #include "BasicGUI_WorkingPlaneDlg.h"
27
28 #include <DlgRef.h>
29 #include <GeometryGUI.h>
30 #include <GEOMBase.h>
31
32 #include <SUIT_ResourceMgr.h>
33 #include <SUIT_Session.h>
34 #include <SalomeApp_Application.h>
35 #include <LightApp_SelectionMgr.h>
36
37 // OCCT Includes
38 #include <BRep_Tool.hxx>
39 #include <TopoDS_Edge.hxx>
40 #include <TopoDS_Vertex.hxx>
41 #include <TopExp.hxx>
42 #include <gp_Pnt.hxx>
43 #include <gp_Dir.hxx>
44 #include <TColStd_MapOfInteger.hxx>
45 #include <TopoDS_Shape.hxx>
46 #include <TColStd_IndexedMapOfInteger.hxx>
47 #include <TopTools_IndexedMapOfShape.hxx>
48
49 // QT Includes
50 #include <QCheckBox>
51
52 #include <GEOMImpl_Types.hxx>
53
54 //=================================================================================
55 // class    : BasicGUI_WorkingPlaneDlg()
56 // purpose  : Constructs a BasicGUI_WorkingPlaneDlg which is a child of 'parent', with the
57 //            name 'name' and widget flags set to 'f'.
58 //            The dialog will by default be modeless, unless you set 'modal' to
59 //            TRUE to construct a modal dialog.
60 //=================================================================================
61 BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
62                                                     bool modal, Qt::WindowFlags fl )
63   : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
64 {
65   QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
66   QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_WPLANE_FACE" ) ) );
67   QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_WPLANE_VECTOR" ) ) );
68   QPixmap image3( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_WPLANE_ORIGIN" ) ) );
69
70   setWindowTitle( tr( "GEOM_WPLANE_TITLE" ) );
71
72   /***************************************************************/
73   mainFrame()->GroupConstructors->setTitle( tr( "GEOM_WPLANE" ) );
74   mainFrame()->RadioButton1->setIcon( image1 );
75   mainFrame()->RadioButton2->setIcon( image2 );
76   mainFrame()->RadioButton3->setIcon( image3 );
77
78   Group1 = new DlgRef_1Sel( centralWidget() );
79
80   Group1->GroupBox1->setTitle( tr( "GEOM_WPLANE_FACE" ) );
81   Group1->TextLabel1->setText( tr( "GEOM_SELECTION" ) );
82   Group1->PushButton1->setIcon( image0 );
83   Group1->LineEdit1->setReadOnly( true );
84
85   Group2 = new DlgRef_2Sel( centralWidget() );
86
87   Group2->GroupBox1->setTitle( tr( "GEOM_WPLANE_VECTOR" ) );
88   Group2->TextLabel1->setText( tr( "GEOM_WPLANE_VX" ) );
89   Group2->TextLabel2->setText( tr( "GEOM_WPLANE_VZ" ) );
90   Group2->PushButton1->setIcon( image0 );
91   Group2->PushButton2->setIcon( image0 );
92   Group2->LineEdit1->setReadOnly( true );
93   Group2->LineEdit2->setReadOnly( true );
94   Group2->PushButton1->setDown( true );
95   Group2->LineEdit1->setEnabled( true );
96   Group2->LineEdit2->setEnabled( false );
97
98   Group3 = new DlgRef_3Check( centralWidget() );
99
100   Group3->GroupBox1->setTitle( tr( "GEOM_WPLANE_ORIGIN" ) );
101   Group3->RadioButton1->setText( tr( "GEOM_WPLANE_OXY" ) );
102   Group3->RadioButton2->setText( tr( "GEOM_WPLANE_OYZ" ) );
103   Group3->RadioButton3->setText( tr( "GEOM_WPLANE_OZX" ) );
104
105   /***************************************************************/
106   QGroupBox* aReverseGroupBox = new QGroupBox( centralWidget() );
107   QHBoxLayout* aReverseGroupBoxLayout = new QHBoxLayout( aReverseGroupBox );
108   aReverseGroupBoxLayout->setMargin( 9 );
109   aReverseGroupBoxLayout->setSpacing( 6 );
110
111   myReverseCB = new QCheckBox( aReverseGroupBox );
112   myReverseCB->setText( tr( "GEOM_REVERSE_PLANE" ) );
113   aReverseGroupBoxLayout->addWidget( myReverseCB );
114
115   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
116   layout->setMargin( 0 ); layout->setSpacing( 6 );
117   layout->addWidget( Group1 );
118   layout->addWidget( Group2 );
119   layout->addWidget( Group3 );
120   layout->addWidget( aReverseGroupBox );
121
122   setHelpFileName( "create_wplane_page.html" );
123
124   Init();
125 }
126
127 //=================================================================================
128 // function : ~BasicGUI_WorkingPlaneDlg()
129 // purpose  : Destroys the object and frees any allocated resources
130 //=================================================================================
131 BasicGUI_WorkingPlaneDlg::~BasicGUI_WorkingPlaneDlg()
132 {
133 }
134
135 //=================================================================================
136 // function : Init()
137 // purpose  :
138 //=================================================================================
139 void BasicGUI_WorkingPlaneDlg::Init()
140 {
141   /* init variables */
142   myEditCurrentArgument = Group1->LineEdit1;
143   myWPlane = myGeomGUI->GetWorkingPlane();
144
145   // myGeomGUI->SetState( 0 );
146
147   myFace  = GEOM::GEOM_Object::_nil();
148   myVectX = GEOM::GEOM_Object::_nil();
149   myVectZ = GEOM::GEOM_Object::_nil();
150
151   aOriginType = 1;
152
153   /* Filter definition */
154   globalSelection( GEOM_PLANE );
155
156    /* signals and slots connections */
157   connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
158   connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ),        this, SLOT( ClickOnCancel() ) );
159
160   connect( buttonOk(),     SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
161   connect( buttonApply(),  SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
162
163   connect( this,           SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
164
165   connect( Group1->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
166   connect( Group1->PushButton1, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
167   connect( Group2->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
168   connect( Group2->PushButton1, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
169   connect( Group2->LineEdit2,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
170   connect( Group2->PushButton2, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
171
172   connect( Group3->GroupBox1, SIGNAL( clicked( int ) ), this, SLOT( GroupClicked( int ) ) );
173
174   connect( myReverseCB, SIGNAL( clicked() ), this, SLOT( onReverse() ) );
175
176   connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
177            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
178
179   initName( tr( "GEOM_WPLANE" ) );
180
181   setConstructorId( 2 ); // simplest constructor
182   ConstructorsClicked( 2 );
183 }
184
185 //=================================================================================
186 // function : ConstructorsClicked()
187 // purpose  : Radio button management
188 //=================================================================================
189 void BasicGUI_WorkingPlaneDlg::ConstructorsClicked( int constructorId )
190 {
191   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
192
193   disconnect( aSelMgr, 0, this, 0 );
194
195   switch ( constructorId ) {
196   case 0:
197     {
198       TColStd_MapOfInteger aMap;
199       aMap.Add( GEOM_PLANE );
200       aMap.Add( GEOM_MARKER );
201       globalSelection( aMap );
202       Group2->hide();
203       Group3->hide();
204       Group1->show();
205       Group1->PushButton1->setDown(true);
206       myEditCurrentArgument = Group1->LineEdit1;
207       Group1->LineEdit1->setText( "" );
208       myFace = GEOM::GEOM_Object::_nil();
209
210       connect( aSelMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
211       break;
212     }
213   case 1:
214     {
215       globalSelection( GEOM_LINE );
216       Group1->hide();
217       Group3->hide();
218       Group2->show();
219       myEditCurrentArgument = Group2->LineEdit1;
220       Group2->LineEdit1->setText( "" );
221       Group2->LineEdit2->setText( "" );
222       Group2->PushButton1->setDown( true );
223       Group2->PushButton2->setDown( false );
224       Group2->LineEdit1->setEnabled( true );
225       Group2->LineEdit2->setEnabled( false );
226       myVectX = GEOM::GEOM_Object::_nil();
227       myVectZ = GEOM::GEOM_Object::_nil();
228
229       connect( aSelMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
230       break;
231     }
232   case 2:
233     {
234       Group1->hide();
235       Group2->hide();
236       Group3->show();
237       Group3->RadioButton1->setChecked( true );
238       aOriginType = 1;
239       break;
240     }
241   }
242
243   qApp->processEvents();
244   updateGeometry();
245   resize( minimumSizeHint() );
246
247   updateWPlane();
248 }
249
250 //=================================================================================
251 // function : GroupClicked()
252 // purpose  : Radio button management
253 //=================================================================================
254 void BasicGUI_WorkingPlaneDlg::GroupClicked( int groupId )
255 {
256   aOriginType = groupId;
257   updateWPlane();
258 }
259
260 //=================================================================================
261 // function : ClickOnOk()
262 // purpose  :
263 //=================================================================================
264 void BasicGUI_WorkingPlaneDlg::ClickOnOk()
265 {
266   if ( ClickOnApply() )
267     ClickOnCancel();
268 }
269
270 //=================================================================================
271 // function : ClickOnApply()
272 // purpose  :
273 //=================================================================================
274 bool BasicGUI_WorkingPlaneDlg::ClickOnApply()
275 {
276   buttonApply()->setFocus();
277   myGeomGUI->application()->putInfo( "" );
278
279   if ( updateWPlane( false ) ) {
280     myGeomGUI->SetWorkingPlane( myWPlane );
281     myGeomGUI->ActiveWorkingPlane();
282   }
283
284   return true;
285 }
286
287 //=================================================================================
288 // function : SelectionIntoArgument()
289 // purpose  : Called when selection as changed or other case
290 //=================================================================================
291 void BasicGUI_WorkingPlaneDlg::SelectionIntoArgument()
292 {
293   myEditCurrentArgument->setText( "" );
294   QString aName;
295
296   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
297   SALOME_ListIO aSelList;
298   aSelMgr->selectedObjects(aSelList);
299
300   const int id = getConstructorId();
301   if (aSelList.Extent() != 1) {
302     if ( id == 0 )
303       myFace = GEOM::GEOM_Object::_nil();
304     else if ( id == 1 ) {
305       if ( myEditCurrentArgument == Group2->LineEdit1 )
306         myVectX = GEOM::GEOM_Object::_nil();
307       else if ( myEditCurrentArgument == Group2->LineEdit2 )
308         myVectZ = GEOM::GEOM_Object::_nil();
309     }
310     return;
311   }
312
313   // nbSel == 1
314   Standard_Boolean aRes = Standard_False;
315   GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
316
317   if ( !aRes || CORBA::is_nil( aSelectedObject ) )
318     return;
319
320   aName = GEOMBase::GetName(aSelectedObject);
321
322   if ( myEditCurrentArgument == Group1->LineEdit1 )
323     myFace = aSelectedObject;
324   else if ( myEditCurrentArgument == Group2->LineEdit1 ||
325             myEditCurrentArgument == Group2->LineEdit2 ) {
326     if ( aRes && !aSelectedObject->_is_nil() ) {
327       TopoDS_Shape aShape;
328       if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
329         TColStd_IndexedMapOfInteger aMap;
330         aSelMgr->GetIndexes(aSelList.First(), aMap);
331         if ( aMap.Extent() == 1 ) {
332           int anIndex = aMap( 1 );
333           aName = aName + ":edge_" + QString::number( anIndex );
334
335           GEOM::GEOM_IShapesOperations_var aShapesOp =
336             getGeomEngine()->GetIShapesOperations( getStudyId() );
337           if ( myEditCurrentArgument == Group2->LineEdit1 )
338             myVectX = aShapesOp->GetSubShape( aSelectedObject, anIndex );
339           else
340             myVectZ = aShapesOp->GetSubShape( aSelectedObject, anIndex );
341         }
342         else {
343           if ( aShape.ShapeType() != TopAbs_EDGE ) {
344             aSelectedObject = GEOM::GEOM_Object::_nil();
345             aName = "";
346           }
347         }
348         aSelMgr->clearSelected();
349       }
350     }
351   }
352
353   myEditCurrentArgument->setText( aName );
354
355   if ( myEditCurrentArgument == Group2->LineEdit1 ) {
356     myVectX = aSelectedObject;
357     if ( !myVectX->_is_nil() && myVectZ->_is_nil() )
358       Group2->PushButton2->click();
359   }
360   else {
361     myVectZ = aSelectedObject;
362     if ( !myVectZ->_is_nil() && myVectX->_is_nil() )
363       Group2->PushButton1->click();
364   }
365
366   updateWPlane();
367 }
368
369
370 //=================================================================================
371 // function : SetEditCurrentArgument()
372 // purpose  :
373 //=================================================================================
374 void BasicGUI_WorkingPlaneDlg::SetEditCurrentArgument()
375 {
376   QPushButton* send = (QPushButton*)sender();
377
378   if ( send == Group1->PushButton1 ) {
379     myEditCurrentArgument = Group1->LineEdit1;
380     globalSelection( GEOM_PLANE );
381   }
382   else if ( send == Group2->PushButton1 ) {
383     myEditCurrentArgument = Group2->LineEdit1;
384     GEOM::GEOM_Object_var anObj;
385     //    localSelection( anObj, TopAbs_EDGE );
386     globalSelection( GEOM_LINE );
387     Group2->PushButton2->setDown( false );
388     Group2->LineEdit1->setEnabled( true );
389     Group2->LineEdit2->setEnabled( false );
390   }
391   else if ( send == Group2->PushButton2 ) {
392     myEditCurrentArgument = Group2->LineEdit2;
393     GEOM::GEOM_Object_var anObj;
394     //    localSelection( anObj, TopAbs_EDGE );
395     globalSelection( GEOM_LINE );
396     Group2->PushButton1->setDown( false );
397     Group2->LineEdit1->setEnabled( false );
398     Group2->LineEdit2->setEnabled( true );
399   }
400
401   myEditCurrentArgument->setFocus();
402   //  SelectionIntoArgument();
403   send->setDown(true);
404   displayPreview();
405 }
406
407
408 //=================================================================================
409 // function : LineEditReturnPressed()
410 // purpose  :
411 //=================================================================================
412 void BasicGUI_WorkingPlaneDlg::LineEditReturnPressed()
413 {
414   QLineEdit* send = (QLineEdit*)sender();
415   if ( send == Group1->LineEdit1 || send == Group2->LineEdit1 || send == Group2->LineEdit2 ) {
416     myEditCurrentArgument = send;
417     GEOMBase_Skeleton::LineEditReturnPressed();
418   }
419 }
420
421
422 //=================================================================================
423 // function : onReverse()
424 // purpose  :
425 //=================================================================================
426 void BasicGUI_WorkingPlaneDlg::onReverse()
427 {
428   updateWPlane();
429 }
430
431
432 //=================================================================================
433 // function : ActivateThisDialog()
434 // purpose  :
435 //=================================================================================
436 void BasicGUI_WorkingPlaneDlg::ActivateThisDialog( )
437 {
438   GEOMBase_Skeleton::ActivateThisDialog();
439   connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( ) ) )->selectionMgr(),
440            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
441
442   ConstructorsClicked( getConstructorId() );
443 }
444
445
446 //=================================================================================
447 // function : DeactivateActiveDialog()
448 // purpose  : public slot to deactivate if active
449 //=================================================================================
450 void BasicGUI_WorkingPlaneDlg::DeactivateActiveDialog()
451 {
452   // myGeomGUI->SetState( -1 );
453   GEOMBase_Skeleton::DeactivateActiveDialog();
454 }
455
456 //=================================================================================
457 // function : enterEvent()
458 // purpose  :
459 //=================================================================================
460 void BasicGUI_WorkingPlaneDlg::enterEvent( QEvent* )
461 {
462   if ( !mainFrame()->GroupConstructors->isEnabled() )
463     ActivateThisDialog();
464 }
465
466 //=================================================================================
467 // function : updateWPlane
468 // purpose  :
469 //=================================================================================
470 bool BasicGUI_WorkingPlaneDlg::updateWPlane( const bool showPreview )
471 {
472   erasePreview();
473
474   const int id = getConstructorId();
475
476   if ( id == 0 ) { // by planar face selection
477     if ( CORBA::is_nil( myFace ) ) {
478       if ( !showPreview )
479         showError( "Face has to be selected" );
480       return false;
481     }
482
483     // PAL12781: set center of WPL to face's center of mass
484     // like it is done for LCS creation
485     CORBA::Double Ox, Oy, Oz,   Zx, Zy, Zz,   Xx, Xy, Xz;
486     Ox = Oy = Oz = Zx = Zy = Xy = Xz = 0.;
487     Zz = Xx = 1.;
488
489     GEOM::GEOM_IMeasureOperations_ptr aMeasureOp =
490       myGeomGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() );
491     aMeasureOp->GetPosition( myFace, Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz);
492
493     if ( aMeasureOp->IsDone() ) {
494       gp_Pnt aPnt ( Ox, Oy, Oz );
495       gp_Dir aDirN ( Zx, Zy, Zz );
496       gp_Dir aDirX ( Xx, Xy, Xz );
497       myWPlane = gp_Ax3( aPnt, aDirN, aDirX );
498     }
499     else {
500       if ( !showPreview )
501         showError( "Wrong shape selected (has to be a planar face)" );
502       return false;
503     }
504   }
505   else if ( id == 1 ) { // by two vectors (Ox & Oz)
506     if ( CORBA::is_nil( myVectX ) || CORBA::is_nil( myVectZ ) ) {
507       if ( !showPreview )
508         showError( "Two vectors have to be selected" );
509       return false;
510     }
511
512     TopoDS_Edge aVectX, aVectZ;
513     TopoDS_Vertex VX1, VX2, VZ1, VZ2;
514     gp_Vec aVX, aVZ;
515
516     if ( !GEOMBase::GetShape( myVectX, aVectX, TopAbs_EDGE ) ||
517          !GEOMBase::GetShape( myVectZ, aVectZ, TopAbs_EDGE ) ) {
518       if ( !showPreview )
519         showError( "Wrong shape selected (two vectors(edges) have to be selected)" );
520       return false;
521     }
522
523     TopExp::Vertices( aVectX, VX1, VX2, Standard_True );
524     TopExp::Vertices( aVectZ, VZ1, VZ2, Standard_True );
525
526     if ( VX1.IsNull() || VX2.IsNull() ) {
527       if ( !showPreview )
528         showError( "Bad OX vector" );
529       return false;
530     }
531     if ( VZ1.IsNull() || VZ2.IsNull() ) {
532       if ( !showPreview )
533         showError( "Bad OZ vector" );
534       return false;
535     }
536
537     aVX = gp_Vec( BRep_Tool::Pnt( VX1 ), BRep_Tool::Pnt( VX2 ) );
538     aVZ = gp_Vec( BRep_Tool::Pnt( VZ1 ), BRep_Tool::Pnt( VZ2 ) );
539
540     if ( aVX.Magnitude() < Precision::Confusion() ) {
541       if ( !showPreview )
542         showError( "Bad OX vector" );
543       return false;
544     }
545     if ( aVZ.Magnitude() < Precision::Confusion() ) {
546       if ( !showPreview )
547         showError( "Bad OZ vector" );
548       return false;
549     }
550
551     gp_Dir aDirX = gp_Dir( aVX.X(), aVX.Y(), aVX.Z() );
552     gp_Dir aDirZ = gp_Dir( aVZ.X(), aVZ.Y(), aVZ.Z() );
553
554     if ( aDirX.IsParallel( aDirZ, Precision::Angular() ) ) {
555       if ( !showPreview )
556         showError( "Parallel vectors selected" );
557       return false;
558     }
559
560     myWPlane = gp_Ax3( BRep_Tool::Pnt( VX1 ), aDirZ, aDirX );
561
562   }
563   else if ( id == 2 ) { // by selection from standard (OXY or OYZ, or OZX)
564     gp_Ax2 anAx2;
565
566     if      ( aOriginType == 1 ) anAx2 = gp::XOY();
567     else if ( aOriginType == 2 ) anAx2 = gp::YOZ();
568     else if ( aOriginType == 0 ) anAx2 = gp::ZOX();
569
570     myWPlane = gp_Ax3( anAx2 );
571
572   }
573   else {
574     return false;
575   }
576
577   if ( myReverseCB->isChecked() ) {
578     myWPlane.YReverse();
579     myWPlane.ZReverse();
580   }
581
582   if ( showPreview ) {
583     GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations( getStudyId() );
584     GEOM::GEOM_Object_var anObj = aBasicOp->MakeMarker
585       ( myWPlane.Location().X(),   myWPlane.Location().Y(),   myWPlane.Location().Z(),
586         myWPlane.XDirection().X(), myWPlane.XDirection().Y(), myWPlane.XDirection().Z(),
587         myWPlane.YDirection().X(), myWPlane.YDirection().Y(), myWPlane.YDirection().Z() );
588     displayPreview( anObj );
589   }
590
591   return true;
592 }