VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
41 
42 VTK_ABI_NAMESPACE_BEGIN
44 class vtkHandleWidget;
45 class vtkWidgetSet;
46 
47 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkParallelopipedWidget
48  : public vtkAbstractWidget
49 {
50 
51  friend class vtkWidgetSet;
52 
53 public:
57  static vtkParallelopipedWidget* New();
58 
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
67  void SetEnabled(int) override;
68 
75  {
76  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
77  }
78 
83  {
84  return reinterpret_cast<vtkParallelopipedRepresentation*>(this->WidgetRep);
85  }
86 
88 
92  vtkSetMacro(EnableChairCreation, vtkTypeBool);
93  vtkGetMacro(EnableChairCreation, vtkTypeBool);
94  vtkBooleanMacro(EnableChairCreation, vtkTypeBool);
96 
100  void CreateDefaultRepresentation() override;
101 
106  void SetProcessEvents(vtkTypeBool) override;
107 
108 protected:
110  ~vtkParallelopipedWidget() override;
111 
112  static void RequestResizeCallback(vtkAbstractWidget*);
113  static void RequestResizeAlongAnAxisCallback(vtkAbstractWidget*);
114  static void RequestChairModeCallback(vtkAbstractWidget*);
115  static void TranslateCallback(vtkAbstractWidget*);
116  static void OnMouseMoveCallback(vtkAbstractWidget*);
117  static void OnLeftButtonUpCallback(vtkAbstractWidget*);
118 
119  // Control whether chairs can be created
121 
123  void BeginTranslateAction(vtkParallelopipedWidget* dispatcher);
124  void TranslateAction(vtkParallelopipedWidget* dispatcher);
126 
127  // helper methods for cursor management
128  void SetCursor(int state) override;
129 
130  // To break reference count loops
131  void ReportReferences(vtkGarbageCollector* collector) override;
132 
133  // The positioning handle widgets
135 
140  {
141  RequestResizeEvent = 10000,
143  RequestChairModeEvent
144  };
145 
147 
148 private:
150  void operator=(const vtkParallelopipedWidget&) = delete;
151 };
152 
153 VTK_ABI_NAMESPACE_END
154 #endif
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
#define VTK_MARSHALAUTO
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...
virtual void SetCursor(int state)