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 "vtkAbstractWidget.h" 00071 00072 class vtkCompassRepresentation; 00073 00074 00075 class VTK_GEOVIS_EXPORT vtkCompassWidget : public vtkAbstractWidget 00076 { 00077 public: 00079 static vtkCompassWidget *New(); 00080 00082 00083 vtkTypeMacro(vtkCompassWidget,vtkAbstractWidget); 00084 void PrintSelf(ostream& os, vtkIndent indent); 00086 00088 00091 void SetRepresentation(vtkCompassRepresentation *r) 00092 {this->Superclass::SetWidgetRepresentation 00093 (reinterpret_cast<vtkWidgetRepresentation*>(r));} 00095 00097 void CreateDefaultRepresentation(); 00098 00100 00101 double GetHeading(); 00102 void SetHeading(double v); 00103 double GetTilt(); 00104 void SetTilt(double t); 00105 double GetDistance(); 00106 void SetDistance(double t); 00108 00109 protected: 00110 vtkCompassWidget(); 00111 ~vtkCompassWidget() {} 00112 00113 // These are the events that are handled 00114 static void SelectAction(vtkAbstractWidget*); 00115 static void EndSelectAction(vtkAbstractWidget*); 00116 static void MoveAction(vtkAbstractWidget*); 00117 static void TimerAction(vtkAbstractWidget*); 00118 00119 //BTX - manage the state of the widget 00120 int WidgetState; 00121 enum _WidgetState 00122 { 00123 Start=0, 00124 Highlighting, 00125 Adjusting, 00126 TiltAdjusting, 00127 DistanceAdjusting 00128 }; 00129 //ETX 00130 00131 int TimerId; 00132 int TimerDuration; 00133 double StartTime; 00134 00135 private: 00136 vtkCompassWidget(const vtkCompassWidget&); //Not implemented 00137 void operator=(const vtkCompassWidget&); //Not implemented 00138 }; 00139 00140 #endif