00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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
00217
00218 enum {Start,Define,Manipulate};
00219
00220
00221 int WidgetState;
00222 int CurrentHandle;
00223 int AllowNodePicking;
00224 int FollowCursor;
00225 int ContinuousDraw;
00226 int ContinuousActive;
00227
00228
00229
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
00240 void SelectNode();
00241 void AddNode();
00242
00243 private:
00244 vtkContourWidget(const vtkContourWidget&);
00245 void operator=(const vtkContourWidget&);
00246 };
00247
00248 #endif