You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.9 KiB
C
69 lines
1.9 KiB
C
3 weeks ago
|
/*=========================================================================
|
||
|
|
||
|
Program: Visualization Toolkit
|
||
|
Module: vtkContextScene.h
|
||
|
|
||
|
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
|
||
|
All rights reserved.
|
||
|
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
|
||
|
|
||
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
||
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||
|
PURPOSE. See the above copyright notice for more information.
|
||
|
|
||
|
=========================================================================*/
|
||
|
|
||
|
/**
|
||
|
* @class vtkContextKeyEvent
|
||
|
* @brief data structure to represent key events.
|
||
|
*
|
||
|
*
|
||
|
* Provides a convenient data structure to represent key events in the
|
||
|
* vtkContextScene. Passed to vtkAbstractContextItem objects.
|
||
|
*/
|
||
|
|
||
|
#ifndef vtkContextKeyEvent_h
|
||
|
#define vtkContextKeyEvent_h
|
||
|
|
||
|
#include "vtkRenderingContext2DModule.h" // For export macro
|
||
|
#include "vtkVector.h" // For vtkVector2i
|
||
|
#include "vtkWeakPointer.h" // For vtkWeakPointer
|
||
|
|
||
|
class vtkRenderWindowInteractor;
|
||
|
|
||
|
class VTKRENDERINGCONTEXT2D_EXPORT vtkContextKeyEvent
|
||
|
{
|
||
|
public:
|
||
|
vtkContextKeyEvent();
|
||
|
|
||
|
/**
|
||
|
* Set the interactor for the key event.
|
||
|
*/
|
||
|
void SetInteractor(vtkRenderWindowInteractor* interactor);
|
||
|
|
||
|
/**
|
||
|
* Get the interactor for the key event. This can be null, and is provided
|
||
|
* only for convenience.
|
||
|
*/
|
||
|
vtkRenderWindowInteractor* GetInteractor() const;
|
||
|
|
||
|
/**
|
||
|
* Set the position of the mouse when the key was pressed.
|
||
|
*/
|
||
|
void SetPosition(const vtkVector2i& position) { this->Position = position; }
|
||
|
|
||
|
/**
|
||
|
* Get the position of the mouse when the key was pressed.
|
||
|
*/
|
||
|
vtkVector2i GetPosition() const { return this->Position; }
|
||
|
|
||
|
char GetKeyCode() const;
|
||
|
|
||
|
protected:
|
||
|
vtkWeakPointer<vtkRenderWindowInteractor> Interactor;
|
||
|
vtkVector2i Position;
|
||
|
};
|
||
|
|
||
|
#endif // vtkContextKeyEvent_h
|
||
|
// VTK-HeaderTest-Exclude: vtkContextKeyEvent.h
|