Salome HOME
NPAL18111: Bad shape build by partition.
[modules/geom.git] / src / BasicGUI / BasicGUI_PlaneDlg.cxx
1 //  GEOM GEOMGUI : GUI for Geometry component
2 //
3 //  Copyright (C) 2003  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 //
24 //  File   : BasicGUI_PlaneDlg.cxx
25 //  Author : Lucien PIGNOLONI
26 //  Module : GEOM
27 //  $Header$
28
29 #include "BasicGUI_PlaneDlg.h"
30
31 #include "SUIT_Desktop.h"
32 #include "SUIT_Session.h"
33 #include "SalomeApp_Application.h"
34 #include "LightApp_SelectionMgr.h"
35
36 #include <TColStd_MapOfInteger.hxx>
37
38 #include <TopoDS_Shape.hxx>
39 #include <TopoDS_Edge.hxx>
40 #include <TopoDS.hxx>
41 #include <TopExp.hxx>
42 #include <TColStd_IndexedMapOfInteger.hxx>
43 #include <TopTools_IndexedMapOfShape.hxx>
44
45 #include <qlabel.h>
46
47 #include "GEOMImpl_Types.hxx"
48
49 using namespace std;
50
51 //=================================================================================
52 // class    : BasicGUI_PlaneDlg()
53 // purpose  : Constructs a BasicGUI_PlaneDlg which is a child of 'parent', with the
54 //            name 'name' and widget flags set to 'f'.
55 //            The dialog will by default be modeless, unless you set 'modal' to
56 //            TRUE to construct a modal dialog.
57 //=================================================================================
58 BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
59                                      const char* name, bool modal, WFlags fl)
60   :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
61                      WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
62 {
63   QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_PV")));
64   QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_3PNTS")));
65   QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_FACE")));
66   QPixmap image3(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
67
68   setCaption(tr("GEOM_PLANE_TITLE"));
69
70   /***************************************************************/
71   GroupConstructors->setTitle(tr("GEOM_PLANE"));
72   RadioButton1->setPixmap(image0);
73   RadioButton2->setPixmap(image1);
74   RadioButton3->setPixmap(image2);
75
76   GroupPntDir = new DlgRef_2Sel1Spin(this, "GroupPointDirection");
77   GroupPntDir->GroupBox1->setTitle(tr("GEOM_PLANE_PV"));
78   GroupPntDir->TextLabel1->setText(tr("GEOM_POINT"));
79   GroupPntDir->TextLabel2->setText(tr("GEOM_VECTOR"));
80   GroupPntDir->TextLabel3->setText(tr("GEOM_PLANE_SIZE"));
81   GroupPntDir->PushButton1->setPixmap(image3);
82   GroupPntDir->PushButton2->setPixmap(image3);
83   GroupPntDir->LineEdit1->setReadOnly( true );
84   GroupPntDir->LineEdit2->setReadOnly( true );
85
86   Group3Pnts = new DlgRef_3Sel1Spin(this, "Group3Pnts");
87   Group3Pnts->GroupBox1->setTitle(tr("GEOM_3_POINTS"));
88   Group3Pnts->TextLabel1->setText(tr("GEOM_POINT1"));
89   Group3Pnts->TextLabel2->setText(tr("GEOM_POINT2"));
90   Group3Pnts->TextLabel3->setText(tr("GEOM_POINT3"));
91   Group3Pnts->TextLabel4->setText(tr("GEOM_PLANE_SIZE"));
92   Group3Pnts->PushButton1->setPixmap(image3);
93   Group3Pnts->PushButton2->setPixmap(image3);
94   Group3Pnts->PushButton3->setPixmap(image3);
95
96   Group3Pnts->LineEdit1->setReadOnly( true );
97   Group3Pnts->LineEdit2->setReadOnly( true );
98   Group3Pnts->LineEdit3->setReadOnly( true );
99
100   GroupFace = new DlgRef_1Sel1Spin(this, "GroupFace");
101   GroupFace->GroupBox1->setTitle(tr("GEOM_FACE_OR_LCS"));
102   GroupFace->TextLabel1->setText(tr("GEOM_SELECTION"));
103   GroupFace->TextLabel2->setText(tr("GEOM_PLANE_SIZE"));
104   GroupFace->PushButton1->setPixmap(image3);
105
106   GroupFace->LineEdit1->setReadOnly( true );
107
108   Layout1->addWidget(GroupPntDir, 2, 0);
109   Layout1->addWidget(Group3Pnts, 2, 0);
110   Layout1->addWidget(GroupFace, 2, 0);
111   /***************************************************************/
112
113   setHelpFileName("plane.htm");
114
115   Init();
116 }
117
118
119 //=================================================================================
120 // function : ~BasicGUI_PlaneDlg()
121 // purpose  : Destroys the object and frees any allocated resources
122 //=================================================================================
123 BasicGUI_PlaneDlg::~BasicGUI_PlaneDlg()
124 {
125 }
126
127
128 //=================================================================================
129 // function : Init()
130 // purpose  :
131 //=================================================================================
132 void BasicGUI_PlaneDlg::Init()
133 {
134   /* init variables */
135   myEditCurrentArgument = GroupPntDir->LineEdit1;
136
137   myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = myFace = GEOM::GEOM_Object::_nil();
138
139   // myGeomGUI->SetState( 0 );
140
141   /* Get setting of step value from file configuration */
142   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
143   double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
144
145   double aTrimSize = 2000.0;
146
147   /* min, max, step and decimals for spin boxes */
148   GroupPntDir->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
149   GroupPntDir->SpinBox_DX->SetValue( aTrimSize );
150   Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
151   Group3Pnts->SpinBox_DX->SetValue( aTrimSize );
152   GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
153   GroupFace->SpinBox_DX->SetValue( aTrimSize );
154
155   /* signals and slots connections */
156   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
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   connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
163
164   connect(GroupPntDir->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
165   connect(GroupPntDir->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
166   connect(Group3Pnts->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
167   connect(Group3Pnts->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
168   connect(Group3Pnts->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
169   connect(GroupFace->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
170
171   connect(GroupPntDir->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
172   connect(GroupPntDir->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
173   connect(Group3Pnts->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
174   connect(Group3Pnts->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
175   connect(Group3Pnts->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
176   connect(GroupFace->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
177
178   connect(GroupPntDir->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
179   connect(Group3Pnts->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
180   connect(GroupFace->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
181
182   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPntDir->SpinBox_DX, SLOT(SetStep(double)));
183   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Pnts->SpinBox_DX, SLOT(SetStep(double)));
184   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupFace->SpinBox_DX, SLOT(SetStep(double)));
185
186   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
187
188   initName( tr( "GEOM_PLANE" ) );
189
190   Group3Pnts->hide();
191   GroupFace->hide();
192   ConstructorsClicked( 0 );
193 }
194
195
196 //=================================================================================
197 // function : ConstructorsClicked()
198 // purpose  : Radio button management
199 //=================================================================================
200 void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
201 {
202   disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
203   myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = myFace = GEOM::GEOM_Object::_nil();
204
205   switch ( constructorId )
206   {
207     case 0: /* plane from a point and a direction (vector, edge...) */
208       {
209                                 Group3Pnts->hide();
210                                 GroupFace->hide();
211                                 resize(0, 0);
212                                 GroupPntDir->show();
213
214                                 myEditCurrentArgument = GroupPntDir->LineEdit1;
215                                 GroupPntDir->LineEdit1->setText(tr(""));
216                                 GroupPntDir->LineEdit2->setText(tr(""));
217
218                                 /* for the first argument */
219                                 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
220                                 break;
221       }
222     case 1: /* plane from 3 points */
223       {
224                                 GroupPntDir->hide();
225                                 GroupFace->hide();
226                                 resize(0, 0);
227                                 Group3Pnts->show();
228
229                                 myEditCurrentArgument = Group3Pnts->LineEdit1;
230                                 Group3Pnts->LineEdit1->setText("");
231                                 Group3Pnts->LineEdit2->setText("");
232                                 Group3Pnts->LineEdit3->setText("");
233
234                                 /* for the first argument */
235                                 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
236                                 break;
237       }
238     case 2: /* plane from a planar face selection */
239       {
240                                 GroupPntDir->hide();
241                                 Group3Pnts->hide();
242                                 resize(0, 0);
243                                 GroupFace->show();
244
245                                 myEditCurrentArgument = GroupFace->LineEdit1;
246                                 GroupFace->LineEdit1->setText(tr(""));
247
248                                 /* for the first argument */
249                                 //globalSelection( GEOM_PLANE );
250                                 TColStd_MapOfInteger aMap;
251                                 aMap.Add( GEOM_PLANE );
252                                 aMap.Add( GEOM_MARKER );
253                                 globalSelection( aMap );
254                                 break;
255       }
256     }
257
258   myEditCurrentArgument->setFocus();
259   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
260           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
261 }
262
263
264 //=================================================================================
265 // function : ClickOnOk()
266 // purpose  :
267 //=================================================================================
268 void BasicGUI_PlaneDlg::ClickOnOk()
269 {
270   if ( ClickOnApply() )
271     ClickOnCancel();
272 }
273
274
275 //=================================================================================
276 // function : ClickOnApply()
277 // purpose  :
278 //=================================================================================
279 bool BasicGUI_PlaneDlg::ClickOnApply()
280 {
281   if ( !onAccept() )
282     return false;
283
284   initName();
285   ConstructorsClicked( getConstructorId() );
286   return true;
287 }
288
289 //=======================================================================
290 // function : ClickOnCancel()
291 // purpose  :
292 //=======================================================================
293 void BasicGUI_PlaneDlg::ClickOnCancel()
294 {
295   GEOMBase_Skeleton::ClickOnCancel();
296 }
297
298 //=================================================================================
299 // function : SelectionIntoArgument()
300 // purpose  : Called when selection has changed
301 //=================================================================================
302 void BasicGUI_PlaneDlg::SelectionIntoArgument()
303 {
304   myEditCurrentArgument->setText("");
305
306   if ( IObjectCount() != 1 )
307   {
308     if      ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint  = GEOM::GEOM_Object::_nil();
309     else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir    = GEOM::GEOM_Object::_nil();
310     else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 )  myPoint1 = GEOM::GEOM_Object::_nil();
311     else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 )  myPoint2 = GEOM::GEOM_Object::_nil();
312     else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 )  myPoint3 = GEOM::GEOM_Object::_nil();
313     else if ( myEditCurrentArgument == GroupFace->LineEdit1 )   myFace   = GEOM::GEOM_Object::_nil();
314     return;
315   }
316
317   // nbSel == 1
318   Standard_Boolean aRes = Standard_False;
319   GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
320   if ( !CORBA::is_nil( aSelectedObject ) && aRes )
321   {
322     myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
323     TopoDS_Shape aShape;
324     if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
325       {
326         LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
327         TColStd_IndexedMapOfInteger aMap;
328         aSelMgr->GetIndexes( firstIObject(), aMap );
329         if ( aMap.Extent() == 1 )
330           {
331             GEOM::GEOM_IShapesOperations_var aShapesOp =
332               getGeomEngine()->GetIShapesOperations( getStudyId() );
333             int anIndex = aMap( 1 );
334             TopTools_IndexedMapOfShape aShapes;
335             TopExp::MapShapes( aShape, aShapes );
336             aShape = aShapes.FindKey( anIndex );
337             aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
338             aSelMgr->clearSelected();
339           }
340       }
341     if      ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint  = aSelectedObject;
342     else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir    = aSelectedObject;
343     else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 )  myPoint1 = aSelectedObject;
344     else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 )  myPoint2 = aSelectedObject;
345     else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 )  myPoint3 = aSelectedObject;
346     else if ( myEditCurrentArgument == GroupFace->LineEdit1 )   myFace   = aSelectedObject;
347   }
348   displayPreview();
349 }
350
351
352 //=================================================================================
353 // function : SetEditCurrentArgument()
354 // purpose  :
355 //=================================================================================
356 void BasicGUI_PlaneDlg::SetEditCurrentArgument()
357 {
358   QPushButton* send = (QPushButton*)sender();
359
360   if      ( send == GroupPntDir->PushButton1 ) myEditCurrentArgument = GroupPntDir->LineEdit1;
361   else if ( send == GroupPntDir->PushButton2 ) myEditCurrentArgument = GroupPntDir->LineEdit2;
362   else if ( send == Group3Pnts->PushButton1 )  myEditCurrentArgument = Group3Pnts->LineEdit1;
363   else if ( send == Group3Pnts->PushButton2 )  myEditCurrentArgument = Group3Pnts->LineEdit2;
364   else if ( send == Group3Pnts->PushButton3 )  myEditCurrentArgument = Group3Pnts->LineEdit3;
365   else if ( send == GroupFace->PushButton1 )   myEditCurrentArgument = GroupFace->LineEdit1;
366
367   myEditCurrentArgument->setFocus();
368
369   if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) {
370     GEOM::GEOM_Object_var anObj;
371     localSelection( anObj, TopAbs_EDGE );
372   }
373   else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) {
374     //globalSelection( GEOM_PLANE );
375     TColStd_MapOfInteger aMap;
376     aMap.Add( GEOM_PLANE );
377     aMap.Add( GEOM_MARKER );
378     globalSelection( aMap );
379   }
380   else
381     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
382
383   SelectionIntoArgument();
384 }
385
386
387 //=================================================================================
388 // function : LineEditReturnPressed()
389 // purpose  :
390 //=================================================================================
391 void BasicGUI_PlaneDlg::LineEditReturnPressed()
392 {
393   QLineEdit* send = (QLineEdit*)sender();
394   if ( send == GroupPntDir->LineEdit1 ||
395        send == GroupPntDir->LineEdit2 ||
396        send == Group3Pnts->LineEdit1 ||
397        send == Group3Pnts->LineEdit2 ||
398        send == Group3Pnts->LineEdit3 ||
399        send == GroupFace->LineEdit1 )
400   {
401     myEditCurrentArgument = send;
402     GEOMBase_Skeleton::LineEditReturnPressed();
403   }
404 }
405
406
407 //=================================================================================
408 // function : ActivateThisDialog()
409 // purpose  :
410 //=================================================================================
411 void BasicGUI_PlaneDlg::ActivateThisDialog()
412 {
413   GEOMBase_Skeleton::ActivateThisDialog();
414   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
415           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
416
417   // myGeomGUI->SetState( 0 );
418
419   ConstructorsClicked( getConstructorId() );
420 }
421
422 //=================================================================================
423 // function : DeactivateActiveDialog()
424 // purpose  : public slot to deactivate if active
425 //=================================================================================
426 void BasicGUI_PlaneDlg::DeactivateActiveDialog()
427 {
428   // myGeomGUI->SetState( -1 );
429   GEOMBase_Skeleton::DeactivateActiveDialog();
430 }
431
432 //=================================================================================
433 // function : enterEvent()
434 // purpose  :
435 //=================================================================================
436 void BasicGUI_PlaneDlg::enterEvent(QEvent* e)
437 {
438   if ( !GroupConstructors->isEnabled() )
439     ActivateThisDialog();
440 }
441
442
443 //=================================================================================
444 // function : ValueChangedInSpinBox()
445 // purpose  :
446 //=================================================================================
447 void BasicGUI_PlaneDlg::ValueChangedInSpinBox(double newValue)
448 {
449   displayPreview();
450 }
451
452 //=================================================================================
453 // function : getSize()
454 // purpose  :
455 //=================================================================================
456 double BasicGUI_PlaneDlg::getSize() const
457 {
458   switch ( getConstructorId() )
459   {
460   case 0 : return GroupPntDir->SpinBox_DX->GetValue();
461   case 1 : return Group3Pnts->SpinBox_DX->GetValue();
462   case 2 : return GroupFace->SpinBox_DX->GetValue();
463   }
464   return 0.;
465 }
466
467 //=================================================================================
468 // function : createOperation
469 // purpose  :
470 //=================================================================================
471 GEOM::GEOM_IOperations_ptr BasicGUI_PlaneDlg::createOperation()
472 {
473   return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
474 }
475
476 //=================================================================================
477 // function : isEqual
478 // purpose  : it may also be needed to check for min distance between gp_Pnt-s...
479 //=================================================================================
480 static bool isEqual( const GEOM::GEOM_Object_var& thePnt1, const GEOM::GEOM_Object_var& thePnt2 )
481 {
482         return thePnt1->_is_equivalent( thePnt2 );
483 }
484
485 //=================================================================================
486 // function : isValid
487 // purpose  :
488 //=================================================================================
489 bool BasicGUI_PlaneDlg::isValid( QString& msg )
490 {
491         const int id = getConstructorId();
492         if ( getSize() <= 0 )
493         {
494                 msg = QString( "Please, enter size greater than 0." );
495                 return false;
496         }
497         if ( id == 0 )
498                 return !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir );
499         else if ( id == 1 )
500                 return !CORBA::is_nil( myPoint1  ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) &&
501                        !isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 );
502         else if ( id == 2 )
503                 return !CORBA::is_nil( myFace );
504         return false;
505 }
506
507 //=================================================================================
508 // function : execute
509 // purpose  :
510 //=================================================================================
511 bool BasicGUI_PlaneDlg::execute( ObjectList& objects )
512 {
513   bool res = false;
514
515   GEOM::GEOM_Object_var anObj;
516
517   switch ( getConstructorId() )
518   {
519   case 0 :
520     anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePlanePntVec( myPoint, myDir, getSize() );
521     res = true;
522     break;
523   case 1 :
524     anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePlaneThreePnt( myPoint1, myPoint2, myPoint3, getSize() );
525     res = true;
526     break;
527   case 2 :
528     anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePlaneFace( myFace, getSize() );
529     res = true;
530     break;
531   }
532
533   if ( !anObj->_is_nil() )
534     objects.push_back( anObj._retn() );
535
536   return res;
537 }
538
539 //=================================================================================
540 // function : closeEvent
541 // purpose  :
542 //=================================================================================
543 void BasicGUI_PlaneDlg::closeEvent( QCloseEvent* e )
544 {
545   GEOMBase_Skeleton::closeEvent( e );
546 }
547