VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkParallelopipedWidget.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 =========================================================================*/ 00046 #ifndef __vtkParallelopipedWidget_h 00047 #define __vtkParallelopipedWidget_h 00048 00049 #include "vtkAbstractWidget.h" 00050 00051 class vtkParallelopipedRepresentation; 00052 class vtkHandleWidget; 00053 class vtkWidgetSet; 00054 00055 class VTK_WIDGETS_EXPORT vtkParallelopipedWidget : public vtkAbstractWidget 00056 { 00057 //BTX 00058 friend class vtkWidgetSet; 00059 //ETX 00060 public: 00062 static vtkParallelopipedWidget *New(); 00063 00064 vtkTypeMacro(vtkParallelopipedWidget,vtkAbstractWidget); 00065 void PrintSelf(ostream& os, vtkIndent indent); 00066 00071 virtual void SetEnabled(int); 00072 00074 00077 void SetRepresentation(vtkParallelopipedRepresentation *r) 00078 { 00079 this->Superclass::SetWidgetRepresentation( 00080 reinterpret_cast<vtkWidgetRepresentation*>(r)); 00081 } 00083 00085 00086 vtkParallelopipedRepresentation *GetParallelopipedRepresentation() 00087 {return reinterpret_cast<vtkParallelopipedRepresentation*>(this->WidgetRep);} 00089 00091 00093 vtkSetMacro(EnableChairCreation,int); 00094 vtkGetMacro(EnableChairCreation,int); 00095 vtkBooleanMacro(EnableChairCreation,int); 00097 00099 void CreateDefaultRepresentation(); 00100 00103 virtual void SetProcessEvents(int); 00104 00105 protected: 00106 vtkParallelopipedWidget(); 00107 ~vtkParallelopipedWidget(); 00108 00109 static void RequestResizeCallback (vtkAbstractWidget* ); 00110 static void RequestResizeAlongAnAxisCallback (vtkAbstractWidget* ); 00111 static void RequestChairModeCallback (vtkAbstractWidget* ); 00112 static void TranslateCallback (vtkAbstractWidget* ); 00113 static void OnMouseMoveCallback (vtkAbstractWidget* ); 00114 static void OnLeftButtonUpCallback (vtkAbstractWidget* ); 00115 00116 // Control whether chairs can be created 00117 int EnableChairCreation; 00118 00120 void BeginTranslateAction ( vtkParallelopipedWidget *dispatcher); 00121 void TranslateAction ( vtkParallelopipedWidget *dispatcher); 00123 00124 // helper methods for cursor management 00125 void SetCursor(int state); 00126 00127 // To break reference count loops 00128 virtual void ReportReferences(vtkGarbageCollector* collector); 00129 00130 // The positioning handle widgets 00131 vtkHandleWidget **HandleWidgets; 00132 00133 //BTX 00135 00136 enum WidgetEventIds 00137 { 00138 RequestResizeEvent = 10000, 00139 RequestResizeAlongAnAxisEvent, 00140 RequestChairModeEvent 00141 }; 00142 //ETX 00144 00145 vtkWidgetSet* WidgetSet; 00146 00147 private: 00148 vtkParallelopipedWidget(const vtkParallelopipedWidget&); //Not implemented 00149 void operator=(const vtkParallelopipedWidget&); //Not implemented 00150 }; 00151 00152 #endif