Salome HOME
Update for 19962 issue: MakePipeBiNormalAlongAxis implementation.
[modules/geom.git] / src / MeasureGUI / MeasureGUI_WhatisDlg.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  GEOM GEOMGUI : GUI for Geometry component
23 //  File   : MeasureGUI_WhatisDlg.cxx
24 //  Author : Nicolas REJNERI
25 //  Module : GEOM
26 //  $Header$
27 //
28 #include "MeasureGUI_WhatisDlg.h"
29 //#include "MeasureGUI_1Sel1TextView_QTD.h"
30 #include "GEOMBase.h"
31
32 #include "DlgRef_SpinBox.h"
33
34 #include <TopTools_MapOfShape.hxx>
35 #include <TCollection_AsciiString.hxx>
36 #include <TopTools_ListOfShape.hxx>
37 #include <TopTools_ListIteratorOfListOfShape.hxx>
38 #include <TopoDS.hxx>
39 #include <TopoDS_Iterator.hxx>
40
41 #include <BRep_Tool.hxx>
42
43 #include "utilities.h"
44 #include "SUIT_Session.h"
45 #include "SalomeApp_Tools.h"
46
47 #include <qtextedit.h>
48 #include <qlineedit.h>
49 #include <qlabel.h>
50 #include <qlayout.h>
51 #include <qpushbutton.h>
52 #include <qradiobutton.h>
53 #include <qbuttongroup.h>
54 #include <qmessagebox.h>
55
56 //=================================================================================
57 // Constructs a MeasureGUI_Whatis_QTD which is a child of 'parent', with the
58 // name 'name' and widget flags set to 'f'
59 //=================================================================================
60 MeasureGUI_Whatis_QTD::MeasureGUI_Whatis_QTD (QWidget* parent, const char* name, WFlags fl)
61   : QWidget(parent, name, fl)
62 {
63   if (!name)
64     setName("MeasureGUI_Whatis_QTD");
65   //resize(130, 160); 
66   MeasureGUI_Whatis_QTDLayout = new QGridLayout (this, 1, 1, 0, 6, "MeasureGUI_Whatis_QTDLayout"); 
67
68   GroupBox1 = new QGroupBox(this, "GroupBox1");
69   GroupBox1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7,
70                                        0, 0, GroupBox1->sizePolicy().hasHeightForWidth()));
71   GroupBox1->setColumnLayout(0, Qt::Vertical);
72   GroupBox1->layout()->setSpacing(6);
73   GroupBox1->layout()->setMargin(11);
74   GroupBox1Layout = new QGridLayout(GroupBox1->layout());
75   GroupBox1Layout->setAlignment(Qt::AlignTop);
76
77   Layout1 = new QGridLayout(0, 1, 1, 0, 6, "Layout1"); 
78
79   TextLabel1 = new QLabel (GroupBox1, "TextLabel1");
80   TextLabel1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
81                                         0, 0, TextLabel1->sizePolicy().hasHeightForWidth()));
82
83   PushButton1 = new QPushButton (GroupBox1, "PushButton1");
84   PushButton1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
85                                          0, 0, PushButton1->sizePolicy().hasHeightForWidth()));
86
87   LineEdit1 = new QLineEdit (GroupBox1, "LineEdit1");
88
89   Layout1->addWidget(TextLabel1 , 0, 0);
90   Layout1->addWidget(PushButton1, 0, 1);
91   Layout1->addWidget(LineEdit1  , 0, 2);
92
93   TextEdit1 = new QTextEdit (GroupBox1, "TextEdit1");
94
95   Layout1->addMultiCellWidget(TextEdit1, 1, 1, 0, 2);
96
97   TextLabel2 = new QLabel (GroupBox1, "TextLabel2");
98   TextLabel2->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
99                                         0, 0, TextLabel1->sizePolicy().hasHeightForWidth()));
100
101   LineEdit2 = new QLineEdit (GroupBox1, "LineEdit2");
102
103   PushButton2 = new QPushButton (GroupBox1, "PushButton2");
104   PushButton2->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0,
105                                          0, 0, PushButton1->sizePolicy().hasHeightForWidth()));
106
107   Layout1->addWidget(TextLabel2 , 2, 0);
108   Layout1->addWidget(LineEdit2  , 2, 1);
109   Layout1->addWidget(PushButton2, 2, 2);
110
111   GroupBox1Layout->addLayout(Layout1, 0, 0);
112
113   MeasureGUI_Whatis_QTDLayout->addWidget(GroupBox1, 0, 0);
114 }
115
116 /*  
117  *  Destroys the object and frees any allocated resources
118  */
119 MeasureGUI_Whatis_QTD::~MeasureGUI_Whatis_QTD()
120 {
121   // no need to delete child widgets, Qt does it all for us
122 }
123
124 //=================================================================================
125 // class    : MeasureGUI_WhatisDlg( )
126 // purpose  : Constructs a MeasureGUI_WhatisDlg which is a child of 'parent', with the
127 //            name 'name' and widget flags set to 'f'.
128 //            The dialog will by default be modeless, unless you set 'modal' to
129 //            TRUE to construct a modal dialog.
130 //=================================================================================
131 MeasureGUI_WhatisDlg::MeasureGUI_WhatisDlg (GeometryGUI* GUI, QWidget* parent)
132   : MeasureGUI_Skeleton(GUI, parent, "MeasureGUI_WhatisDlg")
133 {
134   QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap(
135     "GEOM",tr( "ICON_DLG_WHATIS" ) ) );
136   QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap(
137     "GEOM",tr( "ICON_SELECT" ) ) );
138
139   setCaption( tr( "GEOM_WHATIS_TITLE" ) );
140
141   /***************************************************************/
142
143   GroupConstructors->setTitle( tr( "GEOM_WHATIS" ) );
144   RadioButton1->setPixmap( image0 );
145
146   //myGrp = new MeasureGUI_1Sel1TextView_QTD( this, "myGrp" );
147   myGrp = new MeasureGUI_Whatis_QTD( this, "myGrp" );
148   myGrp->GroupBox1->setTitle( tr( "GEOM_WHATIS_OBJECT" ) );
149
150   myGrp->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
151   myGrp->PushButton1->setPixmap( image1 );
152   myGrp->LineEdit1->setReadOnly( true );
153
154   myGrp->TextEdit1->setReadOnly( TRUE );
155   // fix height to fit all text
156   myGrp->TextEdit1->setWordWrap(QTextEdit::NoWrap);
157   myGrp->TextEdit1->setTextFormat(Qt::PlainText);
158   QString allLines ("\n\n\n\n\n\n\n\n\n"); // 10 lines
159   myGrp->TextEdit1->setText(allLines);
160   int sbHeight = myGrp->TextEdit1->horizontalScrollBar()->height();
161   myGrp->TextEdit1->setFixedHeight(myGrp->TextEdit1->contentsHeight() + sbHeight);
162
163   myGrp->TextLabel2->setText(tr("GEOM_KIND_OF_SHAPE"));
164   myGrp->LineEdit2->setReadOnly(true);
165   myGrp->PushButton2->setText(tr("GEOM_PROPERTIES"));
166
167   Layout1->addWidget( myGrp, 1, 0 );
168
169   // Properties dialog
170   //myParamsDlg = new MeasureGUI_Params_Dlg;
171   myParamsDlg = new QMessageBox ("", "", QMessageBox::Information,
172                                  QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, 
173                                  this, 0, FALSE);
174
175   /***************************************************************/
176
177   myHelpFileName = "using_measurement_tools_page.html#whatis_anchor";
178
179   /* Initialisation */
180   Init();
181 }
182
183 //=================================================================================
184 // function : ~MeasureGUI_WhatisDlg()
185 // purpose  : Destroys the object and frees any allocated resources
186 //=================================================================================
187 MeasureGUI_WhatisDlg::~MeasureGUI_WhatisDlg()
188 {
189 }
190
191 //=================================================================================
192 // function : Init()
193 // purpose  :
194 //=================================================================================
195 void MeasureGUI_WhatisDlg::Init()
196 {
197   mySelBtn = myGrp->PushButton1;
198   mySelEdit = myGrp->LineEdit1;
199
200   connect(myGrp->PushButton2, SIGNAL(clicked()), this, SLOT(ClickOnProperties()));
201
202   MeasureGUI_Skeleton::Init();
203 }
204
205 //=================================================================================
206 // function : processObject
207 // purpose  :
208 //=================================================================================
209 void MeasureGUI_WhatisDlg::processObject()
210 {
211   QString aText;
212   myGrp->TextEdit1->setText( getParameters( aText ) ? aText : QString("") );
213
214   QString aParameters;
215   QString aKind = getKindOfShape(aParameters);
216   myGrp->LineEdit2->setText(aKind);
217   myGrp->PushButton2->setEnabled(!aParameters.isEmpty());
218   myParamsDlg->setCaption(aKind + " " + tr("GEOM_PROPERTIES"));
219   myParamsDlg->setText(aParameters);
220   myParamsDlg->adjustSize();
221 }
222
223 //=================================================================================
224 // function : ClickOnProperties()
225 // purpose  :
226 //=================================================================================
227 void MeasureGUI_WhatisDlg::ClickOnProperties()
228 {
229   myParamsDlg->show();
230 }
231
232 //=================================================================================
233 // function : getParameters
234 // purpose  :
235 //=================================================================================
236 bool MeasureGUI_WhatisDlg::getParameters( QString& theText )
237 {
238   if ( myObj->_is_nil() )
239     return false;
240
241   try
242   {
243     theText = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->WhatIs( myObj );
244   }
245   catch( const SALOME::SALOME_Exception& e )
246   {
247     SalomeApp_Tools::QtCatchCorbaException( e );
248     return false;
249   }
250
251   return getOperation()->IsDone();
252 }
253
254 //=================================================================================
255 // function : getKindOfShape
256 // purpose  :
257 //=================================================================================
258 QString MeasureGUI_WhatisDlg::getKindOfShape (QString& theParameters)
259 {
260   QString aKindStr ("");
261   theParameters = "";
262
263   if ( myObj->_is_nil() )
264     return aKindStr;
265
266   GEOM::GEOM_IKindOfShape::shape_kind aKind;
267   GEOM::ListOfLong_var anInts;
268   GEOM::ListOfDouble_var aDbls;
269
270   GEOM::GEOM_IMeasureOperations_var anOp = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
271
272   try
273   {
274     aKind = anOp->KindOfShape(myObj, anInts, aDbls);
275   }
276   catch( const SALOME::SALOME_Exception& e )
277   {
278     SalomeApp_Tools::QtCatchCorbaException( e );
279     return false;
280   }
281
282   if (!anOp->IsDone())
283     return aKindStr;
284
285   switch (aKind)
286   {
287   case GEOM::GEOM_IKindOfShape::COMPOUND:
288     aKindStr = tr("GEOM_COMPOUND");
289     break;
290   case GEOM::GEOM_IKindOfShape::COMPSOLID:
291     aKindStr = tr("GEOM_COMPOUNDSOLID");
292     break;
293   case GEOM::GEOM_IKindOfShape::SHELL:
294     aKindStr = tr("GEOM_SHELL");
295     if (anInts[0] == 1)
296       theParameters = tr("GEOM_CLOSED");
297     else if (anInts[0] == 2)
298       theParameters = tr("GEOM_UNCLOSED");
299     else
300       theParameters = tr("GEOM_CLOSEDUNCLOSED");
301     break;
302   case GEOM::GEOM_IKindOfShape::WIRE:
303     aKindStr = tr("GEOM_WIRE");
304     if (anInts[0] == 1)
305       theParameters = tr("GEOM_CLOSED");
306     else if (anInts[0] == 2)
307       theParameters = tr("GEOM_UNCLOSED");
308     else
309       theParameters = tr("GEOM_CLOSEDUNCLOSED");
310     break;
311   // SOLIDs
312   case GEOM::GEOM_IKindOfShape::SPHERE:
313     aKindStr = tr("GEOM_SPHERE");
314     theParameters = tr("GEOM_CENTER") +
315       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
316       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
317       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
318       "\n" +        tr("GEOM_DIMENSIONS") +
319       "\n" +        tr("GEOM_RADIUS")     + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]);
320     break;
321   case GEOM::GEOM_IKindOfShape::CYLINDER:
322     aKindStr = tr("GEOM_CYLINDER");
323     theParameters = tr("GEOM_CENTER") +
324       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
325       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
326       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
327       "\n" +        tr("GEOM_AXIS") +
328       "\n" +        tr("GEOM_DX")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
329       "\n" +        tr("GEOM_DY")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
330       "\n" +        tr("GEOM_DZ")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
331       "\n" +        tr("GEOM_DIMENSIONS") +
332       "\n" +        tr("GEOM_RADIUS")     + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
333       "\n" +        tr("GEOM_HEIGHT")     + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]);
334     break;
335   case GEOM::GEOM_IKindOfShape::BOX:
336     aKindStr = tr("GEOM_BOX");
337     theParameters = tr("GEOM_CENTER") + ":" +
338       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
339       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
340       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
341       "\n" +        tr("GEOM_DIMENSIONS") +
342       "\n" +        "Ax :"                + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
343       "\n" +        "Ay :"                + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
344       "\n" +        "Az :"                + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]);
345     break;
346   case GEOM::GEOM_IKindOfShape::ROTATED_BOX:
347     aKindStr = tr("GEOM_BOX");
348     theParameters = tr("GEOM_CENTER") +
349       "\n" +        tr("GEOM_X_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
350       "\n" +        tr("GEOM_Y_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
351       "\n" +        tr("GEOM_Z_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
352       "\nZ Axis:" +
353       "\n" +        "Zx :"                  + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
354       "\n" +        "Zy :"                  + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
355       "\n" +        "Zz :"                  + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
356       "\nX Axis:" +
357       "\n" +        tr("GEOM_X_I").arg("x") + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
358       "\n" +        tr("GEOM_X_I").arg("y") + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]) +
359       "\n" +        tr("GEOM_X_I").arg("z") + DlgRef_SpinBox::PrintDoubleValue(aDbls[8]) +
360       "\nDimensions along local axes:" +
361       "\n" +        "Ax :"                  + DlgRef_SpinBox::PrintDoubleValue(aDbls[9]) +
362       "\n" +        "Ay :"                  + DlgRef_SpinBox::PrintDoubleValue(aDbls[10]) +
363       "\n" +        "Az :"                  + DlgRef_SpinBox::PrintDoubleValue(aDbls[11]);
364     break;
365   case GEOM::GEOM_IKindOfShape::TORUS:
366     aKindStr = tr("GEOM_TORUS");
367     theParameters = tr("GEOM_CENTER") +
368       "\n" +        tr("GEOM_X_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
369       "\n" +        tr("GEOM_Y_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
370       "\n" +        tr("GEOM_Z_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
371       "\n" +        tr("GEOM_AXIS") +
372       "\n" +        tr("GEOM_DX")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
373       "\n" +        tr("GEOM_DY")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
374       "\n" +        tr("GEOM_DZ")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
375       "\n" +        tr("GEOM_DIMENSIONS") +
376       "\n" +        tr("GEOM_RADIUS_I").arg(1) + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
377       "\n" +        tr("GEOM_RADIUS_I").arg(2) + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]);
378     break;
379   case GEOM::GEOM_IKindOfShape::CONE:
380     aKindStr = tr("GEOM_CONE");
381     theParameters = tr("GEOM_CENTER") +
382       "\n" +        tr("GEOM_X_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
383       "\n" +        tr("GEOM_Y_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
384       "\n" +        tr("GEOM_Z_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
385       "\n" +        tr("GEOM_AXIS") +
386       "\n" +        tr("GEOM_DX")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
387       "\n" +        tr("GEOM_DY")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
388       "\n" +        tr("GEOM_DZ")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
389       "\n" +        tr("GEOM_DIMENSIONS") +
390       "\n" +        tr("GEOM_RADIUS_I").arg(1) + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
391       "\n" +        tr("GEOM_RADIUS_I").arg(2) + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]) +
392       "\n" +        tr("GEOM_HEIGHT")          + DlgRef_SpinBox::PrintDoubleValue(aDbls[8]);
393     break;
394   case GEOM::GEOM_IKindOfShape::POLYHEDRON:
395     aKindStr = tr("GEOM_POLYHEDRON");
396     break;
397   case GEOM::GEOM_IKindOfShape::SOLID:
398     aKindStr = tr("GEOM_SOLID");
399     break;
400   // FACEs
401   case GEOM::GEOM_IKindOfShape::SPHERE2D:
402     aKindStr = tr("GEOM_SURFSPHERE");
403     theParameters = tr("GEOM_CENTER") +
404       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
405       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
406       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
407       "\n" +        tr("GEOM_DIMENSIONS") +
408       "\n" +        tr("GEOM_RADIUS")     + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]);
409     break;
410   case GEOM::GEOM_IKindOfShape::CYLINDER2D:
411     aKindStr = tr("GEOM_SURFCYLINDER");
412     theParameters = tr("GEOM_CENTER") +
413       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
414       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
415       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
416       "\n" +        tr("GEOM_AXIS") +
417       "\n" +        tr("GEOM_DX")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
418       "\n" +        tr("GEOM_DY")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
419       "\n" +        tr("GEOM_DZ")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
420       "\n" +        tr("GEOM_DIMENSIONS") +
421       "\n" +        tr("GEOM_RADIUS")     + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
422       "\n" +        tr("GEOM_HEIGHT")     + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]);
423     break;
424   case GEOM::GEOM_IKindOfShape::TORUS2D:
425     aKindStr = tr("GEOM_SURFTORUS");
426     theParameters = tr("GEOM_CENTER") +
427       "\n" +        tr("GEOM_X_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
428       "\n" +        tr("GEOM_Y_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
429       "\n" +        tr("GEOM_Z_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
430       "\n" +        tr("GEOM_AXIS") +
431       "\n" +        tr("GEOM_DX")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
432       "\n" +        tr("GEOM_DY")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
433       "\n" +        tr("GEOM_DZ")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
434       "\n" +        tr("GEOM_DIMENSIONS") +
435       "\n" +        tr("GEOM_RADIUS_I").arg(1) + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
436       "\n" +        tr("GEOM_RADIUS_I").arg(2) + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]);
437     break;
438   case GEOM::GEOM_IKindOfShape::CONE2D:
439     aKindStr = tr("GEOM_SURFCONE");
440     theParameters = tr("GEOM_CENTER") +
441       "\n" +        tr("GEOM_X_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
442       "\n" +        tr("GEOM_Y_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
443       "\n" +        tr("GEOM_Z_I").arg(0)      + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
444       "\n" +        tr("GEOM_AXIS") +
445       "\n" +        tr("GEOM_DX")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
446       "\n" +        tr("GEOM_DY")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
447       "\n" +        tr("GEOM_DZ")              + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
448       "\n" +        tr("GEOM_DIMENSIONS") +
449       "\n" +        tr("GEOM_RADIUS_I").arg(1) + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
450       "\n" +        tr("GEOM_RADIUS_I").arg(2) + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]) +
451       "\n" +        tr("GEOM_HEIGHT")          + DlgRef_SpinBox::PrintDoubleValue(aDbls[8]);
452     break;
453   case GEOM::GEOM_IKindOfShape::DISK_CIRCLE:
454     aKindStr = tr("GEOM_DISK_CIRCLE");
455     theParameters = tr("GEOM_CENTER") +
456       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
457       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
458       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
459       "\n" +        tr("GEOM_NORMAL") +
460       "\n" +        tr("GEOM_DX")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
461       "\n" +        tr("GEOM_DY")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
462       "\n" +        tr("GEOM_DZ")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
463       "\n" +        tr("GEOM_DIMENSIONS") +
464       "\n" +        tr("GEOM_RADIUS")     + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]);
465     break;
466   case GEOM::GEOM_IKindOfShape::DISK_ELLIPSE:
467     aKindStr = tr("GEOM_DISK_ELLIPSE");
468     theParameters = tr("GEOM_CENTER") +
469       "\n" +        tr("GEOM_X_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
470       "\n" +        tr("GEOM_Y_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
471       "\n" +        tr("GEOM_Z_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
472       "\n" +        tr("GEOM_NORMAL") +
473       "\n" +        tr("GEOM_DX")           + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
474       "\n" +        tr("GEOM_DY")           + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
475       "\n" +        tr("GEOM_DZ")           + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
476       "\n" +        tr("GEOM_DIMENSIONS") +
477       "\n" +        tr("GEOM_RADIUS_MAJOR") + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
478       "\n" +        tr("GEOM_RADIUS_MINOR") + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]);
479     break;
480   case GEOM::GEOM_IKindOfShape::POLYGON:
481     aKindStr = tr("GEOM_POLYGON");
482     theParameters = tr("GEOM_CENTER") +
483       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
484       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
485       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
486       "\n" +        tr("GEOM_NORMAL") +
487       "\n" +        tr("GEOM_DX")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
488       "\n" +        tr("GEOM_DY")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
489       "\n" +        tr("GEOM_DZ")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]);
490     break;
491   case GEOM::GEOM_IKindOfShape::PLANE:
492     aKindStr = tr("GEOM_PLANE");
493     theParameters = tr("GEOM_CENTER") +
494       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
495       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
496       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
497       "\n" +        tr("GEOM_NORMAL") +
498       "\n" +        tr("GEOM_DX")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
499       "\n" +        tr("GEOM_DY")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
500       "\n" +        tr("GEOM_DZ")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]);
501     break;
502   case GEOM::GEOM_IKindOfShape::PLANAR:
503     aKindStr = tr("GEOM_PLANAR_FACE");
504     theParameters = tr("GEOM_CENTER") +
505       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
506       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
507       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
508       "\n" +        tr("GEOM_NORMAL") +
509       "\n" +        tr("GEOM_DX")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
510       "\n" +        tr("GEOM_DY")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
511       "\n" +        tr("GEOM_DZ")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]);
512     break;
513   case GEOM::GEOM_IKindOfShape::FACE:
514     aKindStr = tr("GEOM_FACE");
515     break;
516   // EDGEs
517   case GEOM::GEOM_IKindOfShape::CIRCLE:
518     aKindStr = tr("GEOM_CIRCLE");
519     theParameters = tr("GEOM_CENTER") +
520       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
521       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
522       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
523       "\n" +        tr("GEOM_NORMAL") +
524       "\n" +        tr("GEOM_DX")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
525       "\n" +        tr("GEOM_DY")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
526       "\n" +        tr("GEOM_DZ")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
527       "\n" +        tr("GEOM_DIMENSIONS") +
528       "\n" +        tr("GEOM_RADIUS")     + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]);
529     break;
530   case GEOM::GEOM_IKindOfShape::ARC_CIRCLE:
531     aKindStr = tr("GEOM_ARC");
532     theParameters = tr("GEOM_CENTER") +
533       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
534       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
535       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
536       "\n" +        tr("GEOM_NORMAL") +
537       "\n" +        tr("GEOM_DX")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
538       "\n" +        tr("GEOM_DY")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
539       "\n" +        tr("GEOM_DZ")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
540       "\n" +        tr("GEOM_DIMENSIONS") +
541       "\n" +        tr("GEOM_RADIUS")     + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
542       "\n" +        tr("GEOM_POINT_I").arg(1) +
543       "\n" +        tr("GEOM_X_I").arg(1) + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]) +
544       "\n" +        tr("GEOM_Y_I").arg(1) + DlgRef_SpinBox::PrintDoubleValue(aDbls[8]) +
545       "\n" +        tr("GEOM_Z_I").arg(1) + DlgRef_SpinBox::PrintDoubleValue(aDbls[9]) +
546       "\n" +        tr("GEOM_POINT_I").arg(2) +
547       "\n" +        tr("GEOM_X_I").arg(2) + DlgRef_SpinBox::PrintDoubleValue(aDbls[10]) +
548       "\n" +        tr("GEOM_Y_I").arg(2) + DlgRef_SpinBox::PrintDoubleValue(aDbls[11]) +
549       "\n" +        tr("GEOM_Z_I").arg(2) + DlgRef_SpinBox::PrintDoubleValue(aDbls[12]);
550     break;
551   case GEOM::GEOM_IKindOfShape::ELLIPSE:
552     aKindStr = tr("GEOM_ELLIPSE");
553     theParameters = tr("GEOM_CENTER") +
554       "\n" +        tr("GEOM_X_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
555       "\n" +        tr("GEOM_Y_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
556       "\n" +        tr("GEOM_Z_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
557       "\n" +        tr("GEOM_NORMAL") +
558       "\n" +        tr("GEOM_DX")           + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
559       "\n" +        tr("GEOM_DY")           + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
560       "\n" +        tr("GEOM_DZ")           + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
561       "\n" +        tr("GEOM_DIMENSIONS") +
562       "\n" +        tr("GEOM_RADIUS_MAJOR") + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
563       "\n" +        tr("GEOM_RADIUS_MINOR") + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]);
564     break;
565   case GEOM::GEOM_IKindOfShape::ARC_ELLIPSE:
566     aKindStr = tr("GEOM_ARC_ELLIPSE");
567     theParameters = tr("GEOM_CENTER") +
568       "\n" +        tr("GEOM_X_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
569       "\n" +        tr("GEOM_Y_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
570       "\n" +        tr("GEOM_Z_I").arg(0)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
571       "\n" +        tr("GEOM_NORMAL") +
572       "\n" +        tr("GEOM_DX")           + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
573       "\n" +        tr("GEOM_DY")           + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
574       "\n" +        tr("GEOM_DZ")           + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]) +
575       "\n" +        tr("GEOM_DIMENSIONS") +
576       "\n" +        tr("GEOM_RADIUS_MAJOR") + DlgRef_SpinBox::PrintDoubleValue(aDbls[6]) +
577       "\n" +        tr("GEOM_RADIUS_MINOR") + DlgRef_SpinBox::PrintDoubleValue(aDbls[7]) +
578       "\n" +        tr("GEOM_POINT_I").arg(1) +
579       "\n" +        tr("GEOM_X_I").arg(1)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[8]) +
580       "\n" +        tr("GEOM_Y_I").arg(1)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[9]) +
581       "\n" +        tr("GEOM_Z_I").arg(1)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[10]) +
582       "\n" +        tr("GEOM_POINT_I").arg(2) +
583       "\n" +        tr("GEOM_X_I").arg(2)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[11]) +
584       "\n" +        tr("GEOM_Y_I").arg(2)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[12]) +
585       "\n" +        tr("GEOM_Z_I").arg(2)   + DlgRef_SpinBox::PrintDoubleValue(aDbls[13]);
586     break;
587   case GEOM::GEOM_IKindOfShape::LINE:
588     aKindStr = tr("GEOM_LINE");
589     theParameters = tr("GEOM_POSITION") +
590       "\n" +        tr("GEOM_X_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
591       "\n" +        tr("GEOM_Y_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
592       "\n" +        tr("GEOM_Z_I").arg(0) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
593       "\n" +        tr("GEOM_DIRECTION") +
594       "\n" +        tr("GEOM_DX")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
595       "\n" +        tr("GEOM_DY")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
596       "\n" +        tr("GEOM_DZ")         + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]);
597     break;
598   case GEOM::GEOM_IKindOfShape::SEGMENT:
599     aKindStr = tr("GEOM_SEGMENT");
600     theParameters = tr("GEOM_POINT_I").arg(1) +
601       "\n" +        tr("GEOM_X_I").arg(1) + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
602       "\n" +        tr("GEOM_Y_I").arg(1) + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
603       "\n" +        tr("GEOM_Z_I").arg(1) + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]) +
604       "\n" +        tr("GEOM_POINT_I").arg(2) +
605       "\n" +        tr("GEOM_X_I").arg(2) + DlgRef_SpinBox::PrintDoubleValue(aDbls[3]) +
606       "\n" +        tr("GEOM_Y_I").arg(2) + DlgRef_SpinBox::PrintDoubleValue(aDbls[4]) +
607       "\n" +        tr("GEOM_Z_I").arg(2) + DlgRef_SpinBox::PrintDoubleValue(aDbls[5]);
608     break;
609   case GEOM::GEOM_IKindOfShape::EDGE:
610     aKindStr = tr("GEOM_EDGE");
611     break;
612   case GEOM::GEOM_IKindOfShape::VERTEX:
613     aKindStr = tr("GEOM_VERTEX");
614     theParameters = tr("GEOM_COORDINATES") +
615       "\n" +        tr("GEOM_X") + DlgRef_SpinBox::PrintDoubleValue(aDbls[0]) +
616       "\n" +        tr("GEOM_Y") + DlgRef_SpinBox::PrintDoubleValue(aDbls[1]) +
617       "\n" +        tr("GEOM_Z") + DlgRef_SpinBox::PrintDoubleValue(aDbls[2]);
618     break;
619   default:
620     ;
621   }
622
623   return aKindStr;
624 }