]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMGUI/GeometryGUI_PrismDlg.cxx
Salome HOME
NRI : First integration.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_PrismDlg.cxx
1 using namespace std;
2 //  File      : GeometryGUI_PrismDlg.cxx
3 //  Created   :
4 //  Author    : Lucien PIGNOLONI
5 //  Project   : SALOME
6 //  Module    : GeometryGUI
7 //  Copyright : OPEN CASCADE
8 //  $Header$
9
10 #include "GeometryGUI_PrismDlg.h"
11
12 #include "GeometryGUI.h"
13 #include "QAD_Application.h"
14 #include "QAD_Desktop.h"
15 #include "QAD_Config.h"
16 #include "utilities.h"
17
18 #include <qbuttongroup.h>
19 #include <qframe.h>
20 #include <qgroupbox.h>
21 #include <qlineedit.h>
22 #include <qvalidator.h>
23 #include <qpushbutton.h>
24 #include <qradiobutton.h>
25 #include <qlineedit.h>
26 #include <qlayout.h>
27 #include <qcheckbox.h>
28 #include <qvariant.h>
29 #include <qtooltip.h>
30 #include <qwhatsthis.h>
31 #include <qimage.h>
32 #include <qpixmap.h>
33 #include <qevent.h>
34 #include <qlabel.h>
35
36
37
38 //=================================================================================
39 // class    : GeometryGUI_PrismDlg()
40 // purpose  : Constructs a GeometryGUI_PrismDlg which is a child of 'parent', with the 
41 //            name 'name' and widget flags set to 'f'.
42 //            The dialog will by default be modeless, unless you set 'modal' to
43 //            TRUE to construct a modal dialog.
44 //=================================================================================
45 GeometryGUI_PrismDlg::GeometryGUI_PrismDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl )
46     : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
47 {
48
49     QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GeometryGUI",tr("ICON_DLG_PRISM")));
50     QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GeometryGUI",tr("ICON_SELECT")));
51
52     if ( !name )
53         setName( "GeometryGUI_PrismDlg" );
54     resize( 303, 225 ); 
55     setCaption( tr( "GEOM_PRISM_TITLE"  ) );
56     setSizeGripEnabled( TRUE );
57     GeometryGUI_PrismDlgLayout = new QGridLayout( this ); 
58     GeometryGUI_PrismDlgLayout->setSpacing( 6 );
59     GeometryGUI_PrismDlgLayout->setMargin( 11 );
60
61     /**************************************************************/
62     GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
63     GroupConstructors->setTitle( tr( "GEOM_PRISM"  ) );
64     GroupConstructors->setExclusive( TRUE );
65     GroupConstructors->setColumnLayout(0, Qt::Vertical );
66     GroupConstructors->layout()->setSpacing( 0 );
67     GroupConstructors->layout()->setMargin( 0 );
68     GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
69     GroupConstructorsLayout->setAlignment( Qt::AlignTop );
70     GroupConstructorsLayout->setSpacing( 6 );
71     GroupConstructorsLayout->setMargin( 11 );
72     Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
73     Constructor1->setText( tr( ""  ) );
74     Constructor1->setPixmap( image0 );
75     Constructor1->setChecked( TRUE );
76     Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
77     GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
78     QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
79     GroupConstructorsLayout->addItem( spacer, 0, 2 );
80     GeometryGUI_PrismDlgLayout->addWidget( GroupConstructors, 0, 0 );
81
82     /**************************************************************/
83     GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" );
84     GroupConstructor1->setTitle( tr( "GEOM_PRISM_BSV"  ) );
85     GroupConstructor1->setColumnLayout(0, Qt::Vertical );
86     GroupConstructor1->layout()->setSpacing( 0 );
87     GroupConstructor1->layout()->setMargin( 0 );
88     GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() );
89     GroupConstructor1Layout->setAlignment( Qt::AlignTop );
90     GroupConstructor1Layout->setSpacing( 6 );
91     GroupConstructor1Layout->setMargin( 11 );
92     LineEditC1A2Line = new QLineEdit( GroupConstructor1, "LineEditC1A2Line" );
93     LineEditC1A2Line->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A2Line->sizePolicy().hasHeightForWidth() ) );
94     GroupConstructor1Layout->addMultiCellWidget( LineEditC1A2Line, 1, 1, 2, 3 );
95     LineEditC1A1Base = new QLineEdit( GroupConstructor1, "LineEditC1A1Base" );
96     LineEditC1A1Base->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1Base->sizePolicy().hasHeightForWidth() ) );
97     GroupConstructor1Layout->addMultiCellWidget( LineEditC1A1Base, 0, 0, 2, 3 );
98     SelectButtonC1A1Base = new QPushButton( GroupConstructor1, "SelectButtonC1A1Base" );
99     SelectButtonC1A1Base->setText( tr( ""  ) );
100     SelectButtonC1A1Base->setPixmap( image1 );
101     GroupConstructor1Layout->addWidget( SelectButtonC1A1Base, 0, 1 );
102     SelectButtonC1A2Line = new QPushButton( GroupConstructor1, "SelectButtonC1A2Line" );
103     SelectButtonC1A2Line->setText( tr( ""  ) );
104     SelectButtonC1A2Line->setPixmap( image1 );
105     GroupConstructor1Layout->addWidget( SelectButtonC1A2Line, 1, 1 );
106     TextLabelBase = new QLabel( GroupConstructor1, "TextLabelBase" );
107     TextLabelBase->setText( tr( "GEOM_BASE"  ) );
108     TextLabelBase->setMinimumSize( QSize( 50, 0 ) );
109     TextLabelBase->setFrameShape( QLabel::NoFrame );
110     TextLabelBase->setFrameShadow( QLabel::Plain );
111     GroupConstructor1Layout->addWidget( TextLabelBase, 0, 0 );
112     TextLabelVector = new QLabel( GroupConstructor1, "TextLabelVector" );
113     TextLabelVector->setText( tr( "GEOM_VECTOR"  ) );
114     TextLabelVector->setMinimumSize( QSize( 50, 0 ) );
115     TextLabelVector->setFrameShape( QLabel::NoFrame );
116     TextLabelVector->setFrameShadow( QLabel::Plain );
117     GroupConstructor1Layout->addWidget( TextLabelVector, 1, 0 );
118
119     SpinBox_C1A3Height = new GeometryGUI_SpinBox( GroupConstructor1, "GeomSpinBox_C1A3Height" ) ;
120     SpinBox_C1A3Height->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, SpinBox_C1A3Height->sizePolicy().hasHeightForWidth() ) );
121     GroupConstructor1Layout->addWidget( SpinBox_C1A3Height, 2, 3 );
122
123     CheckBoxC3A1Reverse = new QCheckBox( GroupConstructor1, "CheckBoxC3A1Reverse" );
124     CheckBoxC3A1Reverse->setText( tr( "GEOM_REVERSE"  ) );
125     GroupConstructor1Layout->addMultiCellWidget( CheckBoxC3A1Reverse, 2, 2, 0, 1 );
126     TextLabelHeight = new QLabel( GroupConstructor1, "TextLabelHeight" );
127     TextLabelHeight->setText( tr( "GEOM_HEIGHT"  ) );
128     TextLabelHeight->setMinimumSize( QSize( 50, 0 ) );
129     TextLabelHeight->setFrameShape( QLabel::NoFrame );
130     TextLabelHeight->setFrameShadow( QLabel::Plain );
131     GroupConstructor1Layout->addWidget( TextLabelHeight, 2, 2 );
132     GeometryGUI_PrismDlgLayout->addWidget( GroupConstructor1, 1, 0 );
133     
134     /**************************************************************/
135     GroupButtons = new QGroupBox( this, "GroupButtons" );
136     GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); 
137     GroupButtons->setTitle( tr( ""  ) );
138     GroupButtons->setColumnLayout(0, Qt::Vertical );
139     GroupButtons->layout()->setSpacing( 0 );
140     GroupButtons->layout()->setMargin( 0 );
141     GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
142     GroupButtonsLayout->setAlignment( Qt::AlignTop );
143     GroupButtonsLayout->setSpacing( 6 );
144     GroupButtonsLayout->setMargin( 11 );
145     buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
146     buttonCancel->setText( tr( "GEOM_BUT_CLOSE"  ) );
147     buttonCancel->setAutoDefault( TRUE );
148     GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
149     buttonApply = new QPushButton( GroupButtons, "buttonApply" );
150     buttonApply->setText( tr( "GEOM_BUT_APPLY"  ) );
151     buttonApply->setAutoDefault( TRUE );
152     GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
153     QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
154     GroupButtonsLayout->addItem( spacer_9, 0, 2 );
155     buttonOk = new QPushButton( GroupButtons, "buttonOk" );
156     buttonOk->setText( tr( "GEOM_BUT_OK"  ) );
157     buttonOk->setAutoDefault( TRUE );
158     buttonOk->setDefault( TRUE );
159     GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
160     GeometryGUI_PrismDlgLayout->addWidget( GroupButtons, 2, 0 );
161
162     /* Initialisation */
163     Init( Sel ) ; 
164 }
165
166
167 //=================================================================================
168 // function : ~GeometryGUI_PrismDlg()
169 // purpose  : Destroys the object and frees any allocated resources
170 //=================================================================================
171 GeometryGUI_PrismDlg::~GeometryGUI_PrismDlg()
172 {  
173   /* no need to delete child widgets, Qt does it all for us */
174 }
175
176
177
178 //=================================================================================
179 // function : Init()
180 // purpose  :
181 //=================================================================================
182 void GeometryGUI_PrismDlg::Init( SALOME_Selection* Sel )
183 {
184
185   double step ;
186   QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ;
187   step = St.toDouble() ;
188   
189   /* min, max, step and decimals for spin boxes */
190   SpinBox_C1A3Height->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ;
191   SpinBox_C1A3Height->SetValue( 100.0 ) ;   /* = myHeight */
192
193   myHeight = 100.000 ;
194   mySelection = Sel ;
195   mySimulationTopoDs.Nullify() ;
196   myBaseTopo.Nullify() ;
197   myConstructorId = 0 ;
198   myDx = myDy = myDz = 0.0 ;
199
200   myGeomGUI = GeometryGUI::GetGeometryGUI() ;
201
202   GroupConstructor1->show();
203   myConstructorId = 0 ;
204   myEditCurrentArgument = LineEditC1A1Base ;
205   Constructor1->setChecked( TRUE );
206   myOkBase = myOkLine = false ;
207
208   myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
209   
210   /* Retrieves geom component */
211   Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "Geometry");
212   myGeom = GEOM::GEOM_Gen::_narrow(comp);
213   /* Filters definition */
214   myEdgeFilter = new GEOM_ShapeTypeFilter( TopAbs_EDGE, myGeom );
215
216
217   // TODO first selection into selection ?
218
219   /* signals and slots connections */
220   connect( buttonOk, SIGNAL( clicked() ),     this, SLOT( ClickOnOk() ) );
221   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
222   connect( buttonApply, SIGNAL( clicked() ),  this, SLOT(ClickOnApply() ) );
223
224   connect( GroupConstructors, SIGNAL(clicked(int) ),   this, SLOT( ConstructorsClicked(int) ) );
225   connect( SelectButtonC1A1Base, SIGNAL (clicked() ),  this, SLOT( SetEditCurrentArgument() ) ) ;
226   connect( SelectButtonC1A2Line, SIGNAL (clicked() ),  this, SLOT( SetEditCurrentArgument() ) ) ;
227
228   connect( LineEditC1A1Base, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
229   connect( LineEditC1A2Line, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
230
231   connect( CheckBoxC3A1Reverse, SIGNAL (stateChanged(int) ), this, SLOT( ReverseVector(int) ) ) ;
232
233   connect( SpinBox_C1A3Height, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
234
235   connect( mySelection, SIGNAL( currentSelectionChanged() ),     this, SLOT( SelectionIntoArgument() ) );
236   connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
237   /* to close dialog if study change */
238   connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
239  
240   /* Move widget on the botton right corner of main widget */
241   int x, y ;
242   myGeomGUI->DefineDlgPosition( this, x, y ) ;
243   this->move( x, y ) ;
244   this->show() ; /* Displays Dialog */ 
245
246   return ;
247 }
248
249
250
251 //=================================================================================
252 // function : ConstructorsClicked()
253 // purpose  : Radio button management
254 //=================================================================================
255 void GeometryGUI_PrismDlg::ConstructorsClicked(int constructorId)
256 {
257   myGeomGUI->EraseSimulationShape() ;
258
259   switch (constructorId)
260     {
261     case 0: /* base shape + an edge used as a vector */
262       {
263         GroupConstructor1->show();
264         myConstructorId = constructorId ;
265         myEditCurrentArgument = LineEditC1A1Base ;
266         LineEditC1A2Line->setText(tr("")) ;
267
268         SpinBox_C1A3Height->SetValue(100) ;
269         myHeight = 100.0 ;
270
271         Constructor1->setChecked( TRUE );
272         myOkBase = myOkLine = false ;
273         SelectionIntoArgument() ;
274         break;
275       }
276     }
277  return ;
278 }
279
280 //=================================================================================
281 // function : ClickOnOk()
282 // purpose  :
283 //=================================================================================
284 void GeometryGUI_PrismDlg::ClickOnOk()
285 {
286   this->ClickOnApply() ;
287   this->ClickOnCancel() ;
288
289   return ;
290 }
291
292 //=================================================================================
293 // function : ClickOnApply()
294 // purpose  :
295 //=================================================================================
296 void GeometryGUI_PrismDlg::ClickOnApply()
297 {
298   gp_Pnt P1, P2 ;
299
300   if( !myOkBase || !myOkLine )
301     return ;
302   
303   try {
304     myGeomGUI->EraseSimulationShape() ;
305     mySimulationTopoDs.Nullify() ;
306     gp_Vec Vec(myDx, myDy, myDz );
307     Vec.Normalize() ;
308     Vec *= myHeight ;
309     P1.SetCoord( 0.0, 0.0, 0.0 ) ;
310     P2.SetCoord( Vec.X(), Vec.Y(), Vec.Z() ) ;
311     switch(myConstructorId)
312       { 
313       case 0 :
314         {
315           if( myOkBase && myOkLine ) {
316             myGeomGUI->MakePrismAndDisplay( myGeomShape, P1, P2 ) ;
317           }
318           break ;
319         }
320       }
321   }
322   catch(Standard_Failure) {
323     MESSAGE("Exception intercepted in GeometryGUI_PrismDlg" << endl ) ;
324     return ;
325   }
326   
327   return ;
328 }
329
330
331 //=================================================================================
332 // function : ClickOnCancel()
333 // purpose  :
334 //=================================================================================
335 void GeometryGUI_PrismDlg::ClickOnCancel()
336 {
337   mySelection->ClearFilters() ;
338   myGeomGUI->EraseSimulationShape() ;
339   mySimulationTopoDs.Nullify() ;
340   disconnect( mySelection, 0, this, 0 );
341   myGeomGUI->ResetState() ;
342   reject() ;
343   return ;
344 }
345
346
347 //=================================================================================
348 // function : SelectionIntoArgument()
349 // purpose  : Called when selection has changed
350 //=================================================================================
351 void GeometryGUI_PrismDlg::SelectionIntoArgument()
352 {
353   myGeomGUI->EraseSimulationShape() ; 
354   mySimulationTopoDs.Nullify() ;
355
356   /* Future the name of selection */
357   QString aString = "";
358
359   int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
360   if ( nbSel != 1 ) {
361     switch (myConstructorId) 
362       {
363       case 0:
364         {
365           if ( myEditCurrentArgument == LineEditC1A1Base ) {
366             LineEditC1A1Base->setText("") ;
367             myOkBase = false ;
368           }
369           else if ( myEditCurrentArgument == LineEditC1A2Line ) {
370             LineEditC1A2Line->setText("") ;
371             myOkLine = false ;
372           }
373           break ;
374         } 
375       }
376     return ;
377   }
378
379   /*  nbSel == 1  */
380   TopoDS_Shape S; 
381   if( !myGeomGUI->GetTopoFromSelection(mySelection, S) )
382     return ;
383   
384   gp_Pnt aPoint1, aPoint2 ;
385   
386   if ( myEditCurrentArgument == LineEditC1A1Base ) {
387     Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
388     Standard_Boolean testResult ;
389     myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ;
390     if( !testResult)
391       return ;
392     if ( S.ShapeType() <= 2 )
393       return;
394
395     LineEditC1A1Base->setText(aString) ;
396     myBaseTopo = S ;
397     myOkBase = true ;
398   }    
399
400   else if ( myEditCurrentArgument == LineEditC1A2Line && myGeomGUI->LinearEdgeExtremities(S, aPoint1, aPoint2) ) {
401     myGeomGUI->GetBipointDxDyDz( aPoint1, aPoint2, myDx, myDy, myDz ) ;
402     myEditCurrentArgument->setText(aString) ;
403     myOkLine = true ;
404   }
405
406   if( myOkBase && myOkLine ) {
407     MakePrismSimulationAndDisplay( myBaseTopo ) ;
408   }  
409   return ; 
410 }
411
412
413
414 //=================================================================================
415 // function : MakePrismSimulationAndDisplay()
416 // purpose  :
417 //=================================================================================
418 void GeometryGUI_PrismDlg::MakePrismSimulationAndDisplay( const TopoDS_Shape& S )
419 {
420   try {
421     gp_Vec Vec(myDx, myDy, myDz );
422     Vec.Normalize() ;
423     Vec *= myHeight ;
424     mySimulationTopoDs = BRepPrimAPI_MakePrism(S, Vec, Standard_False).Shape() ;
425   }
426   catch(Standard_Failure) {
427     MESSAGE( "Exception catched in MakePrismSimulationAndDisplay" << endl ) ;
428     return ;
429   }
430   myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
431   return ;
432 }
433
434
435
436
437 //=================================================================================
438 // function : SetEditCurrentArgument()
439 // purpose  :
440 //=================================================================================
441 void GeometryGUI_PrismDlg::SetEditCurrentArgument()
442 {
443   QPushButton* send = (QPushButton*)sender();  
444   mySelection->ClearFilters() ;
445
446   switch (myConstructorId)
447     {
448     case 0: /* default constructor */
449       { 
450         if( send == SelectButtonC1A1Base ) {
451           LineEditC1A1Base->setFocus() ;
452           myEditCurrentArgument = LineEditC1A1Base ;
453         }
454         else if(send == SelectButtonC1A2Line) {
455           LineEditC1A2Line->setFocus() ;
456           myEditCurrentArgument = LineEditC1A2Line;
457           mySelection->AddFilter(myEdgeFilter) ;
458         }       
459         SelectionIntoArgument() ;
460         break;
461       }
462     }
463   return ;
464 }
465
466 //=================================================================================
467 // function : ValueChangedInSpinBox()
468 // purpose  :
469 //=================================================================================
470 void GeometryGUI_PrismDlg::ValueChangedInSpinBox( double newValue )
471 {
472   QObject* send = (QObject*)sender();
473   
474   if( send == SpinBox_C1A3Height ) {
475     myHeight = newValue ;
476     if( myOkBase && myOkLine ) {
477       myGeomGUI->EraseSimulationShape() ;
478       mySimulationTopoDs.Nullify() ;
479       MakePrismSimulationAndDisplay( myBaseTopo ) ;
480     }
481   }
482   return ;
483 }
484
485
486 //=================================================================================
487 // function : LineEditReturnPressed()
488 // purpose  :
489 //=================================================================================
490 void GeometryGUI_PrismDlg::LineEditReturnPressed()
491 {
492   QLineEdit* send = (QLineEdit*)sender();  
493   if( send == LineEditC1A1Base )
494     myEditCurrentArgument = LineEditC1A1Base ;
495   else if ( send == LineEditC1A2Line )
496     myEditCurrentArgument = LineEditC1A2Line ; 
497   else
498     return ;
499   
500   /* User name of object input management                          */
501   /* If successfull the selection is changed and signal emitted... */
502   /* so SelectionIntoArgument() is automatically called.           */
503   const QString objectUserName = myEditCurrentArgument->text() ;
504   QWidget* thisWidget = (QWidget*)this ;
505   if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
506     myEditCurrentArgument->setText( objectUserName ) ;
507   }
508   return ;
509 }
510
511
512
513 //=================================================================================
514 // function : DeactivateActiveDialog()
515 // purpose  :
516 //=================================================================================
517 void GeometryGUI_PrismDlg::DeactivateActiveDialog()
518 {
519   if ( GroupConstructors->isEnabled() ) {
520     GroupConstructors->setEnabled(false) ;
521     GroupConstructor1->setEnabled(false) ;
522     GroupButtons->setEnabled(false) ;  
523     disconnect( mySelection, 0, this, 0 );
524     myGeomGUI->EraseSimulationShape() ;
525   }
526   return ;
527 }
528
529
530
531 //=================================================================================
532 // function : closeEvent()
533 // purpose  :
534 //=================================================================================
535 void GeometryGUI_PrismDlg::closeEvent( QCloseEvent* e )
536 {
537   this->ClickOnCancel() ; /* same than click on cancel button */
538 }
539
540
541 //=================================================================================
542 // function : enterEvent()
543 // purpose  : when mouse enter onto the QWidget
544 //=================================================================================
545 void GeometryGUI_PrismDlg::enterEvent( QEvent *  )
546 {
547   if ( GroupConstructors->isEnabled() )
548     return ;  
549   ActivateThisDialog() ;
550 }
551
552
553
554 //=================================================================================
555 // function : ActivateThisDialog()
556 // purpose  :
557 //=================================================================================
558 void GeometryGUI_PrismDlg::ActivateThisDialog()
559 {
560   /* Emit a signal to deactivate any active dialog */
561   myGeomGUI->EmitSignalDeactivateDialog() ;
562   GroupConstructors->setEnabled(true) ;
563   GroupConstructor1->setEnabled(true) ;
564   GroupButtons->setEnabled(true) ;
565
566   connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
567   if( !mySimulationTopoDs.IsNull() )
568     myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
569   return ;
570 }
571
572
573 //=================================================================================
574 // function : ReverseVector()
575 // purpose  : 'state' not used here
576 //=================================================================================
577 void GeometryGUI_PrismDlg::ReverseVector(int state)
578 {
579   myDx = -myDx ;
580   myDy = -myDy ;
581   myDz = -myDz ;
582   if(myOkBase && myOkLine) {
583     myGeomGUI->EraseSimulationShape() ;
584     mySimulationTopoDs.Nullify() ;
585     MakePrismSimulationAndDisplay( myBaseTopo ) ;
586   }
587   return ;
588