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