VTK
dox/Widgets/vtkBorderWidget.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkBorderWidget.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 =========================================================================*/
00078 #ifndef __vtkBorderWidget_h
00079 #define __vtkBorderWidget_h
00080 
00081 #include "vtkAbstractWidget.h"
00082 
00083 class vtkBorderRepresentation;
00084 
00085 
00086 class VTK_WIDGETS_EXPORT vtkBorderWidget : public vtkAbstractWidget
00087 {
00088 public:
00090   static vtkBorderWidget *New();
00091 
00093 
00094   vtkTypeMacro(vtkBorderWidget,vtkAbstractWidget);
00095   void PrintSelf(ostream& os, vtkIndent indent);
00097 
00099 
00103   vtkSetMacro(Selectable,int);
00104   vtkGetMacro(Selectable,int);
00105   vtkBooleanMacro(Selectable,int);
00107 
00108 
00110 
00113   vtkSetMacro(Resizable,int);
00114   vtkGetMacro(Resizable,int);
00115   vtkBooleanMacro(Resizable,int);
00117 
00118 
00120 
00123   void SetRepresentation(vtkBorderRepresentation *r)
00124     {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
00126   
00128 
00129   vtkBorderRepresentation *GetBorderRepresentation()
00130     {return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);}
00132 
00134   virtual void CreateDefaultRepresentation();
00135 
00136 protected:
00137   vtkBorderWidget();
00138   ~vtkBorderWidget();
00139 
00143   virtual void SelectRegion(double eventPos[2]);
00144 
00145   //enable the selection of the region interior to the widget
00146   int Selectable;
00147   int Resizable;
00148 
00149   //processes the registered events
00150   static void SelectAction(vtkAbstractWidget*);
00151   static void TranslateAction(vtkAbstractWidget*);
00152   static void EndSelectAction(vtkAbstractWidget*);
00153   static void MoveAction(vtkAbstractWidget*);
00154 
00155   // Special internal methods to support subclasses handling events.
00156   // If a non-zero value is returned, the subclass is handling the event.
00157   virtual int SubclassSelectAction() {return 0;}
00158   virtual int SubclassTranslateAction() {return 0;}
00159   virtual int SubclassEndSelectAction() {return 0;}
00160   virtual int SubclassMoveAction() {return 0;}
00161   
00162   // helper methods for cursoe management
00163   virtual void SetCursor(int State);
00164 
00165 //BTX
00166   //widget state
00167   int WidgetState;
00168   enum _WidgetState{Start=0,Define,Manipulate,Selected};
00169 //ETX
00170 
00171 private:
00172   vtkBorderWidget(const vtkBorderWidget&);  //Not implemented
00173   void operator=(const vtkBorderWidget&);  //Not implemented
00174 };
00175 
00176 #endif