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

GUI/Widgets/vtkKWRange.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Module:    $RCSfile: vtkKWRange.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 =========================================================================*/
00027 #ifndef __vtkKWRange_h
00028 #define __vtkKWRange_h
00029 
00030 #include "vtkKWWidgetWithLabel.h"
00031 
00032 class vtkKWCanvas;
00033 class vtkKWEntry;
00034 class vtkKWFrame;
00035 class vtkKWPushButtonSet;
00036 
00037 class KWWIDGETS_EXPORT vtkKWRange : public vtkKWWidgetWithLabel
00038 {
00039 public:
00040   static vtkKWRange* New();
00041   vtkTypeRevisionMacro(vtkKWRange,vtkKWWidgetWithLabel);
00042   void PrintSelf(ostream& os, vtkIndent indent);
00043 
00045   virtual void Create(vtkKWApplication *app);
00046 
00048 
00049   vtkGetVector2Macro(WholeRange, double);
00050   virtual void SetWholeRange(double r0, double r1);
00051   virtual void SetWholeRange(double range[2]) 
00052     { this->SetWholeRange(range[0], range[1]); };
00054 
00056 
00057   vtkGetVector2Macro(Range, double);
00058   virtual void SetRange(double r0, double r1);
00059   virtual void SetRange(double *range) 
00060     { this->SetRange(range[0], range[1]); };
00062 
00064 
00066   virtual void GetRelativeRange(double &r0, double &r1);
00067   virtual void GetRelativeRange(double range[2])
00068     { this->GetRelativeRange(range[0], range[1]); };
00069   virtual void SetRelativeRange(double r0, double r1);
00070   virtual void SetRelativeRange(double range[2])
00071     { this->SetRelativeRange(range[0], range[1]); };
00073   
00075 
00087   virtual void SetResolution(double r);
00088   vtkGetMacro(Resolution, double);
00090 
00092 
00093   virtual void SetAdjustResolution(int);
00094   vtkBooleanMacro(AdjustResolution, int);
00095   vtkGetMacro(AdjustResolution, int);
00097   
00099 
00100   enum 
00101   {
00102     OrientationHorizontal = 0,
00103     OrientationVertical   = 1
00104   };
00105   //ETX
00106   virtual void SetOrientation(int);
00107   vtkGetMacro(Orientation, int);
00108   virtual void SetOrientationToHorizontal()
00109     { this->SetOrientation(vtkKWRange::OrientationHorizontal); };
00110   virtual void SetOrientationToVertical() 
00111     { this->SetOrientation(vtkKWRange::OrientationVertical); };
00113 
00115 
00117   virtual void SetInverted(int);
00118   vtkBooleanMacro(Inverted, int);
00119   vtkGetMacro(Inverted, int);
00121 
00123 
00126   virtual void SetThickness(int);
00127   vtkGetMacro(Thickness, int);
00129   
00131 
00134   virtual void SetInternalThickness(double);
00135   vtkGetMacro(InternalThickness, double);
00137   
00139 
00142   virtual void SetRequestedLength(int);
00143   vtkGetMacro(RequestedLength, int);
00145   
00147 
00148   virtual void SetSliderSize(int);
00149   vtkGetMacro(SliderSize, int);
00151   
00153 
00154   vtkSetMacro(SliderCanPush, int);
00155   vtkBooleanMacro(SliderCanPush, int);
00156   vtkGetMacro(SliderCanPush, int);
00158 
00160 
00162   vtkGetVector3Macro(RangeColor, double);
00163   virtual void SetRangeColor(double r, double g, double b);
00164   virtual void SetRangeColor(double rgb[3])
00165     { this->SetRangeColor(rgb[0], rgb[1], rgb[2]); };
00167   
00169 
00172   vtkGetVector3Macro(RangeInteractionColor, double);
00173   virtual void SetRangeInteractionColor(double r, double g, double b);
00174   virtual void SetRangeInteractionColor(double rgb[3])
00175     { this->SetRangeInteractionColor(rgb[0], rgb[1], rgb[2]); };
00177   
00179 
00180   virtual void SetEntriesVisibility(int);
00181   vtkBooleanMacro(EntriesVisibility, int);
00182   vtkGetMacro(EntriesVisibility, int);
00184 
00186 
00187   virtual vtkKWEntry* GetEntry1()
00188     { return this->Entries[0]; };
00189   virtual vtkKWEntry* GetEntry2()
00190     { return this->Entries[1]; };
00192 
00194 
00195   virtual void SetEntriesWidth(int width);
00196   vtkGetMacro(EntriesWidth, int);
00198 
00200 
00204   enum
00205   {
00206     EntryPositionDefault = 0,
00207     EntryPositionTop,
00208     EntryPositionBottom,
00209     EntryPositionLeft,
00210     EntryPositionRight
00211   };
00212   //ETX
00213   virtual void SetEntry1Position(int);
00214   vtkGetMacro(Entry1Position, int);
00215   virtual void SetEntry1PositionToDefault()
00216     { this->SetEntry1Position(vtkKWRange::EntryPositionDefault); };
00217   virtual void SetEntry1PositionToTop()
00218     { this->SetEntry1Position(vtkKWRange::EntryPositionTop); };
00219   virtual void SetEntry1PositionToBottom()
00220     { this->SetEntry1Position(vtkKWRange::EntryPositionBottom); };
00221   virtual void SetEntry1PositionToLeft()
00222     { this->SetEntry1Position(vtkKWRange::EntryPositionLeft); };
00223   virtual void SetEntry1PositionToRight()
00224     { this->SetEntry1Position(vtkKWRange::EntryPositionRight); };
00225   virtual void SetEntry2Position(int);
00226   vtkGetMacro(Entry2Position, int);
00227   virtual void SetEntry2PositionToDefault()
00228     { this->SetEntry2Position(vtkKWRange::EntryPositionDefault); };
00229   virtual void SetEntry2PositionToTop()
00230     { this->SetEntry2Position(vtkKWRange::EntryPositionTop); };
00231   virtual void SetEntry2PositionToBottom()
00232     { this->SetEntry2Position(vtkKWRange::EntryPositionBottom); };
00233   virtual void SetEntry2PositionToLeft()
00234     { this->SetEntry2Position(vtkKWRange::EntryPositionLeft); };
00235   virtual void SetEntry2PositionToRight()
00236     { this->SetEntry2Position(vtkKWRange::EntryPositionRight); };
00238 
00240 
00241   virtual void SetCommand(vtkObject* object, const char *method);
00242   virtual void SetStartCommand(vtkObject* object, const char *method);
00243   virtual void SetEndCommand(vtkObject* object, const char *method);
00244   virtual void SetEntriesCommand(vtkObject* object, const char *method);
00245   virtual void InvokeCommand();
00246   virtual void InvokeStartCommand();
00247   virtual void InvokeEndCommand();
00248   virtual void InvokeEntriesCommand();
00250 
00252 
00255   vtkSetMacro(DisableCommands, int);
00256   vtkGetMacro(DisableCommands, int);
00257   vtkBooleanMacro(DisableCommands, int);
00259 
00262   virtual void SetBalloonHelpString(const char *str);
00263 
00265 
00266   enum
00267   {
00268     SliderIndex1 = 1,
00269     SliderIndex2 = 2
00270   };
00271   //ETX
00272   virtual void ConfigureCallback();
00273   virtual void MaximizeRangeCallback();
00274   virtual void EnlargeRangeCallback();
00275   virtual void ShrinkRangeCallback();
00276   virtual void EntriesUpdateCallback(int i);
00277   virtual void StartInteractionCallback(int x, int y);
00278   virtual void EndInteractionCallback();
00279   virtual void SliderMotionCallback(int slider_idx, int x, int y);
00280   virtual void RangeMotionCallback(int x, int y);
00282 
00284 
00285   vtkGetObjectMacro(Canvas, vtkKWCanvas);
00287 
00294   virtual void UpdateEnableState();
00295 
00297 
00299   vtkSetMacro(ClampRange, int);
00300   vtkGetMacro(ClampRange, int);
00301   vtkBooleanMacro(ClampRange, int);
00303 
00304 protected:
00305   vtkKWRange();
00306   ~vtkKWRange();
00307 
00308   double WholeRange[2];
00309   double Range[2];
00310   double WholeRangeAdjusted[2];
00311   double RangeAdjusted[2];
00312   double Resolution;
00313   int   AdjustResolution;
00314   int   Inverted;
00315   int   Thickness;
00316   double InternalThickness;
00317   int   RequestedLength;
00318   int   Orientation;
00319   int   DisableCommands;
00320   int   SliderSize;
00321   double RangeColor[3];
00322   double RangeInteractionColor[3];
00323   int   EntriesVisibility;
00324   int   Entry1Position;
00325   int   Entry2Position;
00326   int   EntriesWidth;
00327   int   SliderCanPush;
00328 
00329   int   InInteraction;
00330   int   StartInteractionPos;
00331   double StartInteractionRange[2];
00332 
00333   int ClampRange;
00334 
00335   char  *Command;
00336   char  *StartCommand;
00337   char  *EndCommand;
00338   char  *EntriesCommand;
00339 
00340   vtkKWFrame         *CanvasFrame;
00341   vtkKWCanvas        *Canvas;
00342   vtkKWEntry         *Entries[2];
00343 
00344   virtual void CreateEntries();
00345   virtual void UpdateEntriesValue(double range[2]);
00346   virtual void ConstrainResolution();
00347 
00349 
00350   virtual void Bind();
00351   virtual void UnBind();
00353 
00355 
00356   virtual void ConstrainRangeToResolution(double range[2], int adjust = 1);
00357   virtual void ConstrainRangeToWholeRange(
00358     double range[2], double whole_range[2], double *old_range_hint = 0);
00359   virtual void ConstrainWholeRange();
00360   virtual void ConstrainRange(double *old_range_hint = 0);
00361   virtual void ConstrainRanges();
00363 
00365   virtual void Pack();
00366 
00368 
00369   enum
00370   {
00371     DarkShadowColor,
00372     LightShadowColor,
00373     BackgroundColor,
00374     HighlightColor
00375   };
00376   //ETX
00377   virtual void GetWholeRangeColor(int type, double &r, double &g, double &b);
00378   virtual void GetRangeColor(int type, double &r, double &g, double &b);
00379   virtual void GetSliderColor(int type, double &r, double &g, double &b);
00381 
00383 
00384   virtual void RedrawCanvas();
00385   virtual void RedrawWholeRange();
00386   virtual void RedrawRange();
00387   virtual void RedrawSliders();
00388   virtual void RedrawSlider(int x, int slider_idx);
00389   virtual void UpdateRangeColors();
00390   virtual void UpdateColors();
00392 
00394   virtual int HasTag(const char *tag, const char *suffix = 0);
00395 
00397   virtual void GetSlidersPositions(int pos[2]);
00398 
00399 private:
00400   vtkKWRange(const vtkKWRange&); // Not implemented
00401   void operator=(const vtkKWRange&); // Not implemented
00402 };
00403 
00404 #endif
00405 

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