VTK
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 =========================================================================*/
38 #ifndef vtkCaptionWidget_h
39 #define vtkCaptionWidget_h
40 
41 #include "vtkInteractionWidgetsModule.h" // For export macro
42 #include "vtkBorderWidget.h"
43 
45 class vtkCaptionActor2D;
46 class vtkHandleWidget;
48 class vtkCaptionAnchorCallback;
49 
50 
51 class VTKINTERACTIONWIDGETS_EXPORT vtkCaptionWidget : public vtkBorderWidget
52 {
53 public:
57  static vtkCaptionWidget *New();
58 
60 
64  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
71  void SetEnabled(int enabling) override;
72 
79  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
80 
82 
87  void SetCaptionActor2D(vtkCaptionActor2D *capActor);
88  vtkCaptionActor2D *GetCaptionActor2D();
90 
94  void CreateDefaultRepresentation() override;
95 
96 protected:
98  ~vtkCaptionWidget() override;
99 
100  // Handles callbacks from the anchor point
101  vtkCaptionAnchorCallback *AnchorCallback;
102 
103  // Widget for the anchor point
105 
106  // Special callbacks for the anchor interaction
107  void StartAnchorInteraction();
108  void AnchorInteraction();
109  void EndAnchorInteraction();
110 
111  friend class vtkCaptionAnchorCallback;
112 
113 private:
114  vtkCaptionWidget(const vtkCaptionWidget&) = delete;
115  void operator=(const vtkCaptionWidget&) = delete;
116 };
117 
118 #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