VTK  9.3.1
vtkParallelopipedWidget.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
35 #ifndef vtkParallelopipedWidget_h
36 #define vtkParallelopipedWidget_h
37 
38 #include "vtkAbstractWidget.h"
39 #include "vtkInteractionWidgetsModule.h" // For export macro
40 
41 VTK_ABI_NAMESPACE_BEGIN
43 class vtkHandleWidget;
44 class vtkWidgetSet;
45 
46 class VTKINTERACTIONWIDGETS_EXPORT vtkParallelopipedWidget : public vtkAbstractWidget
47 {
48 
49  friend class vtkWidgetSet;
50 
51 public:
55  static vtkParallelopipedWidget* New();
56 
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
65  void SetEnabled(int) override;
66 
73  {
74  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
75  }
76 
81  {
82  return reinterpret_cast<vtkParallelopipedRepresentation*>(this->WidgetRep);
83  }
84 
86 
90  vtkSetMacro(EnableChairCreation, vtkTypeBool);
91  vtkGetMacro(EnableChairCreation, vtkTypeBool);
92  vtkBooleanMacro(EnableChairCreation, vtkTypeBool);
94 
98  void CreateDefaultRepresentation() override;
99 
104  void SetProcessEvents(vtkTypeBool) override;
105 
106 protected:
108  ~vtkParallelopipedWidget() override;
109 
110  static void RequestResizeCallback(vtkAbstractWidget*);
111  static void RequestResizeAlongAnAxisCallback(vtkAbstractWidget*);
112  static void RequestChairModeCallback(vtkAbstractWidget*);
113  static void TranslateCallback(vtkAbstractWidget*);
114  static void OnMouseMoveCallback(vtkAbstractWidget*);
115  static void OnLeftButtonUpCallback(vtkAbstractWidget*);
116 
117  // Control whether chairs can be created
119 
121  void BeginTranslateAction(vtkParallelopipedWidget* dispatcher);
122  void TranslateAction(vtkParallelopipedWidget* dispatcher);
124 
125  // helper methods for cursor management
126  void SetCursor(int state) override;
127 
128  // To break reference count loops
129  void ReportReferences(vtkGarbageCollector* collector) override;
130 
131  // The positioning handle widgets
133 
138  {
139  RequestResizeEvent = 10000,
141  RequestChairModeEvent
142  };
143 
145 
146 private:
148  void operator=(const vtkParallelopipedWidget&) = delete;
149 };
150 
151 VTK_ABI_NAMESPACE_END
152 #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:102
Detect and break reference loops.
vtkWidgetRepresentation * WidgetRep
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
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...