Loading...
Searching...
No Matches
vtkFixedXRenderWindowInteractor.h
/*=========================================================================
Program: Visualization Toolkit
Module: vtkXRenderWindowInteractor.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 vtkXRenderWindowInteractor
* @brief an X event driven interface for a RenderWindow
*
* vtkXRenderWindowInteractor is a convenience object that provides event
* bindings to common graphics functions. For example, camera and actor
* functions such as zoom-in/zoom-out, azimuth, roll, and pan. IT is one of
* the window system specific subclasses of vtkRenderWindowInteractor. Please
* see vtkRenderWindowInteractor documentation for event bindings.
*
* @sa
* vtkRenderWindowInteractor
*/
#ifndef vtkXRenderWindowInteractor_h
#define vtkXRenderWindowInteractor_h
//===========================================================
// now we define the C++ class
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderingUIModule.h" // For export macro
#include <X11/Xlib.h> // Needed for X types in the public interface
namespace pcl {
class vtkCallbackCommand;
class vtkXRenderWindowInteractorInternals;
class VTKRENDERINGUI_EXPORT vtkXRenderWindowInteractor : public vtkRenderWindowInteractor
{
public:
vtkXRenderWindowInteractor(const vtkXRenderWindowInteractor&) = delete;
void operator=(const vtkXRenderWindowInteractor&) = delete;
static vtkXRenderWindowInteractor* New();
vtkTypeMacro(vtkXRenderWindowInteractor, vtkRenderWindowInteractor);
void PrintSelf(ostream& os, vtkIndent indent) override;
/**
* Initializes the event handlers without an XtAppContext. This is
* good for when you don't have a user interface, but you still
* want to have mouse interaction.
*/
void Initialize() override;
/**
* Break the event loop on 'q','e' keypress. Want more ???
*/
void TerminateApp() override;
/**
* Run the event loop and return. This is provided so that you can
* implement your own event loop but yet use the vtk event handling as
* well.
*/
void ProcessEvents() override;
///@{
/**
* Enable/Disable interactions. By default interactors are enabled when
* initialized. Initialize() must be called prior to enabling/disabling
* interaction. These methods are used when a window/widget is being
* shared by multiple renderers and interactors. This allows a "modal"
* display where one interactor is active when its data is to be displayed
* and all other interactors associated with the widget are disabled
* when their data is not displayed.
*/
void Enable() override;
void Disable() override;
///@}
/**
* Update the Size data member and set the associated RenderWindow's
* size.
*/
void UpdateSize(int, int) override;
/**
* Re-defines virtual function to get mouse position by querying X-server.
*/
void GetMousePosition(int* x, int* y) override;
void DispatchEvent(XEvent*);
protected:
vtkXRenderWindowInteractor();
~vtkXRenderWindowInteractor() override;
/**
* Update the Size data member and set the associated RenderWindow's
* size but do not resize the XWindow.
*/
void UpdateSizeNoXResize(int, int);
// Using static here to avoid destroying context when many apps are open:
static int NumAppInitialized;
Display* DisplayId;
bool OwnDisplay = false;
Window WindowId;
Atom KillAtom;
int PositionBeforeStereo[2];
vtkXRenderWindowInteractorInternals* Internal;
// Drag and drop related
int XdndSourceVersion;
Window XdndSource;
Atom XdndFormatAtom;
Atom XdndURIListAtom;
Atom XdndTypeListAtom;
Atom XdndEnterAtom;
Atom XdndPositionAtom;
Atom XdndDropAtom;
Atom XdndActionCopyAtom;
Atom XdndStatusAtom;
Atom XdndFinishedAtom;
///@{
/**
* X-specific internal timer methods. See the superclass for detailed
* documentation.
*/
int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
int InternalDestroyTimer(int platformTimerId) override;
///@}
void FireTimers();
/**
* This will start up the X event loop and never return. If you
* call this method it will loop processing X events until the
* application is exited.
*/
void StartEventLoop() override;
/**
* Deallocate X resource that may have been allocated
* Also calls finalize on the render window if available
*/
void Finalize();
};
} // namespace pcl
#endif
pcl::vtkXRenderWindowInteractor
Definition vtkFixedXRenderWindowInteractor.h:44
pcl::vtkXRenderWindowInteractor::XdndURIListAtom
Atom XdndURIListAtom
Definition vtkFixedXRenderWindowInteractor.h:123
pcl::vtkXRenderWindowInteractor::Internal
vtkXRenderWindowInteractorInternals * Internal
Definition vtkFixedXRenderWindowInteractor.h:117
pcl::vtkXRenderWindowInteractor::StartEventLoop
void StartEventLoop() override
This will start up the X event loop and never return.
pcl::vtkXRenderWindowInteractor::XdndEnterAtom
Atom XdndEnterAtom
Definition vtkFixedXRenderWindowInteractor.h:125
pcl::vtkXRenderWindowInteractor::XdndPositionAtom
Atom XdndPositionAtom
Definition vtkFixedXRenderWindowInteractor.h:126
pcl::vtkXRenderWindowInteractor::~vtkXRenderWindowInteractor
~vtkXRenderWindowInteractor() override
pcl::vtkXRenderWindowInteractor::ProcessEvents
void ProcessEvents() override
Run the event loop and return.
pcl::vtkXRenderWindowInteractor::DisplayId
Display * DisplayId
Definition vtkFixedXRenderWindowInteractor.h:112
pcl::vtkXRenderWindowInteractor::NumAppInitialized
static int NumAppInitialized
Definition vtkFixedXRenderWindowInteractor.h:110
pcl::vtkXRenderWindowInteractor::vtkXRenderWindowInteractor
vtkXRenderWindowInteractor(const vtkXRenderWindowInteractor &)=delete
pcl::vtkXRenderWindowInteractor::WindowId
Window WindowId
Definition vtkFixedXRenderWindowInteractor.h:114
pcl::vtkXRenderWindowInteractor::XdndDropAtom
Atom XdndDropAtom
Definition vtkFixedXRenderWindowInteractor.h:127
pcl::vtkXRenderWindowInteractor::InternalCreateTimer
int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override
X-specific internal timer methods.
pcl::vtkXRenderWindowInteractor::XdndStatusAtom
Atom XdndStatusAtom
Definition vtkFixedXRenderWindowInteractor.h:129
pcl::vtkXRenderWindowInteractor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
pcl::vtkXRenderWindowInteractor::Finalize
void Finalize()
Deallocate X resource that may have been allocated Also calls finalize on the render window if availa...
pcl::vtkXRenderWindowInteractor::Disable
void Disable() override
pcl::vtkXRenderWindowInteractor::TerminateApp
void TerminateApp() override
Break the event loop on 'q','e' keypress.
pcl::vtkXRenderWindowInteractor::Enable
void Enable() override
Enable/Disable interactions.
pcl::vtkXRenderWindowInteractor::FireTimers
void FireTimers()
pcl::vtkXRenderWindowInteractor::KillAtom
Atom KillAtom
Definition vtkFixedXRenderWindowInteractor.h:115
pcl::vtkXRenderWindowInteractor::XdndTypeListAtom
Atom XdndTypeListAtom
Definition vtkFixedXRenderWindowInteractor.h:124
pcl::vtkXRenderWindowInteractor::XdndFinishedAtom
Atom XdndFinishedAtom
Definition vtkFixedXRenderWindowInteractor.h:130
pcl::vtkXRenderWindowInteractor::UpdateSize
void UpdateSize(int, int) override
Update the Size data member and set the associated RenderWindow's size.
pcl::vtkXRenderWindowInteractor::InternalDestroyTimer
int InternalDestroyTimer(int platformTimerId) override
pcl::vtkXRenderWindowInteractor::DispatchEvent
void DispatchEvent(XEvent *)
pcl::vtkXRenderWindowInteractor::vtkXRenderWindowInteractor
vtkXRenderWindowInteractor()
pcl::vtkXRenderWindowInteractor::operator=
void operator=(const vtkXRenderWindowInteractor &)=delete
pcl::vtkXRenderWindowInteractor::UpdateSizeNoXResize
void UpdateSizeNoXResize(int, int)
Update the Size data member and set the associated RenderWindow's size but do not resize the XWindow.
pcl::vtkXRenderWindowInteractor::XdndFormatAtom
Atom XdndFormatAtom
Definition vtkFixedXRenderWindowInteractor.h:122
pcl::vtkXRenderWindowInteractor::New
static vtkXRenderWindowInteractor * New()
pcl::vtkXRenderWindowInteractor::XdndSource
Window XdndSource
Definition vtkFixedXRenderWindowInteractor.h:121
pcl::vtkXRenderWindowInteractor::vtkTypeMacro
vtkTypeMacro(vtkXRenderWindowInteractor, vtkRenderWindowInteractor)
pcl::vtkXRenderWindowInteractor::GetMousePosition
void GetMousePosition(int *x, int *y) override
Re-defines virtual function to get mouse position by querying X-server.
pcl::vtkXRenderWindowInteractor::Initialize
void Initialize() override
Initializes the event handlers without an XtAppContext.
pcl::vtkXRenderWindowInteractor::XdndActionCopyAtom
Atom XdndActionCopyAtom
Definition vtkFixedXRenderWindowInteractor.h:128
pcl::vtkXRenderWindowInteractor::XdndSourceVersion
int XdndSourceVersion
Definition vtkFixedXRenderWindowInteractor.h:120
pcl
Definition convolution.h:46