00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00043 #ifndef __vtkBiDimensionalRepresentation2D_h
00044 #define __vtkBiDimensionalRepresentation2D_h
00045
00046 #include "vtkBiDimensionalRepresentation.h"
00047
00048 class vtkHandleRepresentation;
00049 class vtkCellArray;
00050 class vtkPoints;
00051 class vtkPolyData;
00052 class vtkPolyDataMapper2D;
00053 class vtkTextMapper;
00054 class vtkActor2D;
00055 class vtkProperty2D;
00056 class vtkTextProperty;
00057
00058
00059 class VTK_WIDGETS_EXPORT vtkBiDimensionalRepresentation2D : public vtkBiDimensionalRepresentation
00060 {
00061 public:
00063 static vtkBiDimensionalRepresentation2D *New();
00064
00066
00067 vtkTypeMacro(vtkBiDimensionalRepresentation2D,vtkBiDimensionalRepresentation);
00068 void PrintSelf(ostream& os, vtkIndent indent);
00070
00072
00074 vtkGetObjectMacro(LineProperty,vtkProperty2D);
00075 vtkGetObjectMacro(SelectedLineProperty,vtkProperty2D);
00077
00079
00081 vtkGetObjectMacro(TextProperty,vtkTextProperty);
00083
00084
00085 enum {Outside=0,NearP1,NearP2,NearP3,NearP4,OnL1Inner,OnL1Outer,OnL2Inner,OnL2Outer,OnCenter};
00086
00087
00089
00090 virtual void BuildRepresentation();
00091 virtual int ComputeInteractionState(int X, int Y, int modify=0);
00092 virtual void StartWidgetDefinition(double e[2]);
00093 virtual void Point2WidgetInteraction(double e[2]);
00094 virtual void Point3WidgetInteraction(double e[2]);
00095 virtual void StartWidgetManipulation(double e[2]);
00096 virtual void WidgetInteraction(double e[2]);
00097 virtual void Highlight(int highlightOn);
00099
00101
00102 virtual void ReleaseGraphicsResources(vtkWindow *w);
00103 virtual int RenderOverlay(vtkViewport *viewport);
00105
00107 char* GetLabelText();
00108
00110
00111 double* GetLabelPosition();
00112 void GetLabelPosition(double pos[3]);
00113 void GetWorldLabelPosition(double pos[3]);
00115
00116 protected:
00117 vtkBiDimensionalRepresentation2D();
00118 ~vtkBiDimensionalRepresentation2D();
00119
00120
00121 int Modifier;
00122
00123
00124 vtkCellArray *LineCells;
00125 vtkPoints *LinePoints;
00126 vtkPolyData *LinePolyData;
00127 vtkPolyDataMapper2D *LineMapper;
00128 vtkActor2D *LineActor;
00129 vtkProperty2D *LineProperty;
00130 vtkProperty2D *SelectedLineProperty;
00131
00132
00133 vtkTextProperty *TextProperty;
00134 vtkTextMapper *TextMapper;
00135 vtkActor2D *TextActor;
00136
00137
00138 double P1World[3];
00139 double P2World[3];
00140 double P3World[3];
00141 double P4World[3];
00142 double P21World[3];
00143 double P43World[3];
00144 double T21;
00145 double T43;
00146 double CenterWorld[3];
00147 double StartEventPositionWorld[4];
00148
00149
00150 void ProjectOrthogonalPoint(double x[4], double y[3], double x1[3], double x2[3], double x21[3],
00151 double dir, double xP[3]);
00152
00153 private:
00154 vtkBiDimensionalRepresentation2D(const vtkBiDimensionalRepresentation2D&);
00155 void operator=(const vtkBiDimensionalRepresentation2D&);
00156 };
00157
00158 #endif