VTK  9.3.1
vtkCaptionWidget.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 vtkCaptionWidget_h
33 #define vtkCaptionWidget_h
34 
35 #include "vtkBorderWidget.h"
36 #include "vtkInteractionWidgetsModule.h" // For export macro
37 
38 VTK_ABI_NAMESPACE_BEGIN
40 class vtkCaptionActor2D;
41 class vtkHandleWidget;
43 class vtkCaptionAnchorCallback;
44 
45 class VTKINTERACTIONWIDGETS_EXPORT vtkCaptionWidget : public vtkBorderWidget
46 {
47 public:
51  static vtkCaptionWidget* New();
52 
54 
58  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
65  void SetEnabled(int enabling) override;
66 
73  {
74  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
75  }
76 
78 
83  void SetCaptionActor2D(vtkCaptionActor2D* capActor);
84  vtkCaptionActor2D* GetCaptionActor2D();
86 
90  void CreateDefaultRepresentation() override;
91 
92 protected:
94  ~vtkCaptionWidget() override;
95 
96  // Handles callbacks from the anchor point
97  vtkCaptionAnchorCallback* AnchorCallback;
98 
99  // Widget for the anchor point
101 
102  // Special callbacks for the anchor interaction
103  void StartAnchorInteraction();
104  void AnchorInteraction();
105  void EndAnchorInteraction();
106 
107  friend class vtkCaptionAnchorCallback;
108 
109 private:
110  vtkCaptionWidget(const vtkCaptionWidget&) = delete;
111  void operator=(const vtkCaptionWidget&) = delete;
112 };
113 
114 VTK_ABI_NAMESPACE_END
115 #endif
widget for placing a caption (text plus leader)
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
void SetRepresentation(vtkCaptionRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
place a border around a 2D rectangular region
vtkHandleWidget * HandleWidget
represent the position of a point in 3D space
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for class.
static vtkBorderWidget * New()
Method to instantiate class.
a general widget for moving handles
represents vtkCaptionWidget in the scene
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkCaptionAnchorCallback * AnchorCallback
void SetEnabled(int) override
Methods for activating this widget.
void SetWidgetRepresentation(vtkWidgetRepresentation *r)
draw text label associated with a point