VTK  9.3.1
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
88 #ifndef vtkBiDimensionalWidget_h
89 #define vtkBiDimensionalWidget_h
90 
91 #include "vtkAbstractWidget.h"
92 #include "vtkInteractionWidgetsModule.h" // For export macro
93 
94 VTK_ABI_NAMESPACE_BEGIN
96 class vtkHandleWidget;
97 class vtkBiDimensionalWidgetCallback;
98 
99 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
100 {
101 public:
105  static vtkBiDimensionalWidget* New();
106 
108 
112  void PrintSelf(ostream& os, vtkIndent indent) override;
114 
120  void SetEnabled(int) override;
121 
128  {
129  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
130  }
131 
136  {
137  return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);
138  }
139 
143  void CreateDefaultRepresentation() override;
144 
149  int IsMeasureValid();
150 
154  enum
155  {
156  EndWidgetSelectEvent = 10050
157  };
158 
163  void SetProcessEvents(vtkTypeBool) override;
164 
171  enum
172  {
173  Start = 0,
175  Manipulate
176  };
177 
179 
189  virtual void SetWidgetStateToStart();
190  virtual void SetWidgetStateToManipulate();
192 
196  virtual int GetWidgetState() { return this->WidgetState; }
197 
198 protected:
200  ~vtkBiDimensionalWidget() override;
201 
202  // The state of the widget
212 
213  // Callback interface to capture events when
214  // placing the widget.
215  static void AddPointAction(vtkAbstractWidget*);
216  static void MoveAction(vtkAbstractWidget*);
217  static void EndSelectAction(vtkAbstractWidget*);
218 
219  // The positioning handle widgets
224  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback1;
225  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback2;
226  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback3;
227  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback4;
228 
229  // Methods invoked when the handles at the
230  // end points of the widget are manipulated
231  void StartBiDimensionalInteraction();
232  virtual void EndBiDimensionalInteraction();
233 
234  friend class vtkBiDimensionalWidgetCallback;
235 
236 private:
238  void operator=(const vtkBiDimensionalWidget&) = delete;
239 };
240 
241 VTK_ABI_NAMESPACE_END
242 #endif
measure the bi-dimensional lengths of an object
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback1
represent the vtkBiDimensionalWidget
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
a general widget for moving handles
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback4
vtkWidgetRepresentation * WidgetRep
void SetRepresentation(vtkBiDimensionalRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
int vtkTypeBool
Definition: vtkABI.h:64
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback2
a simple class to control print indentation
Definition: vtkIndent.h:28
define the API for widget / widget representation
virtual void SetProcessEvents(vtkTypeBool)
Methods to change whether the widget responds to interaction.
void SetEnabled(int) override
Methods for activating this widget.
virtual int GetWidgetState()
Return the current widget state.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback3
vtkBiDimensionalRepresentation * GetBiDimensionalRepresentation()
Return the representation as a vtkBiDimensionalRepresentation.