VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkCompassWidget.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 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00020 00021 00067 #ifndef vtkCompassWidget_h 00068 #define vtkCompassWidget_h 00069 00070 #include "vtkGeovisCoreModule.h" // For export macro 00071 #include "vtkAbstractWidget.h" 00072 00073 class vtkCompassRepresentation; 00074 00075 00076 class VTKGEOVISCORE_EXPORT vtkCompassWidget : public vtkAbstractWidget 00077 { 00078 public: 00080 static vtkCompassWidget *New(); 00081 00083 00084 vtkTypeMacro(vtkCompassWidget,vtkAbstractWidget); 00085 void PrintSelf(ostream& os, vtkIndent indent); 00087 00089 00092 void SetRepresentation(vtkCompassRepresentation *r) 00093 {this->Superclass::SetWidgetRepresentation 00094 (reinterpret_cast<vtkWidgetRepresentation*>(r));} 00096 00098 void CreateDefaultRepresentation(); 00099 00101 00102 double GetHeading(); 00103 void SetHeading(double v); 00104 double GetTilt(); 00105 void SetTilt(double t); 00106 double GetDistance(); 00107 void SetDistance(double t); 00109 00110 protected: 00111 vtkCompassWidget(); 00112 ~vtkCompassWidget() {} 00113 00114 // These are the events that are handled 00115 static void SelectAction(vtkAbstractWidget*); 00116 static void EndSelectAction(vtkAbstractWidget*); 00117 static void MoveAction(vtkAbstractWidget*); 00118 static void TimerAction(vtkAbstractWidget*); 00119 00120 //BTX - manage the state of the widget 00121 int WidgetState; 00122 enum _WidgetState 00123 { 00124 Start=0, 00125 Highlighting, 00126 Adjusting, 00127 TiltAdjusting, 00128 DistanceAdjusting 00129 }; 00130 //ETX 00131 00132 int TimerId; 00133 int TimerDuration; 00134 double StartTime; 00135 00136 private: 00137 vtkCompassWidget(const vtkCompassWidget&); //Not implemented 00138 void operator=(const vtkCompassWidget&); //Not implemented 00139 }; 00140 00141 #endif