VTK  9.0.1
vtkParallelopipedWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkParallelopipedWidget.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
41 #ifndef vtkParallelopipedWidget_h
42 #define vtkParallelopipedWidget_h
43 
44 #include "vtkAbstractWidget.h"
45 #include "vtkInteractionWidgetsModule.h" // For export macro
46 
48 class vtkHandleWidget;
49 class vtkWidgetSet;
50 
51 class VTKINTERACTIONWIDGETS_EXPORT vtkParallelopipedWidget : public vtkAbstractWidget
52 {
53 
54  friend class vtkWidgetSet;
55 
56 public:
60  static vtkParallelopipedWidget* New();
61 
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
70  void SetEnabled(int) override;
71 
78  {
79  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
80  }
81 
86  {
87  return reinterpret_cast<vtkParallelopipedRepresentation*>(this->WidgetRep);
88  }
89 
91 
95  vtkSetMacro(EnableChairCreation, vtkTypeBool);
96  vtkGetMacro(EnableChairCreation, vtkTypeBool);
97  vtkBooleanMacro(EnableChairCreation, vtkTypeBool);
99 
103  void CreateDefaultRepresentation() override;
104 
109  void SetProcessEvents(vtkTypeBool) override;
110 
111 protected:
113  ~vtkParallelopipedWidget() override;
114 
115  static void RequestResizeCallback(vtkAbstractWidget*);
116  static void RequestResizeAlongAnAxisCallback(vtkAbstractWidget*);
117  static void RequestChairModeCallback(vtkAbstractWidget*);
118  static void TranslateCallback(vtkAbstractWidget*);
119  static void OnMouseMoveCallback(vtkAbstractWidget*);
120  static void OnLeftButtonUpCallback(vtkAbstractWidget*);
121 
122  // Control whether chairs can be created
124 
126  void BeginTranslateAction(vtkParallelopipedWidget* dispatcher);
127  void TranslateAction(vtkParallelopipedWidget* dispatcher);
129 
130  // helper methods for cursor management
131  void SetCursor(int state) override;
132 
133  // To break reference count loops
134  void ReportReferences(vtkGarbageCollector* collector) override;
135 
136  // The positioning handle widgets
138 
143  {
144  RequestResizeEvent = 10000,
146  RequestChairModeEvent
147  };
148 
150 
151 private:
153  void operator=(const vtkParallelopipedWidget&) = delete;
154 };
155 
156 #endif
virtual void SetCursor(int vtkNotUsed(state))
WidgetEventIds
Events invoked by this widget.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
a general widget for moving handles
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
Synchronize a collection on vtkWidgets drawn on different renderwindows using the Callback - Dispatch...
Definition: vtkWidgetSet.h:113
Detect and break reference loops.
vtkWidgetRepresentation * WidgetRep
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual void ReportReferences(vtkGarbageCollector *)
Default representation for vtkParallelopipedWidget.
vtkParallelopipedRepresentation * GetParallelopipedRepresentation()
Return the representation as a vtkParallelopipedRepresentation.
define the API for widget / widget representation
virtual void SetProcessEvents(vtkTypeBool)
Methods to change whether the widget responds to interaction.
void SetEnabled(int) override
Methods for activating this widget.
a widget to manipulate 3D parallelopipeds
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void SetRepresentation(vtkParallelopipedRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...