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