Salome HOME
NRI : 1_3_0 version.
[modules/geom.git] / src / GEOMGUI / GeometryGUI_BndBoxDlg.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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : GeometryGUI_BndBoxDlg.cxx
25 //  Author : Nicolas REJNERI
26 //  Module : GEOM
27 //  $Header$
28
29 using namespace std;
30 #include "GeometryGUI_BndBoxDlg.h"
31
32 #include "GeometryGUI.h"
33 #include "QAD_Application.h"
34 #include "QAD_Desktop.h"
35 #include "utilities.h"
36
37 #include <BRepPrimAPI_MakeBox.hxx>
38 #include <BRepBndLib.hxx>
39
40 #include <qbuttongroup.h>
41 #include <qgroupbox.h>
42 #include <qlabel.h>
43 #include <qlineedit.h>
44 #include <qpushbutton.h>
45 #include <qradiobutton.h>
46 #include <qlayout.h>
47 #include <qvariant.h>
48 #include <qtooltip.h>
49 #include <qwhatsthis.h>
50 #include <qimage.h>
51 #include <qpixmap.h>
52
53 //=================================================================================
54 // class    : GeometryGUI_BndBoxDlg()
55 // purpose  : Constructs a GeometryGUI_BndBoxDlg which is a child of 'parent', with the 
56 //            name 'name' and widget flags set to 'f'.
57 //            The dialog will by default be modeless, unless you set 'modal' to
58 //            TRUE to construct a modal dialog.
59 //=================================================================================
60 GeometryGUI_BndBoxDlg::GeometryGUI_BndBoxDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl )
61     : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
62 {
63     QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BOUNDING_BOX")));
64     QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
65
66     if ( !name )
67         setName( "GeometryGUI_BndBoxDlg" );
68     resize( 303, 275 ); 
69     setCaption( tr( "GEOM_BNDBOX_TITLE"  ) );
70     setSizeGripEnabled( TRUE );
71     GeometryGUI_BndBoxDlgLayout = new QGridLayout( this ); 
72     GeometryGUI_BndBoxDlgLayout->setSpacing( 6 );
73     GeometryGUI_BndBoxDlgLayout->setMargin( 11 );
74     
75     /***************************************************************/
76     GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
77     GroupConstructors->setTitle( tr( "GEOM_BNDBOX"  ) );
78     GroupConstructors->setExclusive( TRUE );
79     GroupConstructors->setColumnLayout(0, Qt::Vertical );
80     GroupConstructors->layout()->setSpacing( 0 );
81     GroupConstructors->layout()->setMargin( 0 );
82     GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
83     GroupConstructorsLayout->setAlignment( Qt::AlignTop );
84     GroupConstructorsLayout->setSpacing( 6 );
85     GroupConstructorsLayout->setMargin( 11 );
86     Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
87     Constructor1->setText( tr( ""  ) );
88     Constructor1->setPixmap( image0 );
89     Constructor1->setChecked( TRUE );
90     Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 
91                                               Constructor1->sizePolicy().hasHeightForWidth() ) );
92     Constructor1->setMinimumSize( QSize( 60, 0 ) );
93     GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
94     QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
95     GroupConstructorsLayout->addItem( spacer, 0, 1 );
96     GeometryGUI_BndBoxDlgLayout->addWidget( GroupConstructors, 0, 0 );
97
98     /***************************************************************/
99     GroupConstructor1 = new QGroupBox( this, "GroupConstructor1" );
100     GroupConstructor1->setTitle( tr( "GEOM_BNDBOX_OBJDIM"  ) );
101     GroupConstructor1->setColumnLayout(0, Qt::Vertical );
102     GroupConstructor1->layout()->setSpacing( 0 );
103     GroupConstructor1->layout()->setMargin( 0 );
104     GroupConstructor1Layout = new QGridLayout( GroupConstructor1->layout() );
105     GroupConstructor1Layout->setAlignment( Qt::AlignTop );
106     GroupConstructor1Layout->setSpacing( 6 );
107     GroupConstructor1Layout->setMargin( 11 );
108     LineEditC1A1 = new QLineEdit( GroupConstructor1, "LineEditC1A1" );
109     LineEditC1A1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, LineEditC1A1->sizePolicy().hasHeightForWidth() ) );
110 //    GroupConstructor1Layout->addWidget( LineEditC1A1, 0, 2 );
111     SelectButtonC1A1 = new QPushButton( GroupConstructor1, "SelectButtonC1A1" );
112     SelectButtonC1A1->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
113     SelectButtonC1A1->setText( tr( ""  ) );
114     SelectButtonC1A1->setPixmap( image1 );
115 //    GroupConstructor1Layout->addWidget( SelectButtonC1A1, 0, 1 );
116
117     TextLabelC1A1 = new QLabel( GroupConstructor1, "TextLabelC1A1" );
118     TextLabelC1A1->setText( tr( "GEOM_OBJECT"  ) );
119     TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
120     TextLabelC1A1->setFrameShape( QLabel::NoFrame );
121     TextLabelC1A1->setFrameShadow( QLabel::Plain );
122 //    GroupConstructor1Layout->addWidget( TextLabelC1A1, 0, 0 );
123
124     QHBoxLayout* bl = new QHBoxLayout;
125     bl->setMargin(0); bl->setSpacing(6);
126     bl->addWidget(TextLabelC1A1); bl->addWidget(SelectButtonC1A1); bl->addWidget(LineEditC1A1);
127     GroupConstructor1Layout->addMultiCellLayout(bl, 0, 0, 0, 2);
128
129     TextLabel_Min = new QLabel( GroupConstructor1, "TextLabel_Min" );
130     TextLabel_Min->setText( tr( "GEOM_MIN"  ) );
131     TextLabel_Min->setMinimumSize( QSize( 50, 0 ) );
132     TextLabel_Min->setFrameShape( QLabel::NoFrame );
133     TextLabel_Min->setFrameShadow( QLabel::Plain );
134     GroupConstructor1Layout->addWidget( TextLabel_Min, 1, 1 );
135
136     TextLabel_Max = new QLabel( GroupConstructor1, "TextLabel_Max" );
137     TextLabel_Max->setText( tr( "GEOM_MAX"  ) );
138     TextLabel_Max->setMinimumSize( QSize( 50, 0 ) );
139     TextLabel_Max->setFrameShape( QLabel::NoFrame );
140     TextLabel_Max->setFrameShadow( QLabel::Plain );
141     GroupConstructor1Layout->addWidget( TextLabel_Max, 1, 2 );
142
143     TextLabel_X = new QLabel( GroupConstructor1, "TextLabel_X" );
144     TextLabel_X->setText( tr( "GEOM_X"  ) );
145     TextLabel_X->setMinimumSize( QSize( 50, 0 ) );
146     TextLabel_X->setFrameShape( QLabel::NoFrame );
147     TextLabel_X->setFrameShadow( QLabel::Plain );
148     GroupConstructor1Layout->addWidget( TextLabel_X, 2, 0 );
149     LineEdit_MinX = new QLineEdit( GroupConstructor1, "LineEdit_MinX" );
150     LineEdit_MinX->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0,
151                                                  LineEdit_MinX->sizePolicy().hasHeightForWidth() ) );
152     //LineEdit_MinX->setEnabled( FALSE );
153     LineEdit_MinX->setReadOnly( TRUE );
154     GroupConstructor1Layout->addWidget( LineEdit_MinX, 2, 1 );
155     LineEdit_MaxX = new QLineEdit( GroupConstructor1, "LineEdit_MaxX" );
156     LineEdit_MaxX->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0,
157                                                  LineEdit_MaxX->sizePolicy().hasHeightForWidth() ) );
158     //LineEdit_MaxX->setEnabled( FALSE );
159     LineEdit_MaxX->setReadOnly( TRUE );
160     GroupConstructor1Layout->addWidget( LineEdit_MaxX, 2, 2 );
161
162     TextLabel_Y = new QLabel( GroupConstructor1, "TextLabel_Y" );
163     TextLabel_Y->setText( tr( "GEOM_Y"  ) );
164     TextLabel_Y->setMinimumSize( QSize( 50, 0 ) );
165     TextLabel_Y->setFrameShape( QLabel::NoFrame );
166     TextLabel_Y->setFrameShadow( QLabel::Plain );
167     GroupConstructor1Layout->addWidget( TextLabel_Y, 3, 0 );
168     LineEdit_MinY = new QLineEdit( GroupConstructor1, "LineEdit_MinY" );
169     LineEdit_MinY->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0,
170                                                  LineEdit_MinY->sizePolicy().hasHeightForWidth() ) );
171     //LineEdit_MinY->setEnabled( FALSE );
172     LineEdit_MinY->setReadOnly( TRUE );
173     GroupConstructor1Layout->addWidget( LineEdit_MinY, 3, 1 );
174     LineEdit_MaxY = new QLineEdit( GroupConstructor1, "LineEdit_MaxY" );
175     LineEdit_MaxY->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0,
176                                                  LineEdit_MaxY->sizePolicy().hasHeightForWidth() ) );
177     //LineEdit_MaxY->setEnabled( FALSE );
178     LineEdit_MaxY->setReadOnly( TRUE );
179     GroupConstructor1Layout->addWidget( LineEdit_MaxY, 3, 2 );
180
181     TextLabel_Z = new QLabel( GroupConstructor1, "TextLabel_Z" );
182     TextLabel_Z->setText( tr( "GEOM_Z"  ) );
183     TextLabel_Z->setMinimumSize( QSize( 50, 0 ) );
184     TextLabel_Z->setFrameShape( QLabel::NoFrame );
185     TextLabel_Z->setFrameShadow( QLabel::Plain );
186     GroupConstructor1Layout->addWidget( TextLabel_Z, 4, 0 );
187     LineEdit_MinZ = new QLineEdit( GroupConstructor1, "LineEdit_MinZ" );
188     LineEdit_MinZ->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0,
189                                                  LineEdit_MinZ->sizePolicy().hasHeightForWidth() ) );
190     //LineEdit_MinZ->setEnabled( FALSE );
191     LineEdit_MinZ->setReadOnly( TRUE );
192     GroupConstructor1Layout->addWidget( LineEdit_MinZ, 4, 1 );
193     LineEdit_MaxZ = new QLineEdit( GroupConstructor1, "LineEdit_MaxZ" );
194     LineEdit_MaxZ->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0,
195                                                  LineEdit_MaxZ->sizePolicy().hasHeightForWidth() ) );
196     //LineEdit_MaxZ->setEnabled( FALSE );
197     LineEdit_MaxZ->setReadOnly( TRUE );
198     GroupConstructor1Layout->addWidget( LineEdit_MaxZ, 4, 2 );
199
200     GeometryGUI_BndBoxDlgLayout->addWidget( GroupConstructor1, 1, 0 );
201
202     /***************************************************************/
203     GroupButtons = new QGroupBox( this, "GroupButtons" );
204     GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); 
205     GroupButtons->setTitle( tr( ""  ) );
206     GroupButtons->setColumnLayout(0, Qt::Vertical );
207     GroupButtons->layout()->setSpacing( 0 );
208     GroupButtons->layout()->setMargin( 0 );
209     GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
210     GroupButtonsLayout->setAlignment( Qt::AlignTop );
211     GroupButtonsLayout->setSpacing( 6 );
212     GroupButtonsLayout->setMargin( 11 );
213     buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
214     buttonCancel->setText( tr( "GEOM_BUT_CLOSE"  ) );
215     buttonCancel->setAutoDefault( TRUE );
216     GroupButtonsLayout->addWidget( buttonCancel, 0, 1 );
217
218     QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
219     GroupButtonsLayout->addItem( spacer_8, 0, 0 );
220     QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
221     GroupButtonsLayout->addItem( spacer_9, 0, 2 );
222
223     GeometryGUI_BndBoxDlgLayout->addWidget( GroupButtons, 2, 0 );
224     /***************************************************************/
225
226     Init(Sel) ; /* Initialisations */
227 }
228
229
230 //=================================================================================
231 // function : ~GeometryGUI_BndBoxDlg()
232 // purpose  : Destroys the object and frees any allocated resources
233 //=================================================================================
234 GeometryGUI_BndBoxDlg::~GeometryGUI_BndBoxDlg()
235 {
236     // no need to delete child widgets, Qt does it all for us
237 }
238
239
240 //=================================================================================
241 // function : Init()
242 // purpose  :
243 //=================================================================================
244 void GeometryGUI_BndBoxDlg::Init( SALOME_Selection* Sel )
245 {
246   myConstructorId = 0 ;
247   Constructor1->setChecked( TRUE );
248   myEditCurrentArgument = LineEditC1A1 ;        
249   mySelection = Sel;
250   myGeomGUI = GeometryGUI::GetGeometryGUI() ;
251   myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
252   
253   // TODO : previous selection into argument ?
254
255   /* Filter definitions */
256   Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
257   myGeom = GEOM::GEOM_Gen::_narrow(comp);
258
259   /* signals and slots connections */
260   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
261   connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
262   connect( SelectButtonC1A1, SIGNAL (clicked() ),   this, SLOT( SetEditCurrentArgument() ) ) ;
263   connect( mySelection, SIGNAL( currentSelectionChanged() ),     this, SLOT( SelectionIntoArgument() ) );
264
265   connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
266   /* to close dialog if study change */
267   connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
268
269   mySimulationTopoDs.Nullify() ;
270
271   /* Move widget on the botton right corner of main widget */
272   int x, y ;
273   myGeomGUI->DefineDlgPosition( this, x, y ) ;
274   this->move( x, y ) ;  
275   this->show() ; /* displays Dialog */
276
277   return ;
278 }
279
280
281 //=================================================================================
282 // function : ConstructorsClicked()
283 // purpose  : Radio button management
284 //=================================================================================
285 void GeometryGUI_BndBoxDlg::ConstructorsClicked(int constructorId)
286 {
287   return ;
288 }
289
290
291
292 //=================================================================================
293 // function : ClickOnCancel()
294 // purpose  :
295 //=================================================================================
296 void GeometryGUI_BndBoxDlg::ClickOnCancel()
297 {
298   myGeomGUI->EraseSimulationShape() ;
299   mySimulationTopoDs.Nullify() ;
300   disconnect( mySelection, 0, this, 0 );
301   myGeomGUI->ResetState() ;
302   reject() ;
303   return ;
304 }
305
306
307 //=================================================================================
308 // function : SelectionIntoArgument()
309 // purpose  : Called when selection as changed or other case
310 //=================================================================================
311 void GeometryGUI_BndBoxDlg::SelectionIntoArgument()
312 {
313   LineEdit_MinX->setText("") ;
314   LineEdit_MinY->setText("") ;
315   LineEdit_MinZ->setText("") ;
316   LineEdit_MaxX->setText("") ;
317   LineEdit_MaxY->setText("") ;
318   LineEdit_MaxZ->setText("") ;  
319   myEditCurrentArgument->setText("") ;
320   mySimulationTopoDs.Nullify() ;
321
322   QString aString = ""; /* future the name of selection */
323
324   int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
325   if ( nbSel != 1 ) {
326     return ;
327   }
328
329   /*  nbSel == 1  */ 
330   TopoDS_Shape S;
331   if( !myGeomGUI->GetTopoFromSelection(mySelection, S) )
332     return ;
333   
334   if( S.IsNull() ) {
335     myEditCurrentArgument->setText( "" );
336     return ;
337   }
338  
339   LineEditC1A1->setText(aString) ;
340   this->CalculateAndDisplayBndBox(S) ;
341
342   return ;
343 }
344
345
346 //=================================================================================
347 // function : SetEditCurrentArgument()
348 // purpose  :
349 //=================================================================================
350 void GeometryGUI_BndBoxDlg::SetEditCurrentArgument()
351 {
352   QPushButton* send = (QPushButton*)sender();
353   switch (myConstructorId)
354     {
355     case 0: /* default constructor */
356       { 
357         if(send == SelectButtonC1A1) {
358           LineEditC1A1->setFocus() ;
359           myEditCurrentArgument = LineEditC1A1;
360         }
361         SelectionIntoArgument() ;
362         break;
363       }
364     }
365   return ;
366 }
367
368
369
370 //=================================================================================
371 // function : LineEditReturnPressed()
372 // purpose  :
373 //=================================================================================
374 void GeometryGUI_BndBoxDlg::LineEditReturnPressed()
375 {
376   QLineEdit* send = (QLineEdit*)sender();  
377   if( send == LineEditC1A1 )
378     myEditCurrentArgument = LineEditC1A1 ;
379   else
380     return ;
381   
382   /* User name of object input management                          */
383   /* If successfull the selection is changed and signal emitted... */
384   /* so SelectionIntoArgument() is automatically called.           */
385   const QString objectUserName = myEditCurrentArgument->text() ;
386   QWidget* thisWidget = (QWidget*)this ;
387   if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
388     myEditCurrentArgument->setText( objectUserName ) ;
389   }
390
391   return ;
392 }
393
394
395 //=================================================================================
396 // function : DeactivateActiveDialog()
397 // purpose  :
398 //=================================================================================
399 void GeometryGUI_BndBoxDlg::DeactivateActiveDialog()
400 {
401   if ( GroupConstructors->isEnabled() ) {    
402     disconnect( mySelection, 0, this, 0 );
403     GroupConstructors->setEnabled(false) ;
404     GroupConstructor1->setEnabled(false) ;
405     GroupButtons->setEnabled(false) ;
406   }
407   return ;
408 }
409
410
411 //=================================================================================
412 // function : ActivateThisDialog()
413 // purpose  :
414 //=================================================================================
415 void GeometryGUI_BndBoxDlg::ActivateThisDialog()
416 {
417   /* Emit a signal to deactivate the active dialog */
418   myGeomGUI->EmitSignalDeactivateDialog() ;   
419   GroupConstructors->setEnabled(true) ;
420   GroupConstructor1->setEnabled(true) ;
421   GroupButtons->setEnabled(true) ;
422   connect( mySelection, SIGNAL( currentSelectionChanged() ),     this, SLOT( SelectionIntoArgument() ) );
423   return ;
424 }
425
426
427 //=================================================================================
428 // function : enterEvent()
429 // purpose  :
430 //=================================================================================
431 void GeometryGUI_BndBoxDlg::enterEvent(QEvent* e)
432 {
433   if ( GroupConstructors->isEnabled() )
434     return ;  
435   ActivateThisDialog() ;
436   return ;
437 }
438
439
440 //=================================================================================
441 // function : closeEvent()
442 // purpose  :
443 //=================================================================================
444 void GeometryGUI_BndBoxDlg::closeEvent( QCloseEvent* e )
445 {
446   /* same than click on cancel button */
447   this->ClickOnCancel() ;
448   return ;
449 }
450
451
452 //=================================================================================
453 // function : CalculateAndDisplayBndBox()
454 // purpose  :
455 //=================================================================================
456 void GeometryGUI_BndBoxDlg::CalculateAndDisplayBndBox(const TopoDS_Shape& S)
457 {
458   LineEdit_MinX->setText("") ;
459   LineEdit_MinY->setText("") ;
460   LineEdit_MinZ->setText("") ;
461   LineEdit_MaxX->setText("") ;
462   LineEdit_MaxY->setText("") ;
463   LineEdit_MaxZ->setText("") ;
464   if( S.IsNull() ) 
465     return ;
466
467   Standard_Real axmin,aymin,azmin,axmax,aymax,azmax;
468   Bnd_Box B;
469   try {
470     BRepBndLib::Add(S,B);
471     B.Get(axmin,aymin,azmin,axmax,aymax,azmax);
472     LineEdit_MinX->setText( tr("%1").arg( axmin, 12, 'f', 6 ) ) ;
473     LineEdit_MinY->setText( tr("%1").arg( aymin, 12, 'f', 6 ) ) ;
474     LineEdit_MinZ->setText( tr("%1").arg( azmin, 12, 'f', 6 ) ) ;
475     LineEdit_MaxX->setText( tr("%1").arg( axmax, 12, 'f', 6 ) ) ;
476     LineEdit_MaxY->setText( tr("%1").arg( aymax, 12, 'f', 6 ) ) ;
477     LineEdit_MaxZ->setText( tr("%1").arg( azmax, 12, 'f', 6 ) ) ;
478     
479     mySimulationTopoDs = BRepPrimAPI_MakeBox( gp_Pnt(axmin,aymin,azmin),
480                                               gp_Pnt(axmax,aymax,azmax) ).Shape();
481     myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ; 
482   }
483   catch(Standard_Failure) {
484     MESSAGE("Catch intercepted in CalculateAndDisplayBndBox()" << endl ) ;
485   }
486   return ;
487 }