VTK
vtkHandleWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHandleWidget.h
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 =========================================================================*/
67 #ifndef vtkHandleWidget_h
68 #define vtkHandleWidget_h
69 
70 #include "vtkInteractionWidgetsModule.h" // For export macro
71 #include "vtkAbstractWidget.h"
72 
74 
75 
76 class VTKINTERACTIONWIDGETS_EXPORT vtkHandleWidget : public vtkAbstractWidget
77 {
78 public:
82  static vtkHandleWidget *New();
83 
85 
89  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
98  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
99 
104  {return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);}
105 
111 
113 
118  vtkSetMacro( EnableAxisConstraint, vtkTypeBool );
119  vtkGetMacro( EnableAxisConstraint, vtkTypeBool );
120  vtkBooleanMacro( EnableAxisConstraint, vtkTypeBool );
122 
124 
127  vtkSetMacro(EnableTranslation, vtkTypeBool);
128  vtkGetMacro(EnableTranslation, vtkTypeBool);
129  vtkBooleanMacro(EnableTranslation, vtkTypeBool);
131 
133 
137  vtkSetMacro( AllowHandleResize, vtkTypeBool );
138  vtkGetMacro( AllowHandleResize, vtkTypeBool );
139  vtkBooleanMacro( AllowHandleResize, vtkTypeBool );
141 
143 
146  vtkGetMacro( WidgetState, int );
148 
150 
155  vtkSetMacro( ShowInactive, vtkTypeBool );
156  vtkGetMacro( ShowInactive, vtkTypeBool );
157  vtkBooleanMacro( ShowInactive, vtkTypeBool );
159 
160  // Manage the state of the widget
161  enum _WidgetState {Start=0,Active,Inactive};
162 
167  void SetEnabled(int enabling) override;
168 
169 protected:
171  ~vtkHandleWidget() override;
172 
173  // These are the callbacks for this widget
182 
183  // helper methods for cursor management
184  void SetCursor(int state) override;
185 
189 
190  // Allow resizing of handles.
192 
193  // Keep representation visible when disabled
195 
196 private:
197  vtkHandleWidget(const vtkHandleWidget&) = delete;
198  void operator=(const vtkHandleWidget&) = delete;
199 };
200 
201 #endif
vtkHandleWidget::WidgetState
int WidgetState
Definition: vtkHandleWidget.h:186
vtkHandleWidget::_WidgetState
_WidgetState
Definition: vtkHandleWidget.h:161
vtkHandleWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:77
vtkHandleWidget::EndSelectAction
static void EndSelectAction(vtkAbstractWidget *)
vtkHandleWidget::MoveAction3D
static void MoveAction3D(vtkAbstractWidget *)
vtkAbstractWidget.h
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:61
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:59
vtkAbstractWidget::WidgetRep
vtkWidgetRepresentation * WidgetRep
Definition: vtkAbstractWidget.h:174
vtkHandleWidget::EnableAxisConstraint
vtkTypeBool EnableAxisConstraint
Definition: vtkHandleWidget.h:187
vtkHandleWidget::SelectAction3D
static void SelectAction3D(vtkAbstractWidget *)
vtkHandleWidget::SetRepresentation
void SetRepresentation(vtkHandleRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkHandleWidget.h:97
vtkHandleWidget::~vtkHandleWidget
~vtkHandleWidget() override
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:64
vtkHandleWidget::SetCursor
void SetCursor(int state) override
vtkHandleWidget::AllowHandleResize
vtkTypeBool AllowHandleResize
Definition: vtkHandleWidget.h:191
vtkHandleWidget::MoveAction
static void MoveAction(vtkAbstractWidget *)
vtkHandleWidget::GenericAction
static void GenericAction(vtkHandleWidget *)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkHandleWidget::ShowInactive
vtkTypeBool ShowInactive
Definition: vtkHandleWidget.h:194
vtkHandleWidget::SelectAction
static void SelectAction(vtkAbstractWidget *)
vtkHandleWidget::SetEnabled
void SetEnabled(int enabling) override
Enable/disable widget.
vtkHandleWidget::TranslateAction
static void TranslateAction(vtkAbstractWidget *)
vtkHandleWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
vtkHandleWidget::GetHandleRepresentation
vtkHandleRepresentation * GetHandleRepresentation()
Return the representation as a vtkHandleRepresentation.
Definition: vtkHandleWidget.h:103
vtkHandleWidget::vtkHandleWidget
vtkHandleWidget()
vtkHandleWidget::New
static vtkHandleWidget * New()
Instantiate this class.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkHandleWidget::ScaleAction
static void ScaleAction(vtkAbstractWidget *)
vtkHandleWidget::EnableTranslation
vtkTypeBool EnableTranslation
Definition: vtkHandleWidget.h:188