Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef VISU_ScalarBarCtrl_HeaderFile
00029 #define VISU_ScalarBarCtrl_HeaderFile
00030
00031 #include "VISUPipeline.hxx"
00032
00033 #include <vtkObject.h>
00034
00035 #include "VTKViewer.h"
00036
00037 class vtkRenderer;
00038 class VISU_LookupTable;
00039 class VISU_ScalarBarActor;
00040
00041 class VISU_PIPELINE_EXPORT VISU_ScalarBarCtrl : public vtkObject
00042 {
00043 public:
00044 vtkTypeMacro(VISU_ScalarBarCtrl, vtkObject);
00045 static
00046 VISU_ScalarBarCtrl*
00047 New();
00048
00049 enum EMode {eSimple, eGlobal, eLocal};
00050
00051
00052 void
00053 SetMode(EMode theMode);
00054
00055 EMode
00056 GetMode() const;
00057
00058
00059 void
00060 SetRangeGlobal(vtkFloatingPointType theMin,
00061 vtkFloatingPointType theMax);
00062 void
00063 SetRangeGlobal(vtkFloatingPointType *theRange);
00064
00065 void
00066 SetGlobalRangeIsDefined(bool theIsDefined);
00067
00068 void
00069 SetRangeLocal(vtkFloatingPointType theMin,
00070 vtkFloatingPointType theMax);
00071 void
00072 SetRangeLocal(vtkFloatingPointType *theRange);
00073
00074
00075 VISU_ScalarBarActor*
00076 GetLocalBar();
00077
00078 VISU_LookupTable*
00079 GetLocalTable();
00080
00081 VISU_ScalarBarActor*
00082 GetGlobalBar();
00083
00084 VISU_LookupTable*
00085 GetGlobalTable();
00086
00087
00088 void
00089 AddToRender(vtkRenderer* theRenderer);
00090
00091 void
00092 RemoveFromRender(vtkRenderer* theRenderer);
00093
00094
00095 void
00096 SetVisibility(int theFlag);
00097
00098 int
00099 GetVisibility() const;
00100
00101
00102 void
00103 SetCtrlVisibility(int theFlag);
00104
00105 int
00106 GetCtrlVisibility() const;
00107
00108
00109 void Update();
00110
00111
00112 void
00113 SetWidth(const vtkFloatingPointType theWidth);
00114
00115 vtkFloatingPointType
00116 GetWidth() const;
00117
00118 void
00119 SetHeight(const vtkFloatingPointType theHeight);
00120
00121 vtkFloatingPointType
00122 GetHeight() const;
00123
00124 void
00125 SetPosition(const vtkFloatingPointType* thePosition);
00126
00127 const vtkFloatingPointType*
00128 GetPosition() const;
00129
00130
00131 void
00132 SetSpacing(const vtkFloatingPointType theSpacing);
00133
00134 vtkFloatingPointType
00135 GetSpacing() const;
00136
00137
00138 bool
00139 GetBicolor() const;
00140
00141 void
00142 SetBicolor(const bool theBicolor);
00143
00144
00145 void
00146 SetMarkValue(const vtkFloatingPointType theValue);
00147
00148 vtkFloatingPointType
00149 GetMarkValue() const;
00150
00151 void
00152 SetIsMarked(const bool theFlag);
00153
00154 bool
00155 GetIsMarked()const;
00156
00157 protected:
00158 VISU_ScalarBarCtrl();
00159
00160 virtual
00161 ~VISU_ScalarBarCtrl();
00162
00163 void
00164 UpdateForBicolor();
00165
00166 void
00167 UpdateForColor();
00168
00169 void
00170 UpdateMarkValue();
00171
00172 void
00173 PrepareTables();
00174
00175 void
00176 PrepareTables(VISU_ScalarBarActor* theScalarBarActor,
00177 VISU_LookupTable *theLookupTable,
00178 vtkIdType theId);
00179
00180 protected:
00181 EMode myMode;
00182 bool myGlobalRangeIsDefined;
00183
00184 vtkFloatingPointType myDistance;
00185 vtkFloatingPointType myPosition[2];
00186 bool myBicolor;
00187 int myCtrlVisibility;
00188
00189 unsigned char myBlack[3];
00190 unsigned char myGrey[3];
00191
00192 bool myMarked;
00193 vtkFloatingPointType myMarkedValue;
00194
00195 VISU_ScalarBarActor *myGlobalScalarBar;
00196 VISU_LookupTable *myGlobalLookupTable;
00197
00198 VISU_ScalarBarActor *myLocalScalarBar;
00199 VISU_LookupTable *myLocalLookupTable;
00200 };
00201
00202 #endif