00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00033 #ifndef __vtkAbstractPolygonalHandleRepresentation3D_h
00034 #define __vtkAbstractPolygonalHandleRepresentation3D_h
00035
00036 #include "vtkHandleRepresentation.h"
00037
00038 class vtkProperty;
00039 class vtkPolyDataMapper;
00040 class vtkCellPicker;
00041 class vtkTransformPolyDataFilter;
00042 class vtkMatrixToLinearTransform;
00043 class vtkMatrix4x4;
00044 class vtkPolyData;
00045 class vtkAbstractTransform;
00046 class vtkActor;
00047 class vtkFollower;
00048 class vtkVectorText;
00049
00050 class VTK_WIDGETS_EXPORT vtkAbstractPolygonalHandleRepresentation3D
00051 : public vtkHandleRepresentation
00052 {
00053 public:
00054
00056
00057 vtkTypeMacro(vtkAbstractPolygonalHandleRepresentation3D,vtkHandleRepresentation);
00058 void PrintSelf(ostream& os, vtkIndent indent);
00060
00062
00063 virtual void SetWorldPosition(double p[3]);
00064 virtual void SetDisplayPosition(double p[3]);
00066
00068
00069 void SetHandle( vtkPolyData * );
00070 vtkPolyData * GetHandle();
00072
00074
00075 void SetProperty(vtkProperty*);
00076 void SetSelectedProperty(vtkProperty*);
00077 vtkGetObjectMacro(Property,vtkProperty);
00078 vtkGetObjectMacro(SelectedProperty,vtkProperty);
00080
00083 virtual vtkAbstractTransform * GetTransform();
00084
00086
00088 virtual void BuildRepresentation();
00089 virtual void StartWidgetInteraction(double eventPos[2]);
00090 virtual void WidgetInteraction(double eventPos[2]);
00091 virtual int ComputeInteractionState(int X, int Y, int modify=0);
00093
00095
00096 virtual void ShallowCopy(vtkProp *prop);
00097 virtual void DeepCopy(vtkProp *prop);
00098 virtual void GetActors(vtkPropCollection *);
00099 virtual void ReleaseGraphicsResources(vtkWindow *);
00100 virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00101 virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
00102 virtual int HasTranslucentPolygonalGeometry();
00103 virtual double *GetBounds();
00105
00107
00109 vtkSetMacro( LabelVisibility, int );
00110 vtkGetMacro( LabelVisibility, int );
00111 vtkBooleanMacro( LabelVisibility, int );
00112 virtual void SetLabelText( const char * label );
00113 virtual char * GetLabelText();
00115
00117
00118 virtual void SetLabelTextScale( double scale[3] );
00119 virtual double * GetLabelTextScale();
00121
00123
00124 vtkGetObjectMacro( LabelTextActor, vtkFollower );
00126
00130 virtual void SetUniformScale( double scale );
00131
00133
00134 vtkSetMacro( HandleVisibility, int );
00135 vtkGetMacro( HandleVisibility, int );
00136 vtkBooleanMacro( HandleVisibility, int );
00138
00139 protected:
00140 vtkAbstractPolygonalHandleRepresentation3D();
00141 ~vtkAbstractPolygonalHandleRepresentation3D();
00142
00143 vtkActor * Actor;
00144 vtkPolyDataMapper * Mapper;
00145 vtkTransformPolyDataFilter * HandleTransformFilter;
00146 vtkMatrixToLinearTransform * HandleTransform;
00147 vtkMatrix4x4 * HandleTransformMatrix;
00148 vtkCellPicker * HandlePicker;
00149 double LastPickPosition[3];
00150 double LastEventPosition[2];
00151 int ConstraintAxis;
00152 vtkProperty * Property;
00153 vtkProperty * SelectedProperty;
00154 int WaitingForMotion;
00155 int WaitCount;
00156 int HandleVisibility;
00157
00158 void Highlight(int highlight);
00159
00160
00161 virtual void Translate(double *p1, double *p2);
00162 virtual void Scale(double *p1, double *p2, double eventPos[2]);
00163 virtual void MoveFocus(double *p1, double *p2);
00164
00165 void CreateDefaultProperties();
00166
00167
00168
00169
00170
00171
00172
00173 virtual void MoveFocusRequest(
00174 double *p1, double *p2, double requestedDisplayPos[3] );
00175
00176 int DetermineConstraintAxis(int constraint, double *x, double *startPickPos);
00177
00185 virtual void UpdateHandle();
00186
00188 virtual void UpdateLabel();
00189
00190
00191 int LabelVisibility;
00192 vtkFollower *LabelTextActor;
00193 vtkPolyDataMapper *LabelTextMapper;
00194 vtkVectorText *LabelTextInput;
00195 bool LabelAnnotationTextScaleInitialized;
00196
00197 private:
00198 vtkAbstractPolygonalHandleRepresentation3D(const vtkAbstractPolygonalHandleRepresentation3D&);
00199 void operator=(const vtkAbstractPolygonalHandleRepresentation3D&);
00200 };
00201
00202 #endif
00203
00204