00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00041 #ifndef __vtkBorderRepresentation_h
00042 #define __vtkBorderRepresentation_h
00043
00044 #include "vtkWidgetRepresentation.h"
00045 #include "vtkCoordinate.h"
00046
00047 class vtkPoints;
00048 class vtkPolyData;
00049 class vtkTransform;
00050 class vtkTransformPolyDataFilter;
00051 class vtkPolyDataMapper2D;
00052 class vtkActor2D;
00053 class vtkProperty2D;
00054
00055
00056 class VTK_WIDGETS_EXPORT vtkBorderRepresentation : public vtkWidgetRepresentation
00057 {
00058 public:
00060 static vtkBorderRepresentation *New();
00061
00063
00064 vtkTypeMacro(vtkBorderRepresentation,vtkWidgetRepresentation);
00065 void PrintSelf(ostream& os, vtkIndent indent);
00067
00069
00077 vtkViewportCoordinateMacro(Position);
00078 vtkViewportCoordinateMacro(Position2);
00080
00081
00082 enum {BORDER_OFF=0,BORDER_ON,BORDER_ACTIVE};
00083
00085
00090 vtkSetClampMacro(ShowBorder,int,BORDER_OFF,BORDER_ACTIVE);
00091 vtkGetMacro(ShowBorder,int);
00092 void SetShowBorderToOff() {this->SetShowBorder(BORDER_OFF);}
00093 void SetShowBorderToOn() {this->SetShowBorder(BORDER_ON);}
00094 void SetShowBorderToActive() {this->SetShowBorder(BORDER_ACTIVE);}
00096
00098
00099 vtkGetObjectMacro(BorderProperty,vtkProperty2D);
00101
00103
00108 vtkSetMacro(ProportionalResize,int);
00109 vtkGetMacro(ProportionalResize,int);
00110 vtkBooleanMacro(ProportionalResize,int);
00112
00114
00117 vtkSetVector2Macro(MinimumSize,int);
00118 vtkGetVector2Macro(MinimumSize,int);
00119 vtkSetVector2Macro(MaximumSize,int);
00120 vtkGetVector2Macro(MaximumSize,int);
00122
00124
00127 vtkSetClampMacro(Tolerance,int,1,10);
00128 vtkGetMacro(Tolerance,int);
00130
00132
00134 vtkGetVectorMacro(SelectionPoint,double,2);
00136
00138
00141 vtkSetMacro(Moving,int);
00142 vtkGetMacro(Moving,int);
00143 vtkBooleanMacro(Moving,int);
00145
00146
00148
00149 enum _InteractionState
00150 {
00151 Outside=0,
00152 Inside,
00153 AdjustingP0,
00154 AdjustingP1,
00155 AdjustingP2,
00156 AdjustingP3,
00157 AdjustingE0,
00158 AdjustingE1,
00159 AdjustingE2,
00160 AdjustingE3
00161 };
00163
00164
00166
00168 virtual void BuildRepresentation();
00169 virtual void StartWidgetInteraction(double eventPos[2]);
00170 virtual void WidgetInteraction(double eventPos[2]);
00171 virtual void GetSize(double size[2])
00172 {size[0]=1.0; size[1]=1.0;}
00173 virtual int ComputeInteractionState(int X, int Y, int modify=0);
00175
00177
00179 virtual void GetActors2D(vtkPropCollection*);
00180 virtual void ReleaseGraphicsResources(vtkWindow*);
00181 virtual int RenderOverlay(vtkViewport*);
00182 virtual int RenderOpaqueGeometry(vtkViewport*);
00183 virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
00184 virtual int HasTranslucentPolygonalGeometry();
00186
00187 protected:
00188 vtkBorderRepresentation();
00189 ~vtkBorderRepresentation();
00190
00191
00192 int ShowBorder;
00193 vtkProperty2D *BorderProperty;
00194 int ProportionalResize;
00195 int Tolerance;
00196 int Moving;
00197 double SelectionPoint[2];
00198
00199
00200 vtkCoordinate *PositionCoordinate;
00201 vtkCoordinate *Position2Coordinate;
00202
00203
00204
00205 int Negotiated;
00206 virtual void NegotiateLayout();
00207
00208
00209 double StartPosition[2];
00210
00211
00212
00213 vtkPoints *BWPoints;
00214 vtkPolyData *BWPolyData;
00215 vtkTransform *BWTransform;
00216 vtkTransformPolyDataFilter *BWTransformFilter;
00217 vtkPolyDataMapper2D *BWMapper;
00218 vtkActor2D *BWActor;
00219
00220
00221 int MinimumSize[2];
00222 int MaximumSize[2];
00223
00224 private:
00225 vtkBorderRepresentation(const vtkBorderRepresentation&);
00226 void operator=(const vtkBorderRepresentation&);
00227 };
00228
00229 #endif