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 =========================================================================*/
41 #ifndef vtkBiDimensionalRepresentation2D_h
42 #define vtkBiDimensionalRepresentation2D_h
43 
44 #include "vtkInteractionWidgetsModule.h" // For export macro
46 
48 class vtkCellArray;
49 class vtkPoints;
50 class vtkPolyData;
52 class vtkTextMapper;
53 class vtkActor2D;
54 class vtkProperty2D;
55 class vtkTextProperty;
56 
57 
58 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalRepresentation2D : public vtkBiDimensionalRepresentation
59 {
60 public:
65 
67 
71  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
73 
75 
79  vtkGetObjectMacro(LineProperty,vtkProperty2D);
80  vtkGetObjectMacro(SelectedLineProperty,vtkProperty2D);
82 
84 
88  vtkGetObjectMacro(TextProperty,vtkTextProperty);
90 
91  // Used to communicate about the state of the representation
93 
95 
98  void BuildRepresentation() VTK_OVERRIDE;
99  int ComputeInteractionState(int X, int Y, int modify=0) VTK_OVERRIDE;
100  void StartWidgetDefinition(double e[2]) VTK_OVERRIDE;
101  void Point2WidgetInteraction(double e[2]) VTK_OVERRIDE;
102  void Point3WidgetInteraction(double e[2]) VTK_OVERRIDE;
103  void StartWidgetManipulation(double e[2]) VTK_OVERRIDE;
104  void WidgetInteraction(double e[2]) VTK_OVERRIDE;
105  void Highlight(int highlightOn) VTK_OVERRIDE;
107 
109 
112  void ReleaseGraphicsResources(vtkWindow *w) VTK_OVERRIDE;
113  int RenderOverlay(vtkViewport *viewport) VTK_OVERRIDE;
115 
119  char* GetLabelText() VTK_OVERRIDE;
120 
122 
125  double* GetLabelPosition() VTK_OVERRIDE;
126  void GetLabelPosition(double pos[3]) VTK_OVERRIDE;
127  void GetWorldLabelPosition(double pos[3]) VTK_OVERRIDE;
129 
130 protected:
132  ~vtkBiDimensionalRepresentation2D() VTK_OVERRIDE;
133 
134  // Geometry of the lines
135  vtkCellArray *LineCells;
136  vtkPoints *LinePoints;
137  vtkPolyData *LinePolyData;
138  vtkPolyDataMapper2D *LineMapper;
139  vtkActor2D *LineActor;
140  vtkProperty2D *LineProperty;
141  vtkProperty2D *SelectedLineProperty;
142 
143  // The labels for the line lengths
144  vtkTextProperty *TextProperty;
145  vtkTextMapper *TextMapper;
146  vtkActor2D *TextActor;
147 
148  // Helper method
149  void ProjectOrthogonalPoint(double x[4], double y[3], double x1[3], double x2[3], double x21[3],
150  double dir, double xP[3]);
151 
152 private:
154  void operator=(const vtkBiDimensionalRepresentation2D&) VTK_DELETE_FUNCTION;
155 };
156 
157 #endif
abstract class for representing widget handles
represent the vtkBiDimensionalWidget
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:39
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
2D text annotation
Definition: vtkTextMapper.h:47
represent the vtkBiDimensionalWidget
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
a simple class to control print indentation
Definition: vtkIndent.h:33
represent text properties.
object to represent cell connectivity
Definition: vtkCellArray.h:44
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:33