VTK
dox/Widgets/vtkContourWidget.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkContourWidget.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00128 #ifndef __vtkContourWidget_h
00129 #define __vtkContourWidget_h
00130 
00131 #include "vtkAbstractWidget.h"
00132 
00133 class vtkContourRepresentation;
00134 class vtkPolyData;
00135 
00136 class VTK_WIDGETS_EXPORT vtkContourWidget : public vtkAbstractWidget
00137 {
00138 public:
00140   static vtkContourWidget *New();
00141 
00143 
00144   vtkTypeMacro(vtkContourWidget,vtkAbstractWidget);
00145   void PrintSelf(ostream& os, vtkIndent indent);
00147 
00151   virtual void SetEnabled(int);
00152 
00154 
00157   void SetRepresentation(vtkContourRepresentation *r)
00158     {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
00160 
00162   void CreateDefaultRepresentation();
00163 
00165   void CloseLoop();
00166 
00168 
00171   void SetAllowNodePicking(int );
00172   vtkGetMacro( AllowNodePicking, int );
00173   vtkBooleanMacro( AllowNodePicking, int );
00175 
00177 
00182   vtkSetMacro( FollowCursor, int );
00183   vtkGetMacro( FollowCursor, int );
00184   vtkBooleanMacro( FollowCursor, int );
00186 
00188 
00196   vtkSetMacro( ContinuousDraw, int );
00197   vtkGetMacro( ContinuousDraw, int );
00198   vtkBooleanMacro( ContinuousDraw, int );
00200 
00202 
00207   virtual void Initialize( vtkPolyData * poly, int state = 1 );
00208   virtual void Initialize()
00209     {this->Initialize(NULL);}
00211 
00212 protected:
00213   vtkContourWidget();
00214   ~vtkContourWidget();
00215 
00216   // The state of the widget
00217 //BTX
00218   enum {Start,Define,Manipulate};
00219 //ETX
00220 
00221   int WidgetState;
00222   int CurrentHandle;
00223   int AllowNodePicking;
00224   int FollowCursor;
00225   int ContinuousDraw;
00226   int ContinuousActive;
00227 
00228   // Callback interface to capture events when
00229   // placing the widget.
00230   static void SelectAction(vtkAbstractWidget*);
00231   static void AddFinalPointAction(vtkAbstractWidget*);
00232   static void MoveAction(vtkAbstractWidget*);
00233   static void EndSelectAction(vtkAbstractWidget*);
00234   static void DeleteAction(vtkAbstractWidget*);
00235   static void TranslateContourAction(vtkAbstractWidget*);
00236   static void ScaleContourAction(vtkAbstractWidget*);
00237   static void ResetAction(vtkAbstractWidget*);
00238 
00239   // Internal helper methods
00240   void SelectNode();
00241   void AddNode();
00242 
00243 private:
00244   vtkContourWidget(const vtkContourWidget&);  //Not implemented
00245   void operator=(const vtkContourWidget&);  //Not implemented
00246 };
00247 
00248 #endif