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