Salome HOME
ccd194ddf021fa3927a622169d4118427ee25314
[modules/visu.git] / src / VISUGUI / VisuGUI_CutSegmentDlg.cxx
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
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 //  File   : VisuGUI_CutSegmentDlg.cxx
21 //  Author : Oleg UVAROV
22 //  Module : VISU
23 //
24 #include "VisuGUI_CutSegmentDlg.h"
25
26 #include "VisuGUI.h"
27 #include "VisuGUI_Tools.h"
28 #include "VisuGUI_ViewTools.h"
29 #include "VisuGUI_InputPane.h"
30
31 #include "VISU_Gen_i.hh"
32 #include "VISU_CutSegment_i.hh"
33 #include "VISU_ColoredPrs3dFactory.hh"
34
35 #include "VISU_PipeLine.hxx"
36 #include "VISU_CutSegmentPL.hxx"
37
38 #include "SVTK_ViewWindow.h"
39
40 #include "LightApp_Application.h"
41 #include "SalomeApp_Study.h"
42 #include <SalomeApp_DoubleSpinBox.h>
43
44 #include "SUIT_ResourceMgr.h"
45
46 #include <QLayout>
47 #include <QTabWidget>
48 #include <QLabel>
49 #include <QPushButton>
50
51 #include <vtkAppendPolyData.h>
52 #include <vtkCellArray.h>
53 #include <vtkDataSetMapper.h>
54 #include <vtkFloatArray.h>
55 #include <vtkGlyph3D.h>
56 #include <vtkGlyphSource2D.h>
57 #include <vtkPointData.h>
58 #include <vtkPolyData.h>
59 #include <vtkPolyDataMapper.h>
60 #include <vtkRenderer.h>
61
62 using namespace std;
63
64 VisuGUI_CutSegmentDlg::VisuGUI_CutSegmentDlg (SalomeApp_Module* theModule)
65   : VisuGUI_ScalarBarBaseDlg(theModule),
66     myPreviewActor(0),
67     myPreviewActorGlyphs(0),
68     myPreviewActorPoints(0)
69 {
70   setWindowTitle("Cut Segment Definition");
71   setSizeGripEnabled(true);
72
73   QVBoxLayout* aMainLayout = new QVBoxLayout (this);
74   aMainLayout->setMargin( 7 );
75   aMainLayout->setSpacing(5);
76
77   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
78   hasInit = false;  
79
80   // Tab pane
81   myTabBox = new QTabWidget(this);
82
83   // Cut Segment
84   QFrame* aCutSegmentPane = new QFrame( this );
85
86   QGroupBox* aSegmentBox = new QGroupBox( tr( "LBL_SEGMENT" ), aCutSegmentPane );
87
88   QLabel* aPoint1Label = new QLabel( tr( "LBL_POINT_1" ), aSegmentBox );
89   QLabel* aPoint1XLabel = new QLabel( tr( "LBL_X" ), aSegmentBox );
90   QLabel* aPoint1YLabel = new QLabel( tr( "LBL_Y" ), aSegmentBox );
91   QLabel* aPoint1ZLabel = new QLabel( tr( "LBL_Z" ), aSegmentBox );
92   QLabel* aPoint2Label = new QLabel( tr( "LBL_POINT_2" ), aSegmentBox );
93   QLabel* aPoint2XLabel = new QLabel( tr( "LBL_X" ), aSegmentBox );
94   QLabel* aPoint2YLabel = new QLabel( tr( "LBL_Y" ), aSegmentBox );
95   QLabel* aPoint2ZLabel = new QLabel( tr( "LBL_Z" ), aSegmentBox );
96   for( int i = 0; i < 3; i++ ) {
97     myPoint1.append( new SalomeApp_DoubleSpinBox( aSegmentBox ) );
98     myPoint2.append( new SalomeApp_DoubleSpinBox( aSegmentBox ) );
99   }
100
101   QListIterator<SalomeApp_DoubleSpinBox*> anIter( myPoint1 + myPoint2 );
102   while( anIter.hasNext() ) {
103     SalomeApp_DoubleSpinBox* aSpinBox = anIter.next();
104     // Use default range - see QDoubleSpinBox minimum/maximum properties
105     VISU::initSpinBox( aSpinBox, 0., 99.99, 1., "length_precision" );
106     aSpinBox->setMinimumWidth( 100 );
107   }
108
109   QGridLayout* aSegmentBoxLayout = new QGridLayout( aSegmentBox );
110   aSegmentBoxLayout->addWidget( aPoint1Label,  0, 0 );
111   aSegmentBoxLayout->addWidget( aPoint1XLabel, 0, 1 );
112   aSegmentBoxLayout->addWidget( myPoint1[0],   0, 2 );
113   aSegmentBoxLayout->addWidget( aPoint1YLabel, 0, 3 );
114   aSegmentBoxLayout->addWidget( myPoint1[1],   0, 4 );
115   aSegmentBoxLayout->addWidget( aPoint1ZLabel, 0, 5 );
116   aSegmentBoxLayout->addWidget( myPoint1[2],   0, 6 );
117   aSegmentBoxLayout->addWidget( aPoint2Label,  1, 0 );
118   aSegmentBoxLayout->addWidget( aPoint2XLabel, 1, 1 );
119   aSegmentBoxLayout->addWidget( myPoint2[0],   1, 2 );
120   aSegmentBoxLayout->addWidget( aPoint2YLabel, 1, 3 );
121   aSegmentBoxLayout->addWidget( myPoint2[1],   1, 4 );
122   aSegmentBoxLayout->addWidget( aPoint2ZLabel, 1, 5 );
123   aSegmentBoxLayout->addWidget( myPoint2[2],   1, 6 );
124
125   myPreviewCheck = new QCheckBox( tr( "LBL_SHOW_PREVIEW" ), aCutSegmentPane );
126   myPreviewCheck->setChecked( aResourceMgr->booleanValue( "VISU", "show_preview", false ) );
127
128   myAllCurvesInvertedCheck = new QCheckBox( tr( "LBL_INVERT_CURVES" ), aCutSegmentPane );
129   myAllCurvesInvertedCheck->setChecked( false );
130
131   myUseAbsoluteLengthCheck = new QCheckBox( tr( "LBL_ABSOLUTE_LENGTH" ), aCutSegmentPane );
132   myUseAbsoluteLengthCheck->setChecked( false );
133
134   myCreateTable = new QCheckBox( tr("LBL_GENERATE_TABLE"), aCutSegmentPane );
135   myCreateTable->setChecked( aResourceMgr->booleanValue( "VISU", "generate_data_table", true ) );
136
137   QWidget* aCheckPane = new QWidget( aCutSegmentPane );
138   myCurvesCheck = new QCheckBox( tr( "LBL_GENERATE_CURVES" ), aCheckPane );
139   myCurvesCheck->setChecked( aResourceMgr->booleanValue( "VISU", "generate_curves", true ) );
140   myCurvesCheck->setEnabled( aResourceMgr->booleanValue( "VISU", "generate_data_table", true ) );
141
142   QHBoxLayout* aCheckLayout = new QHBoxLayout( aCheckPane );
143   aCheckLayout->setMargin( 0 );
144   aCheckLayout->setSpacing( 0 );
145   aCheckLayout->insertSpacing( 0, 20 );
146   aCheckLayout->addWidget( myCurvesCheck );
147
148   QVBoxLayout* aCutSegmentLayout = new QVBoxLayout( aCutSegmentPane );
149   aCutSegmentLayout->setMargin( 5 );
150   aCutSegmentLayout->setSpacing( 6 );
151   aCutSegmentLayout->addWidget( aSegmentBox );
152   aCutSegmentLayout->addWidget( myPreviewCheck );
153   aCutSegmentLayout->addWidget( myAllCurvesInvertedCheck );
154   aCutSegmentLayout->addWidget( myUseAbsoluteLengthCheck );
155   aCutSegmentLayout->addWidget( myCreateTable );
156   aCutSegmentLayout->addWidget( aCheckPane );
157   aCutSegmentLayout->addStretch();
158
159   myTabBox->addTab( aCutSegmentPane, tr("LBL_CUT_SEGMENT") );
160
161   myInputPane = new VisuGUI_InputPane(VISU::TCUTSEGMENT, theModule, this);
162   myTabBox->addTab(GetScalarPane(), "Scalar Bar");
163   myTabBox->addTab(myInputPane, "Input");
164
165   aMainLayout->addWidget(myTabBox);
166
167   // Dialog buttons
168   QFrame* aBtnBox = new QFrame(this);
169   QHBoxLayout* aHBLay = new QHBoxLayout( aBtnBox );
170   aBtnBox->setFrameStyle(QFrame::Box | QFrame::Sunken);
171   aBtnBox->setLineWidth( 1 );
172   aHBLay->setSpacing( 5 );
173   aHBLay->setMargin( 11 );
174
175   QPushButton* aOkBtn = new QPushButton (tr("BUT_OK"), aBtnBox);
176   aOkBtn->setAutoDefault( TRUE );
177   aOkBtn->setDefault( true );
178   aHBLay->addWidget(aOkBtn);
179
180   aHBLay->addStretch();
181
182   QPushButton* aCloseBtn = new QPushButton(tr("BUT_CANCEL"), aBtnBox);
183   aHBLay->addWidget(aCloseBtn);
184
185   QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox);
186   aHBLay->addWidget(aHelpBtn);
187
188   aMainLayout->addWidget(aBtnBox);
189
190   // signals and slots connections
191   connect(myPreviewCheck, SIGNAL(toggled(bool))         , this, SLOT(onPreviewCheck(bool)));
192   connect(myAllCurvesInvertedCheck, SIGNAL(toggled(bool)),this, SLOT(onAllCurvesInvertedCheck(bool)));
193   for( int i = 0; i < 3; i++ ) {
194     connect(myPoint1[ i ], SIGNAL(valueChanged(double)), this, SLOT(onPointModified()));
195     connect(myPoint2[ i ], SIGNAL(valueChanged(double)), this, SLOT(onPointModified()));
196   }
197   connect(myCreateTable , SIGNAL(toggled(bool)), myCurvesCheck, SLOT(setEnabled(bool)));
198
199   connect(aOkBtn, SIGNAL(clicked()), this, SLOT(accept()));
200   connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject()));
201   connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
202 }
203
204 /*!
205   Destructor
206 */
207 VisuGUI_CutSegmentDlg::~VisuGUI_CutSegmentDlg()
208 {
209   deletePlanes();
210   if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
211     vf->Repaint();
212 }
213
214 //------------------------------------------------------------------------------
215 void VisuGUI_CutSegmentDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
216                                                 bool theInit )
217 {
218   if( theInit )
219     myPrsCopy = VISU::TSameAsFactory<VISU::TCUTSEGMENT>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
220
221   VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
222
223   hasInit = true;
224   myCutSegment = VISU::TSameAsFactory<VISU::TCUTSEGMENT>().Create(myPrsCopy, VISU::ColoredPrs3d_i::EDoNotPublish);
225   myCutSegment->CopyCurvesInverted(myPrsCopy->GetCurvesInverted());
226   myAllCurvesInvertedCheck->setChecked( myCutSegment->IsAllCurvesInverted() );
227   myUseAbsoluteLengthCheck->setChecked( myCutSegment->IsUseAbsoluteLength() );
228
229   vtkDataSet* anInput = myCutSegment->GetPipeLine()->GetInput();
230   anInput->Update();
231
232   vtkFloatingPointType bounds[6];
233   anInput->GetBounds( bounds );
234
235   for( int i = 0; i < 3; i++ ) {
236     double min = bounds[ 2*i ], max = bounds[ 2*i+1 ];
237     myPoint1[ i ]->setRange( min, max );
238     myPoint2[ i ]->setRange( min, max );
239
240     myPoint1[ i ]->setSingleStep( ( max - min ) / 10 );
241     myPoint2[ i ]->setSingleStep( ( max - min ) / 10 );
242   }
243
244   double p1[3], p2[3];
245   myPrsCopy->GetPoint1( p1[0], p1[1], p1[2] );
246   myPrsCopy->GetPoint2( p2[0], p2[1], p2[2] );
247
248   for( int i = 0; i < 3; i++ ) {
249     myPoint1[i]->setValue( p1[i] );
250     myPoint2[i]->setValue( p2[i] );
251   }
252
253   // Draw Preview
254   if (myPreviewCheck->isChecked()) {
255     createPlanes();
256   }
257
258   if( !theInit )
259     return;
260
261   myInputPane->initFromPrsObject( myPrsCopy );
262   myTabBox->setCurrentIndex( 0 );
263 }
264
265 //------------------------------------------------------------------------------
266 int VisuGUI_CutSegmentDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
267 {
268   if(!myInputPane->check() || !GetScalarPane()->check())
269     return 0;
270   
271   int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
272   anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
273
274   myPrsCopy->SetAllCurvesInverted( myAllCurvesInvertedCheck->isChecked() );
275   myPrsCopy->SetUseAbsoluteLength( myUseAbsoluteLengthCheck->isChecked() );
276
277   double p1[3], p2[3];
278   for( int i = 0; i < 3; i++ ) {
279     p1[i] = myPoint1[i]->value();
280     p2[i] = myPoint2[i]->value();
281   }
282   myPrsCopy->SetPoint1( p1[0], p1[1], p1[2] );
283   myPrsCopy->SetPoint2( p2[0], p2[1], p2[2] );
284
285   VISU::TSameAsFactory<VISU::TCUTSEGMENT>().Copy(myPrsCopy, thePrs);
286
287   return anIsOk;
288 }
289
290 //------------------------------------------------------------------------------
291 void VisuGUI_CutSegmentDlg::createPlanes()
292 {
293   SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
294   if (aView == NULL) return;
295   if (!(bool)myCutSegment) return;
296   if (myPreviewActor != 0) return;
297
298   storeToPrsObject(myCutSegment);
299   myCutSegment->GetPipeLine()->Update();
300   vtkAppendPolyData* aPolyData = myCutSegment->GetSpecificPL()->GetAppendPolyData();
301   vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
302   aPlaneMapper->SetInput(aPolyData->GetOutput());
303   aPlaneMapper->ScalarVisibilityOff();
304   
305   myPreviewActorGlyphs = SALOME_Actor::New();
306   myPreviewActorGlyphs->PickableOff();
307   updateGlyphs(false);
308   
309   myPreviewActorPoints = SALOME_Actor::New();
310   myPreviewActorPoints->PickableOff();
311   updatePoints(false);
312   
313   myPreviewActor = SALOME_Actor::New();
314   myPreviewActor->PickableOff();
315   myPreviewActor->SetMapper(aPlaneMapper);
316   aPlaneMapper->Delete();
317   aView->AddActor(myPreviewActor);
318   aView->AddActor(myPreviewActorGlyphs);
319   aView->AddActor(myPreviewActorPoints);
320   aView->getRenderer()->Render();
321   aView->onFitAll();
322 }
323
324 //------------------------------------------------------------------------------
325 void VisuGUI_CutSegmentDlg::deletePlanes()
326 {
327   if (myPreviewActor == 0) return;
328   vtkRenderer* aRend       = myPreviewActor->GetRenderer();
329   vtkRenderer* aRendGlyphs = myPreviewActorGlyphs->GetRenderer();
330   vtkRenderer* aRendPoints = myPreviewActorPoints->GetRenderer();
331   
332   vtkRenderWindow* aWnd1 = aRend->GetRenderWindow();
333   vtkRenderWindow* aWnd2 = aRendGlyphs->GetRenderWindow();
334   vtkRenderWindow* aWnd3 = aRendPoints->GetRenderWindow();
335   if(aRend && aWnd1)
336     myPreviewActor->RemoveFromRender(aRend);
337   if(aRendGlyphs && aWnd2)
338     myPreviewActorGlyphs->RemoveFromRender(aRendGlyphs);
339   if(aRendPoints && aWnd3)
340     myPreviewActorPoints->RemoveFromRender(aRendPoints);
341
342   myPreviewActor->Delete();
343   myPreviewActorGlyphs->Delete();
344   myPreviewActorPoints->Delete();
345   myPreviewActor = 0;
346   myPreviewActorGlyphs = 0;
347   myPreviewActorPoints = 0;
348 }
349
350 //------------------------------------------------------------------------------
351 void VisuGUI_CutSegmentDlg::updateGlyphs(bool update){
352   if (myPreviewActorGlyphs == 0 ) return;
353   const vtkFloatingPointType *aDirLn = myCutSegment->GetSpecificPL()->GetRealDirLn();
354   vtkFloatingPointType aSecondPnt[3];
355   vtkFloatingPointType aBoundCenter[3];
356
357   vtkAppendPolyData* aPolyData = myCutSegment->GetSpecificPL()->GetAppendPolyData();
358   vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
359   aPlaneMapper->SetInput(aPolyData->GetOutput());
360   vtkFloatingPointType bounds[6];
361   aPlaneMapper->GetBounds(bounds);
362
363   for(int i=0; i<3; i++) aBoundCenter[i] = (bounds[i*2] + bounds[i*2+1])/2.0;
364   for(int i=0; i<3; i++){ 
365     if (!myAllCurvesInvertedCheck->isChecked())
366       aSecondPnt[i] = aDirLn[i];
367     else
368       aSecondPnt[i] = - aDirLn[i];
369   }
370   
371   vtkFloatingPointType max_bound = 0;
372   max_bound < bounds[1]-bounds[0] ? max_bound = bounds[1] - bounds[0] : max_bound = max_bound;
373   max_bound < bounds[3]-bounds[2] ? max_bound = bounds[3] - bounds[2] : max_bound = max_bound;
374   max_bound < bounds[5]-bounds[4] ? max_bound = bounds[5] - bounds[4] : max_bound = max_bound;
375
376   vtkPolyData* profile = vtkPolyData::New();
377   vtkPoints* aPoints = vtkPoints::New();
378   vtkGlyph3D* glyphs = vtkGlyph3D::New();
379   vtkFloatArray *aFloatArray = vtkFloatArray::New();
380   vtkGlyphSource2D* source = vtkGlyphSource2D::New();
381   
382   source->FilledOn();
383   source->SetGlyphTypeToArrow();
384   
385   aPoints->InsertNextPoint(aBoundCenter);
386   profile->SetPoints(aPoints);
387   
388   aFloatArray->SetNumberOfComponents(3);
389   for(int i=0; i<3 ;i++)
390     aFloatArray->InsertNextValue(aSecondPnt[i]);
391   
392   vtkDataSetAttributes* aDataSetAttributes;
393   aDataSetAttributes = profile->GetPointData();
394   aDataSetAttributes->SetVectors(aFloatArray);
395   
396   glyphs->SetScaleFactor(0.25*max_bound);
397   glyphs->SetVectorModeToUseVector();
398   glyphs->SetScaleModeToScaleByVector();
399   glyphs->SetInput(profile);
400   glyphs->SetSource(source->GetOutput());
401
402   vtkPolyDataMapper* aGlyphsMapper = vtkPolyDataMapper::New();
403   aGlyphsMapper->ScalarVisibilityOff();
404   aGlyphsMapper->SetInput(glyphs->GetOutput());
405   
406   myPreviewActorGlyphs->SetMapper(aGlyphsMapper);
407
408   profile->Delete();
409   glyphs->Delete();
410   aPoints->Delete();
411   aGlyphsMapper->Delete();
412   aFloatArray->Delete();
413   source->Delete();
414   aPlaneMapper->Delete();
415
416   if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
417     if (update)
418       vf->Repaint();
419 }
420
421 //------------------------------------------------------------------------------
422 void VisuGUI_CutSegmentDlg::updatePoints( bool update )
423 {
424   if( !myPreviewActorPoints )
425     return;
426
427   vtkFloatingPointType aPoint1[3], aPoint2[3];
428   myCutSegment->GetSpecificPL()->GetPoint1( aPoint1[0], aPoint1[1], aPoint1[2] );
429   myCutSegment->GetSpecificPL()->GetPoint2( aPoint2[0], aPoint2[1], aPoint2[2] );
430
431   vtkPoints* aPoints = vtkPoints::New();
432   aPoints->InsertNextPoint( aPoint1 );
433   aPoints->InsertNextPoint( aPoint2 );
434
435   vtkCellArray* aVerts = vtkCellArray::New();
436   for( vtkIdType i = 0, n = aPoints->GetNumberOfPoints(); i < n; i++ )
437     aVerts->InsertNextCell( 1, &i );
438
439   vtkPolyData* aProfile = vtkPolyData::New();
440   aProfile->SetPoints( aPoints );
441   aProfile->SetVerts( aVerts );
442
443   vtkPolyDataMapper* aPointsMapper = vtkPolyDataMapper::New();
444   aPointsMapper->ScalarVisibilityOff();
445   aPointsMapper->SetInput( aProfile );
446   
447   myPreviewActorPoints->SetMapper( aPointsMapper );
448   myPreviewActorPoints->GetProperty()->SetRepresentationToPoints();
449   myPreviewActorPoints->GetProperty()->SetPointSize( 5 );
450
451   aProfile->Delete();
452   aPoints->Delete();
453   aVerts->Delete();
454
455   if( SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>() )
456     if( update )
457       vf->Repaint();
458 }
459
460 //------------------------------------------------------------------------------
461 void VisuGUI_CutSegmentDlg::accept()
462 {
463   VisuGUI_ScalarBarBaseDlg::accept();
464 }
465
466 //------------------------------------------------------------------------------
467 void VisuGUI_CutSegmentDlg::reject()
468 {
469   VisuGUI_ScalarBarBaseDlg::reject();
470 }
471
472 //------------------------------------------------------------------------------
473 void VisuGUI_CutSegmentDlg::onPreviewCheck (bool thePreview)
474 {
475   if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
476     if (thePreview) {
477       createPlanes();
478     } else {
479       deletePlanes();
480       vf->Repaint();
481     }
482   }
483 }
484
485 //------------------------------------------------------------------------------
486 void VisuGUI_CutSegmentDlg::onAllCurvesInvertedCheck(bool theInvert)
487 {
488   bool anIsAllCurvesInverted = myAllCurvesInvertedCheck->isChecked();
489
490   myCutSegment->SetAllCurvesInverted( anIsAllCurvesInverted );
491   myPrsCopy->SetAllCurvesInverted( anIsAllCurvesInverted );
492
493   updateGlyphs(true);
494   updatePoints(true);
495 }
496
497 //------------------------------------------------------------------------------
498 void VisuGUI_CutSegmentDlg::onPointModified ()
499 {
500   if (!(bool)myCutSegment) return;
501   SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
502   if (aView) {
503     if (myPreviewCheck->isChecked()) {
504       deletePlanes();
505       createPlanes();
506     }
507   }
508 }
509
510 //------------------------------------------------------------------------------
511 QString VisuGUI_CutSegmentDlg::GetContextHelpFilePath()
512 {
513   return "cut_segment_page.html";
514 }