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