1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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, or (at your option) any later version.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File : MeasureGUI_WhatisDlg.cxx
25 // Author : Nicolas REJNERI, Open CASCADE S.A.S.
27 #include "MeasureGUI_WhatisDlg.h"
28 #include "MeasureGUI_Widgets.h"
33 #include <SUIT_Session.h>
34 #include <SUIT_ResourceMgr.h>
35 #include <SalomeApp_Tools.h>
39 #include <QMessageBox>
41 class MeasureGUI_WhatisDlg::Whatis : public QGroupBox
44 Whatis( QWidget* parent );
48 QPushButton* PushButton1;
55 QPushButton* PushButton2;
58 //=================================================================================
59 // Constructs a MeasureGUI_Whatis_QTD which is a child of 'parent', with the
60 // name 'name' and widget flags set to 'f'
61 //=================================================================================
62 MeasureGUI_WhatisDlg::Whatis::Whatis( QWidget* parent )
65 QGridLayout* topLayout = new QGridLayout( this );
66 topLayout->setMargin( 11 );
67 topLayout->setSpacing( 6 );
69 TextLabel1 = new QLabel( this );
70 PushButton1 = new QPushButton( this );
71 LineEdit1 = new QLineEdit( this );
72 TextEdit1 = new QTextEdit( this );
73 TextLabel2 = new QLabel( this );
74 LineEdit2 = new QLineEdit( this);
75 PushButton2 = new QPushButton( this );
77 topLayout->addWidget( TextLabel1, 0, 0 );
78 topLayout->addWidget( PushButton1, 0, 1 );
79 topLayout->addWidget( LineEdit1, 0, 2, 1, 2 );
80 topLayout->addWidget( TextEdit1, 1, 0, 1, 4 );
81 topLayout->addWidget( TextLabel2 , 2, 0 );
82 topLayout->addWidget( LineEdit2 , 2, 1, 1, 2 );
83 topLayout->addWidget( PushButton2, 2, 3 );
86 //=================================================================================
87 // Destroys the object and frees any allocated resources
88 //=================================================================================
89 MeasureGUI_WhatisDlg::Whatis::~Whatis()
93 //=================================================================================
94 // class : MeasureGUI_WhatisDlg( )
95 // purpose : Constructs a MeasureGUI_WhatisDlg which is a child of 'parent', with the
96 // name 'name' and widget flags set to 'f'.
97 // The dialog will by default be modeless, unless you set 'modal' to
98 // true to construct a modal dialog.
99 //=================================================================================
100 MeasureGUI_WhatisDlg::MeasureGUI_WhatisDlg( GeometryGUI* GUI, QWidget* parent )
101 : MeasureGUI_Skeleton( GUI, parent )
103 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
104 QPixmap image0( resMgr->loadPixmap( "GEOM", tr( "ICON_DLG_WHATIS" ) ) );
105 QPixmap image1( resMgr->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
107 setWindowTitle( tr( "GEOM_WHATIS_TITLE" ) );
109 /***************************************************************/
111 mainFrame()->GroupConstructors->setTitle( tr( "GEOM_WHATIS" ) );
112 mainFrame()->RadioButton1->setIcon( image0 );
114 myGrp = new Whatis( this );
116 myGrp->setTitle( tr( "GEOM_WHATIS_OBJECT" ) );
118 myGrp->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
119 myGrp->PushButton1->setIcon( image1 );
120 myGrp->PushButton1->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
121 myGrp->LineEdit1->setReadOnly( true );
123 myGrp->TextEdit1->setReadOnly( true );
124 myGrp->TextEdit1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
125 QFontMetrics fm( myGrp->TextEdit1->font() );
126 myGrp->TextEdit1->setMinimumHeight( fm.height()*20 );
128 myGrp->TextLabel2->setText( tr( "GEOM_KIND_OF_SHAPE" ) );
129 myGrp->LineEdit2->setReadOnly( true );
130 myGrp->LineEdit2->setMinimumWidth( 150 );
131 myGrp->PushButton2->setText( tr( "GEOM_PROPERTIES" ) );
132 myGrp->PushButton2->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
134 QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
135 layout->setMargin( 0 ); layout->setSpacing( 6 );
136 layout->addWidget( myGrp );
139 myParamsDlg = new QMessageBox(QMessageBox::Information, "", "", QMessageBox::Ok, this);
140 myParamsDlg->setModal( false );
142 /***************************************************************/
144 myHelpFileName = "whatis_page.html";
150 //=================================================================================
151 // function : ~MeasureGUI_WhatisDlg()
152 // purpose : Destroys the object and frees any allocated resources
153 //=================================================================================
154 MeasureGUI_WhatisDlg::~MeasureGUI_WhatisDlg()
158 //=================================================================================
161 //=================================================================================
162 void MeasureGUI_WhatisDlg::Init()
164 mySelBtn = myGrp->PushButton1;
165 mySelEdit = myGrp->LineEdit1;
167 connect( myGrp->PushButton2, SIGNAL( clicked() ), this, SLOT( ClickOnProperties() ) );
169 MeasureGUI_Skeleton::Init();
172 //=================================================================================
173 // function : processObject
175 //=================================================================================
176 void MeasureGUI_WhatisDlg::processObject()
179 myGrp->TextEdit1->setText( getParameters( aText ) ? aText : QString( "" ) );
182 QString aKind = getKindOfShape( aParameters );
183 myGrp->LineEdit2->setText( aKind );
184 myGrp->PushButton2->setEnabled( !aParameters.isEmpty());
185 myParamsDlg->setWindowTitle(aKind + " " + tr("GEOM_PROPERTIES"));
186 myParamsDlg->setText(aParameters);
187 myParamsDlg->adjustSize();
190 //=================================================================================
191 // function : activateSelection()
193 //=================================================================================
194 void MeasureGUI_WhatisDlg::activateSelection()
196 globalSelection(); // all types of objects
197 localSelection(TopAbs_SHAPE); // all types of sub-shapes
200 //=================================================================================
201 // function : ClickOnProperties()
203 //=================================================================================
204 void MeasureGUI_WhatisDlg::ClickOnProperties()
209 //=================================================================================
210 // function : getParameters
212 //=================================================================================
213 bool MeasureGUI_WhatisDlg::getParameters( QString& theText )
218 GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
221 theText = anOper->WhatIs( myObj.get() );
223 catch( const SALOME::SALOME_Exception& e )
225 SalomeApp_Tools::QtCatchCorbaException( e );
229 return anOper->IsDone();
232 //=================================================================================
233 // function : getKindOfShape
235 //=================================================================================
236 QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
238 QString aKindStr("");
241 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
242 int aLenPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
247 GEOM::GEOM_IKindOfShape::shape_kind aKind;
248 GEOM::ListOfLong_var anInts;
249 GEOM::ListOfDouble_var aDbls;
251 GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
255 aKind = anOper->KindOfShape( myObj.get(), anInts, aDbls );
257 catch( const SALOME::SALOME_Exception& e ) {
258 SalomeApp_Tools::QtCatchCorbaException( e );
262 if ( !anOper->IsDone() )
265 #define PRINT_DOUBLE(val, tol) QString(" %1").arg( DlgRef::PrintDoubleValue( val, tol ) )
266 #define TITLE(val) QString("<b>%1</b>").arg(tr(val))
267 #define TITLE_I(val, i) QString("<b>%1</b>").arg(tr(val).arg(i))
270 case GEOM::GEOM_IKindOfShape::COMPOUND:
271 aKindStr = tr( "GEOM_COMPOUND" );
273 case GEOM::GEOM_IKindOfShape::COMPSOLID:
274 aKindStr = tr( "GEOM_COMPOUNDSOLID" );
276 case GEOM::GEOM_IKindOfShape::SHELL:
277 aKindStr = tr( "GEOM_SHELL" );
278 if ( anInts[0] == 1 )
279 theParameters = tr( "GEOM_CLOSED" );
280 else if ( anInts[0] == 2 )
281 theParameters = tr( "GEOM_UNCLOSED" );
283 theParameters = tr( "GEOM_CLOSEDUNCLOSED" );
285 case GEOM::GEOM_IKindOfShape::WIRE:
286 aKindStr = tr( "GEOM_WIRE" );
287 if ( anInts[0] == 1 )
288 theParameters = tr( "GEOM_CLOSED" );
289 else if ( anInts[0] == 2 )
290 theParameters = tr( "GEOM_UNCLOSED" );
292 theParameters = tr( "GEOM_CLOSEDUNCLOSED" );
295 case GEOM::GEOM_IKindOfShape::SPHERE:
296 aKindStr = tr( "GEOM_SPHERE" );
297 theParameters = TITLE( "GEOM_CENTER" ) +
298 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
299 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
300 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
301 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
302 "<br>" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision );
304 case GEOM::GEOM_IKindOfShape::CYLINDER:
305 aKindStr = tr( "GEOM_CYLINDER" );
306 theParameters = TITLE( "GEOM_CENTER" ) +
307 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
308 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
309 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
310 "<br>" + TITLE( "GEOM_AXIS" ) +
311 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
312 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
313 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
314 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
315 "<br>" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
316 "<br>" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
318 case GEOM::GEOM_IKindOfShape::BOX:
319 aKindStr = tr( "GEOM_BOX" );
320 theParameters = TITLE( "GEOM_CENTER" ) +
321 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
322 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
323 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
324 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
325 "<br>" + "Ax :" + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
326 "<br>" + "Ay :" + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
327 "<br>" + "Az :" + PRINT_DOUBLE( aDbls[5], aLenPrecision );
329 case GEOM::GEOM_IKindOfShape::ROTATED_BOX:
330 aKindStr = tr( "GEOM_BOX" );
331 theParameters = TITLE( "GEOM_CENTER" ) +
332 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
333 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
334 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
335 "<br>" + TITLE( "GEOM_Z_AXIS") +
336 "<br>" + tr( "GEOM_Z_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
337 "<br>" + tr( "GEOM_Z_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
338 "<br>" + tr( "GEOM_Z_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
339 "<br>" + TITLE( "GEOM_X_AXIS") +
340 "<br>" + tr( "GEOM_X_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
341 "<br>" + tr( "GEOM_X_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
342 "<br>" + tr( "GEOM_X_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
343 "<br>" + TITLE( "GEOM_DIM_AXES") +
344 "<br>" + tr( "GEOM_A_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
345 "<br>" + tr( "GEOM_A_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
346 "<br>" + tr( "GEOM_A_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[11], aLenPrecision );
348 case GEOM::GEOM_IKindOfShape::TORUS:
349 aKindStr = tr( "GEOM_TORUS" );
350 theParameters = TITLE( "GEOM_CENTER" ) +
351 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
352 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
353 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
354 "<br>" + TITLE( "GEOM_AXIS" ) +
355 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
356 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
357 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
358 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
359 "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
360 "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
362 case GEOM::GEOM_IKindOfShape::CONE:
363 aKindStr = tr( "GEOM_CONE" );
364 theParameters = TITLE( "GEOM_CENTER" ) +
365 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
366 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
367 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
368 "<br>" + TITLE( "GEOM_AXIS" ) +
369 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
370 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
371 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
372 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
373 "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
374 "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
375 "<br>" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[8], aLenPrecision );
377 case GEOM::GEOM_IKindOfShape::POLYHEDRON:
378 aKindStr = tr( "GEOM_POLYHEDRON" );
380 case GEOM::GEOM_IKindOfShape::SOLID:
381 aKindStr = tr( "GEOM_SOLID" );
384 case GEOM::GEOM_IKindOfShape::SPHERE2D:
385 aKindStr = tr( "GEOM_SURFSPHERE" );
386 theParameters = TITLE( "GEOM_CENTER" ) +
387 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
388 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
389 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
390 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
391 "<br>" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision );
393 case GEOM::GEOM_IKindOfShape::CYLINDER2D:
394 aKindStr = tr( "GEOM_SURFCYLINDER" );
395 theParameters = TITLE( "GEOM_CENTER" ) +
396 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
397 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
398 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
399 "<br>" + TITLE( "GEOM_AXIS" ) +
400 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
401 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
402 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
403 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
404 "<br>" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
405 "<br>" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
407 case GEOM::GEOM_IKindOfShape::TORUS2D:
408 aKindStr = tr( "GEOM_SURFTORUS" );
409 theParameters = TITLE( "GEOM_CENTER" ) +
410 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
411 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
412 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
413 "<br>" + TITLE( "GEOM_AXIS" ) +
414 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
415 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
416 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
417 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
418 "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
419 "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
421 case GEOM::GEOM_IKindOfShape::CONE2D:
422 aKindStr = tr( "GEOM_SURFCONE" );
423 theParameters = TITLE( "GEOM_CENTER" ) +
424 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
425 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
426 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
427 "<br>" + TITLE( "GEOM_AXIS" ) +
428 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
429 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
430 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
431 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
432 "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
433 "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
434 "<br>" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[8], aLenPrecision );
436 case GEOM::GEOM_IKindOfShape::DISK_CIRCLE:
437 aKindStr = tr( "GEOM_DISK_CIRCLE" );
438 theParameters = TITLE( "GEOM_CENTER" ) +
439 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
440 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
441 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
442 "<br>" + TITLE( "GEOM_NORMAL" ) +
443 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
444 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
445 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
446 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
447 "<br>" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision );
449 case GEOM::GEOM_IKindOfShape::DISK_ELLIPSE:
450 aKindStr = tr( "GEOM_DISK_ELLIPSE" );
451 theParameters = TITLE( "GEOM_CENTER" ) +
452 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
453 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
454 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
455 "<br>" + TITLE( "GEOM_NORMAL" ) +
456 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
457 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
458 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
459 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
460 "<br>" + tr( "GEOM_RADIUS_MAJOR" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
461 "<br>" + tr( "GEOM_RADIUS_MINOR" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
463 case GEOM::GEOM_IKindOfShape::POLYGON:
464 aKindStr = tr( "GEOM_POLYGON" );
465 theParameters = TITLE( "GEOM_CENTER" ) +
466 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
467 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
468 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
469 "<br>" + TITLE( "GEOM_NORMAL" ) +
470 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
471 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
472 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision );
474 case GEOM::GEOM_IKindOfShape::PLANE:
475 aKindStr = tr( "GEOM_PLANE" );
476 theParameters = TITLE( "GEOM_CENTER" ) +
477 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
478 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
479 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
480 "<br>" + TITLE( "GEOM_NORMAL" ) +
481 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
482 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
483 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision );
485 case GEOM::GEOM_IKindOfShape::PLANAR:
486 aKindStr = tr( "GEOM_PLANAR_FACE" );
487 theParameters = TITLE( "GEOM_CENTER" ) +
488 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
489 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
490 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
491 "<br>" + TITLE( "GEOM_NORMAL" ) +
492 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
493 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
494 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision );
496 case GEOM::GEOM_IKindOfShape::FACE:
497 aKindStr = tr( "GEOM_FACE" );
500 case GEOM::GEOM_IKindOfShape::CIRCLE:
501 aKindStr = tr( "GEOM_CIRCLE" );
502 theParameters = TITLE( "GEOM_CENTER" ) +
503 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
504 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
505 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
506 "<br>" + TITLE( "GEOM_NORMAL" ) +
507 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
508 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
509 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
510 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
511 "<br>" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision );
513 case GEOM::GEOM_IKindOfShape::ARC_CIRCLE:
514 aKindStr = tr( "GEOM_ARC" );
515 theParameters = TITLE( "GEOM_CENTER" ) +
516 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
517 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
518 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
519 "<br>" + TITLE( "GEOM_NORMAL" ) +
520 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
521 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
522 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
523 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
524 "<br>" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
525 "<br>" + TITLE_I( "GEOM_POINT_I", 1 ) +
526 "<br>" + tr( "GEOM_X_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
527 "<br>" + tr( "GEOM_Y_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
528 "<br>" + tr( "GEOM_Z_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
529 "<br>" + TITLE_I( "GEOM_POINT_I", 2 ) +
530 "<br>" + tr( "GEOM_X_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
531 "<br>" + tr( "GEOM_Y_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[11], aLenPrecision ) +
532 "<br>" + tr( "GEOM_Z_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[12], aLenPrecision );
534 case GEOM::GEOM_IKindOfShape::ELLIPSE:
535 aKindStr = tr( "GEOM_ELLIPSE" );
536 theParameters = TITLE( "GEOM_CENTER" ) +
537 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
538 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
539 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
540 "<br>" + TITLE( "GEOM_NORMAL" ) +
541 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
542 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
543 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
544 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
545 "<br>" + tr( "GEOM_RADIUS_MAJOR" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
546 "<br>" + tr( "GEOM_RADIUS_MINOR" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
548 case GEOM::GEOM_IKindOfShape::ARC_ELLIPSE:
549 aKindStr = tr( "GEOM_ARC_ELLIPSE" );
550 theParameters = TITLE( "GEOM_CENTER" ) +
551 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
552 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
553 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
554 "<br>" + TITLE( "GEOM_NORMAL" ) +
555 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
556 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
557 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
558 "<br>" + TITLE( "GEOM_DIMENSIONS" ) +
559 "<br>" + tr( "GEOM_RADIUS_MAJOR" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
560 "<br>" + tr( "GEOM_RADIUS_MINOR" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
561 "<br>" + TITLE_I( "GEOM_POINT_I", 1 ) +
562 "<br>" + tr( "GEOM_X_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
563 "<br>" + tr( "GEOM_Y_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
564 "<br>" + tr( "GEOM_Z_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
565 "<br>" + TITLE_I( "GEOM_POINT_I", 2 ) +
566 "<br>" + tr( "GEOM_X_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[11], aLenPrecision ) +
567 "<br>" + tr( "GEOM_Y_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[12], aLenPrecision ) +
568 "<br>" + tr( "GEOM_Z_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[13], aLenPrecision );
570 case GEOM::GEOM_IKindOfShape::LINE:
571 aKindStr = tr( "GEOM_LINE" );
572 theParameters = TITLE( "GEOM_POSITION" ) +
573 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
574 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
575 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
576 "<br>" + TITLE( "GEOM_DIRECTION" ) +
577 "<br>" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
578 "<br>" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
579 "<br>" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision );
581 case GEOM::GEOM_IKindOfShape::SEGMENT:
582 aKindStr = tr( "GEOM_SEGMENT" );
583 theParameters = TITLE_I( "GEOM_POINT_I", 1 ) +
584 "<br>" + tr( "GEOM_X_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
585 "<br>" + tr( "GEOM_Y_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
586 "<br>" + tr( "GEOM_Z_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
587 "<br>" + TITLE_I( "GEOM_POINT_I", 2 ) +
588 "<br>" + tr( "GEOM_X_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
589 "<br>" + tr( "GEOM_Y_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
590 "<br>" + tr( "GEOM_Z_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[5], aLenPrecision );
592 case GEOM::GEOM_IKindOfShape::EDGE:
593 aKindStr = tr( "GEOM_EDGE" );
595 case GEOM::GEOM_IKindOfShape::VERTEX:
596 aKindStr = tr( "GEOM_VERTEX" );
597 theParameters = TITLE( "GEOM_COORDINATES" ) +
598 "<br>" + tr( "GEOM_X" ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
599 "<br>" + tr( "GEOM_Y" ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
600 "<br>" + tr( "GEOM_Z" ) + PRINT_DOUBLE( aDbls[2], aLenPrecision );
602 case GEOM::GEOM_IKindOfShape::LCS:
603 aKindStr = tr( "GEOM_LCS" );
604 theParameters = TITLE("GEOM_POSITION") +
605 "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
606 "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
607 "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
608 "<br>" + TITLE( "GEOM_X_AXIS") +
609 "<br>" + "Xx :" + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
610 "<br>" + "Xy :" + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
611 "<br>" + "Xz :" + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
612 "<br>" + TITLE( "GEOM_Y_AXIS") +
613 "<br>" + "Yx :" + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
614 "<br>" + "Yy :" + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
615 "<br>" + "Yz :" + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
616 "<br>" + TITLE( "GEOM_Z_AXIS") +
617 "<br>" + "Zx :" + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
618 "<br>" + "Zy :" + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
619 "<br>" + "Zz :" + PRINT_DOUBLE( aDbls[11], aLenPrecision );
621 case GEOM::GEOM_IKindOfShape::ADVANCED:
623 QString strid = QString( "GEOM_ADVANCED_%1" ).arg( myObj->GetType() );
624 aKindStr = tr( strid.toLatin1().constData() ) == strid ?
625 tr( "GEOM_ADVANCED" ).arg( myObj->GetType() ) :
626 tr( strid.toLatin1().constData() );
636 void MeasureGUI_WhatisDlg::SelectionIntoArgument()
639 myObj = getSelected( TopAbs_SHAPE );
642 mySelEdit->setText("");
648 mySelEdit->setText(GEOMBase::GetName(myObj.get()));