Salome HOME
Livraison IHM Hexa7
[modules/hexablock.git] / src / HEXABLOCKGUI / MyBasicGUI_PointDlg.cxx
1 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "MyBasicGUI_PointDlg.hxx"
21
22 #include <SUIT_ResourceMgr.h>
23 #include <SUIT_Session.h>
24 #include <SalomeApp_Application.h>
25 #include <LightApp_SelectionMgr.h>
26
27 #include "MyDlgRef.hxx"
28
29
30 #include <QApplication>
31 #include <QButtonGroup>
32 #include <QHBoxLayout>
33 #include <QLabel>
34 #include <QRadioButton>
35 #include <QMenu>
36 #include <QTimer>
37
38 #include <gp_Pnt.hxx>
39 #include <TopoDS_Shape.hxx>
40 #include <TopAbs_ShapeEnum.hxx>
41 #include <TopoDS.hxx>
42 #include <BRep_Tool.hxx>
43 #include <TopExp.hxx>
44 #include <TColStd_IndexedMapOfInteger.hxx>
45 #include <TopTools_IndexedMapOfShape.hxx>
46
47
48 #include <VTKViewer_ViewModel.h>
49 #include <SUIT_MessageBox.h>
50 #include <SUIT_OverrideCursor.h>
51 #include <SalomeApp_Tools.h>
52 #include <SalomeApp_Study.h>
53
54 #include "HEXABLOCKGUI_DocumentModel.hxx"
55 #include "HEXABLOCKGUI_DocumentSelectionModel.hxx"
56 #include "HEXABLOCKGUI_DocumentItem.hxx"
57 #include "HEXABLOCKGUI_SalomeTools.hxx"
58 #include "HEXABLOCKGUI.hxx"
59 #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
60
61 #define PARAM_VALUE 0
62 #define COORD_VALUE 1
63 #define LENGTH_VALUE 2
64
65 #define GEOM_POINT_XYZ    0
66 #define GEOM_POINT_REF    1
67 #define GEOM_POINT_EDGE   2
68 #define GEOM_POINT_INTINT 3
69 #define GEOM_POINT_SURF   4
70
71 #define SPACING 6
72 #define MARGIN  9
73
74 using namespace HEXABLOCK::GUI;
75
76 Q_DECLARE_METATYPE(HEXABLOCK::GUI::HexaTreeRole);
77 Q_DECLARE_METATYPE(TopAbs_ShapeEnum);
78 Q_DECLARE_METATYPE(TopoDS_Shape);
79
80 //=================================================================================
81 // class    : MyBasicGUI_PointDlg()
82 // purpose  : Constructs a MyBasicGUI_PointDlg which is a child of 'parent', with the
83 //            name 'name' and widget flags set to 'f'.
84 //            The dialog will by default be modeless, unless you set 'modal' to
85 //            TRUE to construct a modal dialog.
86 //=================================================================================
87 MyBasicGUI_PointDlg::MyBasicGUI_PointDlg(QWidget* parent, Qt::WindowFlags fl)
88 : MyGEOMBase_Skeleton(parent, fl),
89   myBusy (false)
90 {
91     SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
92     QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT")));
93     QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_EDGE")));
94     QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
95     QPixmap image3 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_REF")));
96     QPixmap image4 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_LINES")));
97     QPixmap image5 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_FACE")));
98     QPixmap image6 (aResMgr->loadPixmap("GEOM", tr("ICO_LINE")));
99     QPixmap image7 (aResMgr->loadPixmap("GEOM", tr("ICO_WIRE")));
100
101     setWindowTitle( tr("Vertex Association") );
102 //    setMinimumWidth(260);
103 //    setMinimumHeight(400);
104
105     mainFrame()->GroupConstructors->setTitle(tr("GEOM_POINTS"));
106     mainFrame()->RadioButton1->setIcon(image0);
107     mainFrame()->RadioButton2->setIcon(image3);
108     mainFrame()->RadioButton3->setIcon(image1);
109     mainFrame()->RadioButton4->show();
110     mainFrame()->RadioButton4->setIcon(image4);
111     mainFrame()->RadioButton5->show();
112     mainFrame()->RadioButton5->setIcon(image5);
113
114     myParamGroup = new QGroupBox(centralWidget());
115     myParamCoord = new QButtonGroup(myParamGroup);
116     QHBoxLayout* boxLayout = new QHBoxLayout(myParamGroup);
117     boxLayout->setMargin(MARGIN); boxLayout->setSpacing(SPACING);
118     QRadioButton* btn = new QRadioButton(tr("By Param"), myParamGroup);
119     myParamCoord->addButton(btn, PARAM_VALUE);
120     boxLayout->addWidget(btn);
121     btn = new QRadioButton(tr("By Length"), myParamGroup);
122     myParamCoord->addButton(btn, LENGTH_VALUE);
123     boxLayout->addWidget(btn);
124     btn = new QRadioButton(tr("By Coords"), myParamGroup);
125     myParamCoord->addButton(btn, COORD_VALUE);
126     boxLayout->addWidget(btn);
127     myParamCoord->setExclusive(true);
128     myParamCoord->button(PARAM_VALUE)->setChecked(true);
129
130     GroupXYZ = new DlgRef_3Spin(centralWidget());
131     GroupXYZ->GroupBox1->setTitle(tr("GEOM_COORDINATES"));
132     GroupXYZ->TextLabel1->setText(tr("GEOM_X"));
133     GroupXYZ->TextLabel2->setText(tr("GEOM_Y"));
134     GroupXYZ->TextLabel3->setText(tr("GEOM_Z"));
135     coordsInputValue[GEOM_POINT_XYZ]  = new QVector3D(0, 0, 0);
136     coordsInputValue[GEOM_POINT_EDGE] = new QVector3D(0, 0, 0);
137     coordsInputValue[GEOM_POINT_SURF] = new QVector3D(0, 0, 0);
138
139     GroupOnCurve = new DlgRef_2Sel1Spin(centralWidget());
140     GroupOnCurve->GroupBox1->setTitle(tr("GEOM_POINT_ON_EDGE"));
141     GroupOnCurve->TextLabel1->setText(tr("GEOM_EDGE"));
142     GroupOnCurve->TextLabel2->setText(tr("GEOM_START_POINT"));
143     GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER"));
144     paramInputValue[PARAM_VALUE] = 0.5;
145     paramInputValue[LENGTH_VALUE] = 0.5;
146
147     GroupOnSurface = new DlgRef_1Sel2Spin(centralWidget());
148     GroupOnSurface->GroupBox1->setTitle(tr("GEOM_POINT_ON_FACE"));
149     GroupOnSurface->TextLabel1->setText(tr("GEOM_FACE"));
150     GroupOnSurface->TextLabel2->setText(tr("GEOM_UPARAMETER"));
151     GroupOnSurface->TextLabel3->setText(tr("GEOM_VPARAMETER"));
152
153     GroupRefPoint = new DlgRef_1Sel3Spin(centralWidget());
154     GroupRefPoint->GroupBox1->setTitle(tr("GEOM_REF_POINT"));
155     GroupRefPoint->TextLabel1->setText(tr("GEOM_POINT"));
156     GroupRefPoint->TextLabel2->setText(tr("GEOM_DX"));
157     GroupRefPoint->TextLabel3->setText(tr("GEOM_DY"));
158     GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ"));
159
160     /* popup menu for line intersect buttons */
161     QIcon ico_line = QIcon(image6);
162     QIcon ico_wire = QIcon(image7);
163     // * menu for line1
164     myBtnPopup = new QMenu(this);
165     action_line1_edge = myBtnPopup->addAction(ico_line, tr("GEOM_EDGE"));
166     action_line1_wire = myBtnPopup->addAction(ico_wire, tr("GEOM_WIRE"));
167
168     // * menu for line 2
169     myBtnPopup2 = new QMenu(this);
170     action_line2_edge = myBtnPopup2->addAction(ico_line, tr("GEOM_EDGE"));
171     action_line2_wire = myBtnPopup2->addAction(ico_wire, tr("GEOM_WIRE"));
172
173     GroupLineIntersection = new DlgRef_2Sel(centralWidget());
174     GroupLineIntersection->GroupBox1->setTitle(tr("GEOM_LINE_INTERSECTION"));
175     GroupLineIntersection->TextLabel1->setText(tr("GEOM_LINE1"));
176     GroupLineIntersection->TextLabel2->setText(tr("GEOM_LINE2"));
177     GroupLineIntersection->PushButton1->setIcon(image2);
178     GroupLineIntersection->PushButton1->setMenu(myBtnPopup);
179     GroupLineIntersection->PushButton2->setIcon(image2);
180     GroupLineIntersection->PushButton2->setMenu(myBtnPopup2);
181
182     myCoordGrp = new QGroupBox(tr("GEOM_COORDINATES_RES"), centralWidget());
183     QGridLayout* myCoordGrpLayout = new QGridLayout(myCoordGrp);
184     myCoordGrpLayout->addWidget(new QLabel(tr("GEOM_X"), myCoordGrp), 0, 0);
185     myX = new QLineEdit(myCoordGrp);
186     myCoordGrpLayout->addWidget(myX, 0, 1);
187     myCoordGrpLayout->addWidget(new QLabel(tr("GEOM_Y"), myCoordGrp), 1, 0);
188     myY = new QLineEdit(myCoordGrp);
189     myCoordGrpLayout->addWidget(myY, 1, 1);
190     myCoordGrpLayout->addWidget(new QLabel(tr("GEOM_Z"), myCoordGrp), 2, 0);
191     myZ = new QLineEdit(myCoordGrp);
192     myCoordGrpLayout->addWidget(myZ, 2, 1);
193
194     QVBoxLayout* layout = new QVBoxLayout(centralWidget());
195     layout->setMargin(0); layout->setSpacing(6);
196     layout->addWidget(myParamGroup);
197     layout->addWidget(GroupXYZ);
198     layout->addWidget(GroupOnCurve);
199     layout->addWidget(GroupOnSurface);
200     layout->addWidget(GroupRefPoint);
201     layout->addWidget(GroupLineIntersection);
202     layout->addWidget(myCoordGrp);
203
204     myX->setReadOnly(true);
205     myY->setReadOnly(true);
206     myZ->setReadOnly(true);
207
208     myX->setEnabled(false);
209     myY->setEnabled(false);
210     myZ->setEnabled(false);
211
212     QPalette aPal = myX->palette();
213     aPal.setColor(QPalette::Disabled, QPalette::Text, QColor(0, 0, 0));
214     myX->setPalette(aPal);
215     myY->setPalette(aPal);
216     myZ->setPalette(aPal);
217
218     _helpFileName = "gui_asso_quad_to_geom.html#associate-to-a-vertex-of-the-geometry";
219     _initWidget( _editMode );
220     mainFrame()->RadioButton1->click();
221 }
222
223 //=================================================================================
224 // function : ~MyBasicGUI_PointDlg()
225 // purpose  : Destructor
226 //=================================================================================
227 MyBasicGUI_PointDlg::~MyBasicGUI_PointDlg()
228 {
229 }
230
231 void MyBasicGUI_PointDlg::_initInputWidget( HexaBaseDialog::Mode editmode )
232 {
233     // *** Init input widgets ***/
234     initSpinBox(GroupXYZ->SpinBox_DX, COORD_MIN, COORD_MAX);
235     initSpinBox(GroupXYZ->SpinBox_DY, COORD_MIN, COORD_MAX);
236     initSpinBox(GroupXYZ->SpinBox_DZ, COORD_MIN, COORD_MAX);
237     GroupXYZ->SpinBox_DX->setValue(0.0);
238     GroupXYZ->SpinBox_DY->setValue(0.0);
239     GroupXYZ->SpinBox_DZ->setValue(0.0);
240
241     initSpinBox(GroupRefPoint->SpinBox_DX, COORD_MIN, COORD_MAX);
242     initSpinBox(GroupRefPoint->SpinBox_DY, COORD_MIN, COORD_MAX);
243     initSpinBox(GroupRefPoint->SpinBox_DZ, COORD_MIN, COORD_MAX);
244     GroupRefPoint->SpinBox_DX->setValue(0.0);
245     GroupRefPoint->SpinBox_DY->setValue(0.0);
246     GroupRefPoint->SpinBox_DZ->setValue(0.0);
247
248     initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1.);
249     GroupOnCurve->SpinBox_DX->setValue(paramInputValue[PARAM_VALUE]);
250
251     initSpinBox(GroupOnSurface->SpinBox_DX, 0., 1.);
252     GroupOnSurface->SpinBox_DX->setValue(0.5);
253     initSpinBox(GroupOnSurface->SpinBox_DY, 0., 1.);
254     GroupOnSurface->SpinBox_DY->setValue(0.5);
255
256     // * vtk input widget
257     mainFrame()->_vertex_le->setReadOnly(true);
258     mainFrame()->_vertex_le->setProperty( "HexaWidgetType",  QVariant::fromValue(HEXABLOCK::GUI::VERTEX_TREE) );
259     mainFrame()->_vertex_le->installEventFilter(this);
260
261     // * geom input widgets
262     // point with ref
263     GroupRefPoint->LineEdit1->setReadOnly(true);
264     GroupRefPoint->LineEdit1->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMPOINT_TREE) );
265     GroupRefPoint->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_VERTEX) );
266     GroupRefPoint->LineEdit1->installEventFilter(this);
267
268     // point on curve
269     //  - Line
270     GroupOnCurve->LineEdit1->setReadOnly(true);
271     GroupOnCurve->LineEdit1->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMEDGE_TREE) );
272     GroupOnCurve->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) );
273     GroupOnCurve->LineEdit1->installEventFilter(this);
274
275     //  - Start point
276     GroupOnCurve->LineEdit2->setReadOnly(true);
277     GroupOnCurve->LineEdit2->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMPOINT_TREE) );
278     GroupOnCurve->LineEdit2->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_VERTEX) );
279     GroupOnCurve->LineEdit2->installEventFilter(this);
280
281     // point of 2 lines intersection
282     //  - Line1
283     GroupLineIntersection->LineEdit1->setReadOnly(true);
284     GroupLineIntersection->LineEdit1->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMEDGE_TREE) );
285     GroupLineIntersection->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) );
286     GroupLineIntersection->LineEdit1->installEventFilter(this);
287
288     // - Line2
289     GroupLineIntersection->LineEdit2->setReadOnly(true);
290     GroupLineIntersection->LineEdit2->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMEDGE_TREE) );
291     GroupLineIntersection->LineEdit2->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) );
292     GroupLineIntersection->LineEdit2->installEventFilter(this);
293
294     //point on surface
295     GroupOnSurface->LineEdit1->setReadOnly(true);
296     GroupOnSurface->LineEdit1->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMFACE_TREE) );
297     GroupOnSurface->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_FACE) );
298     GroupOnSurface->LineEdit1->installEventFilter(this);
299
300     // * connect signals
301     connect(this,           SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
302     connect(myParamCoord,   SIGNAL(buttonClicked(int)), this, SLOT(ClickParamCoord(int)));
303     connect(myBtnPopup, SIGNAL(triggered(QAction*)), this, SLOT(onBtnPopup(QAction*)));
304     connect(myBtnPopup2, SIGNAL(triggered(QAction*)), this, SLOT(onBtnPopup(QAction*)));
305
306     // ref point
307     connect(GroupRefPoint->LineEdit1, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&)));
308
309     //point on curve
310     connect(GroupOnCurve->LineEdit1, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&)));
311     connect(GroupOnCurve->LineEdit2, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&)));
312
313     connect(GroupOnCurve->SpinBox_DX,   SIGNAL(valueChanged(double)), this, SLOT(onParamValueChanged(double)));
314     connect(GroupOnCurve->SpinBox_DX,  SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&)));
315
316     // intersection point
317     connect(GroupLineIntersection->LineEdit1, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&)));
318     connect(GroupLineIntersection->LineEdit2, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&)));
319
320     // point on surface
321     connect(GroupOnSurface->SpinBox_DX, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&)));
322     connect(GroupOnSurface->SpinBox_DY, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&)));
323     connect(GroupOnSurface->LineEdit1,  SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&))); //surface: Face
324
325     // Coords X, Y, Z
326     connect(GroupXYZ->SpinBox_DX,       SIGNAL(valueChanged(double)), this, SLOT(onXCoordChanged(double)));
327     connect(GroupXYZ->SpinBox_DY,       SIGNAL(valueChanged(double)), this, SLOT(onYCoordChanged(double)));
328     connect(GroupXYZ->SpinBox_DZ,       SIGNAL(valueChanged(double)), this, SLOT(onZCoordChanged(double)));
329
330     connect(GroupXYZ->SpinBox_DX,  SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&)));
331     connect(GroupXYZ->SpinBox_DY,  SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&)));
332     connect(GroupXYZ->SpinBox_DZ,  SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&)));
333
334     // DX, DY, DZ
335     connect(GroupRefPoint->SpinBox_DX,  SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&)));
336     connect(GroupRefPoint->SpinBox_DY,  SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&)));
337     connect(GroupRefPoint->SpinBox_DZ,  SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&)));
338
339     // radio buttons
340     connect( mainFrame()->RadioButton1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
341     connect( mainFrame()->RadioButton2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
342     connect( mainFrame()->RadioButton3, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
343     connect( mainFrame()->RadioButton4, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
344     connect( mainFrame()->RadioButton5, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
345
346     connect( mainFrame()->RadioButton1, SIGNAL(clicked()), this, SLOT( refreshHighlight()) );
347     connect( mainFrame()->RadioButton2, SIGNAL(clicked()), this, SLOT(refreshHighlight()) );
348     connect( mainFrame()->RadioButton1, SIGNAL(clicked()), this, SLOT( refreshHighlight()) );
349     connect( mainFrame()->RadioButton2, SIGNAL(clicked()), this, SLOT(refreshHighlight()) );
350     connect( mainFrame()->RadioButton1, SIGNAL(clicked()), this, SLOT( refreshHighlight()) );
351
352     connect( myParamCoord->button(PARAM_VALUE), SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
353     connect( myParamCoord->button(LENGTH_VALUE), SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
354     connect( myParamCoord->button(COORD_VALUE), SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
355
356 }
357
358 void MyBasicGUI_PointDlg::showEvent ( QShowEvent * event )
359 {
360     HexaBaseDialog::showEvent(event);
361     if (getConstructorId() == GEOM_POINT_XYZ)
362         HEXABLOCKGUI::currentOccGView->setSelectionMode(TopAbs_VERTEX);
363 }
364 //===============================================================
365 // function : updateHelpFileName()
366 // purpose  : update the help file according to the current panel
367 //===============================================================
368 void MyBasicGUI_PointDlg::updateHelpFileName()
369 {
370     if ( sender() == mainFrame()->RadioButton1 ){
371         _helpFileName = "gui_asso_quad_to_geom.html#associate-to-a-vertex-of-the-geometry";
372     } else if ( sender() == mainFrame()->RadioButton2 ){
373         _helpFileName = "gui_asso_vertex_to_geom.html#by-a-reference";
374     } else if ( sender() == mainFrame()->RadioButton3 ){
375         _helpFileName = "gui_asso_vertex_to_geom.html#by-an-edge-and-a-parameter";
376     } else if ( sender() == mainFrame()->RadioButton4 ){
377         _helpFileName = "gui_asso_vertex_to_geom.html#by-intersection-of-two-lines-or-wires";
378     } else if ( sender() == mainFrame()->RadioButton5 ){
379         _helpFileName = "gui_asso_vertex_to_geom.html#by-a-face-and-two-parameters";
380     } else if (sender() == myParamCoord->button(PARAM_VALUE)){
381         if (mainFrame()->RadioButton3->isChecked()){
382             _helpFileName = "gui_asso_vertex_to_geom.html#by-an-edge-and-a-parameter";
383         } else if (mainFrame()->RadioButton5->isChecked()){
384             _helpFileName = "gui_asso_vertex_to_geom.html#by-a-face-and-two-parameters";
385         }
386     } else if (sender() == myParamCoord->button(LENGTH_VALUE)){
387         _helpFileName = "gui_asso_vertex_to_geom.html#by-an-edge-and-a-length";
388     } else if (sender() == myParamCoord->button(COORD_VALUE)){
389         if (mainFrame()->RadioButton3->isChecked()){
390             _helpFileName = "gui_asso_vertex_to_geom.html#by-an-edge-and-coordinates";
391         } else if (mainFrame()->RadioButton5->isChecked()){
392             _helpFileName = "gui_asso_vertex_to_geom.html#by-a-face-and-coordinates";
393         }
394     }
395 }
396
397 //=================================================================================
398 // function : SetDoubleSpinBoxStep()
399 // purpose  : Double spin box management
400 //=================================================================================
401 void MyBasicGUI_PointDlg::SetDoubleSpinBoxStep(double step)
402 {
403     GroupOnCurve->SpinBox_DX->setSingleStep(step);
404     GroupXYZ->SpinBox_DX->setSingleStep(step);
405     GroupXYZ->SpinBox_DY->setSingleStep(step);
406     GroupXYZ->SpinBox_DZ->setSingleStep(step);
407     GroupRefPoint->SpinBox_DX->setSingleStep(step);
408     GroupRefPoint->SpinBox_DY->setSingleStep(step);
409     GroupRefPoint->SpinBox_DZ->setSingleStep(step);
410 }
411
412
413 //=================================================================================
414 // function : ConstructorsClicked()
415 // purpose  : Radio button management
416 //=================================================================================
417 void MyBasicGUI_PointDlg::ConstructorsClicked(int constructorId)
418 {
419         clearVTKSelection();
420         clearOCCSelection();
421
422     switch (constructorId) {
423     case GEOM_POINT_XYZ:
424     {
425         HEXABLOCKGUI::currentOccGView->setSelectionMode(TopAbs_VERTEX);
426         GroupRefPoint->hide();
427         GroupOnCurve->hide();
428         GroupLineIntersection->hide();
429         GroupOnSurface->hide();
430         myCoordGrp->hide();
431         myParamGroup->hide();
432         GroupXYZ->show();
433         break;
434     }
435     case GEOM_POINT_REF:
436     {
437         myParamGroup->hide();
438         GroupXYZ->hide();
439         GroupOnCurve->hide();
440         GroupLineIntersection->hide();
441         GroupOnSurface->hide();
442         GroupRefPoint->show();
443         myCoordGrp->show();
444         break;
445     }
446     case GEOM_POINT_EDGE:
447     {
448         GroupRefPoint->hide();
449         GroupLineIntersection->hide();
450         GroupOnSurface->hide();
451         myParamGroup->show();
452         myParamCoord->button(LENGTH_VALUE)->show();
453         myParamCoord->button(PARAM_VALUE)->setChecked(true);
454         GroupOnCurve->show();
455         myCoordGrp->show();
456         updateParamCoord(false);
457         break;
458     }
459     case GEOM_POINT_INTINT:
460     {
461         myParamGroup->hide();
462         GroupXYZ->hide();
463         GroupRefPoint->hide();
464         GroupOnCurve->hide();
465         GroupOnSurface->hide();
466         myCoordGrp->show();
467         GroupLineIntersection->show();
468         break;
469     }
470     case GEOM_POINT_SURF:
471     {
472         GroupRefPoint->hide();
473         GroupOnCurve->hide();
474         GroupLineIntersection->hide();
475         myParamGroup->show();
476         myParamCoord->button(LENGTH_VALUE)->hide();
477         myParamCoord->button(PARAM_VALUE)->setChecked(true);
478         GroupOnSurface->show();
479         myCoordGrp->show();
480         updateParamCoord(false);
481         break;
482     }
483     }
484
485     updateInputs(constructorId);
486 }
487
488 //=================================================================================
489 // funcion  : getParameter()
490 // purpose  :
491 //=================================================================================
492 double MyBasicGUI_PointDlg::getParameter() const
493 {
494     return GroupOnCurve->SpinBox_DX->value();
495 }
496
497 //=================================================================================
498 // funcion  : getUParameter()
499 // purpose  :
500 //=================================================================================
501 double MyBasicGUI_PointDlg::getUParameter() const
502 {
503     return GroupOnSurface->SpinBox_DX->value();
504 }
505
506 //=================================================================================
507 // funcion  : getVParameter()
508 // purpose  :
509 //=================================================================================
510 double MyBasicGUI_PointDlg::getVParameter() const
511 {
512     return GroupOnSurface->SpinBox_DY->value();
513 }
514
515 void MyBasicGUI_PointDlg::onParamValueChanged(double newValue)
516 {
517     if (getConstructorId() == GEOM_POINT_EDGE)
518         paramInputValue[myParamCoord->checkedId()] = newValue;
519 }
520
521 // ============================================================== onSelectionChanged
522 /*
523  * Puts elements selected in the model in the corresponding widget (list widget or line edit)
524  * of the current dialog box.
525  */
526 void MyBasicGUI_PointDlg::onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel )
527 {
528     QModelIndexList l = sel.indexes();
529     if ( l.count() == 0)
530         return;
531
532     QModelIndex selected = l[0];
533     int selectedType = selected.data(HEXA_TREE_ROLE).toInt();
534     // fill the coordinates of the selected point
535     if ( getConstructorId() == GEOM_POINT_XYZ && selectedType == GEOMPOINT_TREE)
536     {
537         DocumentModel::GeomObj* geomObj = getGeomObj(selected);
538         if (geomObj == NULL)
539             return;
540
541         DocumentModel* docModel = getDocumentModel();
542         QString objId =  geomObj->shapeName + "," + geomObj->subId;
543         HEXA_NS::SubShape* ssh = docModel->getGeomPtr(objId);
544         if (ssh == NULL)
545             return;
546         TopoDS_Shape shape = ssh->getShape();
547         if (shape.IsNull() || shape.ShapeType() != TopAbs_VERTEX)
548             return;
549         TopoDS_Vertex vertex = TopoDS::Vertex(shape);
550         gp_Pnt pnt = BRep_Tool::Pnt(vertex);
551         OnPointSelected(pnt);
552         return;
553     }
554
555     QLineEdit*   aLineEdit   = NULL;
556     QListWidget* aListWidget = NULL;
557
558     // * put selection in the current line edit
559     aLineEdit = dynamic_cast<QLineEdit*>(_currentObj);
560     if ( aLineEdit != NULL )
561     {
562         _onSelectionChanged( sel, aLineEdit );
563         return;
564     }
565
566     // * put selection in the current list widget
567     aListWidget = dynamic_cast<QListWidget*>(_currentObj);
568     if ( aListWidget )
569         _onSelectionChanged( sel, aListWidget );
570 }
571
572
573 bool MyBasicGUI_PointDlg::apply(QModelIndex& result)
574 {
575     PatternGeomSelectionModel* pgsm = getPatternGeomSelectionModel();
576     PatternDataSelectionModel* pdsm = getPatternDataSelectionModel();
577     PatternDataModel* pdm = getPatternDataModel();
578     DocumentModel* docModel = getDocumentModel();
579
580     // get the selected vertex in the vtk view
581     QVariant v = mainFrame()->_vertex_le->property("QModelIndex");
582     if ( !v.isValid() )
583     {
584         SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE VERTEX ASSOCIATION" ) );
585         return false;
586     }
587     QModelIndex iVertex = pdm->mapToSource( v.value<QModelIndex>() );
588
589     // get the selected vertex in the geometry (occ view)
590     TopoDS_Vertex geomVertex = computeGeomVertex();
591
592     // control
593     if (!iVertex.isValid() || geomVertex.IsNull())
594     {
595         SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE VERTEX ASSOCIATION" ) );
596         return false;
597     }
598
599     // * set association
600     gp_Pnt aPnt = BRep_Tool::Pnt(geomVertex);
601     if (!docModel->setVertexAssociation(iVertex, aPnt.X(), aPnt.Y(), aPnt.Z()))
602     {
603         SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE VERTEX ASSOCIATION" ) );
604         return false;
605     }
606
607     // * update data in the occ view and the geom tree
608     HEXABLOCKGUI::currentOccGView->addVertexToCloud(geomVertex);
609     docModel->updateGeomTree();
610
611     // highlight associated items
612     QModelIndex iGeomVertex = docModel->getVertexAssociation(iVertex);
613     QModelIndexList list1, list2;
614     result = v.value<QModelIndex>();
615     list1 << result;
616     list2 << iGeomVertex;
617     pdsm->highlightTreeItems(list1); // data tree
618     pgsm->highlightTreeItems(list2); // geom tree
619     setFocus();
620     _updateCurrentObject(NULL);
621     HEXABLOCKGUI::currentOccGView->setSelectionMode(TopAbs_VERTEX);
622     HEXABLOCKGUI::currentDocGView->highlight(list1); // vtk view
623     HEXABLOCKGUI::currentOccGView->highlight(list1); // occ view
624
625     return true;
626 }
627
628
629 void MyBasicGUI_PointDlg::onXCoordChanged(double newValue)
630 {
631     int constructorId = getConstructorId();
632     if (constructorId != GEOM_POINT_XYZ && constructorId != GEOM_POINT_EDGE &&
633             constructorId != GEOM_POINT_SURF)
634         return;
635     coordsInputValue[constructorId]->setX(newValue);
636 }
637
638 void MyBasicGUI_PointDlg::onYCoordChanged(double newValue)
639 {
640     int constructorId = getConstructorId();
641     if (constructorId != GEOM_POINT_XYZ && constructorId != GEOM_POINT_EDGE &&
642             constructorId != GEOM_POINT_SURF)
643         return;
644     coordsInputValue[constructorId]->setY(newValue);
645 }
646
647 void MyBasicGUI_PointDlg::onZCoordChanged(double newValue)
648 {
649     int constructorId = getConstructorId();
650     if (constructorId != GEOM_POINT_XYZ && constructorId != GEOM_POINT_EDGE &&
651             constructorId != GEOM_POINT_SURF)
652         return;
653     coordsInputValue[constructorId]->setZ(newValue);
654
655 }
656
657 void MyBasicGUI_PointDlg::onUpdateResults(const QString& data)
658 {
659     if (getConstructorId() == GEOM_POINT_XYZ)
660         return;
661
662     // * compute the geom vertex
663     TopoDS_Vertex vertex = computeGeomVertex(true);
664
665     // * update results
666     if (vertex.IsNull())
667     {
668         myX->setText("");
669         myY->setText("");
670         myZ->setText("");
671         return;
672     }
673     gp_Pnt pnt = BRep_Tool::Pnt(vertex);
674     myX->setText(DlgRef::PrintDoubleValue(pnt.X(), 6));
675     myY->setText(DlgRef::PrintDoubleValue(pnt.Y(), 6));
676     myZ->setText(DlgRef::PrintDoubleValue(pnt.Z(), 6));
677 }
678
679 TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomVertex(bool preview)
680 {
681     TopoDS_Vertex vertex;
682     int constructorId = getConstructorId();
683
684     //display an emply vertex to erase the current preview
685     HEXABLOCKGUI::currentOccGView->displayPreview(vertex);
686
687     // compute the point
688     switch (constructorId) {
689     case GEOM_POINT_XYZ:
690         vertex = computeGeomPointXYZ();
691         break;
692     case GEOM_POINT_REF:
693         vertex = computeGeomPointRef();
694         break;
695     case GEOM_POINT_EDGE:
696         vertex = computeGeomPointEdge();
697         break;
698     case GEOM_POINT_INTINT:
699         vertex = computeGeomPointInt();
700         break;
701     case GEOM_POINT_SURF:
702         vertex = computeGeomPointSurf();
703         break;
704     default:
705         break;
706     }
707
708     // * display preview of computed point
709     if (preview)
710         HEXABLOCKGUI::currentOccGView->displayPreview(vertex);
711
712     return vertex;
713 }
714
715 TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomPointXYZ()
716 {
717     TopoDS_Vertex vertex;
718
719     if (getConstructorId() != GEOM_POINT_XYZ)
720         return vertex;
721
722     // - X, Y, Z Coords
723     double x = GroupXYZ->SpinBox_DX->value();
724     double y = GroupXYZ->SpinBox_DY->value();
725     double z = GroupXYZ->SpinBox_DZ->value();
726
727     // - compute the resulting vertex
728     vertex = makePoint(x, y, z);
729
730     return vertex;
731 }
732
733 TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomPointRef()
734 {
735     TopoDS_Vertex vertex;
736
737     if (getConstructorId() != GEOM_POINT_REF)
738         return vertex;
739
740     // get parameters from widgets
741     double dx = GroupRefPoint->SpinBox_DX->value();
742     double dy = GroupRefPoint->SpinBox_DY->value();
743     double dz = GroupRefPoint->SpinBox_DZ->value();
744
745     QVariant v = GroupRefPoint->LineEdit1->property("TopoDS_Shape");
746     if ( !v.isValid() )
747         return vertex;
748     TopoDS_Shape shape = v.value<TopoDS_Shape>();
749
750     // compute the resulting point
751     vertex = makePointWithReference(shape, dx, dy, dz);
752
753     return vertex;
754 }
755
756 TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomPointEdge()
757 {
758     TopoDS_Vertex vertex;
759
760     if (getConstructorId() != GEOM_POINT_EDGE)
761         return vertex;
762
763     // * get inputs values
764
765     // - the edge
766     QVariant v1 = GroupOnCurve->LineEdit1->property("TopoDS_Shape");
767     if ( !v1.isValid() )
768         return vertex;
769     TopoDS_Shape edgeShape = v1.value<TopoDS_Shape>();
770
771     bool isParam =  myParamCoord->checkedId() == PARAM_VALUE;
772     bool isLength = myParamCoord->checkedId() == LENGTH_VALUE;
773     bool isCoord  = myParamCoord->checkedId() == COORD_VALUE;
774     if (isParam)
775     {
776         // - param
777         double param = GroupOnCurve->SpinBox_DX->value();
778
779         // - compute the resulting vertex
780         vertex = makePointOnCurve(edgeShape, param);
781     }
782     else if (isLength)
783     {
784         // - the starting point
785         QVariant v2 = GroupOnCurve->LineEdit2->property("TopoDS_Shape");
786         if ( !v2.isValid() )
787                 return vertex;
788         TopoDS_Shape pointShape = v2.value<TopoDS_Shape>();
789
790         // - length
791         double length = GroupOnCurve->SpinBox_DX->value();
792
793         // - compute the resulting vertex
794         vertex = makePointOnCurveByLength(edgeShape, pointShape,length);
795     }
796     else if (isCoord)
797     {
798         // - X, Y, Z Coords
799         double x = GroupXYZ->SpinBox_DX->value();
800         double y = GroupXYZ->SpinBox_DY->value();
801         double z = GroupXYZ->SpinBox_DZ->value();
802
803         // - compute the resulting vertex
804         vertex = makePointOnCurveByCoord(edgeShape, x, y, z);
805     }
806
807     return vertex;
808 }
809
810 TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomPointInt()
811 {
812     TopoDS_Vertex vertex;
813
814     if (getConstructorId() != GEOM_POINT_INTINT)
815         return vertex;
816
817     QVariant v;
818
819     // * get inputs values
820
821     // - get edge 1
822     v = GroupLineIntersection->LineEdit1->property("TopoDS_Shape");
823     if ( !v.isValid() )
824         return vertex;
825     TopoDS_Shape line1 = v.value<TopoDS_Shape>();
826
827     // - get edge 2
828     v = GroupLineIntersection->LineEdit2->property("TopoDS_Shape");
829     if ( !v.isValid() )
830         return vertex;
831     TopoDS_Shape line2 = v.value<TopoDS_Shape>();
832
833     // * compute the resulting vertex
834     vertex = makePointOnLinesIntersection(line1, line2);
835
836     return vertex;
837 }
838
839 TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomPointSurf()
840 {
841     TopoDS_Vertex vertex;
842
843     if (getConstructorId() != GEOM_POINT_SURF)
844         return vertex;
845
846     // * get inputs values
847
848     // - the face
849     QVariant v = GroupOnSurface->LineEdit1->property("TopoDS_Shape");
850     if ( !v.isValid() )
851         return vertex;
852     TopoDS_Shape faceShape = v.value<TopoDS_Shape>();
853
854     bool isParam =  myParamCoord->checkedId() == PARAM_VALUE;
855     bool isCoord  = myParamCoord->checkedId() == COORD_VALUE;
856     if (isParam)
857     {
858         // - params U,V
859         double param_u = GroupOnSurface->SpinBox_DX->value();
860         double param_v = GroupOnSurface->SpinBox_DY->value();
861
862         // - compute the resulting vertex
863         vertex = makePointOnSurface(faceShape, param_u, param_v);
864     }
865     else if (isCoord)
866     {
867         // - X, Y, Z Coords
868         double x = GroupXYZ->SpinBox_DX->value();
869         double y = GroupXYZ->SpinBox_DY->value();
870         double z = GroupXYZ->SpinBox_DZ->value();
871
872         // - compute the resulting vertex
873         vertex = makePointOnSurfaceByCoord(faceShape, x, y, z);
874     }
875
876     return vertex;
877 }
878
879 //=================================================================================
880 // function : OnPointSelected
881 // purpose  :
882 //=================================================================================
883 void MyBasicGUI_PointDlg::OnPointSelected(const gp_Pnt& thePnt)
884 {
885     if (getConstructorId() == GEOM_POINT_XYZ) {
886         GroupXYZ->SpinBox_DX->setValue(thePnt.X());
887         GroupXYZ->SpinBox_DY->setValue(thePnt.Y());
888         GroupXYZ->SpinBox_DZ->setValue(thePnt.Z());
889     }
890 }
891
892 void MyBasicGUI_PointDlg::updateInputs(const int constructorId)
893 {
894     QString str;
895     QVector3D* coords = NULL;
896
897     switch (constructorId) {
898     case GEOM_POINT_XYZ :
899         coords = coordsInputValue[GEOM_POINT_XYZ];
900         break;
901     case GEOM_POINT_REF:
902         break;
903     case GEOM_POINT_EDGE:
904         coords = coordsInputValue[GEOM_POINT_EDGE];
905         updateParamCoord(true);
906         break;
907     case GEOM_POINT_INTINT:
908         break;
909     case GEOM_POINT_SURF:
910         coords = coordsInputValue[GEOM_POINT_SURF];
911         updateParamCoord(true);
912         break;
913     default:
914         break;
915     }
916
917     if (coords != NULL)
918     {
919         GroupXYZ->SpinBox_DX->setValue(coords->x());
920         GroupXYZ->SpinBox_DY->setValue(coords->y());
921         GroupXYZ->SpinBox_DZ->setValue(coords->z());
922     }
923
924     onUpdateResults(str);
925 }
926
927 //=================================================================================
928 // function : ClickParamCoord()
929 // purpose  :
930 //=================================================================================
931 void MyBasicGUI_PointDlg::ClickParamCoord(int id)
932 {
933     updateInputs(getConstructorId());
934 }
935
936 //=================================================================================
937 // function : updateParamCoord
938 // purpose  :
939 //=================================================================================
940 void MyBasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
941 {
942     bool isParam = myParamCoord->checkedId() == PARAM_VALUE;
943     bool isLength = myParamCoord->checkedId() == LENGTH_VALUE;
944
945     const int id = getConstructorId();
946     if (id == GEOM_POINT_EDGE) {
947         GroupOnCurve->TextLabel2->setVisible(isLength);
948         GroupOnCurve->LineEdit2->setVisible(isLength);
949         GroupOnCurve->TextLabel3->setVisible(isParam || isLength);
950         GroupOnCurve->SpinBox_DX->setVisible(isParam || isLength);
951         if (isParam){
952             GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER"));
953             double value = paramInputValue[PARAM_VALUE];
954             GroupOnCurve->SpinBox_DX->setValue(0.5);
955             initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1.);
956             GroupOnCurve->SpinBox_DX->setValue(value);
957         }
958         else if (isLength){
959             GroupOnCurve->TextLabel3->setText(tr("GEOM_LENGTH"));
960             double value = paramInputValue[LENGTH_VALUE];
961             GroupOnCurve->SpinBox_DX->setValue(0.5);
962             initSpinBox(GroupOnCurve->SpinBox_DX, COORD_MIN, COORD_MAX);
963             GroupOnCurve->SpinBox_DX->setValue(value);
964         }
965     }
966     else if (id == GEOM_POINT_SURF) {
967         GroupOnSurface->TextLabel2->setShown(isParam);
968         GroupOnSurface->TextLabel3->setShown(isParam);
969         GroupOnSurface->SpinBox_DX->setShown(isParam);
970         GroupOnSurface->SpinBox_DY->setShown(isParam);
971     }
972
973     GroupXYZ->setShown(!isParam && !isLength);
974 }
975
976 //=================================================================================
977 // function : onBtnPopup()
978 // purpose  :
979 //=================================================================================
980 void MyBasicGUI_PointDlg::onBtnPopup(QAction* a)
981 {
982     if (a == action_line1_edge)
983     {
984         GroupLineIntersection->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) );
985         GroupLineIntersection->LineEdit1->setFocus();
986         GroupLineIntersection->PushButton2->setDown(false);
987     }
988     else if (a == action_line1_wire)
989     {
990         GroupLineIntersection->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_WIRE) );
991         GroupLineIntersection->LineEdit1->setFocus();
992         GroupLineIntersection->PushButton2->setDown(false);
993     }
994     else if (a == action_line2_edge)
995     {
996         GroupLineIntersection->LineEdit2->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) );
997         GroupLineIntersection->LineEdit2->setFocus();
998         GroupLineIntersection->PushButton1->setDown(false);
999     }
1000     else if (a == action_line2_wire)
1001     {
1002         GroupLineIntersection->LineEdit2->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_WIRE) );
1003         GroupLineIntersection->LineEdit2->setFocus();
1004         GroupLineIntersection->PushButton1->setDown(false);
1005     }
1006 }
1007
1008 //=================================================================================
1009 // function : updateSize
1010 // purpose  : adjust dialog size to minimum
1011 //=================================================================================
1012 void MyBasicGUI_PointDlg::updateSize()
1013 {
1014     qApp->processEvents();
1015     updateGeometry();
1016     resize(minimumSizeHint());
1017 }
1018
1019 void MyBasicGUI_PointDlg::clear()
1020 {
1021     mainFrame()->_vertex_le->clear();
1022     modelUnregister(mainFrame()->_vertex_le);
1023
1024     GroupRefPoint->LineEdit1->clear();
1025     GroupRefPoint->LineEdit1->setProperty("TopoDS_Shape", QVariant());
1026     GroupRefPoint->LineEdit1->setProperty("QModelIndex", QVariant());
1027     GroupRefPoint->LineEdit1->setProperty("HexaData", QVariant());
1028
1029     GroupOnCurve->LineEdit1->clear();
1030     GroupOnCurve->LineEdit1->setProperty("TopoDS_Shape", QVariant());
1031     GroupOnCurve->LineEdit1->setProperty("QModelIndex", QVariant());
1032     GroupOnCurve->LineEdit1->setProperty("HexaData", QVariant());
1033
1034     GroupOnCurve->LineEdit2->clear();
1035     GroupOnCurve->LineEdit2->setProperty("TopoDS_Shape", QVariant());
1036     GroupOnCurve->LineEdit2->setProperty("QModelIndex", QVariant());
1037     GroupOnCurve->LineEdit2->setProperty("HexaData", QVariant());
1038
1039     GroupLineIntersection->LineEdit1->clear();
1040     GroupLineIntersection->LineEdit1->setProperty("TopoDS_Shape", QVariant());
1041     GroupLineIntersection->LineEdit1->setProperty("QModelIndex", QVariant());
1042     GroupLineIntersection->LineEdit1->setProperty("HexaData", QVariant());
1043
1044     GroupLineIntersection->LineEdit2->clear();
1045     GroupLineIntersection->LineEdit2->setProperty("TopoDS_Shape", QVariant());
1046     GroupLineIntersection->LineEdit2->setProperty("QModelIndex", QVariant());
1047     GroupLineIntersection->LineEdit2->setProperty("HexaData", QVariant());
1048
1049     GroupOnSurface->LineEdit1->clear();
1050     GroupOnSurface->LineEdit1->setProperty("TopoDS_Shape", QVariant());
1051     GroupOnSurface->LineEdit1->setProperty("QModelIndex", QVariant());
1052     GroupOnSurface->LineEdit1->setProperty("HexaData", QVariant());
1053
1054     modelUnregister(this);
1055 }
1056
1057
1058 void MyBasicGUI_PointDlg::onWindowActivated(SUIT_ViewManager* vm)
1059 {
1060     QString vmType = vm->getType();
1061     if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ){
1062         mainFrame()->_vertex_le->setFocus();
1063     } else if ( vmType == OCCViewer_Viewer::Type() ){
1064         // ...
1065     }
1066 }