VTK  9.0.2
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:
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 
155 
161 
165  enum
166  {
167  EndWidgetSelectEvent = 10050
168  };
169 
175 
182  enum
183  {
184  Start = 0,
186  Manipulate
187  };
188 
190 
200  virtual void SetWidgetStateToStart();
203 
207  virtual int GetWidgetState() { return this->WidgetState; }
208 
209 protected:
212 
213  // The state of the widget
223 
224  // Callback interface to capture events when
225  // placing the widget.
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
244 
245  friend class vtkBiDimensionalWidgetCallback;
246 
247 private:
249  void operator=(const vtkBiDimensionalWidget&) = delete;
250 };
251 
252 #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
Methods invoked by print to print information about the object including superclasses.
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()
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:34
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69