VTK  9.2.6
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 =========================================================================*/
100 #ifndef vtkBiDimensionalWidget_h
101 #define vtkBiDimensionalWidget_h
102 
103 #include "vtkAbstractWidget.h"
104 #include "vtkInteractionWidgetsModule.h" // For export macro
105 
107 class vtkHandleWidget;
108 class vtkBiDimensionalWidgetCallback;
109 
110 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
111 {
112 public:
116  static vtkBiDimensionalWidget* New();
117 
119 
123  void PrintSelf(ostream& os, vtkIndent indent) override;
125 
131  void SetEnabled(int) override;
132 
139  {
140  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
141  }
142 
147  {
148  return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);
149  }
150 
154  void CreateDefaultRepresentation() override;
155 
160  int IsMeasureValid();
161 
165  enum
166  {
167  EndWidgetSelectEvent = 10050
168  };
169 
174  void SetProcessEvents(vtkTypeBool) override;
175 
182  enum
183  {
184  Start = 0,
186  Manipulate
187  };
188 
190 
200  virtual void SetWidgetStateToStart();
201  virtual void SetWidgetStateToManipulate();
203 
207  virtual int GetWidgetState() { return this->WidgetState; }
208 
209 protected:
211  ~vtkBiDimensionalWidget() override;
212 
213  // The state of the widget
223 
224  // Callback interface to capture events when
225  // placing the widget.
226  static void AddPointAction(vtkAbstractWidget*);
227  static void MoveAction(vtkAbstractWidget*);
228  static void EndSelectAction(vtkAbstractWidget*);
229 
230  // The positioning handle widgets
235  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback1;
236  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback2;
237  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback3;
238  vtkBiDimensionalWidgetCallback* BiDimensionalWidgetCallback4;
239 
240  // Methods invoked when the handles at the
241  // end points of the widget are manipulated
242  void StartBiDimensionalInteraction();
243  virtual void EndBiDimensionalInteraction();
244 
245  friend class vtkBiDimensionalWidgetCallback;
246 
247 private:
249  void operator=(const vtkBiDimensionalWidget&) = delete;
250 };
251 
252 #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:39
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.