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
00163 vtkContourRepresentation *GetContourRepresentation()
00164 {return reinterpret_cast<vtkContourRepresentation*>(this->WidgetRep);}
00166
00168 void CreateDefaultRepresentation();
00169
00171 void CloseLoop();
00172
00174
00175 vtkSetMacro(WidgetState,int);
00177
00179
00180 vtkGetMacro(WidgetState,int);
00182
00184
00187 void SetAllowNodePicking(int );
00188 vtkGetMacro( AllowNodePicking, int );
00189 vtkBooleanMacro( AllowNodePicking, int );
00191
00193
00198 vtkSetMacro( FollowCursor, int );
00199 vtkGetMacro( FollowCursor, int );
00200 vtkBooleanMacro( FollowCursor, int );
00202
00204
00212 vtkSetMacro( ContinuousDraw, int );
00213 vtkGetMacro( ContinuousDraw, int );
00214 vtkBooleanMacro( ContinuousDraw, int );
00216
00218
00223 virtual void Initialize( vtkPolyData * poly, int state = 1 );
00224 virtual void Initialize()
00225 {this->Initialize(NULL);}
00227
00228 protected:
00229 vtkContourWidget();
00230 ~vtkContourWidget();
00231
00232
00233
00234 enum {Start,Define,Manipulate};
00235
00236
00237 int WidgetState;
00238 int CurrentHandle;
00239 int AllowNodePicking;
00240 int FollowCursor;
00241 int ContinuousDraw;
00242 int ContinuousActive;
00243
00244
00245
00246 static void SelectAction(vtkAbstractWidget*);
00247 static void AddFinalPointAction(vtkAbstractWidget*);
00248 static void MoveAction(vtkAbstractWidget*);
00249 static void EndSelectAction(vtkAbstractWidget*);
00250 static void DeleteAction(vtkAbstractWidget*);
00251 static void TranslateContourAction(vtkAbstractWidget*);
00252 static void ScaleContourAction(vtkAbstractWidget*);
00253 static void ResetAction(vtkAbstractWidget*);
00254
00255
00256 void SelectNode();
00257 void AddNode();
00258
00259 private:
00260 vtkContourWidget(const vtkContourWidget&);
00261 void operator=(const vtkContourWidget&);
00262 };
00263
00264 #endif