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) 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() override;
99  int ComputeInteractionState(int X, int Y, int modify=0) override;
100  void StartWidgetDefinition(double e[2]) override;
101  void Point2WidgetInteraction(double e[2]) override;
102  void Point3WidgetInteraction(double e[2]) override;
103  void StartWidgetManipulation(double e[2]) override;
104  void WidgetInteraction(double e[2]) override;
105  void Highlight(int highlightOn) override;
107 
109 
112  void ReleaseGraphicsResources(vtkWindow *w) override;
113  int RenderOverlay(vtkViewport *viewport) override;
115 
119  char* GetLabelText() override;
120 
122 
125  double* GetLabelPosition() override;
126  void GetLabelPosition(double pos[3]) override;
127  void GetWorldLabelPosition(double pos[3]) override;
129 
130 protected:
133 
134  // Geometry of the lines
142 
143  // The labels for the line lengths
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&) = delete;
155 };
156 
157 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:45
vtkBiDimensionalRepresentation::GetWorldLabelPosition
virtual void GetWorldLabelPosition(double pos[3])=0
vtkBiDimensionalRepresentation2D
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation2D.h:58
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:55
vtkBiDimensionalRepresentation::OnL1Outer
Definition: vtkBiDimensionalRepresentation.h:164
vtkX3D::dir
Definition: vtkX3D.h:324
vtkBiDimensionalRepresentation2D::LineProperty
vtkProperty2D * LineProperty
Definition: vtkBiDimensionalRepresentation2D.h:140
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkBiDimensionalRepresentation::GetLabelPosition
virtual double * GetLabelPosition()=0
Get the position of the widget's label in display coordinates.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkBiDimensionalRepresentation::Point2WidgetInteraction
virtual void Point2WidgetInteraction(double e[2])=0
vtkBiDimensionalRepresentation2D::TextProperty
vtkTextProperty * TextProperty
Definition: vtkBiDimensionalRepresentation2D.h:144
vtkWidgetRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkWidgetRepresentation.h:220
vtkBiDimensionalRepresentation::NearP4
Definition: vtkBiDimensionalRepresentation.h:164
vtkBiDimensionalRepresentation::StartWidgetDefinition
virtual void StartWidgetDefinition(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
vtkBiDimensionalRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBiDimensionalRepresentation2D::LinePoints
vtkPoints * LinePoints
Definition: vtkBiDimensionalRepresentation2D.h:136
vtkWidgetRepresentation::WidgetInteraction
virtual void WidgetInteraction(double newEventPos[2])
Definition: vtkWidgetRepresentation.h:137
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:47
vtkBiDimensionalRepresentation2D::TextActor
vtkActor2D * TextActor
Definition: vtkBiDimensionalRepresentation2D.h:146
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkBiDimensionalRepresentation2D::LineActor
vtkActor2D * LineActor
Definition: vtkBiDimensionalRepresentation2D.h:139
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:44
vtkBiDimensionalRepresentation::NearP2
Definition: vtkBiDimensionalRepresentation.h:164
vtkBiDimensionalRepresentation
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation.h:52
vtkBiDimensionalRepresentation2D::LineMapper
vtkPolyDataMapper2D * LineMapper
Definition: vtkBiDimensionalRepresentation2D.h:138
vtkBiDimensionalRepresentation2D::LineCells
vtkCellArray * LineCells
Definition: vtkBiDimensionalRepresentation2D.h:135
vtkBiDimensionalRepresentation::GetLabelText
virtual char * GetLabelText()=0
Get the text shown in the widget's label.
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkBiDimensionalRepresentation2D::TextMapper
vtkTextMapper * TextMapper
Definition: vtkBiDimensionalRepresentation2D.h:145
vtkBiDimensionalRepresentation.h
vtkBiDimensionalRepresentation::StartWidgetManipulation
virtual void StartWidgetManipulation(double e[2])=0
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:33
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkWidgetRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:221
vtkBiDimensionalRepresentation::NearP3
Definition: vtkBiDimensionalRepresentation.h:164
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkBiDimensionalRepresentation::OnL2Inner
Definition: vtkBiDimensionalRepresentation.h:164
vtkBiDimensionalRepresentation::OnL1Inner
Definition: vtkBiDimensionalRepresentation.h:164
vtkBiDimensionalRepresentation::Point3WidgetInteraction
virtual void Point3WidgetInteraction(double e[2])=0
vtkBiDimensionalRepresentation::NearP1
Definition: vtkBiDimensionalRepresentation.h:164
vtkBiDimensionalRepresentation2D::SelectedLineProperty
vtkProperty2D * SelectedLineProperty
Definition: vtkBiDimensionalRepresentation2D.h:141
vtkWidgetRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkWidgetRepresentation::Highlight
virtual void Highlight(int vtkNotUsed(highlightOn))
Definition: vtkWidgetRepresentation.h:142
vtkBiDimensionalRepresentation2D::LinePolyData
vtkPolyData * LinePolyData
Definition: vtkBiDimensionalRepresentation2D.h:137
vtkBiDimensionalRepresentation::OnL2Outer
Definition: vtkBiDimensionalRepresentation.h:164