VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
38 
39 VTK_ABI_NAMESPACE_BEGIN
41 class vtkCaptionActor2D;
42 class vtkHandleWidget;
44 class vtkCaptionAnchorCallback;
45 
46 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCaptionWidget : public vtkBorderWidget
47 {
48 public:
52  static vtkCaptionWidget* New();
53 
55 
59  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
66  void SetEnabled(int enabling) override;
67 
74  {
75  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
76  }
77 
79 
84  void SetCaptionActor2D(vtkCaptionActor2D* capActor);
85  vtkCaptionActor2D* GetCaptionActor2D();
87 
91  void CreateDefaultRepresentation() override;
92 
93 protected:
95  ~vtkCaptionWidget() override;
96 
97  // Handles callbacks from the anchor point
98  vtkCaptionAnchorCallback* AnchorCallback;
99 
100  // Widget for the anchor point
102 
103  // Special callbacks for the anchor interaction
104  void StartAnchorInteraction();
105  void AnchorInteraction();
106  void EndAnchorInteraction();
107 
108  friend class vtkCaptionAnchorCallback;
109 
110 private:
111  vtkCaptionWidget(const vtkCaptionWidget&) = delete;
112  void operator=(const vtkCaptionWidget&) = delete;
113 };
114 
115 VTK_ABI_NAMESPACE_END
116 #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)
#define VTK_MARSHALAUTO
draw text label associated with a point