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 
47 
49 class vtkCellArray;
50 class vtkPoints;
51 class vtkPolyData;
53 class vtkTextMapper;
54 class vtkActor2D;
55 class vtkProperty2D;
56 class vtkTextProperty;
57 
58 
60 {
61 public:
64 
66 
68  void PrintSelf(ostream& os, vtkIndent indent);
70 
72 
74  vtkGetObjectMacro(LineProperty,vtkProperty2D);
75  vtkGetObjectMacro(SelectedLineProperty,vtkProperty2D);
77 
79 
81  vtkGetObjectMacro(TextProperty,vtkTextProperty);
83 
84 //BTX -- used to communicate about the state of the representation
86 //ETX
87 
89 
90  virtual void BuildRepresentation();
91  virtual int ComputeInteractionState(int X, int Y, int modify=0);
92  virtual void StartWidgetDefinition(double e[2]);
93  virtual void Point2WidgetInteraction(double e[2]);
94  virtual void Point3WidgetInteraction(double e[2]);
95  virtual void StartWidgetManipulation(double e[2]);
96  virtual void WidgetInteraction(double e[2]);
97  virtual void Highlight(int highlightOn);
99 
101 
102  virtual void ReleaseGraphicsResources(vtkWindow *w);
103  virtual int RenderOverlay(vtkViewport *viewport);
105 
107  char* GetLabelText();
108 
110 
111  double* GetLabelPosition();
112  void GetLabelPosition(double pos[3]);
113  void GetWorldLabelPosition(double pos[3]);
115 
116 protected:
119 
120  // Keep track if modifier is set
121  int Modifier;
122 
123  // Geometry of the lines
131 
132  // The labels for the line lengths
136 
137  // Internal variables
138  double P1World[3];
139  double P2World[3];
140  double P3World[3];
141  double P4World[3];
142  double P21World[3];
143  double P43World[3];
144  double T21;
145  double T43;
146  double CenterWorld[3];
147  double StartEventPositionWorld[4];
148 
149  // Helper method
150  void ProjectOrthogonalPoint(double x[4], double y[3], double x1[3], double x2[3], double x21[3],
151  double dir, double xP[3]);
152 
153 private:
155  void operator=(const vtkBiDimensionalRepresentation2D&); //Not implemented
156 };
157 
158 #endif