VTK  9.0.20201030
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
vtkBiDimensionalWidget::Point2Widget
vtkHandleWidget * Point2Widget
Definition: vtkBiDimensionalWidget.h:232
vtkBiDimensionalWidget::CenterSelected
int CenterSelected
Definition: vtkBiDimensionalWidget.h:222
vtkBiDimensionalWidget::Line2OuterSelected
int Line2OuterSelected
Definition: vtkBiDimensionalWidget.h:221
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:78
vtkBiDimensionalWidget::Line1InnerSelected
int Line1InnerSelected
Definition: vtkBiDimensionalWidget.h:218
vtkBiDimensionalWidget::Point4Widget
vtkHandleWidget * Point4Widget
Definition: vtkBiDimensionalWidget.h:234
vtkAbstractWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractWidget.h
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkBiDimensionalWidget::GetBiDimensionalRepresentation
vtkBiDimensionalRepresentation * GetBiDimensionalRepresentation()
Return the representation as a vtkBiDimensionalRepresentation.
Definition: vtkBiDimensionalWidget.h:146
vtkBiDimensionalWidget::HandleLine1Selected
int HandleLine1Selected
Definition: vtkBiDimensionalWidget.h:216
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:65
vtkBiDimensionalWidget::Line2InnerSelected
int Line2InnerSelected
Definition: vtkBiDimensionalWidget.h:220
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkBiDimensionalWidget::SetRepresentation
void SetRepresentation(vtkBiDimensionalRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkBiDimensionalWidget.h:138
vtkBiDimensionalWidget::GetWidgetState
virtual int GetWidgetState()
Return the current widget state.
Definition: vtkBiDimensionalWidget.h:207
vtkBiDimensionalRepresentation
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation.h:51
vtkBiDimensionalWidget::Point3Widget
vtkHandleWidget * Point3Widget
Definition: vtkBiDimensionalWidget.h:233
vtkBiDimensionalWidget::BiDimensionalWidgetCallback3
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback3
Definition: vtkBiDimensionalWidget.h:237
vtkBiDimensionalWidget
measure the bi-dimensional lengths of an object
Definition: vtkBiDimensionalWidget.h:110
vtkBiDimensionalWidget::WidgetState
int WidgetState
Definition: vtkBiDimensionalWidget.h:214
vtkBiDimensionalWidget::Line1OuterSelected
int Line1OuterSelected
Definition: vtkBiDimensionalWidget.h:219
vtkBiDimensionalWidget::BiDimensionalWidgetCallback2
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback2
Definition: vtkBiDimensionalWidget.h:236
vtkAbstractWidget::SetEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkBiDimensionalWidget::HandleLine2Selected
int HandleLine2Selected
Definition: vtkBiDimensionalWidget.h:217
vtkBiDimensionalWidget::Define
Definition: vtkBiDimensionalWidget.h:185
vtkAbstractWidget::SetProcessEvents
virtual void SetProcessEvents(vtkTypeBool)
Methods to change whether the widget responds to interaction.
vtkBiDimensionalWidget::BiDimensionalWidgetCallback1
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback1
Definition: vtkBiDimensionalWidget.h:235
vtkBiDimensionalWidget::Point1Widget
vtkHandleWidget * Point1Widget
Definition: vtkBiDimensionalWidget.h:231
vtkBiDimensionalWidget::BiDimensionalWidgetCallback4
vtkBiDimensionalWidgetCallback * BiDimensionalWidgetCallback4
Definition: vtkBiDimensionalWidget.h:238
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkBiDimensionalWidget::CurrentHandle
int CurrentHandle
Definition: vtkBiDimensionalWidget.h:215