gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
gVirtualXRay::StereoHelper Class Reference

StereoHelper is a class to handle stereo vision using OpenGL's quad buffer. More...

#include <StereoHelper.h>

Collaboration diagram for gVirtualXRay::StereoHelper:
Collaboration graph

Public Types

enum  EyeType { LEFT_EYE = 0, RIGHT_EYE = 1, MONO = 2 }
 Enum defining eyes. More...
 

Public Member Functions

 StereoHelper ()
 Default constructor. More...
 
void setIntraocularDistance (double aDistance)
 Set the intraocular distance. More...
 
double getIntraocularDistance () const
 Accessor on the intraocular distance. More...
 
void setScreenAspectRatio (double aRatio)
 Set the screen aspect ratio. More...
 
void setFieldOfViewY (double aFOVY)
 Set the field of view along the y-axis. More...
 
double getFieldOfViewY () const
 Accessor on the field of view along the y-axis. More...
 
void setNear (double aPlane)
 Set the near clipping plane. More...
 
double getNear () const
 Accessor on the near clipping plane. More...
 
void setFar (double aPlane)
 Set the far clipping plane. More...
 
double getFar () const
 Accessor on the far clipping plane. More...
 
void setScreenProjectionPlane (double aPlane)
 Set the screen projection plane. More...
 
const MATRIX4getLeftEyeProjectionMatrix ()
 Accessor on the projection matrix corresponding to the left eye. More...
 
const MATRIX4getRightEyeProjectionMatrix ()
 Accessor on the projection matrix corresponding to the right eye. More...
 
void swapEye ()
 Swap eye. More...
 
bool enable ()
 Enable the stereo if possible. More...
 
void disable ()
 Disable the stereo. More...
 
bool isActive () const
 Accessor on the stereo flag. More...
 

Protected Member Functions

void update ()
 Compute the projection matrices. More...
 

Protected Attributes

double m_intraocular_distance
 Intraocular distance. More...
 
MATRIX4 m_left_eye_projection_matrix
 The projection matrix corresponding to the left eye. More...
 
MATRIX4 m_right_eye_projection_matrix
 The projection matrix corresponding to the right eye. More...
 
double m_left_eye_frustum [4]
 
double m_right_eye_frustum [4]
 
double m_near
 Near clipping plane. More...
 
double m_far
 Far clipping plane. More...
 
double m_fovy
 Field of view along the y-axis. More...
 
double m_screen_aspect_ratio
 Screen aspect ratio. More...
 
double m_screen_projection_plane
 Screen projection plane. More...
 
bool m_matrices_are_up_to_date
 Flag set to true when the matrices are up-to-date. More...
 
EyeType m_current_eye
 Current eye type. More...
 
bool m_stereo_currently_in_use
 Flag set to true when the stereo is in used. More...
 

Detailed Description

StereoHelper is a class to handle stereo vision using OpenGL's quad buffer.

Definition at line 97 of file StereoHelper.h.

Member Enumeration Documentation

◆ EyeType

Enum defining eyes.

Enumerator
LEFT_EYE 
RIGHT_EYE 
MONO 

Definition at line 105 of file StereoHelper.h.

Constructor & Destructor Documentation

◆ StereoHelper()

gVirtualXRay::StereoHelper::StereoHelper ( )

Default constructor.

Member Function Documentation

◆ disable()

void gVirtualXRay::StereoHelper::disable ( )

Disable the stereo.

◆ enable()

bool gVirtualXRay::StereoHelper::enable ( )

Enable the stereo if possible.

◆ getFar()

double gVirtualXRay::StereoHelper::getFar ( ) const
inline

Accessor on the far clipping plane.

Returns
the far clipping plane

Definition at line 139 of file StereoHelper.inl.

◆ getFieldOfViewY()

double gVirtualXRay::StereoHelper::getFieldOfViewY ( ) const
inline

Accessor on the field of view along the y-axis.

return the field of view along the y-axis

Definition at line 105 of file StereoHelper.inl.

◆ getIntraocularDistance()

double gVirtualXRay::StereoHelper::getIntraocularDistance ( ) const
inline

Accessor on the intraocular distance.

Returns
the intraocular distance

Definition at line 79 of file StereoHelper.inl.

◆ getLeftEyeProjectionMatrix()

const MATRIX4 & gVirtualXRay::StereoHelper::getLeftEyeProjectionMatrix ( )
inline

Accessor on the projection matrix corresponding to the left eye.

Returns
the projection matrix

Definition at line 156 of file StereoHelper.inl.

◆ getNear()

double gVirtualXRay::StereoHelper::getNear ( ) const
inline

Accessor on the near clipping plane.

Returns
the near clipping plane

Definition at line 122 of file StereoHelper.inl.

◆ getRightEyeProjectionMatrix()

const MATRIX4 & gVirtualXRay::StereoHelper::getRightEyeProjectionMatrix ( )
inline

Accessor on the projection matrix corresponding to the right eye.

Returns
the projection matrix

