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 =========================================================================*/
47 #ifndef vtkParallelopipedWidget_h
48 #define vtkParallelopipedWidget_h
49 
50 #include "vtkAbstractWidget.h"
51 #include "vtkInteractionWidgetsModule.h" // For export macro
52 
54 class vtkHandleWidget;
55 class vtkWidgetSet;
56 
57 class VTKINTERACTIONWIDGETS_EXPORT vtkParallelopipedWidget : public vtkAbstractWidget
58 {
59 
60  friend class vtkWidgetSet;
61 
62 public:
66  static vtkParallelopipedWidget* New();
67 
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
76  void SetEnabled(int) override;
77 
84  {
85  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
86  }
87 
92  {
93  return reinterpret_cast<vtkParallelopipedRepresentation*>(this->WidgetRep);
94  }
95 
97 
101  vtkSetMacro(EnableChairCreation, vtkTypeBool);
102  vtkGetMacro(EnableChairCreation, vtkTypeBool);
103  vtkBooleanMacro(EnableChairCreation, vtkTypeBool);
105 
109  void CreateDefaultRepresentation() override;
110 
115  void SetProcessEvents(vtkTypeBool) override;
116 
117 protected:
119  ~vtkParallelopipedWidget() override;
120 
121  static void RequestResizeCallback(vtkAbstractWidget*);
122  static void RequestResizeAlongAnAxisCallback(vtkAbstractWidget*);
123  static void RequestChairModeCallback(vtkAbstractWidget*);
124  static void TranslateCallback(vtkAbstractWidget*);
125  static void OnMouseMoveCallback(vtkAbstractWidget*);
126  static void OnLeftButtonUpCallback(vtkAbstractWidget*);
127 
128  // Control whether chairs can be created
130 
132  void BeginTranslateAction(vtkParallelopipedWidget* dispatcher);
133  void TranslateAction(vtkParallelopipedWidget* dispatcher);
135 
136  // helper methods for cursor management
137  void SetCursor(int state) override;
138 
139  // To break reference count loops
140  void ReportReferences(vtkGarbageCollector* collector) override;
141 
142  // The positioning handle widgets
144 
149  {
150  RequestResizeEvent = 10000,
152  RequestChairModeEvent
153  };
154 
156 
157 private:
159  void operator=(const vtkParallelopipedWidget&) = delete;
160 };
161 
162 #endif
vtkAbstractWidget::SetCursor
virtual void SetCursor(int vtkNotUsed(state))
Definition: vtkAbstractWidget.h:179
vtkHandleWidget
a general widget for moving handles
Definition: vtkHandleWidget.h:78
vtkAbstractWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAbstractWidget.h
vtkObjectBase::ReportReferences
virtual void ReportReferences(vtkGarbageCollector *)
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:59
vtkAbstractWidget::WidgetRep
vtkWidgetRepresentation * WidgetRep
Definition: vtkAbstractWidget.h:175
vtkParallelopipedWidget::WidgetEventIds
WidgetEventIds
Events invoked by this widget.
Definition: vtkParallelopipedWidget.h:148
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:65
vtkParallelopipedWidget
a widget to manipulate 3D parallelopipeds
Definition: vtkParallelopipedWidget.h:57
vtkAbstractWidget::CreateDefaultRepresentation
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkWidgetSet
Synchronize a collection on vtkWidgets drawn on different renderwindows using the Callback - Dispatch...
Definition: vtkWidgetSet.h:113
vtkParallelopipedWidget::GetParallelopipedRepresentation
vtkParallelopipedRepresentation * GetParallelopipedRepresentation()
Return the representation as a vtkParallelopipedRepresentation.
Definition: vtkParallelopipedWidget.h:91
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkParallelopipedWidget::EnableChairCreation
vtkTypeBool EnableChairCreation
Definition: vtkParallelopipedWidget.h:129
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:94
vtkAbstractWidget::SetEnabled
void SetEnabled(int) override
Methods for activating this widget.
vtkParallelopipedWidget::HandleWidgets
vtkHandleWidget ** HandleWidgets
Definition: vtkParallelopipedWidget.h:143
vtkParallelopipedWidget::SetRepresentation
void SetRepresentation(vtkParallelopipedRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
Definition: vtkParallelopipedWidget.h:83
vtkAbstractWidget::SetProcessEvents
virtual void SetProcessEvents(vtkTypeBool)
Methods to change whether the widget responds to interaction.
vtkParallelopipedWidget::RequestResizeAlongAnAxisEvent
@ RequestResizeAlongAnAxisEvent
Definition: vtkParallelopipedWidget.h:151
vtkParallelopipedRepresentation
Default representation for vtkParallelopipedWidget.
Definition: vtkParallelopipedRepresentation.h:50
vtkParallelopipedWidget::WidgetSet
vtkWidgetSet * WidgetSet
Definition: vtkParallelopipedWidget.h:155
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69