VTK  9.2.20230322
vtkBiDimensionalWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBiDimensionalWidget.h,v
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
119 #ifndef vtkBiDimensionalWidget_h
120 #define vtkBiDimensionalWidget_h
121 
122 #include "vtkAbstractWidget.h"
123 #include "vtkInteractionWidgetsModule.h" // For export macro
124 
125 VTK_ABI_NAMESPACE_BEGIN
127 class vtkHandleWidget;
128 class vtkBiDimensionalWidgetCallback;
129 
130 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
131 {
132 public:
137 
139 
143  void PrintSelf(ostream& os, vtkIndent indent) override;
145 
151  void SetEnabled(int) override;
152 
159  {
160  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
161  }
162 
167  {
168  return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);
169  }
170 
175 
181 
185  enum
186  {
187  EndWidgetSelectEvent = 10050
188  };
189 
195 
202  enum
203  {
204  Start = 0,
206  Manipulate
207  };
208 
210 
220  virtual void SetWidgetStateToStart();
223 
227  virtual int GetWidgetState() { return this->WidgetState; }
228 
229 protected:
232 
233  // The state of the widget
243 
244  // Callback interface to capture events when
245  // placing the widget.
249 
250  // The positioning handle widgets
255  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback1;
256  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback2;
257  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback3;
258  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback4;
259 
260  // Methods invoked when the handles at the
261  // end points of the widget are manipulated
264 
265  friend class vtkBiDimensionalWidgetCallback;
266 
267 private:
269  void operator=(const vtkBiDimensionalWidget&) = delete;
270 };
271 
272 VTK_ABI_NAMESPACE_END
273 #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:120
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:71