VTK  9.1.0
vtkLineWidget2.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkLineWidget2.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=========================================================================*/
101#ifndef vtkLineWidget2_h
102#define vtkLineWidget2_h
103
104#include "vtkAbstractWidget.h"
105#include "vtkInteractionWidgetsModule.h" // For export macro
106
108class vtkHandleWidget;
109
110class VTKINTERACTIONWIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget
111{
112public:
117
119
123 void PrintSelf(ostream& os, vtkIndent indent) override;
125
130 void SetEnabled(int enabling) override;
131
138 {
139 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
140 }
141
146 {
147 return reinterpret_cast<vtkLineRepresentation*>(this->WidgetRep);
148 }
149
154
160
161protected:
163 ~vtkLineWidget2() override;
164
165 // Manage the state of the widget
168 {
169 Start = 0,
170 Active
171 };
173
174 // These methods handle events
180
181 // The positioning handle widgets
182 vtkHandleWidget* Point1Widget; // first end point
183 vtkHandleWidget* Point2Widget; // second end point
184 vtkHandleWidget* LineHandle; // used when selecting the line
185
187 static void ProcessKeyEvents(vtkObject*, unsigned long, void*, void*);
188
189private:
190 vtkLineWidget2(const vtkLineWidget2&) = delete;
191 void operator=(const vtkLineWidget2&) = delete;
192};
193
194#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
supports function callbacks
a general widget for moving handles
a simple class to control print indentation
Definition: vtkIndent.h:113
a class defining the representation for a vtkLineWidget2
3D widget for manipulating a finite, straight line
~vtkLineWidget2() override
vtkHandleWidget * Point1Widget
static void ProcessKeyEvents(vtkObject *, unsigned long, void *, void *)
vtkHandleWidget * Point2Widget
void SetRepresentation(vtkLineRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
vtkCallbackCommand * KeyEventCallbackCommand
static void EndSelectAction(vtkAbstractWidget *)
vtkLineRepresentation * GetLineRepresentation()
Return the representation as a vtkLineRepresentation.
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
static void MoveAction(vtkAbstractWidget *)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard vtkObject methods.
static void ScaleAction(vtkAbstractWidget *)
void SetEnabled(int enabling) override
Override superclasses' SetEnabled() method because the line widget must enable its internal handle wi...
static void TranslateAction(vtkAbstractWidget *)
static vtkLineWidget2 * New()
Instantiate the object.
vtkHandleWidget * LineHandle
static void SelectAction(vtkAbstractWidget *)
void SetProcessEvents(vtkTypeBool) override
Methods to change the whether the widget responds to interaction.
abstract base class for most VTK objects
Definition: vtkObject.h:73
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition: vtkABI.h:69