NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
NumeRe::WindowManager Class Reference

This is the window manager of the kernel. All windows opened by the kernel will be registered here. More...

#include <windowmanager.hpp>

Collaboration diagram for NumeRe::WindowManager:

Public Member Functions

 WindowManager ()
 Empty window manager constructor. More...
 
 ~WindowManager ()
 Destructor. It will detach all registered windows from the manager. This is done to avoid segmentation faults during application shut down. More...
 
size_t createWindow (GraphHelper *graph)
 This public member function will create a window object containing the passed graph. More...
 
size_t createWindow (WindowType type, const WindowSettings &settings)
 This public member function will create a dialog window, which is described by the passed WindowSettings object. More...
 
size_t createWindow (tinyxml2::XMLDocument *layoutString)
 This public member function will create a custom window, which is described by the passed layout XML object. More...
 
WindowInformation getWindowInformation (size_t windowId)
 This public member function will return the window information stored in the internal map. If the window was closed by the user and this was noted in the window information then the object is deleted from the internal map. More...
 
WindowInformation getWindowInformationModal (size_t windowId)
 This public member function will return the window information stored in the internal map. The access is modal, i.e. it's checked repeatedly, whether a window has been closed until the information is returned. The object is then deleted from the internal map. More...
 

Private Member Functions

void updateWindowInformation (const WindowInformation &information)
 This function is used by the registered windows to inform the window manager about new window statuses or return values. More...
 
size_t registerWindow (Window *window, size_t id)
 This member function registers a new window or changes the registration to a new window. More...
 
void unregisterWindow (Window *window, size_t id)
 This member function will unregister a window. This is done only if the ID and the window pointer are both matching the internal mapping. More...
 

Private Attributes

std::map< size_t, WindowInformationm_windowMap
 

Friends

class Window
 

Detailed Description

This is the window manager of the kernel. All windows opened by the kernel will be registered here.

Definition at line 231 of file windowmanager.hpp.

Constructor & Destructor Documentation

◆ WindowManager()

NumeRe::WindowManager::WindowManager ( )

Empty window manager constructor.

Definition at line 616 of file windowmanager.cpp.

◆ ~WindowManager()

NumeRe::WindowManager::~WindowManager ( )

Destructor. It will detach all registered windows from the manager. This is done to avoid segmentation faults during application shut down.

Definition at line 628 of file windowmanager.cpp.

References m_windowMap, and NumeRe::STATUS_CANCEL.

Member Function Documentation

◆ createWindow() [1/3]

size_t NumeRe::WindowManager::createWindow ( GraphHelper graph)

This public member function will create a window object containing the passed graph.

Parameters
graphGraphHelper*
Returns
size_t

Definition at line 650 of file windowmanager.cpp.

References NumeRe::Window::getId(), NumeReKernel::getInstance(), NumeReKernel::showWindow(), and NumeRe::WINDOW_GRAPH.

Referenced by createPlot(), createPlotForHist1D(), createPlotsForHist2D(), dialogCommand(), and windowCommand().

Here is the call graph for this function:

◆ createWindow() [2/3]

size_t NumeRe::WindowManager::createWindow ( tinyxml2::XMLDocument layoutString)

This public member function will create a custom window, which is described by the passed layout XML object.

Parameters
layoutStringtinyxml2::XMLDocument*
Returns
size_t

Definition at line 689 of file windowmanager.cpp.

References NumeRe::Window::getId(), NumeReKernel::getInstance(), NumeReKernel::showWindow(), and NumeRe::WINDOW_CUSTOM.

Here is the call graph for this function:

◆ createWindow() [3/3]

size_t NumeRe::WindowManager::createWindow ( WindowType  type,
const WindowSettings settings 
)

This public member function will create a dialog window, which is described by the passed WindowSettings object.

Parameters
typeWindowType
settingsconst WindowSettings&
Returns
size_t

Definition at line 670 of file windowmanager.cpp.

References NumeRe::Window::getId(), NumeReKernel::getInstance(), and NumeReKernel::showWindow().

Here is the call graph for this function:

◆ getWindowInformation()

WindowInformation NumeRe::WindowManager::getWindowInformation ( size_t  windowId)

This public member function will return the window information stored in the internal map. If the window was closed by the user and this was noted in the window information then the object is deleted from the internal map.

Parameters
windowIdsize_t
Returns
WindowInformation

Definition at line 711 of file windowmanager.cpp.

References m_windowMap, and NumeRe::WindowInformation::nStatus.

Referenced by createPlot(), getWindow(), and windowCommand().

◆ getWindowInformationModal()

WindowInformation NumeRe::WindowManager::getWindowInformationModal ( size_t  windowId)

This public member function will return the window information stored in the internal map. The access is modal, i.e. it's checked repeatedly, whether a window has been closed until the information is returned. The object is then deleted from the internal map.

Parameters
windowIdsize_t
Returns
WindowInformation

Definition at line 747 of file windowmanager.cpp.

References m_windowMap, NumeRe::WindowInformation::nStatus, and NumeRe::STATUS_RUNNING.

Referenced by dialogCommand().

◆ registerWindow()

size_t NumeRe::WindowManager::registerWindow ( Window window,
size_t  id 
)
private

This member function registers a new window or changes the registration to a new window.

Parameters
windowWindow*
idsize_t
Returns
size_t

Definition at line 562 of file windowmanager.cpp.

References m_windowMap.

Referenced by NumeRe::Window::registerWindow().

◆ unregisterWindow()

void NumeRe::WindowManager::unregisterWindow ( Window window,
size_t  id 
)
private

This member function will unregister a window. This is done only if the ID and the window pointer are both matching the internal mapping.

Parameters
windowWindow*
idsize_t
Returns
void

Definition at line 591 of file windowmanager.cpp.

References NumeRe::Window::getType(), m_windowMap, NumeRe::STATUS_CANCEL, NumeRe::STATUS_RUNNING, and NumeRe::WINDOW_GRAPH.

Referenced by NumeRe::Window::unregisterWindow().

Here is the call graph for this function:

◆ updateWindowInformation()

void NumeRe::WindowManager::updateWindowInformation ( const WindowInformation information)
private

This function is used by the registered windows to inform the window manager about new window statuses or return values.

Parameters
informationconst WindowInformation&
Returns
void

Definition at line 545 of file windowmanager.cpp.

References m_windowMap, and NumeRe::WindowInformation::nWindowID.

Referenced by NumeRe::Window::updateWindowInformation().

Friends And Related Function Documentation

◆ Window

friend class Window
friend

Definition at line 234 of file windowmanager.hpp.

Member Data Documentation

◆ m_windowMap

std::map<size_t, WindowInformation> NumeRe::WindowManager::m_windowMap
private

The documentation for this class was generated from the following files: