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 
137 {
138 public:
140  static vtkContourWidget *New();
141 
143 
145  void PrintSelf(ostream& os, vtkIndent indent);
147 
151  virtual void SetEnabled(int);
152 
154 
158  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
160 
162 
164  {return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);}
166 
169 
171  void CloseLoop();
172 
174 
175  vtkSetMacro(WidgetState,int);
177 
179 
180  vtkGetMacro(WidgetState,int);
182 
184 
187  void SetAllowNodePicking(int );
188  vtkGetMacro( AllowNodePicking, int );
189  vtkBooleanMacro( AllowNodePicking, int );
191 
193 
198  vtkSetMacro( FollowCursor, int );
199  vtkGetMacro( FollowCursor, int );
200  vtkBooleanMacro( FollowCursor, int );
202 
204 
212  vtkSetMacro( ContinuousDraw, int );
213  vtkGetMacro( ContinuousDraw, int );
214  vtkBooleanMacro( ContinuousDraw, int );
216 
218 
223  virtual void Initialize( vtkPolyData * poly, int state = 1 );
224  virtual void Initialize()
225  {this->Initialize(NULL);}
227 
228 protected:
230  ~vtkContourWidget();
231 
232  // The state of the widget
233 //BTX
234  enum {Start,Define,Manipulate};
235 //ETX
236 
243 
244  // Callback interface to capture events when
245  // placing the widget.
246  static void SelectAction(vtkAbstractWidget*);
247  static void AddFinalPointAction(vtkAbstractWidget*);
248  static void MoveAction(vtkAbstractWidget*);
249  static void EndSelectAction(vtkAbstractWidget*);
250  static void DeleteAction(vtkAbstractWidget*);
251  static void TranslateContourAction(vtkAbstractWidget*);
252  static void ScaleContourAction(vtkAbstractWidget*);
253  static void ResetAction(vtkAbstractWidget*);
254 
255  // Internal helper methods
256  void SelectNode();
257  void AddNode();
258 
259 private:
260  vtkContourWidget(const vtkContourWidget&); //Not implemented
261  void operator=(const vtkContourWidget&); //Not implemented
262 };
263 
264 #endif
void PrintSelf(ostream &os, vtkIndent indent)
void SetRepresentation(vtkContourRepresentation *r)
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:81
virtual void CreateDefaultRepresentation()=0
represent the vtkContourWidget
vtkWidgetRepresentation * WidgetRep
vtkContourRepresentation * GetContourRepresentation()
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_WIDGETS_EXPORT
define the API for widget / widget representation
create a contour with a set of points
static vtkObject * New()
virtual void Initialize()
virtual void SetEnabled(int)