Definition at line 169 of file StereoHelper.inl.

◆ isActive()

bool gVirtualXRay::StereoHelper::isActive ( ) const
inline

Accessor on the stereo flag.

Definition at line 182 of file StereoHelper.inl.

◆ setFar()

void gVirtualXRay::StereoHelper::setFar ( double  aPlane)
inline

Set the far clipping plane.

Parameters
aPlanethe far clipping plane

Definition at line 130 of file StereoHelper.inl.

◆ setFieldOfViewY()

void gVirtualXRay::StereoHelper::setFieldOfViewY ( double  aFOVY)
inline

Set the field of view along the y-axis.

Parameters
aFOVYthe field of view along the y-axis

Definition at line 96 of file StereoHelper.inl.

◆ setIntraocularDistance()

void gVirtualXRay::StereoHelper::setIntraocularDistance ( double  aDistance)
inline

Set the intraocular distance.

Parameters
aDistancethe intraocular distance

Definition at line 70 of file StereoHelper.inl.

◆ setNear()

void gVirtualXRay::StereoHelper::setNear ( double  aPlane)
inline

Set the near clipping plane.

Parameters
aPlanethe near clipping plane

Definition at line 113 of file StereoHelper.inl.

◆ setScreenAspectRatio()

void gVirtualXRay::StereoHelper::setScreenAspectRatio ( double  aRatio)
inline

Set the screen aspect ratio.

Parameters
aRatiothe screen aspect ratio

Definition at line 87 of file StereoHelper.inl.

◆ setScreenProjectionPlane()

void gVirtualXRay::StereoHelper::setScreenProjectionPlane ( double  aPlane)
inline

Set the screen projection plane.

Parameters
aPlanethe screen projection plane

Definition at line 147 of file StereoHelper.inl.

◆ swapEye()

void gVirtualXRay::StereoHelper::swapEye ( )

Swap eye.

◆ update()

void gVirtualXRay::StereoHelper::update ( )
protected

Compute the projection matrices.

Field Documentation

◆ m_current_eye

EyeType gVirtualXRay::StereoHelper::m_current_eye
protected

Current eye type.

Definition at line 310 of file StereoHelper.h.

◆ m_far

double gVirtualXRay::StereoHelper::m_far
protected

Far clipping plane.

Definition at line 290 of file StereoHelper.h.

◆ m_fovy

double gVirtualXRay::StereoHelper::m_fovy
protected

Field of view along the y-axis.

Definition at line 294 of file StereoHelper.h.

◆ m_intraocular_distance

double gVirtualXRay::StereoHelper::m_intraocular_distance
protected

Intraocular distance.

Definition at line 258 of file StereoHelper.h.

◆ m_left_eye_frustum

double gVirtualXRay::StereoHelper::m_left_eye_frustum[4]
protected

Frustum of the left eye m_left_eye_frustum[0] corresponds to the left clipping plane m_left_eye_frustum[1] corresponds to the right clipping plane m_left_eye_frustum[2] corresponds to the bottom clipping plane m_left_eye_frustum[3] corresponds to the top clipping plane

Definition at line 274 of file StereoHelper.h.

◆ m_left_eye_projection_matrix

MATRIX4 gVirtualXRay::StereoHelper::m_left_eye_projection_matrix
protected

The projection matrix corresponding to the left eye.

Definition at line 262 of file StereoHelper.h.

◆ m_matrices_are_up_to_date

bool gVirtualXRay::StereoHelper::m_matrices_are_up_to_date
protected

Flag set to true when the matrices are up-to-date.

Definition at line 306 of file StereoHelper.h.

◆ m_near

double gVirtualXRay::StereoHelper::m_near
protected

Near clipping plane.

Definition at line 286 of file StereoHelper.h.

◆ m_right_eye_frustum

double gVirtualXRay::StereoHelper::m_right_eye_frustum[4]
protected

Frustum of the right eye m_right_eye_frustum[0] corresponds to the left clipping plane m_right_eye_frustum[1] corresponds to the right clipping plane m_right_eye_frustum[2] corresponds to the bottom clipping plane m_right_eye_frustum[3] corresponds to the top clipping plane

Definition at line 282 of file StereoHelper.h.

◆ m_right_eye_projection_matrix

MATRIX4 gVirtualXRay::StereoHelper::m_right_eye_projection_matrix
protected

The projection matrix corresponding to the right eye.

Definition at line 266 of file StereoHelper.h.

◆ m_screen_aspect_ratio

double gVirtualXRay::StereoHelper::m_screen_aspect_ratio
protected

Screen aspect ratio.

Definition at line 298 of file StereoHelper.h.

◆ m_screen_projection_plane

double gVirtualXRay::StereoHelper::m_screen_projection_plane
protected

Screen projection plane.

Definition at line 302 of file StereoHelper.h.

◆ m_stereo_currently_in_use

bool gVirtualXRay::StereoHelper::m_stereo_currently_in_use
protected

Flag set to true when the stereo is in used.

Definition at line 314 of file StereoHelper.h.


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