dip::viewer::Manager class

Simple window manager.

Derived classes

class GLFWManager
Simple GLFW window manager.
class GLUTManager
Simple GLUT window manager.

Public functions

void createWindow(WindowPtr window) pure virtual
Create a window.
auto activeWindows() -> size_t pure virtual
Returns the number of managed windows.
void destroyWindows() pure virtual
Destroys all windows.
void processEvents() pure virtual
Processes event queue.

Protected functions

void swapBuffers(Window* window) pure virtual
Swap display buffers.
void setWindowTitle(Window* window, const char* name) pure virtual
Sets a Window's title.
void refreshWindow(Window* window) pure virtual
Refresh a Window's contents.
void setWindowPosition(Window* window, int x, int y) pure virtual
Set a Window's screen position.
void setWindowSize(Window* window, int width, int height) pure virtual
Set a Window's size.

Function documentation

void dip::viewer::Manager::createWindow(WindowPtr window) pure virtual

Create a window.

Example usage:

manager.createWindow( dip::viewer::SliceViewer::Create( image ));

void dip::viewer::Manager::processEvents() pure virtual

Processes event queue.

This function must be periodically called to allow user interaction. Example usage:

while ( manager.activeWindows()) {
   manager.processEvents();
   std::this_thread::sleep_for( std::chrono::microseconds( 1000 ) );
}

void dip::viewer::Manager::swapBuffers(Window* window) pure virtual protected

Swap display buffers.

Must be called from the specified Window's callback.

void dip::viewer::Manager::setWindowTitle(Window* window, const char* name) pure virtual protected

Sets a Window's title.

Must be called from the specified Window's callback.