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  // Used to communicate about the state of the representation
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
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:84
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