VTK: Interaction/Widgets/vtkParallelopipedWidget.h Source File

| 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
42 class vtkParallelopipedRepresentation;
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
57 vtkTypeMacro(vtkParallelopipedWidget, vtkAbstractWidget);
58 void PrintSelf(ostream& os, vtkIndent indent) override;
59
65 void SetEnabled(int) override;
66
72 void SetRepresentation(vtkParallelopipedRepresentation* r)
73 {
74 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
75 }
76
80 vtkParallelopipedRepresentation* GetParallelopipedRepresentation()
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:
107 vtkParallelopipedWidget();
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
118 vtkTypeBool EnableChairCreation;
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
132 vtkHandleWidget** HandleWidgets;
133
137 enum WidgetEventIds
138 {
139 RequestResizeEvent = 10000,
140 RequestResizeAlongAnAxisEvent,
141 RequestChairModeEvent
142 };
143
144 vtkWidgetSet* WidgetSet;
145
146 private:
147 vtkParallelopipedWidget(const vtkParallelopipedWidget&) = delete;
148 void operator=(const vtkParallelopipedWidget&) = delete;
149 };
150
151 VTK_ABI_NAMESPACE_END
152 #endif
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:64
vtkAbstractWidget::WidgetRep
vtkWidgetRepresentation * WidgetRep
Definition: vtkAbstractWidget.h:178
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:80
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:70
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkParallelopipedRepresentation
Default representation for vtkParallelopipedWidget.
Definition: vtkParallelopipedRepresentation.h:45
vtkParallelopipedWidget
a widget to manipulate 3D parallelopipeds
Definition: vtkParallelopipedWidget.h:47
vtkParallelopipedWidget::HandleWidgets
vtkHandleWidget ** HandleWidgets
Definition: vtkParallelopipedWidget.h:132
vtkParallelopipedWidget::CreateDefaultRepresentation
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
vtkParallelopipedWidget::SetRepresentation
void SetRepresentation(vtkParallelopipedRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkParallelopipedWidget.h:72
vtkParallelopipedWidget::ReportReferences
void ReportReferences(vtkGarbageCollector *collector) override
vtkParallelopipedWidget::vtkParallelopipedWidget
vtkParallelopipedWidget()
vtkParallelopipedWidget::BeginTranslateAction
void BeginTranslateAction(vtkParallelopipedWidget *dispatcher)
vtkParallelopipedWidget::SetProcessEvents
void SetProcessEvents(vtkTypeBool) override
Methods to change the whether the widget responds to interaction.
vtkParallelopipedWidget::TranslateAction
void TranslateAction(vtkParallelopipedWidget *dispatcher)
vtkParallelopipedWidget::RequestResizeCallback
static void RequestResizeCallback(vtkAbstractWidget *)
vtkParallelopipedWidget::OnLeftButtonUpCallback
static void OnLeftButtonUpCallback(vtkAbstractWidget *)
vtkParallelopipedWidget::WidgetSet
vtkWidgetSet * WidgetSet
Definition: vtkParallelopipedWidget.h:144
vtkParallelopipedWidget::WidgetEventIds
WidgetEventIds
Events invoked by this widget.
Definition: vtkParallelopipedWidget.h:138
vtkParallelopipedWidget::RequestResizeAlongAnAxisEvent
@ RequestResizeAlongAnAxisEvent
Definition: vtkParallelopipedWidget.h:140
vtkParallelopipedWidget::RequestResizeAlongAnAxisCallback
static void RequestResizeAlongAnAxisCallback(vtkAbstractWidget *)
vtkParallelopipedWidget::GetParallelopipedRepresentation
vtkParallelopipedRepresentation * GetParallelopipedRepresentation()
Return the representation as a vtkParallelopipedRepresentation.
Definition: vtkParallelopipedWidget.h:80
vtkParallelopipedWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
vtkParallelopipedWidget::SetCursor
void SetCursor(int state) override
vtkParallelopipedWidget::TranslateCallback
static void TranslateCallback(vtkAbstractWidget *)
vtkParallelopipedWidget::OnMouseMoveCallback
static void OnMouseMoveCallback(vtkAbstractWidget *)
vtkParallelopipedWidget::EnableChairCreation
vtkTypeBool EnableChairCreation
Definition: vtkParallelopipedWidget.h:118
vtkParallelopipedWidget::RequestChairModeCallback
static void RequestChairModeCallback(vtkAbstractWidget *)
vtkParallelopipedWidget::SetEnabled
void SetEnabled(int) override
Override the superclass method.
vtkParallelopipedWidget::New
static vtkParallelopipedWidget * New()
Instantiate the object.
vtkParallelopipedWidget::~vtkParallelopipedWidget
~vtkParallelopipedWidget() override
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:65
vtkWidgetSet
Synchronize a collection on vtkWidgets drawn on different renderwindows using the Callback - Dispatch...
Definition: vtkWidgetSet.h:103
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkAbstractWidget.h