00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00041 #ifndef __vtkWidgetRepresentation_h
00042 #define __vtkWidgetRepresentation_h
00043
00044 #include "vtkProp.h"
00045
00046 class vtkRenderer;
00047
00048
00049 class VTK_WIDGETS_EXPORT vtkWidgetRepresentation : public vtkProp
00050 {
00051 public:
00053
00054 vtkTypeMacro(vtkWidgetRepresentation,vtkProp);
00055 void PrintSelf(ostream& os, vtkIndent indent);
00057
00059
00067 virtual void SetRenderer(vtkRenderer *ren);
00068 vtkGetObjectMacro(Renderer,vtkRenderer);
00069 virtual void BuildRepresentation() = 0;
00071
00073
00099 virtual void PlaceWidget(double* vtkNotUsed(bounds[6])) {}
00100 virtual void StartWidgetInteraction(double eventPos[2]) { (void)eventPos; }
00101 virtual void WidgetInteraction(double newEventPos[2]) { (void)newEventPos; }
00102 virtual void EndWidgetInteraction(double newEventPos[2]) { (void)newEventPos; }
00103 virtual int ComputeInteractionState(int X, int Y, int modify=0);
00104 virtual int GetInteractionState()
00105 {return this->InteractionState;}
00106 virtual void Highlight(int vtkNotUsed(highlightOn)) {}
00108
00110
00116 vtkSetClampMacro(PlaceFactor,double,0.01,VTK_DOUBLE_MAX);
00117 vtkGetMacro(PlaceFactor,double);
00119
00121
00129 vtkSetClampMacro(HandleSize,double,0.001,1000);
00130 vtkGetMacro(HandleSize,double);
00132
00134
00136 vtkGetMacro( NeedToRender, int );
00137 vtkSetClampMacro( NeedToRender, int, 0, 1 );
00138 vtkBooleanMacro( NeedToRender, int );
00140
00142
00149 virtual double *GetBounds() {return NULL;}
00150 virtual void ShallowCopy(vtkProp *prop);
00151 virtual void GetActors(vtkPropCollection *) {}
00152 virtual void GetActors2D(vtkPropCollection *) {}
00153 virtual void GetVolumes(vtkPropCollection *) {}
00154 virtual void ReleaseGraphicsResources(vtkWindow *) {}
00155 virtual int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) {return 0;}
00156 virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) {return 0;}
00157 virtual int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) {return 0;}
00158 virtual int RenderVolumetricGeometry(vtkViewport *vtkNotUsed(viewport)) {return 0;}
00159 virtual int HasTranslucentPolygonalGeometry() { return 0; }
00161
00162 protected:
00163 vtkWidgetRepresentation();
00164 ~vtkWidgetRepresentation();
00165
00166
00167 vtkRenderer *Renderer;
00168
00169
00170 int InteractionState;
00171
00172
00173
00174 double StartEventPosition[3];
00175
00176
00177 double PlaceFactor;
00178 int Placed;
00179 void AdjustBounds(double bounds[6], double newBounds[6], double center[3]);
00180 double InitialBounds[6];
00181 double InitialLength;
00182
00183
00184
00185
00186
00187
00188 int ValidPick;
00189
00190
00191
00192
00193 double HandleSize;
00194 double SizeHandlesRelativeToViewport(double factor, double pos[3]);
00195 double SizeHandlesInPixels(double factor,double pos[3]);
00196
00197
00198 int NeedToRender;
00199
00200
00201
00202 vtkTimeStamp BuildTime;
00203
00204 private:
00205 vtkWidgetRepresentation(const vtkWidgetRepresentation&);
00206 void operator=(const vtkWidgetRepresentation&);
00207 };
00208
00209 #endif