VTK
vtkContourWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContourWidget.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 =========================================================================*/
128 #ifndef __vtkContourWidget_h
129 #define __vtkContourWidget_h
130 
131 #include "vtkAbstractWidget.h"
132 
134 class vtkPolyData;
135 class vtkIdList;
136 
138 {
139 public:
141  static vtkContourWidget *New();
142 
144 
146  void PrintSelf(ostream& os, vtkIndent indent);
148 
152  virtual void SetEnabled(int);
153 
155 
158  void SetRepresentation(vtkContourRepresentation *r)
159  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
161 
163 
164  vtkContourRepresentation *GetContourRepresentation()
165  {return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);}
167 
170 
172  void CloseLoop();
173 
175 
176  vtkSetMacro(WidgetState,int);
178 
180 
181  vtkGetMacro(WidgetState,int);
183 
185 
188  void SetAllowNodePicking(int );
189  vtkGetMacro( AllowNodePicking, int );
190  vtkBooleanMacro( AllowNodePicking, int );
192 
194 
199  vtkSetMacro( FollowCursor, int );
200  vtkGetMacro( FollowCursor, int );
201  vtkBooleanMacro( FollowCursor, int );
203 
205 
213  vtkSetMacro( ContinuousDraw, int );
214  vtkGetMacro( ContinuousDraw, int );
215  vtkBooleanMacro( ContinuousDraw, int );
217 
219 
224  virtual void Initialize( vtkPolyData * poly, int state = 1, vtkIdList *idList = NULL );
225  virtual void Initialize()
226  {this->Initialize(NULL);}
228 
229  // The state of the widget
230  //BTX
231  enum {Start,Define,Manipulate};
232  //ETX
233 
234 protected:
236  ~vtkContourWidget();
237 
244 
245  // Callback interface to capture events when
246  // placing the widget.
247  static void SelectAction(vtkAbstractWidget*);
248  static void AddFinalPointAction(vtkAbstractWidget*);
249  static void MoveAction(vtkAbstractWidget*);
250  static void EndSelectAction(vtkAbstractWidget*);
251  static void DeleteAction(vtkAbstractWidget*);
252  static void TranslateContourAction(vtkAbstractWidget*);
253  static void ScaleContourAction(vtkAbstractWidget*);
254  static void ResetAction(vtkAbstractWidget*);
255 
256  // Internal helper methods
257  void SelectNode();
258  void AddNode();
259 
260 private:
261  vtkContourWidget(const vtkContourWidget&); //Not implemented
262  void operator=(const vtkContourWidget&); //Not implemented
263 };
264 
265 #endif