VTK
dox/Widgets/vtkLineWidget2.h
Go to the documentation of this file.
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 =========================================================================*/
00090 #ifndef __vtkLineWidget2_h
00091 #define __vtkLineWidget2_h
00092 
00093 #include "vtkAbstractWidget.h"
00094 
00095 class vtkLineRepresentation;
00096 class vtkHandleWidget;
00097 
00098 
00099 class VTK_WIDGETS_EXPORT vtkLineWidget2 : public vtkAbstractWidget
00100 {
00101 public:
00103   static vtkLineWidget2 *New();
00104 
00106 
00107   vtkTypeMacro(vtkLineWidget2,vtkAbstractWidget);
00108   void PrintSelf(ostream& os, vtkIndent indent);
00110 
00113   virtual void SetEnabled(int enabling);
00114 
00116 
00119   void SetRepresentation(vtkLineRepresentation *r)
00120     {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
00122   
00124 
00125   vtkLineRepresentation *GetLineRepresentation()
00126     {return reinterpret_cast<vtkLineRepresentation*>(this->WidgetRep);}
00128 
00130   void CreateDefaultRepresentation();
00131 
00134   virtual void SetProcessEvents(int);
00135 
00136 protected:
00137   vtkLineWidget2();
00138   ~vtkLineWidget2();
00139 
00140 //BTX - manage the state of the widget
00141   int WidgetState;
00142   enum _WidgetState {Start=0,Active};
00143 //ETX
00144   int CurrentHandle;
00145     
00146   // These methods handle events
00147   static void SelectAction(vtkAbstractWidget*);
00148   static void TranslateAction(vtkAbstractWidget*);
00149   static void ScaleAction(vtkAbstractWidget*);
00150   static void EndSelectAction(vtkAbstractWidget*);
00151   static void MoveAction(vtkAbstractWidget*);
00152 
00153   // The positioning handle widgets
00154   vtkHandleWidget *Point1Widget; //first end point
00155   vtkHandleWidget *Point2Widget; //second end point
00156   vtkHandleWidget *LineHandle; //used when selecting the line
00157 
00158 private:
00159   vtkLineWidget2(const vtkLineWidget2&);  //Not implemented
00160   void operator=(const vtkLineWidget2&);  //Not implemented
00161 };
00162 
00163 #endif