VTK
vtkBiDimensionalRepresentation2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBiDimensionalRepresentation2D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
43 #ifndef __vtkBiDimensionalRepresentation2D_h
44 #define __vtkBiDimensionalRepresentation2D_h
45 
46 #include "vtkInteractionWidgetsModule.h" // For export macro
48 
50 class vtkCellArray;
51 class vtkPoints;
52 class vtkPolyData;
54 class vtkTextMapper;
55 class vtkActor2D;
56 class vtkProperty2D;
57 class vtkTextProperty;
58 
59 
60 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalRepresentation2D : public vtkBiDimensionalRepresentation
61 {
62 public:
65 
67 
69  void PrintSelf(ostream& os, vtkIndent indent);
71 
73 
75  vtkGetObjectMacro(LineProperty,vtkProperty2D);
76  vtkGetObjectMacro(SelectedLineProperty,vtkProperty2D);
78 
80 
82  vtkGetObjectMacro(TextProperty,vtkTextProperty);
84 
85 //BTX -- used to communicate about the state of the representation
87 //ETX
88 
90 
91  virtual void BuildRepresentation();
92  virtual int ComputeInteractionState(int X, int Y, int modify=0);
93  virtual void StartWidgetDefinition(double e[2]);
94  virtual void Point2WidgetInteraction(double e[2]);
95  virtual void Point3WidgetInteraction(double e[2]);
96  virtual void StartWidgetManipulation(double e[2]);
97  virtual void WidgetInteraction(double e[2]);
98  virtual void Highlight(int highlightOn);
100 
102 
103  virtual void ReleaseGraphicsResources(vtkWindow *w);
104  virtual int RenderOverlay(vtkViewport *viewport);
106 
108  char* GetLabelText();
109 
111 
112  double* GetLabelPosition();
113  void GetLabelPosition(double pos[3]);
114  void GetWorldLabelPosition(double pos[3]);
116 
117 protected:
120 
121  // Keep track if modifier is set
122  int Modifier;
123 
124  // Geometry of the lines
132 
133  // The labels for the line lengths
137 
138  // Internal variables
139  double P1World[3];
140  double P2World[3];
141  double P3World[3];
142  double P4World[3];
143  double P21World[3];
144  double P43World[3];
145  double T21;
146  double T43;
147  double CenterWorld[3];
148  double StartEventPositionWorld[4];
149 
150  // Helper method
151  void ProjectOrthogonalPoint(double x[4], double y[3], double x1[3], double x2[3], double x21[3],
152  double dir, double xP[3]);
153 
154 private:
156  void operator=(const vtkBiDimensionalRepresentation2D&); //Not implemented
157 };
158 
159 #endif