VTK  9.3.0
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
97 #ifndef vtkBiDimensionalWidget_h
98 #define vtkBiDimensionalWidget_h
99 
100 #include "vtkAbstractWidget.h"
101 #include "vtkInteractionWidgetsModule.h" // For export macro
102 
103 VTK_ABI_NAMESPACE_BEGIN
105 class vtkHandleWidget;
106 class vtkBiDimensionalWidgetCallback;
107 
108 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
109 {
110 public:
115 
117 
121  void PrintSelf(ostream& os, vtkIndent indent) override;
123 
129  void SetEnabled(int) override;
130 
137  {
138  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
139  }
140 
145  {
146  return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);
147  }
148 
153 
159 
163  enum
164  {
165  EndWidgetSelectEvent = 10050
166  };
167 
173 
180  enum
181  {
182  Start = 0,
184  Manipulate
185  };
186 
188 
198  virtual void SetWidgetStateToStart();
201 
205  virtual int GetWidgetState() { return this->WidgetState; }
206 
207 protected:
210 
211  // The state of the widget
221 
222  // Callback interface to capture events when
223  // placing the widget.
227 
228  // The positioning handle widgets
233  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback1;
234  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback2;
235  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback3;
236  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback4;
237 
238  // Methods invoked when the handles at the
239  // end points of the widget are manipulated
242 
243  friend class vtkBiDimensionalWidgetCallback;
244 
245 private:
247  void operator=(const vtkBiDimensionalWidget&) = delete;
248 };
249 
250 VTK_ABI_NAMESPACE_END
251 #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:38
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:64