VTK
dox/Interaction/Widgets/vtkParallelopipedWidget.h
Go to the documentation of this file.
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 "vtkInteractionWidgetsModule.h" // For export macro
00050 #include "vtkAbstractWidget.h"
00051 
00052 class vtkParallelopipedRepresentation;
00053 class vtkHandleWidget;
00054 class vtkWidgetSet;
00055 
00056 class VTKINTERACTIONWIDGETS_EXPORT vtkParallelopipedWidget : public vtkAbstractWidget
00057 {
00058   //BTX
00059   friend class vtkWidgetSet;
00060   //ETX
00061 public:
00063   static vtkParallelopipedWidget *New();
00064 
00065   vtkTypeMacro(vtkParallelopipedWidget,vtkAbstractWidget);
00066   void PrintSelf(ostream& os, vtkIndent indent);
00067 
00072   virtual void SetEnabled(int);
00073 
00075 
00078   void SetRepresentation(vtkParallelopipedRepresentation *r)
00079     {
00080     this->Superclass::SetWidgetRepresentation(
00081         reinterpret_cast<vtkWidgetRepresentation*>(r));
00082     }
00084 
00086 
00087   vtkParallelopipedRepresentation *GetParallelopipedRepresentation()
00088     {return reinterpret_cast<vtkParallelopipedRepresentation*>(this->WidgetRep);}
00090 
00092 
00094   vtkSetMacro(EnableChairCreation,int);
00095   vtkGetMacro(EnableChairCreation,int);
00096   vtkBooleanMacro(EnableChairCreation,int);
00098 
00100   void CreateDefaultRepresentation();
00101 
00104   virtual void SetProcessEvents(int);
00105 
00106 protected:
00107   vtkParallelopipedWidget();
00108   ~vtkParallelopipedWidget();
00109 
00110   static void RequestResizeCallback             (vtkAbstractWidget* );
00111   static void RequestResizeAlongAnAxisCallback  (vtkAbstractWidget* );
00112   static void RequestChairModeCallback          (vtkAbstractWidget* );
00113   static void TranslateCallback                 (vtkAbstractWidget* );
00114   static void OnMouseMoveCallback               (vtkAbstractWidget* );
00115   static void OnLeftButtonUpCallback            (vtkAbstractWidget* );
00116 
00117   // Control whether chairs can be created
00118   int EnableChairCreation;
00119 
00121   void BeginTranslateAction ( vtkParallelopipedWidget *dispatcher);
00122   void TranslateAction ( vtkParallelopipedWidget *dispatcher);
00124 
00125   // helper methods for cursor management
00126   void SetCursor(int state);
00127 
00128   // To break reference count loops
00129   virtual void ReportReferences(vtkGarbageCollector* collector);
00130 
00131   // The positioning handle widgets
00132   vtkHandleWidget **HandleWidgets;
00133 
00134   //BTX
00136 
00137   enum WidgetEventIds
00138     {
00139     RequestResizeEvent = 10000,
00140     RequestResizeAlongAnAxisEvent,
00141     RequestChairModeEvent
00142     };
00143   //ETX
00145 
00146   vtkWidgetSet* WidgetSet;
00147 
00148 private:
00149   vtkParallelopipedWidget(const vtkParallelopipedWidget&);  //Not implemented
00150   void operator=(const vtkParallelopipedWidget&);  //Not implemented
00151 };
00152 
00153 #endif