00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00034 #ifndef __vtkSliderRepresentation3D_h
00035 #define __vtkSliderRepresentation3D_h
00036
00037 #include "vtkSliderRepresentation.h"
00038 #include "vtkCoordinate.h"
00039
00040 class vtkActor;
00041 class vtkPolyDataMapper;
00042 class vtkSphereSource;
00043 class vtkCellPicker;
00044 class vtkProperty;
00045 class vtkCylinderSource;
00046 class vtkVectorText;
00047 class vtkAssembly;
00048 class vtkTransform;
00049 class vtkTransformPolyDataFilter;
00050 class vtkMatrix4x4;
00051
00052
00053 class VTK_WIDGETS_EXPORT vtkSliderRepresentation3D : public vtkSliderRepresentation
00054 {
00055 public:
00057 static vtkSliderRepresentation3D *New();
00058
00060
00061 vtkTypeMacro(vtkSliderRepresentation3D,vtkSliderRepresentation);
00062 void PrintSelf(ostream& os, vtkIndent indent);
00064
00066
00072 vtkCoordinate *GetPoint1Coordinate();
00073 void SetPoint1InWorldCoordinates(double x, double y, double z);
00075
00077
00083 vtkCoordinate *GetPoint2Coordinate();
00084 void SetPoint2InWorldCoordinates(double x, double y, double z);
00086
00088
00090 virtual void SetTitleText(const char*);
00091 virtual const char* GetTitleText();
00093
00095
00097 vtkSetClampMacro(SliderShape,int,SphereShape,CylinderShape);
00098 vtkGetMacro(SliderShape, int);
00099 void SetSliderShapeToSphere() { this->SetSliderShape(SphereShape); }
00100 void SetSliderShapeToCylinder() { this->SetSliderShape(CylinderShape); }
00102
00104
00107 vtkSetMacro(Rotation,double);
00108 vtkGetMacro(Rotation,double);
00110
00112
00114 vtkGetObjectMacro(SliderProperty,vtkProperty);
00116
00118
00119 vtkGetObjectMacro(TubeProperty,vtkProperty);
00120 vtkGetObjectMacro(CapProperty,vtkProperty);
00122
00124
00126 vtkGetObjectMacro(SelectedProperty,vtkProperty);
00128
00130
00131 virtual void PlaceWidget(double bounds[6]);
00132 virtual void BuildRepresentation();
00133 virtual void StartWidgetInteraction(double eventPos[2]);
00134 virtual void WidgetInteraction(double newEventPos[2]);
00135 virtual void Highlight(int);
00137
00139
00140 virtual double *GetBounds();
00141 virtual void GetActors(vtkPropCollection*);
00142 virtual void ReleaseGraphicsResources(vtkWindow*);
00143 virtual int RenderOpaqueGeometry(vtkViewport*);
00144 virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
00145 virtual int HasTranslucentPolygonalGeometry();
00147
00149 virtual unsigned long GetMTime();
00150
00151 protected:
00152 vtkSliderRepresentation3D();
00153 ~vtkSliderRepresentation3D();
00154
00155
00156 vtkCoordinate *Point1Coordinate;
00157 vtkCoordinate *Point2Coordinate;
00158 double Length;
00159
00160
00161
00162 double SP1[3];
00163 double SP2[3];
00164
00165
00166 double Rotation;
00167 int SliderShape;
00168
00169
00170 vtkCellPicker *Picker;
00171
00172
00173 virtual double ComputePickPosition(double eventPos[2]);
00174
00175
00176
00177
00178 vtkAssembly *WidgetAssembly;
00179
00180
00181 vtkCylinderSource *CylinderSource;
00182 vtkTransformPolyDataFilter *Cylinder;
00183
00184
00185 vtkPolyDataMapper *TubeMapper;
00186 vtkActor *TubeActor;
00187 vtkProperty *TubeProperty;
00188
00189
00190 vtkSphereSource *SliderSource;
00191 vtkPolyDataMapper *SliderMapper;
00192 vtkActor *SliderActor;
00193 vtkProperty *SliderProperty;
00194 vtkProperty *SelectedProperty;
00195
00196
00197 vtkPolyDataMapper *LeftCapMapper;
00198 vtkActor *LeftCapActor;
00199 vtkProperty *CapProperty;
00200
00201
00202 vtkPolyDataMapper *RightCapMapper;
00203 vtkActor *RightCapActor;
00204
00205
00206
00207 vtkVectorText *LabelText;
00208 vtkPolyDataMapper *LabelMapper;
00209 vtkActor *LabelActor;
00210
00211 vtkVectorText *TitleText;
00212 vtkPolyDataMapper *TitleMapper;
00213 vtkActor *TitleActor;
00214
00215
00216 vtkMatrix4x4 *Matrix;
00217 vtkTransform *Transform;
00218
00219
00220 enum _SliderShape {
00221 SphereShape,
00222 CylinderShape
00223 };
00224
00225
00226
00227
00228 private:
00229 vtkSliderRepresentation3D(const vtkSliderRepresentation3D&);
00230 void operator=(const vtkSliderRepresentation3D&);
00231 };
00232
00233 #endif