VTK  9.3.0
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 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkScalarBarActor;
35 
36 class VTKINTERACTIONWIDGETS_EXPORT vtkScalarBarWidget : public vtkBorderWidget
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
49 
54  {
55  return reinterpret_cast<vtkScalarBarRepresentation*>(this->GetRepresentation());
56  }
57 
59 
62  virtual void SetScalarBarActor(vtkScalarBarActor* actor);
65 
67 
73  vtkSetMacro(Repositionable, vtkTypeBool);
74  vtkGetMacro(Repositionable, vtkTypeBool);
75  vtkBooleanMacro(Repositionable, vtkTypeBool);
77 
81  void CreateDefaultRepresentation() override;
82 
88 
89 protected:
91  ~vtkScalarBarWidget() override;
92 
94 
95  // Handle the case of Repositionable == 0
97 
98  // set the cursor to the correct shape based on State argument
99  void SetCursor(int State) override;
100 
101 private:
102  vtkScalarBarWidget(const vtkScalarBarWidget&) = delete;
103  void operator=(const vtkScalarBarWidget&) = delete;
104 };
105 
106 VTK_ABI_NAMESPACE_END
107 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * GetRepresentation()
Return an instance of vtkWidgetRepresentation used to represent this widget in the scene.
place a border around a 2D rectangular region
a simple class to control print indentation
Definition: vtkIndent.h:29
Create a scalar bar with labels.
represent scalar bar for vtkScalarBarWidget
2D widget for manipulating a scalar bar
vtkScalarBarRepresentation * GetScalarBarRepresentation()
Return the representation as a vtkScalarBarRepresentation.
vtkTypeBool Repositionable
static void MoveAction(vtkAbstractWidget *)
virtual void SetRepresentation(vtkScalarBarRepresentation *rep)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
vtkTypeBool GetProcessEvents() override
Reimplement ProcessEvents to use vtkAbstractWidget instead of vtkBorderWidget, for interaction with t...
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
~vtkScalarBarWidget() override
void SetCursor(int State) override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for class.
static vtkScalarBarWidget * New()
virtual void SetScalarBarActor(vtkScalarBarActor *actor)
Get the ScalarBar used by this Widget.
virtual vtkScalarBarActor * GetScalarBarActor()
Get the ScalarBar used by this Widget.
int vtkTypeBool
Definition: vtkABI.h:64