Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

GUI/Widgets/vtkKWThumbWheel.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Module:    $RCSfile: vtkKWThumbWheel.h,v $
00004 
00005   Copyright (c) Kitware, Inc.
00006   All rights reserved.
00007   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00021 #ifndef __vtkKWThumbWheel_h
00022 #define __vtkKWThumbWheel_h
00023 
00024 #include "vtkKWCompositeWidget.h"
00025 
00026 class vtkKWApplication;
00027 class vtkKWLabel;
00028 class vtkKWEntry;
00029 class vtkKWPushButton;
00030 class vtkKWTopLevel;
00031 
00032 class KWWIDGETS_EXPORT vtkKWThumbWheel : public vtkKWCompositeWidget
00033 {
00034 public:
00035   static vtkKWThumbWheel* New();
00036   vtkTypeRevisionMacro(vtkKWThumbWheel,vtkKWCompositeWidget);
00037   void PrintSelf(ostream& os, vtkIndent indent);
00038 
00040   virtual void Create(vtkKWApplication *app);
00041 
00043 
00044   virtual void SetValue(double v);
00045   vtkGetMacro(Value, double);
00047 
00049 
00051   vtkSetMacro(MinimumValue, double);
00052   vtkGetMacro(MinimumValue, double);
00053   vtkSetMacro(ClampMinimumValue, int);
00054   vtkGetMacro(ClampMinimumValue, int);
00055   vtkBooleanMacro(ClampMinimumValue, int);  
00057 
00059 
00061   vtkSetMacro(MaximumValue, double);
00062   vtkGetMacro(MaximumValue, double);
00063   vtkSetMacro(ClampMaximumValue, int);
00064   vtkGetMacro(ClampMaximumValue, int);
00065   vtkBooleanMacro(ClampMaximumValue, int);  
00067 
00069 
00070   virtual void SetRange(double min, double max)
00071     { this->SetMinimumValue(min); this->SetMaximumValue(max); };
00072   virtual void SetRange(const double *range) 
00073     { this->SetRange(range[0], range[1]); };
00075 
00077 
00080   virtual void SetResolution(double r);
00081   vtkGetMacro(Resolution, double);
00083   
00085 
00087   enum
00088   {
00089     InteractionModeNone = 0,
00090     InteractionModeLinearMotion,
00091     InteractionModeNonLinearMotion,
00092     InteractionModeToggleCenterIndicator
00093   };
00094   //ETX
00095   virtual void SetInteractionMode(int mode, int v);
00096   virtual int GetInteractionMode(int mode);
00097   virtual void SetInteractionModeToNone(int mode) 
00098     { this->SetInteractionMode(
00099       mode, vtkKWThumbWheel::InteractionModeNone); };
00100   virtual void SetInteractionModeToLinear(int mode) 
00101     { this->SetInteractionMode(
00102       mode, vtkKWThumbWheel::InteractionModeLinearMotion); };
00103   virtual void SetInteractionModeToNonLinear(int mode) 
00104     { this->SetInteractionMode(
00105       mode, vtkKWThumbWheel::InteractionModeNonLinearMotion); };
00106   virtual void SetInteractionModeToToggleCenterIndicator(int mode) 
00107     { this->SetInteractionMode(
00108       mode, vtkKWThumbWheel::InteractionModeToggleCenterIndicator); };
00109   virtual char *GetInteractionModeAsString(int mode);
00111 
00113 
00119   vtkSetMacro(LinearThreshold, double);
00120   vtkGetMacro(LinearThreshold, double);
00122 
00124 
00127   vtkSetMacro(NonLinearMaximumMultiplier, double);
00128   vtkGetMacro(NonLinearMaximumMultiplier, double);
00130 
00132 
00134   virtual void SetThumbWheelWidth(int v);
00135   vtkGetMacro(ThumbWheelWidth, int);
00136   virtual void SetThumbWheelHeight(int v);
00137   vtkGetMacro(ThumbWheelHeight, int);
00138   virtual void SetThumbWheelSize(int w, int h) 
00139     { this->SetThumbWheelWidth(w); this->SetThumbWheelHeight(h); };
00140   virtual void SetLength(int v) { this->SetThumbWheelWidth(v); };
00142 
00144 
00148   virtual void SetResizeThumbWheel(int flag);
00149   vtkGetMacro(ResizeThumbWheel, int);
00150   vtkBooleanMacro(ResizeThumbWheel, int);
00151   void ResizeThumbWheelCallback();
00153 
00155 
00158   vtkSetMacro(DisplayThumbWheelPositionIndicator, int);
00159   vtkGetMacro(DisplayThumbWheelPositionIndicator, int);
00160   vtkBooleanMacro(DisplayThumbWheelPositionIndicator, int);  
00161   vtkSetVector3Macro(ThumbWheelPositionIndicatorColor, double);
00162   vtkGetVectorMacro(ThumbWheelPositionIndicatorColor, double, 3);
00164 
00166 
00168   virtual void SetDisplayThumbWheelCenterIndicator(int flag);
00169   vtkGetMacro(DisplayThumbWheelCenterIndicator, int);
00170   vtkBooleanMacro(DisplayThumbWheelCenterIndicator, int);  
00171   virtual void ToggleDisplayThumbWheelCenterIndicator();
00173 
00175 
00179   virtual void SetSizeOfNotches(double v);
00180   vtkGetMacro(SizeOfNotches, double);
00182 
00184 
00185   virtual void SetDisplayEntry(int flag);
00186   vtkGetMacro(DisplayEntry, int);
00187   vtkBooleanMacro(DisplayEntry, int);  
00188   vtkGetObjectMacro(Entry, vtkKWEntry);
00190 
00192 
00193   virtual void SetDisplayLabel(int flag);
00194   vtkGetMacro(DisplayLabel, int);
00195   vtkBooleanMacro(DisplayLabel, int);  
00196   virtual vtkKWLabel* GetLabel();
00198 
00200 
00202   virtual void SetDisplayEntryAndLabelOnTop(int flag);
00203   vtkGetMacro(DisplayEntryAndLabelOnTop, int);
00204   vtkBooleanMacro(DisplayEntryAndLabelOnTop, int);  
00206 
00208 
00210   vtkSetMacro(PopupMode, int);
00211   vtkGetMacro(PopupMode, int);
00212   vtkBooleanMacro(PopupMode, int);  
00213   void DisplayPopupCallback();
00214   void WithdrawPopupCallback();
00215   vtkGetObjectMacro(PopupPushButton, vtkKWPushButton);
00217 
00219 
00223   virtual void SetExpandEntry(int flag);
00224   vtkGetMacro(ExpandEntry, int);
00225   vtkBooleanMacro(ExpandEntry, int);  
00227 
00229 
00233   virtual void SetCommand(vtkObject* Object, const char *arg);
00234   virtual void SetStartCommand(vtkObject* Object, const char *arg);
00235   virtual void SetEndCommand(vtkObject* Object, const char *arg);
00236   virtual void SetEntryCommand (vtkObject* Object, const char *arg);
00237   virtual void InvokeCommand();
00238   virtual void InvokeStartCommand();
00239   virtual void InvokeEndCommand();
00240   virtual void InvokeEntryCommand();
00242 
00245   virtual void SetBalloonHelpString(const char *str);
00246 
00248 
00250   void Bind();
00251   void UnBind();
00253 
00255 
00257   virtual void EntryValueCallback();
00258   virtual void StartLinearMotionCallback();
00259   virtual void PerformLinearMotionCallback();
00260   virtual void StartNonLinearMotionCallback();
00261   virtual void PerformNonLinearMotionCallback();
00262   virtual void StopMotionCallback();
00264 
00271   virtual void UpdateEnableState();
00272 
00273 protected:
00274   vtkKWThumbWheel();
00275   ~vtkKWThumbWheel();
00276 
00277   double      Value;
00278   double      MinimumValue;
00279   int         ClampMinimumValue;
00280   double      MaximumValue;
00281   int         ClampMaximumValue;
00282   double      Resolution;
00283   double      NonLinearMaximumMultiplier;
00284   double      LinearThreshold;
00285 
00286   int         ThumbWheelWidth;
00287   int         ThumbWheelHeight;
00288   double      SizeOfNotches;
00289   double      ThumbWheelPositionIndicatorColor[3];
00290 
00291   int         ResizeThumbWheel;
00292   int         DisplayLabel;
00293   int         DisplayEntry;
00294   int         DisplayEntryAndLabelOnTop;
00295   int         DisplayThumbWheelPositionIndicator;
00296   int         DisplayThumbWheelCenterIndicator;
00297   int         PopupMode;
00298   int         ExpandEntry;
00299 
00300   char        *Command;
00301   char        *StartCommand;
00302   char        *EndCommand;
00303   char        *EntryCommand;
00304 
00305   double      ThumbWheelShift;
00306 
00307   int         InteractionModes[3];
00308 
00309   vtkKWLabel    *ThumbWheel;
00310   vtkKWEntry    *Entry;
00311   vtkKWLabel    *Label;
00312   vtkKWTopLevel *TopLevel;
00313   vtkKWPushButton *PopupPushButton;
00314 
00315   void CreateEntry();
00316   void CreateLabel();
00317   void UpdateThumbWheelImage(double pos = -1.0);
00318   void PackWidget();
00319   double GetMousePositionInThumbWheel();
00320 
00321   //BTX
00322 
00323   int State;
00324   enum WidgetState
00325   {
00326     Idle,
00327     InMotion
00328   };
00329   
00330   class LinearMotionState
00331   {
00332   public:
00333     double Value;
00334     double ThumbWheelShift;
00335     double MousePosition;
00336     int InPerform;
00337   };
00338 
00339   class NonLinearMotionState
00340   {
00341   public:
00342     double Value;
00343     double Increment;
00344     int InPerform;
00345   };
00346   //ETX
00347 
00348   LinearMotionState StartLinearMotionState;
00349   NonLinearMotionState StartNonLinearMotionState;
00350 
00351   int InInvokeCommand;
00352 
00353   void RefreshValue();
00354 
00355 private:
00356   vtkKWThumbWheel(const vtkKWThumbWheel&); // Not implemented
00357   void operator=(const vtkKWThumbWheel&); // Not implemented
00358 };
00359 
00360 #endif
00361 

Generated on Tue May 30 12:31:44 2006 for ParaView by doxygen 1.3.5