OpenWalnut
1.4.0
|
Class for wrapping around the OSG Camera class. More...
#include <WGECamera.h>
Public Types | |
enum | ProjectionMode { ORTHOGRAPHIC, PERSPECTIVE, TWO_D, TWO_D_UNIT } |
List of possible camera modes. More... | |
Public Member Functions | |
WGECamera (int width, int height, ProjectionMode projectionMode) | |
Constructor which sets defaults. More... | |
WGECamera () | |
Constructor which sets defaults. More... | |
void | setDefaultProjectionMode (ProjectionMode mode) |
Sets the default projection mode used for cameras getting reset. More... | |
ProjectionMode | getDefaultProjectionMode () |
Returns the current default projection mode. More... | |
void | reset () |
Resets the camera and activates the prior set defaults. More... | |
void | resize () |
Change camera parameters which should be changed on a resize. More... | |
Protected Member Functions | |
virtual | ~WGECamera () |
Destructor. More... | |
Protected Attributes | |
ProjectionMode | m_DefProjMode |
The projection mode used as default. More... | |
Class for wrapping around the OSG Camera class.
It adds some utility functions for simply setting some camera defaults.
Definition at line 35 of file WGECamera.h.
WGECamera::WGECamera | ( | int | width, |
int | height, | ||
ProjectionMode | projectionMode | ||
) |
Constructor which sets defaults.
width | width of the viewport. |
height | height of the viewport. |
projectionMode | projection mode of the viewer. |
Definition at line 31 of file WGECamera.cpp.
References reset().
WGECamera::WGECamera | ( | ) |
Constructor which sets defaults.
Definition at line 54 of file WGECamera.cpp.
|
protectedvirtual |
Destructor.
This desctructor is protected to avoid accidentally deleting a instance of WGECamera. This follows the philosophy of OSG to avoid problems in multithreaded environments, since these camera pointers are used deep in the OSG where an deletion could cause a segfault.
Definition at line 73 of file WGECamera.cpp.
WGECamera::ProjectionMode WGECamera::getDefaultProjectionMode | ( | ) |
Returns the current default projection mode.
Definition at line 83 of file WGECamera.cpp.
References m_DefProjMode.
void WGECamera::reset | ( | ) |
Resets the camera and activates the prior set defaults.
Definition at line 88 of file WGECamera.cpp.
References m_DefProjMode, and resize().
Referenced by WGECamera().
void WGECamera::resize | ( | ) |
Change camera parameters which should be changed on a resize.
Definition at line 114 of file WGECamera.cpp.
References m_DefProjMode.
Referenced by reset(), and WGEViewer::resize().
void WGECamera::setDefaultProjectionMode | ( | WGECamera::ProjectionMode | mode | ) |
Sets the default projection mode used for cameras getting reset.
mode | the mode to set. |
Definition at line 78 of file WGECamera.cpp.
References m_DefProjMode.
|
protected |
The projection mode used as default.
Definition at line 103 of file WGECamera.h.
Referenced by getDefaultProjectionMode(), reset(), resize(), and setDefaultProjectionMode().