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 
76  vtkGetObjectMacro(SelectedLineProperty,vtkProperty2D);
78 
80 
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 
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkBiDimensionalRepresentation2D::GetLabelText
char * GetLabelText()
vtkBiDimensionalRepresentation2D::BuildRepresentation
virtual void BuildRepresentation()
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkBiDimensionalRepresentation2D::StartWidgetDefinition
virtual void StartWidgetDefinition(double e[2])
vtkBiDimensionalRepresentation2D::Modifier
int Modifier
Definition: vtkBiDimensionalRepresentation2D.h:122
vtkBiDimensionalRepresentation2D
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation2D.h:61
vtkBiDimensionalRepresentation2D::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *w)
vtkBiDimensionalRepresentation2D::T43
double T43
Definition: vtkBiDimensionalRepresentation2D.h:146
vtkBiDimensionalRepresentation2D::GetLabelPosition
void GetLabelPosition(double pos[3])
vtkBiDimensionalRepresentation2D::~vtkBiDimensionalRepresentation2D
~vtkBiDimensionalRepresentation2D()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkBiDimensionalRepresentation2D::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:58
vtkBiDimensionalRepresentation2D::Point2WidgetInteraction
virtual void Point2WidgetInteraction(double e[2])
vtkBiDimensionalRepresentation::OnL1Outer
@ OnL1Outer
Definition: vtkBiDimensionalRepresentation.h:145
vtkX3D::dir
@ dir
Definition: vtkX3D.h:324
vtkInteractionWidgetsModule.h
vtkBiDimensionalRepresentation2D::LineProperty
vtkProperty2D * LineProperty
Definition: vtkBiDimensionalRepresentation2D.h:130
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkBiDimensionalRepresentation2D::RenderOverlay
virtual int RenderOverlay(vtkViewport *viewport)
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkBiDimensionalRepresentation2D::TextProperty
vtkTextProperty * TextProperty
Definition: vtkBiDimensionalRepresentation2D.h:134
vtkBiDimensionalRepresentation2D::Point3WidgetInteraction
virtual void Point3WidgetInteraction(double e[2])
vtkBiDimensionalRepresentation::NearP4
@ NearP4
Definition: vtkBiDimensionalRepresentation.h:145
vtkBiDimensionalRepresentation2D::vtkBiDimensionalRepresentation2D
vtkBiDimensionalRepresentation2D()
vtkBiDimensionalRepresentation2D::LinePoints
vtkPoints * LinePoints
Definition: vtkBiDimensionalRepresentation2D.h:126
vtkBiDimensionalRepresentation2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:53
vtkBiDimensionalRepresentation2D::StartWidgetManipulation
virtual void StartWidgetManipulation(double e[2])
vtkBiDimensionalRepresentation2D::TextActor
vtkActor2D * TextActor
Definition: vtkBiDimensionalRepresentation2D.h:136
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkBiDimensionalRepresentation2D::LineActor
vtkActor2D * LineActor
Definition: vtkBiDimensionalRepresentation2D.h:129
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:50
vtkBiDimensionalRepresentation::NearP2
@ NearP2
Definition: vtkBiDimensionalRepresentation.h:145
vtkBiDimensionalRepresentation2D::GetLabelPosition
double * GetLabelPosition()
vtkBiDimensionalRepresentation2D::Highlight
virtual void Highlight(int highlightOn)
vtkBiDimensionalRepresentation2D::T21
double T21
Definition: vtkBiDimensionalRepresentation2D.h:145
vtkBiDimensionalRepresentation
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation.h:52
vtkBiDimensionalRepresentation2D::LineMapper
vtkPolyDataMapper2D * LineMapper
Definition: vtkBiDimensionalRepresentation2D.h:128
vtkBiDimensionalRepresentation2D::LineCells
vtkCellArray * LineCells
Definition: vtkBiDimensionalRepresentation2D.h:125
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkBiDimensionalRepresentation2D::TextMapper
vtkTextMapper * TextMapper
Definition: vtkBiDimensionalRepresentation2D.h:135
vtkBiDimensionalRepresentation.h
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkBiDimensionalRepresentation::NearP3
@ NearP3
Definition: vtkBiDimensionalRepresentation.h:145
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkBiDimensionalRepresentation::OnL2Inner
@ OnL2Inner
Definition: vtkBiDimensionalRepresentation.h:145
vtkBiDimensionalRepresentation::OnL1Inner
@ OnL1Inner
Definition: vtkBiDimensionalRepresentation.h:145
vtkBiDimensionalRepresentation2D::WidgetInteraction
virtual void WidgetInteraction(double e[2])
vtkgl::w
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
vtkBiDimensionalRepresentation::NearP1
@ NearP1
Definition: vtkBiDimensionalRepresentation.h:145
vtkBiDimensionalRepresentation2D::GetWorldLabelPosition
void GetWorldLabelPosition(double pos[3])
vtkBiDimensionalRepresentation2D::SelectedLineProperty
vtkProperty2D * SelectedLineProperty
Definition: vtkBiDimensionalRepresentation2D.h:131
vtkBiDimensionalRepresentation2D::LinePolyData
vtkPolyData * LinePolyData
Definition: vtkBiDimensionalRepresentation2D.h:127
vtkBiDimensionalRepresentation::OnL2Outer
@ OnL2Outer
Definition: vtkBiDimensionalRepresentation.h:145
vtkBiDimensionalRepresentation2D::New
static vtkBiDimensionalRepresentation2D * New()