VTK
vtkSeedWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSeedWidget.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 =========================================================================*/
73 #ifndef vtkSeedWidget_h
74 #define vtkSeedWidget_h
75 
76 #include "vtkInteractionWidgetsModule.h" // For export macro
77 #include "vtkAbstractWidget.h"
78 
80 class vtkHandleWidget;
81 class vtkSeedList;
83 
84 
85 class VTKINTERACTIONWIDGETS_EXPORT vtkSeedWidget : public vtkAbstractWidget
86 {
87 public:
91  static vtkSeedWidget *New();
92 
94 
98  void PrintSelf(ostream& os, vtkIndent indent) override;
100 
106  void SetEnabled(int) override;
107 
112  void SetCurrentRenderer( vtkRenderer * ) override;
113 
118  void SetInteractor( vtkRenderWindowInteractor * ) override;
119 
126  {
127  this->Superclass::SetWidgetRepresentation(
128  reinterpret_cast<vtkWidgetRepresentation*>(rep) );
129  }
130 
135  {return reinterpret_cast<vtkSeedRepresentation*>(this->WidgetRep);}
136 
140  void CreateDefaultRepresentation() override;
141 
146  void SetProcessEvents(vtkTypeBool) override;
147 
157  virtual void CompleteInteraction();
158 
163  virtual void RestartInteraction();
164 
172  virtual vtkHandleWidget * CreateNewHandle();
173 
177  void DeleteSeed(int n);
178 
182  vtkHandleWidget * GetSeed( int n );
183 
185 
188  vtkGetMacro( WidgetState, int );
190 
191  // The state of the widget
192 
193  enum
194  {
195  Start = 1,
196  PlacingSeeds = 2,
197  PlacedSeeds = 4,
198  MovingSeed = 8
199  };
200 
201 protected:
202  vtkSeedWidget();
203  ~vtkSeedWidget() override;
204 
205 
207 
208  // Callback interface to capture events when
209  // placing the widget.
210  static void AddPointAction( vtkAbstractWidget* );
211  static void CompletedAction( vtkAbstractWidget* );
212  static void MoveAction( vtkAbstractWidget* );
213  static void EndSelectAction( vtkAbstractWidget* );
214  static void DeleteAction( vtkAbstractWidget* );
215 
216  // The positioning handle widgets
217  vtkSeedList *Seeds;
218 
219  // Manipulating or defining ?
220  int Defining;
221 
222 private:
223  vtkSeedWidget(const vtkSeedWidget&) = delete;
224  void operator=(const vtkSeedWidget&) = delete;
225 };
226 
227 #endif
virtual void SetInteractor(vtkRenderWindowInteractor *iren)
This method is used to associate the widget with the render window interactor.
abstract class for representing widget handles
vtkSeedList * Seeds
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
a general widget for moving handles
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkSeedRepresentation * GetSeedRepresentation()
Return the representation as a vtkSeedRepresentation.
place multiple seed points
Definition: vtkSeedWidget.h:85
vtkWidgetRepresentation * WidgetRep
int vtkTypeBool
Definition: vtkABI.h:69
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void SetCurrentRenderer(vtkRenderer *)
Set/Get the current renderer.
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.
void SetRepresentation(vtkSeedRepresentation *rep)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent the vtkSeedWidget