VTK  9.0.20210424
vtkObserverMediator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkObserverMediator.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 =========================================================================*/
31 #ifndef vtkObserverMediator_h
32 #define vtkObserverMediator_h
33 
34 #include "vtkObject.h"
35 #include "vtkRenderingCoreModule.h" // For export macro
36 
39 class vtkObserverMap;
40 
41 class VTKRENDERINGCORE_EXPORT vtkObserverMediator : public vtkObject
42 {
43 public:
48 
50 
54  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
58 
63  vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor);
65 
71  int RequestCursorShape(vtkInteractorObserver*, int requestedShape);
72 
77 
78 protected:
81 
82  // The render window whose cursor we are controlling
84 
85  // A map whose key is the observer*, and whose data value is a cursor
86  // request. Note that a special compare function is used to sort the
87  // widgets based on the observer's priority.
88  vtkObserverMap* ObserverMap; // given a widget*, return its data
89 
90  // The current observer and cursor shape
93 
94 private:
96  void operator=(const vtkObserverMediator&) = delete;
97 };
98 
99 #endif
vtkObserverMediator::RemoveAllCursorShapeRequests
void RemoveAllCursorShapeRequests(vtkInteractorObserver *)
Remove all requests for cursor shape from a given interactor.
vtkObserverMediator::CurrentObserver
vtkInteractorObserver * CurrentObserver
Definition: vtkObserverMediator.h:91
vtkObserverMediator::CurrentCursorShape
int CurrentCursorShape
Definition: vtkObserverMediator.h:92
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:63
vtkObserverMediator::ObserverMap
vtkObserverMap * ObserverMap
Definition: vtkObserverMediator.h:88
vtkInteractorObserver
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
Definition: vtkInteractorObserver.h:66
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.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkObserverMediator::Interactor
vtkRenderWindowInteractor * Interactor
Definition: vtkObserverMediator.h:83
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:83
vtkObserverMediator::SetInteractor
void SetInteractor(vtkRenderWindowInteractor *iren)
Specify the instance of vtkRenderWindow whose cursor shape is to be managed.
vtkObject.h
vtkObserverMediator::New
static vtkObserverMediator * New()
Instantiate the class.
vtkObserverMediator::~vtkObserverMediator
~vtkObserverMediator() override
vtkObserverMediator
manage contention for cursors and other resources
Definition: vtkObserverMediator.h:42
vtkObserverMediator::vtkObserverMediator
vtkObserverMediator()