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 =========================================================================*/
44 #ifndef vtkBiDimensionalRepresentation2D_h
45 #define vtkBiDimensionalRepresentation2D_h
46 
47 #include "vtkInteractionWidgetsModule.h" // For export macro
49 
51 class vtkCellArray;
52 class vtkPoints;
53 class vtkPolyData;
55 class vtkTextMapper;
56 class vtkActor2D;
57 class vtkProperty2D;
58 class vtkTextProperty;
59 
60 
61 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalRepresentation2D : public vtkBiDimensionalRepresentation
62 {
63 public:
68 
70 
74  void PrintSelf(ostream& os, vtkIndent indent);
76 
78 
82  vtkGetObjectMacro(LineProperty,vtkProperty2D);
83  vtkGetObjectMacro(SelectedLineProperty,vtkProperty2D);
85 
87 
91  vtkGetObjectMacro(TextProperty,vtkTextProperty);
93 
94  // Used to communicate about the state of the representation
96 
98 
101  virtual void BuildRepresentation();
102  virtual int ComputeInteractionState(int X, int Y, int modify=0);
103  virtual void StartWidgetDefinition(double e[2]);
104  virtual void Point2WidgetInteraction(double e[2]);
105  virtual void Point3WidgetInteraction(double e[2]);
106  virtual void StartWidgetManipulation(double e[2]);
107  virtual void WidgetInteraction(double e[2]);
108  virtual void Highlight(int highlightOn);
110 
112 
116  virtual int RenderOverlay(vtkViewport *viewport);
118 
122  char* GetLabelText();
123 
125 
128  double* GetLabelPosition();
129  void GetLabelPosition(double pos[3]);
130  void GetWorldLabelPosition(double pos[3]);
132 
133 protected:
136 
137  // Keep track if modifier is set
138  int Modifier;
139 
140  // Geometry of the lines
148 
149  // The labels for the line lengths
153 
154  // Internal variables
155  double P1World[3];
156  double P2World[3];
157  double P3World[3];
158  double P4World[3];
159  double P21World[3];
160  double P43World[3];
161  double T21;
162  double T43;
163  double CenterWorld[3];
164  double StartEventPositionWorld[4];
165 
166  // Helper method
167  void ProjectOrthogonalPoint(double x[4], double y[3], double x1[3], double x2[3], double x21[3],
168  double dir, double xP[3]);
169 
170 private:
172  void operator=(const vtkBiDimensionalRepresentation2D&) VTK_DELETE_FUNCTION;
173 };
174 
175 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkBiDimensionalRepresentation2D::GetLabelText
char * GetLabelText()
Get the text shown in the widget's label.
vtkBiDimensionalRepresentation2D::BuildRepresentation
virtual void BuildRepresentation()
These are methods that satisfy vtkWidgetRepresentation's API.
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:52
vtkBiDimensionalRepresentation2D::StartWidgetDefinition
virtual void StartWidgetDefinition(double e[2])
These are methods that satisfy vtkWidgetRepresentation's API.
vtkBiDimensionalRepresentation::OnL2Outer
@ OnL2Outer
Definition: vtkBiDimensionalRepresentation.h:164
vtkBiDimensionalRepresentation2D::Modifier
int Modifier
Definition: vtkBiDimensionalRepresentation2D.h:138
vtkBiDimensionalRepresentation2D
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation2D.h:62
vtkBiDimensionalRepresentation2D::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *w)
Methods required by vtkProp superclass.
vtkBiDimensionalRepresentation2D::T43
double T43
Definition: vtkBiDimensionalRepresentation2D.h:162
vtkBiDimensionalRepresentation2D::GetLabelPosition
void GetLabelPosition(double pos[3])
vtkBiDimensionalRepresentation2D::~vtkBiDimensionalRepresentation2D
~vtkBiDimensionalRepresentation2D()
vtkBiDimensionalRepresentation2D::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:59
vtkBiDimensionalRepresentation2D::Point2WidgetInteraction
virtual void Point2WidgetInteraction(double e[2])
vtkX3D::dir
@ dir
Definition: vtkX3D.h:324
vtkBiDimensionalRepresentation::OnL2Inner
@ OnL2Inner
Definition: vtkBiDimensionalRepresentation.h:164
vtkBiDimensionalRepresentation2D::LineProperty
vtkProperty2D * LineProperty
Definition: vtkBiDimensionalRepresentation2D.h:146
vtkBiDimensionalRepresentation::NearP4
@ NearP4
Definition: vtkBiDimensionalRepresentation.h:164
vtkBiDimensionalRepresentation2D::RenderOverlay
virtual int RenderOverlay(vtkViewport *viewport)
vtkBiDimensionalRepresentation::OnL1Inner
@ OnL1Inner
Definition: vtkBiDimensionalRepresentation.h:164
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkBiDimensionalRepresentation2D::TextProperty
vtkTextProperty * TextProperty
Definition: vtkBiDimensionalRepresentation2D.h:150
vtkBiDimensionalRepresentation2D::Point3WidgetInteraction
virtual void Point3WidgetInteraction(double e[2])
vtkBiDimensionalRepresentation2D::vtkBiDimensionalRepresentation2D
vtkBiDimensionalRepresentation2D()
vtkBiDimensionalRepresentation2D::LinePoints
vtkPoints * LinePoints
Definition: vtkBiDimensionalRepresentation2D.h:142
vtkBiDimensionalRepresentation2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:54
vtkBiDimensionalRepresentation2D::StartWidgetManipulation
virtual void StartWidgetManipulation(double e[2])
vtkBiDimensionalRepresentation2D::TextActor
vtkActor2D * TextActor
Definition: vtkBiDimensionalRepresentation2D.h:152
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkBiDimensionalRepresentation2D::LineActor
vtkActor2D * LineActor
Definition: vtkBiDimensionalRepresentation2D.h:145
vtkBiDimensionalRepresentation2D::ProjectOrthogonalPoint
void ProjectOrthogonalPoint(double x[4], double y[3], double x1[3], double x2[3], double x21[3], double dir, double xP[3])
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:51
vtkBiDimensionalRepresentation2D::GetLabelPosition
double * GetLabelPosition()
Get the position of the widget's label in display coordinates.
vtkBiDimensionalRepresentation2D::Highlight
virtual void Highlight(int highlightOn)
vtkBiDimensionalRepresentation2D::T21
double T21
Definition: vtkBiDimensionalRepresentation2D.h:161
vtkBiDimensionalRepresentation
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation.h:53
vtkBiDimensionalRepresentation2D::LineMapper
vtkPolyDataMapper2D * LineMapper
Definition: vtkBiDimensionalRepresentation2D.h:144
vtkBiDimensionalRepresentation2D::LineCells
vtkCellArray * LineCells
Definition: vtkBiDimensionalRepresentation2D.h:141
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkBiDimensionalRepresentation2D::TextMapper
vtkTextMapper * TextMapper
Definition: vtkBiDimensionalRepresentation2D.h:151
vtkBiDimensionalRepresentation.h
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:40
vtkBiDimensionalRepresentation::NearP2
@ NearP2
Definition: vtkBiDimensionalRepresentation.h:164
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:41
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:46
vtkBiDimensionalRepresentation::OnL1Outer
@ OnL1Outer
Definition: vtkBiDimensionalRepresentation.h:164
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkBiDimensionalRepresentation2D::WidgetInteraction
virtual void WidgetInteraction(double e[2])
vtkBiDimensionalRepresentation::NearP3
@ NearP3
Definition: vtkBiDimensionalRepresentation.h:164
vtkBiDimensionalRepresentation2D::GetWorldLabelPosition
void GetWorldLabelPosition(double pos[3])
vtkBiDimensionalRepresentation2D::SelectedLineProperty
vtkProperty2D * SelectedLineProperty
Definition: vtkBiDimensionalRepresentation2D.h:147
vtkBiDimensionalRepresentation::NearP1
@ NearP1
Definition: vtkBiDimensionalRepresentation.h:164
vtkBiDimensionalRepresentation2D::LinePolyData
vtkPolyData * LinePolyData
Definition: vtkBiDimensionalRepresentation2D.h:143
vtkBiDimensionalRepresentation2D::New
static vtkBiDimensionalRepresentation2D * New()
Instantiate the class.