1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
23 // File: VISU_ScalarBarCtrl.hxx
24 // Author: Peter KURNEV
27 #ifndef VISU_ScalarBarCtrl_HeaderFile
28 #define VISU_ScalarBarCtrl_HeaderFile
30 #include <vtkObject.h>
34 class vtkScalarBarActor;
36 class VISU_ScalarBarCtrl : public vtkObject
39 vtkTypeMacro(VISU_ScalarBarCtrl, vtkObject);
40 static VISU_ScalarBarCtrl* New();
42 enum EMode {eSimple, eGlobal, eLocal};
45 void SetMode(EMode theMode);
46 EMode GetMode() const;
49 void SetRangeGlobal(float theMin,
51 void SetRangeGlobal(float *theRange);
53 void SetGlobalRangeIsDefined(bool theIsDefined);
55 void SetRangeLocal(float theMin,
57 void SetRangeLocal(float *theRange);
60 vtkScalarBarActor* GetLocalBar();
61 vtkLookupTable* GetLocalTable();
63 vtkScalarBarActor* GetGlobalBar();
64 vtkLookupTable* GetGlobalTable();
67 void AddToRender(vtkRenderer* theRenderer);
68 void RemoveFromRender(vtkRenderer* theRenderer);
71 void SetVisibility(int theFlag);
72 int GetVisibility() const;
75 void SetCtrlVisibility(int theFlag);
76 int GetCtrlVisibility() const;
82 void SetWidth(const float theWidth);
83 float GetWidth()const;
84 void SetHeight(const float theHeight);
85 float GetHeight()const;
86 void SetPosition(const float* thePosition);
87 const float* GetPosition()const;
90 void SetSpacing(const float theSpacing);
91 float GetSpacing()const;
94 bool GetBicolor() const;
95 void SetBicolor(const bool theBicolor);
98 void SetMarkValue (const float theValue);
99 float GetMarkValue ()const;
100 void SetIsMarked(const bool theFlag);
101 bool GetIsMarked()const;
104 VISU_ScalarBarCtrl();
105 virtual ~VISU_ScalarBarCtrl();
107 void UpdateForBicolor();
108 void UpdateForColor();
109 void UpdateMarkValue();
110 void PrepareTables();
112 void PrepareTables(vtkScalarBarActor* theScalarBarActor,
113 vtkLookupTable *theLookupTable,
118 bool myGlobalRangeIsDefined;
123 int myCtrlVisibility;
125 unsigned char myBlack[3];
126 unsigned char myGrey[3];
131 vtkScalarBarActor *myGlobalScalarBar;
132 vtkLookupTable *myGlobalLookupTable;
134 vtkScalarBarActor *myLocalScalarBar;
135 vtkLookupTable *myLocalLookupTable;