OpenWalnut  1.4.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
WGECamera Class Reference

Class for wrapping around the OSG Camera class. More...

#include <WGECamera.h>

+ Inheritance diagram for WGECamera:

List of all members.

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.
 WGECamera ()
 Constructor which sets defaults.
void setDefaultProjectionMode (ProjectionMode mode)
 Sets the default projection mode used for cameras getting reset.
ProjectionMode getDefaultProjectionMode ()
 Returns the current default projection mode.
void reset ()
 Resets the camera and activates the prior set defaults.
void resize ()
 Change camera parameters which should be changed on a resize.

Protected Member Functions

virtual ~WGECamera ()
 Destructor.

Protected Attributes

ProjectionMode m_DefProjMode
 The projection mode used as default.

Detailed Description

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.


Member Enumeration Documentation

List of possible camera modes.

The TWO_D modes use a standard two dimensional orthogonal projection. TWO_D_UNOT is somewhat special. It creates a view-cube with an edge-length of 1, centered at 0 for X and Y. For Z, it is from 0 to 1. This relates to the standard glOrtho command.

Definition at line 43 of file WGECamera.h.


Constructor & Destructor Documentation

WGECamera::WGECamera ( int  width,
int  height,
ProjectionMode  projectionMode 
)

Constructor which sets defaults.

Parameters:
widthwidth of the viewport.
heightheight of the viewport.
projectionModeprojection mode of the viewer.

Definition at line 31 of file WGECamera.cpp.

References reset().

Constructor which sets defaults.

Definition at line 54 of file WGECamera.cpp.

WGECamera::~WGECamera ( ) [protected, virtual]

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.


Member Function Documentation

Returns the current default projection mode.

Returns:
the currently set 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().

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().

Sets the default projection mode used for cameras getting reset.

Parameters:
modethe mode to set.

Definition at line 78 of file WGECamera.cpp.

References m_DefProjMode.


Member Data Documentation

The projection mode used as default.

Definition at line 103 of file WGECamera.h.

Referenced by getDefaultProjectionMode(), reset(), resize(), and setDefaultProjectionMode().


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