VTK: Rendering/Core/vtkObserverMediator.h Source File

| VTK 9.3.1

vtkObserverMediator.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
19 #ifndef vtkObserverMediator_h
20 #define vtkObserverMediator_h
21
22 #include "vtkObject.h"
23 #include "vtkRenderingCoreModule.h" // For export macro
24
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkRenderWindowInteractor;
27 class vtkInteractorObserver;
28 class vtkObserverMap;
29
30 class VTKRENDERINGCORE_EXPORT vtkObserverMediator : public vtkObject
31 {
32 public:
36 static vtkObserverMediator* New();
37
39
42 vtkTypeMacro(vtkObserverMediator, vtkObject);
43 void PrintSelf(ostream& os, vtkIndent indent) override;
45
47
51 void SetInteractor(vtkRenderWindowInteractor* iren);
52 vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor);
54
60 int RequestCursorShape(vtkInteractorObserver*, int requestedShape);
61
65 void RemoveAllCursorShapeRequests(vtkInteractorObserver*);
66
67 protected:
68 vtkObserverMediator();
69 ~vtkObserverMediator() override;
70
71 // The render window whose cursor we are controlling
72 vtkRenderWindowInteractor* Interactor;
73
74 // A map whose key is the observer*, and whose data value is a cursor
75 // request. Note that a special compare function is used to sort the
76 // widgets based on the observer's priority.
77 vtkObserverMap* ObserverMap; // given a widget*, return its data
78
79 // The current observer and cursor shape
80 vtkInteractorObserver* CurrentObserver;
81 int CurrentCursorShape;
82
83 private:
84 vtkObserverMediator(const vtkObserverMediator&) = delete;
85 void operator=(const vtkObserverMediator&) = delete;
86 };
87
88 VTK_ABI_NAMESPACE_END
89 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInteractorObserver
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
Definition: vtkInteractorObserver.h:64
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkObserverMediator
manage contention for cursors and other resources
Definition: vtkObserverMediator.h:31
vtkObserverMediator::RemoveAllCursorShapeRequests
void RemoveAllCursorShapeRequests(vtkInteractorObserver *)
Remove all requests for cursor shape from a given interactor.
vtkObserverMediator::vtkObserverMediator
vtkObserverMediator()
vtkObserverMediator::New
static vtkObserverMediator * New()
Instantiate the class.
vtkObserverMediator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
vtkObserverMediator::RequestCursorShape
int RequestCursorShape(vtkInteractorObserver *, int requestedShape)
Method used to request a cursor shape.
vtkObserverMediator::SetInteractor
void SetInteractor(vtkRenderWindowInteractor *iren)
Specify the instance of vtkRenderWindow whose cursor shape is to be managed.
vtkObserverMediator::Interactor
vtkRenderWindowInteractor * Interactor
Definition: vtkObserverMediator.h:72
vtkObserverMediator::~vtkObserverMediator
~vtkObserverMediator() override
vtkObserverMediator::ObserverMap
vtkObserverMap * ObserverMap
Definition: vtkObserverMediator.h:77
vtkObserverMediator::CurrentCursorShape
int CurrentCursorShape
Definition: vtkObserverMediator.h:81
vtkObserverMediator::CurrentObserver
vtkInteractorObserver * CurrentObserver
Definition: vtkObserverMediator.h:80
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:82
vtkObject.h