VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkLineWidget2.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 =========================================================================*/ 00087 #ifndef __vtkLineWidget2_h 00088 #define __vtkLineWidget2_h 00089 00090 #include "vtkInteractionWidgetsModule.h" // For export macro 00091 #include "vtkAbstractWidget.h" 00092 00093 class vtkLineRepresentation; 00094 class vtkHandleWidget; 00095 00096 00097 class VTKINTERACTIONWIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget 00098 { 00099 public: 00101 static vtkLineWidget2 *New(); 00102 00104 00105 vtkTypeMacro(vtkLineWidget2,vtkAbstractWidget); 00106 void PrintSelf(ostream& os, vtkIndent indent); 00108 00111 virtual void SetEnabled(int enabling); 00112 00114 00117 void SetRepresentation(vtkLineRepresentation *r) 00118 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00120 00122 00123 vtkLineRepresentation *GetLineRepresentation() 00124 {return reinterpret_cast<vtkLineRepresentation*>(this->WidgetRep);} 00126 00128 void CreateDefaultRepresentation(); 00129 00132 virtual void SetProcessEvents(int); 00133 00134 protected: 00135 vtkLineWidget2(); 00136 ~vtkLineWidget2(); 00137 00138 //BTX - manage the state of the widget 00139 int WidgetState; 00140 enum _WidgetState {Start=0,Active}; 00141 //ETX 00142 int CurrentHandle; 00143 00144 // These methods handle events 00145 static void SelectAction(vtkAbstractWidget*); 00146 static void TranslateAction(vtkAbstractWidget*); 00147 static void ScaleAction(vtkAbstractWidget*); 00148 static void EndSelectAction(vtkAbstractWidget*); 00149 static void MoveAction(vtkAbstractWidget*); 00150 00151 // The positioning handle widgets 00152 vtkHandleWidget *Point1Widget; //first end point 00153 vtkHandleWidget *Point2Widget; //second end point 00154 vtkHandleWidget *LineHandle; //used when selecting the line 00155 00156 private: 00157 vtkLineWidget2(const vtkLineWidget2&); //Not implemented 00158 void operator=(const vtkLineWidget2&); //Not implemented 00159 }; 00160 00161 #endif