VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSliderRepresentation.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00037 #ifndef __vtkSliderRepresentation_h 00038 #define __vtkSliderRepresentation_h 00039 00040 #include "vtkInteractionWidgetsModule.h" // For export macro 00041 #include "vtkWidgetRepresentation.h" 00042 00043 00044 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation 00045 { 00046 public: 00048 00049 vtkTypeMacro(vtkSliderRepresentation,vtkWidgetRepresentation); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00052 00054 00056 void SetValue(double value); 00057 vtkGetMacro(Value,double); 00059 00061 00064 void SetMinimumValue(double value); 00065 vtkGetMacro(MinimumValue,double); 00067 00069 00072 void SetMaximumValue(double value); 00073 vtkGetMacro(MaximumValue,double); 00075 00077 00079 vtkSetClampMacro(SliderLength,double,0.01,0.5); 00080 vtkGetMacro(SliderLength,double); 00082 00084 00088 vtkSetClampMacro(SliderWidth,double,0.0,1.0); 00089 vtkGetMacro(SliderWidth,double); 00091 00093 00095 vtkSetClampMacro(TubeWidth,double,0.0,1.0); 00096 vtkGetMacro(TubeWidth,double); 00098 00100 00103 vtkSetClampMacro(EndCapLength,double,0.0,0.25); 00104 vtkGetMacro(EndCapLength,double); 00106 00108 00110 vtkSetClampMacro(EndCapWidth,double,0.0,0.25); 00111 vtkGetMacro(EndCapWidth,double); 00113 00115 00117 virtual void SetTitleText(const char*) {} 00118 virtual const char* GetTitleText() {return NULL;} 00120 00122 00123 vtkSetStringMacro(LabelFormat); 00124 vtkGetStringMacro(LabelFormat); 00126 00128 00130 vtkSetClampMacro(LabelHeight,double,0.0,2.0); 00131 vtkGetMacro(LabelHeight,double); 00133 00135 00137 vtkSetClampMacro(TitleHeight,double,0.0,2.0); 00138 vtkGetMacro(TitleHeight,double); 00140 00142 00144 vtkSetMacro(ShowSliderLabel,int); 00145 vtkGetMacro(ShowSliderLabel,int); 00146 vtkBooleanMacro(ShowSliderLabel,int); 00148 00150 00152 virtual double GetCurrentT() 00153 {return this->CurrentT;} 00154 virtual double GetPickedT() 00155 {return this->PickedT;} 00157 00158 //BTX 00159 // Enums are used to describe what is selected 00160 enum _InteractionState 00161 { 00162 Outside=0, 00163 Tube, 00164 LeftCap, 00165 RightCap, 00166 Slider 00167 }; 00168 //ETX 00169 00170 protected: 00171 vtkSliderRepresentation(); 00172 ~vtkSliderRepresentation(); 00173 00174 // Values 00175 double Value; 00176 double MinimumValue; 00177 double MaximumValue; 00178 00179 // More ivars controlling the appearance of the widget 00180 double SliderLength; 00181 double SliderWidth; 00182 double EndCapLength; 00183 double EndCapWidth; 00184 double TubeWidth; 00185 00186 // The current parametric coordinate 00187 double CurrentT; 00188 double PickedT; 00189 00190 // both the title and label 00191 int ShowSliderLabel; 00192 char *LabelFormat; 00193 double LabelHeight; 00194 double TitleHeight; 00195 00196 private: 00197 vtkSliderRepresentation(const vtkSliderRepresentation&); //Not implemented 00198 void operator=(const vtkSliderRepresentation&); //Not implemented 00199 }; 00200 00201 #endif