VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkBoxWidget2.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 =========================================================================*/ 00101 #ifndef __vtkBoxWidget2_h 00102 #define __vtkBoxWidget2_h 00103 00104 #include "vtkAbstractWidget.h" 00105 00106 class vtkBoxRepresentation; 00107 class vtkHandleWidget; 00108 00109 00110 class VTK_WIDGETS_EXPORT vtkBoxWidget2 : public vtkAbstractWidget 00111 { 00112 public: 00114 static vtkBoxWidget2 *New(); 00115 00117 00118 vtkTypeMacro(vtkBoxWidget2,vtkAbstractWidget); 00119 void PrintSelf(ostream& os, vtkIndent indent); 00121 00123 00126 void SetRepresentation(vtkBoxRepresentation *r) 00127 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00129 00131 00137 vtkSetMacro(TranslationEnabled,int); 00138 vtkGetMacro(TranslationEnabled,int); 00139 vtkBooleanMacro(TranslationEnabled,int); 00140 vtkSetMacro(ScalingEnabled,int); 00141 vtkGetMacro(ScalingEnabled,int); 00142 vtkBooleanMacro(ScalingEnabled,int); 00143 vtkSetMacro(RotationEnabled,int); 00144 vtkGetMacro(RotationEnabled,int); 00145 vtkBooleanMacro(RotationEnabled,int); 00146 vtkSetMacro(MoveFacesEnabled,int); 00147 vtkGetMacro(MoveFacesEnabled,int); 00148 vtkBooleanMacro(MoveFacesEnabled,int); 00150 00153 void CreateDefaultRepresentation(); 00154 00155 protected: 00156 vtkBoxWidget2(); 00157 ~vtkBoxWidget2(); 00158 00159 //BTX - manage the state of the widget 00160 int WidgetState; 00161 enum _WidgetState {Start=0,Active}; 00162 //ETX 00163 00164 // These methods handle events 00165 static void SelectAction(vtkAbstractWidget*); 00166 static void EndSelectAction(vtkAbstractWidget*); 00167 static void TranslateAction(vtkAbstractWidget*); 00168 static void ScaleAction(vtkAbstractWidget*); 00169 static void MoveAction(vtkAbstractWidget*); 00170 00171 // Control whether scaling, rotation, and translation are supported 00172 int TranslationEnabled; 00173 int ScalingEnabled; 00174 int RotationEnabled; 00175 int MoveFacesEnabled; 00176 private: 00177 vtkBoxWidget2(const vtkBoxWidget2&); //Not implemented 00178 void operator=(const vtkBoxWidget2&); //Not implemented 00179 }; 00180 00181 #endif