VTK  9.7.1
vtkScalarBarWidget.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
26 #ifndef vtkScalarBarWidget_h
27 #define vtkScalarBarWidget_h
28 
29 #include "vtkBorderWidget.h"
30 #include "vtkInteractionWidgetsModule.h" // For export macro
31 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
32 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkScalarBarActor;
36 
37 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkScalarBarWidget : public vtkBorderWidget
38 {
39 public:
40  static vtkScalarBarWidget* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
50 
55  {
56  return reinterpret_cast<vtkScalarBarRepresentation*>(this->GetRepresentation());
57  }
58 
60 
63  virtual void SetScalarBarActor(vtkScalarBarActor* actor);
64  virtual vtkScalarBarActor* GetScalarBarActor();
66 
68 
74  vtkSetMacro(Repositionable, vtkTypeBool);
75  vtkGetMacro(Repositionable, vtkTypeBool);
76  vtkBooleanMacro(Repositionable, vtkTypeBool);
78 
82  void CreateDefaultRepresentation() override;
83 
88  vtkTypeBool GetProcessEvents() override;
89 
90 protected:
92  ~vtkScalarBarWidget() override;
93 
95 
96  // Handle the case of Repositionable == 0
97  static void MoveAction(vtkAbstractWidget*);
98 
99  // set the cursor to the correct shape based on State argument
100  void SetCursor(int State) override;
101 
102 private:
103  vtkScalarBarWidget(const vtkScalarBarWidget&) = delete;
104  void operator=(const vtkScalarBarWidget&) = delete;
105 };
106 
107 VTK_ABI_NAMESPACE_END
108 #endif
vtkTypeBool Repositionable
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
place a border around a 2D rectangular region
static void MoveAction(vtkAbstractWidget *)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for class.
static vtkBorderWidget * New()
Method to instantiate class.
Create a scalar bar with labels.
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
represent scalar bar for vtkScalarBarWidget
define the API for widget / widget representation
vtkTypeBool GetProcessEvents() override
Reimplement ProcessEvents to disable it when using relative location with windowLocation.
void SetCursor(int State) override
#define VTK_MARSHALAUTO
void SetRepresentation(vtkBorderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
vtkWidgetRepresentation * GetRepresentation()
Return an instance of vtkWidgetRepresentation used to represent this widget in the scene...
vtkScalarBarRepresentation * GetScalarBarRepresentation()
Return the representation as a vtkScalarBarRepresentation.
2D widget for manipulating a scalar bar