Salome HOME
Update copyrights 2014.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_PropertiesDlg.cxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : SMESHGUI_PropertiesDlg.cxx
23 //  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
24
25 #include "SMESHGUI_PropertiesDlg.h"
26 #include "SMESH_Actor.h"
27
28 #include <QCheckBox>
29 #include <QFrame>
30 #include <QGroupBox>
31 #include <QHBoxLayout>
32 #include <QLabel>
33
34 #include <QtxBiColorTool.h>
35 #include <QtxColorButton.h>
36 #include <QtxIntSpinBox.h>
37 #include <VTKViewer_MarkerWidget.h>
38 #include <SUIT_Session.h>
39 #include <LightApp_Application.h>
40
41 const int MARGIN  = 9;
42 const int SPACING = 6;
43
44 /*!
45   \class SMESHGUI_PropertiesDlg
46   \brief Dialog box to set-up mesh presentation properties: colors,
47   sizes of elements, width of lines etc
48 */
49
50 /*
51   \brief Constructor
52   \param customMarkers custom node markers
53   \param parent parent widget
54 */
55 SMESHGUI_PropertiesDlg::SMESHGUI_PropertiesDlg( const VTK::MarkerMap& customMarkers, QWidget* parent )
56   : SMESHGUI_Dialog( parent, true, true, Standard )
57 {
58   // set title
59   setWindowTitle( tr( "TITLE" ) );
60   
61   // create widgets
62
63   QHBoxLayout* hl;
64   int widthLab1 = 0, widthLab2 = 0;
65
66   // -- node controls
67   myNodeGrp = new QGroupBox( tr( "NODES" ), mainFrame() );
68   QLabel* nodeColorLab = new QLabel( tr( "COLOR" ), myNodeGrp );
69   myNodeColor = new QtxColorButton( myNodeGrp );
70   myNodeMarker = new VTKViewer_MarkerWidget( myNodeGrp );
71   hl = new QHBoxLayout( myNodeGrp );
72   hl->setMargin( MARGIN );
73   hl->setSpacing( SPACING );
74   hl->addWidget( nodeColorLab );
75   hl->addWidget( myNodeColor );
76   hl->addWidget( myNodeMarker );
77   widthLab1 = qMax( widthLab1, nodeColorLab->minimumSizeHint().width() );
78   widthLab2 = qMax( widthLab2, myNodeMarker->typeLabel()->minimumSizeHint().width() );
79
80   // -- edge controls
81   myEdgeGrp = new QGroupBox( tr( "EDGES" ), mainFrame() );
82   QLabel* edgeColorLab = new QLabel( tr( "COLOR" ), myEdgeGrp );
83   myEdgeColor = new QtxColorButton( myEdgeGrp );
84   QLabel* edgeWidthLab = new QLabel( tr( "WIDTH" ), myEdgeGrp );
85   myEdgeWidth = new QtxIntSpinBox( myEdgeGrp );
86   hl = new QHBoxLayout( myEdgeGrp );
87   hl->setMargin( MARGIN );
88   hl->setSpacing( SPACING );
89   hl->addWidget( edgeColorLab );
90   hl->addWidget( myEdgeColor );
91   hl->addWidget( edgeWidthLab );
92   hl->addWidget( myEdgeWidth );
93   widthLab1 = qMax( widthLab1, edgeColorLab->minimumSizeHint().width() );
94   widthLab2 = qMax( widthLab2, edgeWidthLab->minimumSizeHint().width() );
95   
96   // -- face controls
97   myFaceGrp = new QGroupBox( tr( "FACES" ), mainFrame() );
98   QLabel* faceColorLab = new QLabel( tr( "FACE_FRONT" ), myFaceGrp );
99   myFaceColor = new QtxBiColorTool( myFaceGrp );
100   myFaceColor->label()->setText( tr( "FACE_BACK" ) );
101   hl = new QHBoxLayout( myFaceGrp );
102   hl->setMargin( MARGIN );
103   hl->setSpacing( SPACING );
104   hl->addWidget( faceColorLab );
105   hl->addWidget( myFaceColor );
106   widthLab1 = qMax( widthLab1, faceColorLab->minimumSizeHint().width() );
107   widthLab2 = qMax( widthLab2, myFaceColor->label()->minimumSizeHint().width() );
108   
109   // -- volumes
110   myVolumeGrp = new QGroupBox( tr( "VOLUMES" ), mainFrame() );
111   QLabel* volumeColorLab = new QLabel( tr( "VOLUME_NORMAL" ), myVolumeGrp );
112   myVolumeColor = new QtxBiColorTool( myVolumeGrp );
113   myVolumeColor->label()->setText( tr( "VOLUME_REVERSED" ) );
114   hl = new QHBoxLayout( myVolumeGrp );
115   hl->setMargin( MARGIN );
116   hl->setSpacing( SPACING );
117   hl->addWidget( volumeColorLab );
118   hl->addWidget( myVolumeColor );
119   widthLab1 = qMax( widthLab1, volumeColorLab->minimumSizeHint().width() );
120   widthLab2 = qMax( widthLab2, myVolumeColor->label()->minimumSizeHint().width() );
121
122   // -- outline controls
123   myOutlineGrp = new QGroupBox( tr( "OUTLINES" ), mainFrame() );
124   QLabel* outlineColorLab = new QLabel( tr( "COLOR" ), myOutlineGrp );
125   myOutlineColor = new QtxColorButton( myOutlineGrp );
126   QLabel* outlineWidthLab = new QLabel( tr( "WIDTH" ), myOutlineGrp );
127   myOutlineWidth = new QtxIntSpinBox( myOutlineGrp );
128   hl = new QHBoxLayout( myOutlineGrp );
129   hl->setMargin( MARGIN );
130   hl->setSpacing( SPACING );
131   hl->addWidget( outlineColorLab );
132   hl->addWidget( myOutlineColor );
133   hl->addWidget( outlineWidthLab );
134   hl->addWidget( myOutlineWidth );
135   widthLab1 = qMax( widthLab1, outlineColorLab->minimumSizeHint().width() );
136   widthLab2 = qMax( widthLab2, outlineWidthLab->minimumSizeHint().width() );
137
138   // -- 0d element controls
139   myElem0dGrp = new QGroupBox( tr( "0D_ELEMENTS" ), mainFrame() );
140   QLabel* elem0dColorLab = new QLabel( tr( "COLOR" ), myElem0dGrp );
141   myElem0dColor = new QtxColorButton( myElem0dGrp );
142   QLabel* elem0dSizeLab = new QLabel( tr( "SIZE" ), myElem0dGrp );
143   myElem0dSize = new QtxIntSpinBox( myElem0dGrp );
144   hl = new QHBoxLayout( myElem0dGrp );
145   hl->setMargin( MARGIN );
146   hl->setSpacing( SPACING );
147   hl->addWidget( elem0dColorLab );
148   hl->addWidget( myElem0dColor );
149   hl->addWidget( elem0dSizeLab );
150   hl->addWidget( myElem0dSize );
151   widthLab1 = qMax( widthLab1, elem0dColorLab->minimumSizeHint().width() );
152   widthLab2 = qMax( widthLab2, elem0dSizeLab->minimumSizeHint().width() );
153   
154   // -- ball controls
155   myBallGrp = new QGroupBox( tr( "BALLS" ), mainFrame() );
156   QLabel* ballColorLab = new QLabel( tr( "COLOR" ), myBallGrp );
157   myBallColor = new QtxColorButton( myBallGrp );
158   QLabel* ballSizeLab = new QLabel( tr( "SIZE" ), myBallGrp );
159   myBallSize = new QtxIntSpinBox( myBallGrp );
160   hl = new QHBoxLayout( myBallGrp );
161   hl->setMargin( MARGIN );
162   hl->setSpacing( SPACING );
163   hl->addWidget( ballColorLab );
164   hl->addWidget( myBallColor );
165   hl->addWidget( ballSizeLab );
166   hl->addWidget( myBallSize );
167   widthLab1 = qMax( widthLab1, ballColorLab->minimumSizeHint().width() );
168   widthLab2 = qMax( widthLab2, ballSizeLab->minimumSizeHint().width() );
169   
170   // -- orientation vector controls
171   myOrientationGrp = new QGroupBox( tr( "ORIENTATIONS" ), mainFrame() );
172   QLabel* orientationColorLab = new QLabel( tr( "COLOR" ), myOrientationGrp );
173   myOrientationColor = new QtxColorButton( myOrientationGrp );
174   QLabel* orientationScaleLab = new QLabel( tr( "ORIENTATION_SCALE" ), myOrientationGrp );
175   myOrientationSize = new QtxIntSpinBox( myOrientationGrp );
176   myOrientationSize->setSuffix( "% ");
177   myOrientation3d = new QCheckBox( tr("ORIENTATION_3D"), myOrientationGrp );
178   hl = new QHBoxLayout( myOrientationGrp );
179   hl->setMargin( MARGIN );
180   hl->setSpacing( SPACING );
181   hl->addWidget( orientationColorLab );
182   hl->addWidget( myOrientationColor );
183   hl->addWidget( orientationScaleLab );
184   hl->addWidget( myOrientationSize );
185   hl->addWidget( myOrientation3d );
186   widthLab1 = qMax( widthLab1, orientationColorLab->minimumSizeHint().width() );
187   widthLab2 = qMax( widthLab2, orientationScaleLab->minimumSizeHint().width() );
188
189   // -- other controls
190   myExtraGrp = new QFrame( mainFrame() );
191   QLabel* shrinkSizeLab = new QLabel( tr( "SHRINK" ), myExtraGrp );
192   myShrinkSize = new QtxIntSpinBox( myExtraGrp );
193   myShrinkSize->setSuffix( "% ");
194   hl = new QHBoxLayout( myExtraGrp );
195   hl->setMargin( MARGIN );
196   hl->setSpacing( SPACING );
197   hl->addWidget( shrinkSizeLab );
198   hl->addWidget( myShrinkSize );
199   hl->addStretch();
200   widthLab1 = qMax( widthLab1, shrinkSizeLab->minimumSizeHint().width() );
201
202   // layout widgets
203   QVBoxLayout* vl = new QVBoxLayout( mainFrame() );
204   vl->setMargin( 0 );
205   vl->setSpacing( SPACING );
206   vl->addWidget( myNodeGrp );
207   vl->addWidget( myEdgeGrp );
208   vl->addWidget( myFaceGrp );
209   vl->addWidget( myVolumeGrp );
210   vl->addWidget( myOutlineGrp );
211   vl->addWidget( myElem0dGrp );
212   vl->addWidget( myBallGrp );
213   vl->addWidget( myOrientationGrp );
214   vl->addWidget( myExtraGrp );
215   
216   nodeColorLab->setMinimumWidth( widthLab1 );
217   edgeColorLab->setMinimumWidth( widthLab1 );
218   faceColorLab->setMinimumWidth( widthLab1 );
219   volumeColorLab->setMinimumWidth( widthLab1 );
220   outlineColorLab->setMinimumWidth( widthLab1 );
221   elem0dColorLab->setMinimumWidth( widthLab1 );
222   ballColorLab->setMinimumWidth( widthLab1 );
223   orientationColorLab->setMinimumWidth( widthLab1 );
224   shrinkSizeLab->setMinimumWidth( widthLab1 );
225
226   myNodeMarker->typeLabel()->setMinimumWidth( widthLab2 );
227   edgeWidthLab->setMinimumWidth( widthLab2 );
228   myFaceColor->label()->setMinimumWidth( widthLab2 );
229   myVolumeColor->label()->setMinimumWidth( widthLab2 );
230   outlineWidthLab->setMinimumWidth( widthLab2 );
231   elem0dSizeLab->setMinimumWidth( widthLab2 );
232   ballSizeLab->setMinimumWidth( widthLab2 );
233   orientationScaleLab->setMinimumWidth( widthLab2 );
234
235   myEdgeWidth->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
236   myOutlineWidth->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
237   myElem0dSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
238   myBallSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
239   myOrientationSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
240   myShrinkSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
241
242   // initialize widgets
243   myNodeMarker->setCustomMarkers( customMarkers );
244   myElem0dSize->setRange( 1, 10 );
245   myBallSize->setRange( 1, 10 );
246   myEdgeWidth->setRange( 1, 5 );
247   myOutlineWidth->setRange( 1, 5 );
248   myShrinkSize->setRange( 20, 100 );
249   myOrientationSize->setRange( 5, 100 );
250
251   button( OK )->setText( tr( "SMESH_BUT_OK" ) );
252
253   connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
254 }
255
256 /*
257   \brief Destructor: clean-up resources if necessary
258 */
259 SMESHGUI_PropertiesDlg::~SMESHGUI_PropertiesDlg()
260 {
261 }
262
263 /*!
264   \brief Set nodes color
265   \param color nodes color
266 */
267 void SMESHGUI_PropertiesDlg::setNodeColor( const QColor& color )
268 {
269   myNodeColor->setColor( color );
270 }
271
272 /*!
273   \brief Get nodes color
274   \return current nodes color
275 */
276 QColor SMESHGUI_PropertiesDlg::nodeColor() const
277 {
278   return myNodeColor->color();
279 }
280
281 /*!
282   \brief Set standard nodes marker
283   \param type standard nodes marker type
284   \param scale standard nodes marker scale
285 */
286 void SMESHGUI_PropertiesDlg::setNodeMarker( VTK::MarkerType type, VTK::MarkerScale scale )
287 {
288   myNodeMarker->setMarker( type, scale );
289 }
290
291 /*!
292   \brief Set custom nodes marker
293   \param id custom nodes marker id
294 */
295 void SMESHGUI_PropertiesDlg::setNodeCustomMarker( int id )
296 {
297   myNodeMarker->setCustomMarker( id );
298 }
299
300 /*!
301   \brief Get nodes marker type.
302   For custom marker, VTK::MT_USER is returned and markerId() function
303   then returns its identifier.
304   \return currently selected nodes marker type
305 */
306 VTK::MarkerType SMESHGUI_PropertiesDlg::nodeMarkerType() const
307 {
308   return myNodeMarker->markerType();
309 }
310
311 /*!
312   \brief Get nodes marker scale.
313   For custom marker return value is undefined.
314   \return currently selected nodes marker scale
315 */
316 VTK::MarkerScale SMESHGUI_PropertiesDlg::nodeMarkerScale() const
317 {
318   return myNodeMarker->markerScale();
319 }
320
321 /*!
322   \brief Get custom nodes marker.
323   For standard markers return value is VTK::MT_NONE.
324   \return custom nodes marker id
325 */
326 int SMESHGUI_PropertiesDlg::nodeMarkerId() const
327 {
328   return myNodeMarker->markerId();
329 }
330
331 /*!
332   \brief Set edges (wireframe) color
333   \param color edges color
334 */
335 void SMESHGUI_PropertiesDlg::setEdgeColor( const QColor& color )
336 {
337   myEdgeColor->setColor( color );
338 }
339
340 /*!
341   \brief Get edges (wireframe) color
342   \return current edges color
343 */
344 QColor SMESHGUI_PropertiesDlg::edgeColor() const
345 {
346   return myEdgeColor->color();
347 }
348
349 /*!
350   \brief Set edges width
351   \param width edges width
352 */
353 void SMESHGUI_PropertiesDlg::setEdgeWidth( int width )
354 {
355   myEdgeWidth->setValue( width );
356 }
357
358 /*!
359   \brief Get edges width
360   \return current edges width
361 */
362 int SMESHGUI_PropertiesDlg::edgeWidth() const
363 {
364   return myEdgeWidth->value();
365 }
366
367 /*!
368   \brief Set faces colors
369   \param color front faces color
370   \param delta back faces coloring delta
371 */
372 void SMESHGUI_PropertiesDlg::setFaceColor( const QColor& color, int delta )
373 {
374   myFaceColor->setMainColor( color );
375   myFaceColor->setDelta( delta );
376 }
377
378 /*!
379   \brief Get front faces color
380   \return current front faces color
381 */
382 QColor SMESHGUI_PropertiesDlg::faceColor() const
383 {
384   return myFaceColor->mainColor();
385 }
386
387 /*!
388   \brief Get back faces coloring delta
389   \return current back faces coloring delta
390 */
391 int SMESHGUI_PropertiesDlg::faceColorDelta() const
392 {
393   return myFaceColor->delta();
394 }
395
396 /*!
397   \brief Set volumes colors
398   \param color normal volumes color
399   \param delta reversed volumes coloring delta
400 */
401 void SMESHGUI_PropertiesDlg::setVolumeColor( const QColor& color, int delta )
402 {
403   myVolumeColor->setMainColor( color );
404   myVolumeColor->setDelta( delta );
405 }
406
407 /*!
408   \brief Get normal volumes color
409   \return current normal volumes color
410 */
411 QColor SMESHGUI_PropertiesDlg::volumeColor() const
412 {
413   return myVolumeColor->mainColor();
414 }
415
416 /*!
417   \brief Get reversed volumes coloring delta
418   \return current reversed volumes coloring delta
419 */
420 int SMESHGUI_PropertiesDlg::volumeColorDelta() const
421 {
422   return myVolumeColor->delta();
423 }
424
425 /*!
426   \brief Set outlines color
427   \param color outlines color
428 */
429 void SMESHGUI_PropertiesDlg::setOutlineColor( const QColor& color )
430 {
431   myOutlineColor->setColor( color );
432 }
433
434 /*!
435   \brief Get outlines color
436   \return current outlines color
437 */
438 QColor SMESHGUI_PropertiesDlg::outlineColor() const
439 {
440   return myOutlineColor->color();
441 }
442
443 /*!
444   \brief Set outlines width
445   \param width outlines width
446 */
447 void SMESHGUI_PropertiesDlg::setOutlineWidth( int width )
448 {
449   myOutlineWidth->setValue( width );
450 }
451
452 /*!
453   \brief Get outlines width
454   \return current outlines width
455 */
456 int SMESHGUI_PropertiesDlg::outlineWidth() const
457 {
458   return myOutlineWidth->value();
459 }
460
461 /*!
462   \brief Set 0D elements color
463   \param color 0D elements color
464 */
465 void SMESHGUI_PropertiesDlg::setElem0dColor( const QColor& color )
466 {
467   myElem0dColor->setColor( color );
468 }
469
470 /*!
471   \brief Get 0D elements color
472   \return current 0D elements color
473 */
474 QColor SMESHGUI_PropertiesDlg::elem0dColor() const
475 {
476   return myElem0dColor->color();
477 }
478
479 /*!
480   \brief Set 0D elements size
481   \param size 0D elements size
482 */
483 void SMESHGUI_PropertiesDlg::setElem0dSize( int size )
484 {
485   myElem0dSize->setValue( size );
486 }
487
488 /*!
489   \brief Get 0D elements size
490   \return current 0D elements size
491 */
492 int SMESHGUI_PropertiesDlg::elem0dSize() const
493 {
494   return myElem0dSize->value();
495 }
496
497 /*!
498   \brief Set discrete elements (balls) color
499   \param color discrete elements (balls) color
500 */
501 void SMESHGUI_PropertiesDlg::setBallColor( const QColor& color )
502 {
503   myBallColor->setColor( color );
504 }
505
506 /*!
507   \brief Get discrete elements (balls) color
508   \return current discrete elements (balls) color
509 */
510 QColor SMESHGUI_PropertiesDlg::ballColor() const
511 {
512   return myBallColor->color();
513 }
514
515 /*!
516   \brief Set discrete elements (balls) size
517   \param size discrete elements (balls) size
518 */
519 void SMESHGUI_PropertiesDlg::setBallSize( int size )
520 {
521   myBallSize->setValue( size );
522 }
523
524 /*!
525   \brief Get discrete elements (balls) size
526   \return current discrete elements (balls) size
527 */
528 int SMESHGUI_PropertiesDlg::ballSize() const
529 {
530   return myBallSize->value();
531 }
532
533 /*!
534   \brief Set orientation vectors color
535   \param color orientation vectors color
536 */
537 void SMESHGUI_PropertiesDlg::setOrientationColor( const QColor& color )
538 {
539   myOrientationColor->setColor( color );
540 }
541
542 /*!
543   \brief Get orientation vectors color
544   \return current orientation vectors color
545 */
546 QColor SMESHGUI_PropertiesDlg::orientationColor() const
547 {
548   return myOrientationColor->color();
549 }
550
551 /*!
552   \brief Set orientation vectors scale (percent)
553   \param scale orientation vectors scale
554 */
555 void SMESHGUI_PropertiesDlg::setOrientationSize( int scale )
556 {
557   myOrientationSize->setValue( scale );
558 }
559
560 /*!
561   \brief Get orientation vectors scale (percent)
562   \return current orientation vectors scale
563 */
564 int SMESHGUI_PropertiesDlg::orientationSize() const
565 {
566   return myOrientationSize->value();
567 }
568
569 /*!
570   \brief Set orientation vectors 3d flag
571   \param on orientation vectors 3d flag value
572 */
573 void SMESHGUI_PropertiesDlg::setOrientation3d( bool on )
574 {
575   myOrientation3d->setChecked( on );
576 }
577
578 /*!
579   \brief Get orientation vectors 3d flag
580   \return orientation vectors 3d flag value
581 */
582 bool SMESHGUI_PropertiesDlg::orientation3d() const
583 {
584   return myOrientation3d->isChecked();
585 }
586
587 /*!
588   \brief Set shrink coefficient (percent)
589   \param coef shrink coefficient
590 */
591 void SMESHGUI_PropertiesDlg::setShrinkCoef( int coef )
592 {
593   myShrinkSize->setValue( coef );
594 }
595
596 /*!
597   \brief Get shrink coefficient (percent)
598   \return current shrink coefficient
599 */
600 int SMESHGUI_PropertiesDlg::shrinkCoef() const
601 {
602   return myShrinkSize->value();
603 }
604
605 /*
606   \brief Get custom markers
607   \return custom markers map
608 */
609 VTK::MarkerMap SMESHGUI_PropertiesDlg::customMarkers() const
610 {
611   return myNodeMarker->customMarkers();
612 }
613
614 /*!
615   \brief Show / hide controls for specified entity type
616   \param elements mesh element types (an or-ed combination of flags)
617   \param nodes mesh nodes presence flag
618 */
619 void SMESHGUI_PropertiesDlg::showControls( int elements, bool nodes )
620 {
621   // node controls are supposed to be shown if at least any element type is present
622   // or if there are only nodes
623   myNodeGrp->setVisible( nodes || elements & SMESH_Actor::eAllEntity );
624   // edge/wireframe controls are needed for edges, faces and volumes
625   myEdgeGrp->setVisible( elements & ( SMESH_Actor::eEdges | SMESH_Actor::eFaces | SMESH_Actor::eVolumes ) );
626   // face controls are shown only if there are faces
627   myFaceGrp->setVisible( elements & SMESH_Actor::eFaces );
628   // volume controls are shown only if there are volumes
629   myVolumeGrp->setVisible( elements & SMESH_Actor::eVolumes );
630   // 0d elements controls are shown only if there are 0d elements
631   myElem0dGrp->setVisible( elements & SMESH_Actor::e0DElements );
632   // ball controls are shown only if there are balls
633   myBallGrp->setVisible( elements & SMESH_Actor::eBallElem );
634   // outline controls are needed for faces and volumes
635   myOutlineGrp->setVisible( elements & ( SMESH_Actor::eFaces | SMESH_Actor::eVolumes ) );
636   // orientation controls are needed for faces and volumes
637   myOrientationGrp->setVisible( elements & ( SMESH_Actor::eFaces | SMESH_Actor::eVolumes ) );
638   // shrink factor is shown if there are edges and/or faces and/or volumes
639   myExtraGrp->setVisible( elements & ( SMESH_Actor::eEdges | SMESH_Actor::eFaces | SMESH_Actor::eVolumes ) );
640 }
641
642 /*!
643   \brief Show online help on dialog box
644 */
645 void SMESHGUI_PropertiesDlg::onHelp()
646 {
647   LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
648   app->onHelpContextModule( "SMESH", "colors_size_page.html" );
649 }