VTK  9.0.1
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 =========================================================================*/
97 #ifndef vtkBiDimensionalWidget_h
98 #define vtkBiDimensionalWidget_h
99 
100 #include "vtkAbstractWidget.h"
101 #include "vtkInteractionWidgetsModule.h" // For export macro
102 
104 class vtkHandleWidget;
105 class vtkBiDimensionalWidgetCallback;
106 
107 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
108 {
109 public:
113  static vtkBiDimensionalWidget* New();
114 
116 
120  void PrintSelf(ostream& os, vtkIndent indent) override;
122 
128  void SetEnabled(int) override;
129 
136  {
137  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
138  }
139 
144  {
145  return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);
146  }
147 
151  void CreateDefaultRepresentation() override;
152 
157  int IsMeasureValid();
158 
162  enum
163  {
164  EndWidgetSelectEvent = 10050
165  };
166 
171  void SetProcessEvents(vtkTypeBool) override;
172 
179  enum
180  {
181  Start = 0,
183  Manipulate
184  };
185 
187 
197  virtual void SetWidgetStateToStart();
198  virtual void SetWidgetStateToManipulate();
200 
204  virtual int GetWidgetState() { return this->WidgetState; }
205 
206 protected:
208  ~vtkBiDimensionalWidget() override;
209 
210  // The state of the widget
220 
221  // Callback interface to capture events when
222  // placing the widget.
223  static void AddPointAction(vtkAbstractWidget*);
224  static void MoveAction(vtkAbstractWidget*);
225  static void EndSelectAction(vtkAbstractWidget*);
226 
227  // The positioning handle widgets
232  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback1;
233  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback2;
234  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback3;
235  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback4;
236 
237  // Methods invoked when the handles at the
238  // end points of the widget are manipulated
239  void StartBiDimensionalInteraction();
240  virtual void EndBiDimensionalInteraction();
241 
242  friend class vtkBiDimensionalWidgetCallback;
243 
244 private:
246  void operator=(const vtkBiDimensionalWidget&) = delete;
247 };
248 
249 #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:69
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback2
a simple class to control print indentation
Definition: vtkIndent.h:33
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.