+
+void HYDROGUI_VTKPrsDisplayer::SetZRange( const int theViewId, double theRange[] )
+{
+ myScalarBars[ theViewId ]->GetLookupTable()->SetRange( theRange );
+}
+
+double* HYDROGUI_VTKPrsDisplayer::GetZRange( const int theViewId ) const
+{
+ return myScalarBars[ theViewId ]->GetLookupTable()->GetRange();
+}
+
+void HYDROGUI_VTKPrsDisplayer::createScalarBar( const int theViewId )
+{
+ if ( !myScalarBars.contains( theViewId ) )
+ {
+ // The invalid value is used to identify the case when the table range is not initialized yet.
+ double anInvalidValue = HYDROGUI_VTKPrs::InvalidZValue();
+ vtkLookupTable* aTable = vtkLookupTable::New();
+ aTable->SetHueRange( HUE_START, HUE_END );
+ aTable->SetSaturationRange( SATURATION_START, SATURATION_END );
+ aTable->SetTableRange( anInvalidValue, anInvalidValue );
+ aTable->SetValueRange( 1.0, 1.0 );
+ aTable->SetAlphaRange( 1.0, 1.0 );
+ aTable->SetNumberOfColors( NB_COLORS );
+ aTable->Build();
+ vtkSmartPointer<vtkScalarBarActor> aScalarBar = vtkScalarBarActor::New();
+ aScalarBar->SetLookupTable( aTable );
+ aScalarBar->SetNumberOfLabels( NB_COLORS * 0.75 );
+ aScalarBar->SetWidth( aScalarBar->GetWidth() / 1.5 );
+ aScalarBar->SetTextureGridWidth( aScalarBar->GetTextureGridWidth() * 4. );
+ aScalarBar->SetTitle( " " );
+ // The call of SetTitle() with dummy string is a workaround necessary
+ // to avoid the problem with uninitialized variables in VTK scalar bar actor
+ // which leads to incorrect (very big) size of the VTK scalar bar presentation
+ aTable->Delete();
+ myScalarBars.insert( theViewId, aScalarBar );
+ }
+}