VTK  9.3.1
vtkBiDimensionalRepresentation2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
32 #ifndef vtkBiDimensionalRepresentation2D_h
33 #define vtkBiDimensionalRepresentation2D_h
34 
36 #include "vtkInteractionWidgetsModule.h" // For export macro
37 
38 VTK_ABI_NAMESPACE_BEGIN
40 class vtkCellArray;
41 class vtkPoints;
42 class vtkPolyData;
44 class vtkTextMapper;
45 class vtkActor2D;
46 class vtkProperty2D;
47 class vtkTextProperty;
48 
49 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalRepresentation2D
51 {
52 public:
57 
59 
63  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
67 
71  vtkGetObjectMacro(LineProperty, vtkProperty2D);
72  vtkGetObjectMacro(SelectedLineProperty, vtkProperty2D);
74 
76 
80  vtkGetObjectMacro(TextProperty, vtkTextProperty);
82 
83  // Used to communicate about the state of the representation
84  enum
85  {
86  Outside = 0,
95  OnCenter
96  };
97 
99 
102  void BuildRepresentation() override;
103  int ComputeInteractionState(int X, int Y, int modify = 0) override;
104  void StartWidgetDefinition(double e[2]) override;
105  void Point2WidgetInteraction(double e[2]) override;
106  void Point3WidgetInteraction(double e[2]) override;
107  void StartWidgetManipulation(double e[2]) override;
108  void WidgetInteraction(double e[2]) override;
109  void Highlight(int highlightOn) override;
111 
113 
116  void ReleaseGraphicsResources(vtkWindow* w) override;
117  int RenderOverlay(vtkViewport* viewport) override;
119 
123  char* GetLabelText() override;
124 
126 
129  double* GetLabelPosition() override;
130  void GetLabelPosition(double pos[3]) override;
131  void GetWorldLabelPosition(double pos[3]) override;
133 
134 protected:
137 
138  // Geometry of the lines
146 
147  // The labels for the line lengths
151 
152  // Helper method
153  void ProjectOrthogonalPoint(
154  double x[4], double y[3], double x1[3], double x2[3], double x21[3], double dir, double xP[3]);
155 
156 private:
158  void operator=(const vtkBiDimensionalRepresentation2D&) = delete;
159 };
160 
161 VTK_ABI_NAMESPACE_END
162 #endif
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:44
a actor that draws 2D data
Definition: vtkActor2D.h:34
virtual void Point3WidgetInteraction(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
virtual double * GetLabelPosition()=0
Get the position of the widget's label in display coordinates.
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:39
represent the vtkBiDimensionalWidget
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
virtual void StartWidgetManipulation(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void Point2WidgetInteraction(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void StartWidgetDefinition(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
a simple class to control print indentation
Definition: vtkIndent.h:28
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void WidgetInteraction(double newEventPos[2])
virtual char * GetLabelText()=0
Get the text shown in the widget's label.
represent text properties.
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
object to represent cell connectivity
Definition: vtkCellArray.h:175
virtual void GetWorldLabelPosition(double pos[3])=0
Get the position of the widget's label in display coordinates.
virtual void Highlight(int vtkNotUsed(highlightOn))
represent surface properties of a 2D image
Definition: vtkProperty2D.h:29
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:28