VTK
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 =========================================================================*/
94 #ifndef vtkBiDimensionalWidget_h
95 #define vtkBiDimensionalWidget_h
96 
97 #include "vtkInteractionWidgetsModule.h" // For export macro
98 #include "vtkAbstractWidget.h"
99 
101 class vtkHandleWidget;
102 class vtkBiDimensionalWidgetCallback;
103 
104 
105 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
106 {
107 public:
111  static vtkBiDimensionalWidget *New();
112 
114 
118  void PrintSelf(ostream& os, vtkIndent indent) override;
120 
126  void SetEnabled(int) override;
127 
134  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
135 
140  {return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);}
141 
145  void CreateDefaultRepresentation() override;
146 
151  int IsMeasureValid();
152 
156  enum
157  {
158  EndWidgetSelectEvent = 10050
159  };
160 
165  void SetProcessEvents(vtkTypeBool) override;
166 
173  enum {Start=0,Define,Manipulate};
174 
176 
186  virtual void SetWidgetStateToStart();
187  virtual void SetWidgetStateToManipulate();
189 
193  virtual int GetWidgetState()
194  {return this->WidgetState;}
195 
196 protected:
198  ~vtkBiDimensionalWidget() override;
199 
200  // The state of the widget
210 
211  // Callback interface to capture events when
212  // placing the widget.
213  static void AddPointAction(vtkAbstractWidget*);
214  static void MoveAction(vtkAbstractWidget*);
215  static void EndSelectAction(vtkAbstractWidget*);
216 
217  // The positioning handle widgets
222  vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback1;
223  vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback2;
224  vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback3;
225  vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback4;
226 
227  // Methods invoked when the handles at the
228  // end points of the widget are manipulated
229  void StartBiDimensionalInteraction();
230  virtual void EndBiDimensionalInteraction();
231 
232  friend class vtkBiDimensionalWidgetCallback;
233 
234 private:
236  void operator=(const vtkBiDimensionalWidget&) = delete;
237 };
238 
239 #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
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.