OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WGECamera Class Reference

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

#include <WGECamera.h>

+ Inheritance diagram for WGECamera:
+ Collaboration diagram for WGECamera:

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

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

◆ ProjectionMode

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() [1/2]

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

+ Here is the call graph for this function:

◆ WGECamera() [2/2]

WGECamera::WGECamera ( )

Constructor which sets defaults.

Definition at line 54 of file WGECamera.cpp.

◆ ~WGECamera()

WGECamera::~WGECamera ( )
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.

Member Function Documentation

◆ getDefaultProjectionMode()

WGECamera::ProjectionMode WGECamera::getDefaultProjectionMode ( )

Returns the current default projection mode.

Returns
the currently set mode.

Definition at line 83 of file WGECamera.cpp.

References m_DefProjMode.

◆ reset()

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resize()

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

+ Here is the caller graph for this function:

◆ setDefaultProjectionMode()

void WGECamera::setDefaultProjectionMode ( WGECamera::ProjectionMode  mode)

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

◆ m_DefProjMode

ProjectionMode WGECamera::m_DefProjMode
protected

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: