VTK
|
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 "vtkInteractionWidgetsModule.h" // For export macro 00082 #include "vtkAbstractWidget.h" 00083 00084 class vtkBorderRepresentation; 00085 00086 00087 class VTKINTERACTIONWIDGETS_EXPORT vtkBorderWidget : public vtkAbstractWidget 00088 { 00089 public: 00091 static vtkBorderWidget *New(); 00092 00094 00095 vtkTypeMacro(vtkBorderWidget,vtkAbstractWidget); 00096 void PrintSelf(ostream& os, vtkIndent indent); 00098 00100 00104 vtkSetMacro(Selectable,int); 00105 vtkGetMacro(Selectable,int); 00106 vtkBooleanMacro(Selectable,int); 00108 00109 00111 00114 vtkSetMacro(Resizable,int); 00115 vtkGetMacro(Resizable,int); 00116 vtkBooleanMacro(Resizable,int); 00118 00119 00121 00124 void SetRepresentation(vtkBorderRepresentation *r) 00125 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00127 00129 00130 vtkBorderRepresentation *GetBorderRepresentation() 00131 {return reinterpret_cast<vtkBorderRepresentation*>(this->WidgetRep);} 00133 00135 virtual void CreateDefaultRepresentation(); 00136 00137 protected: 00138 vtkBorderWidget(); 00139 ~vtkBorderWidget(); 00140 00144 virtual void SelectRegion(double eventPos[2]); 00145 00146 //enable the selection of the region interior to the widget 00147 int Selectable; 00148 int Resizable; 00149 00150 //processes the registered events 00151 static void SelectAction(vtkAbstractWidget*); 00152 static void TranslateAction(vtkAbstractWidget*); 00153 static void EndSelectAction(vtkAbstractWidget*); 00154 static void MoveAction(vtkAbstractWidget*); 00155 00156 // Special internal methods to support subclasses handling events. 00157 // If a non-zero value is returned, the subclass is handling the event. 00158 virtual int SubclassSelectAction() {return 0;} 00159 virtual int SubclassTranslateAction() {return 0;} 00160 virtual int SubclassEndSelectAction() {return 0;} 00161 virtual int SubclassMoveAction() {return 0;} 00162 00163 // helper methods for cursoe management 00164 virtual void SetCursor(int State); 00165 00166 //BTX 00167 //widget state 00168 int WidgetState; 00169 enum _WidgetState{Start=0,Define,Manipulate,Selected}; 00170 //ETX 00171 00172 private: 00173 vtkBorderWidget(const vtkBorderWidget&); //Not implemented 00174 void operator=(const vtkBorderWidget&); //Not implemented 00175 }; 00176 00177 #endif