VTK  9.0.1
vtkCaptionWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCaptionWidget.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 vtkCaptionWidget_h
42 #define vtkCaptionWidget_h
43 
44 #include "vtkBorderWidget.h"
45 #include "vtkInteractionWidgetsModule.h" // For export macro
46 
48 class vtkCaptionActor2D;
49 class vtkHandleWidget;
51 class vtkCaptionAnchorCallback;
52 
53 class VTKINTERACTIONWIDGETS_EXPORT vtkCaptionWidget : public vtkBorderWidget
54 {
55 public:
59  static vtkCaptionWidget* New();
60 
62 
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
73  void SetEnabled(int enabling) override;
74 
81  {
82  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
83  }
84 
86 
91  void SetCaptionActor2D(vtkCaptionActor2D* capActor);
92  vtkCaptionActor2D* GetCaptionActor2D();
94 
98  void CreateDefaultRepresentation() override;
99 
100 protected:
102  ~vtkCaptionWidget() override;
103 
104  // Handles callbacks from the anchor point
105  vtkCaptionAnchorCallback* AnchorCallback;
106 
107  // Widget for the anchor point
109 
110  // Special callbacks for the anchor interaction
111  void StartAnchorInteraction();
112  void AnchorInteraction();
113  void EndAnchorInteraction();
114 
115  friend class vtkCaptionAnchorCallback;
116 
117 private:
118  vtkCaptionWidget(const vtkCaptionWidget&) = delete;
119  void operator=(const vtkCaptionWidget&) = delete;
120 };
121 
122 #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:33
vtkCaptionAnchorCallback * AnchorCallback
void SetEnabled(int) override
Methods for activating this widget.
void SetWidgetRepresentation(vtkWidgetRepresentation *r)
draw text label associated with a point