VTK  9.3.20240224
vtkBiDimensionalWidget.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
107 #ifndef vtkBiDimensionalWidget_h
108 #define vtkBiDimensionalWidget_h
109 
110 #include "vtkAbstractWidget.h"
111 #include "vtkInteractionWidgetsModule.h" // For export macro
112 
113 VTK_ABI_NAMESPACE_BEGIN
115 class vtkHandleWidget;
116 class vtkBiDimensionalWidgetCallback;
117 
118 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
119 {
120 public:
125 
127 
131  void PrintSelf(ostream& os, vtkIndent indent) override;
133 
139  void SetEnabled(int) override;
140 
147  {
148  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
149  }
150 
155  {
156  return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);
157  }
158 
163 
169 
173  enum
174  {
175  EndWidgetSelectEvent = 10050
176  };
177 
183 
190  enum
191  {
192  Start = 0,
194  Manipulate
195  };
196 
198 
208  virtual void SetWidgetStateToStart();
211 
215  virtual int GetWidgetState() { return this->WidgetState; }
216 
217 protected:
220 
221  // The state of the widget
231 
232  // Callback interface to capture events when
233  // placing the widget.
237 
238  // The positioning handle widgets
243  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback1;
244  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback2;
245  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback3;
246  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback4;
247 
248  // Methods invoked when the handles at the
249  // end points of the widget are manipulated
252 
253  friend class vtkBiDimensionalWidgetCallback;
254 
255 private:
257  void operator=(const vtkBiDimensionalWidget&) = delete;
258 };
259 
260 VTK_ABI_NAMESPACE_END
261 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
represent the vtkBiDimensionalWidget
measure the bi-dimensional lengths of an object
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
virtual int GetWidgetState()
Return the current widget state.
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback1
vtkBiDimensionalRepresentation * GetBiDimensionalRepresentation()
Return the representation as a vtkBiDimensionalRepresentation.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for a VTK class.
void SetProcessEvents(vtkTypeBool) override
Methods to change the whether the widget responds to interaction.
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback3
static void EndSelectAction(vtkAbstractWidget *)
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback4
virtual void EndBiDimensionalInteraction()
virtual void SetWidgetStateToStart()
Set the state of the widget.
~vtkBiDimensionalWidget() override
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback2
int IsMeasureValid()
A flag indicates whether the bi-dimensional measure is valid.
void SetRepresentation(vtkBiDimensionalRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
void SetEnabled(int) override
The method for activating and deactivating this widget.
static void MoveAction(vtkAbstractWidget *)
virtual void SetWidgetStateToManipulate()
Set the state of the widget.
static vtkBiDimensionalWidget * New()
Instantiate this class.
static void AddPointAction(vtkAbstractWidget *)
void StartBiDimensionalInteraction()
a general widget for moving handles
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:64