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 
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
virtual int RenderOverlay(vtkViewport *vtkNotUsed(viewport))
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
represent the vtkBiDimensionalWidget
abstract specification for Viewports
Definition: vtkViewport.h:46
a actor that draws 2D data
Definition: vtkActor2D.h:44
virtual void Point3WidgetInteraction(double e[2])=0
virtual double * GetLabelPosition()=0
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
virtual void ReleaseGraphicsResources(vtkWindow *)
virtual void BuildRepresentation()=0
2D text annotation
Definition: vtkTextMapper.h:52
represent the vtkBiDimensionalWidget
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
#define VTKINTERACTIONWIDGETS_EXPORT
virtual void StartWidgetManipulation(double e[2])=0
virtual void Point2WidgetInteraction(double e[2])=0
virtual void StartWidgetDefinition(double e[2])=0
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void WidgetInteraction(double newEventPos[2])
virtual char * GetLabelText()=0
represent text properties.
object to represent cell connectivity
Definition: vtkCellArray.h:49
void PrintSelf(ostream &os, vtkIndent indent)
virtual void GetWorldLabelPosition(double pos[3])=0
virtual void Highlight(int vtkNotUsed(highlightOn))
represent surface properties of a 2D image
Definition: vtkProperty2D.h:39
static vtkObject * New()
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:38