KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | List of all members
kjb::Glut_perspective_camera Class Reference

#include <glut_perspective_camera.h>

Static Public Member Functions

static int create_glut_perspective_camera_submenu (void(*icamera_submenu_callback)(int i), kjb::Perspective_camera *pc, bool enable_translation=true, bool enable_pitch=true, bool enable_yaw=true, bool enable_roll=true, bool enable_focal_length=true, bool enable_principal_point=true, bool enable_skew=true, bool enable_aspect_ratio=true, bool enable_world_scale=true, bool enable_clipping=true, bool enable_viewport=true, bool icentre_when_scaling_viewport=true, unsigned char iincrement_char=GLUT_PC_INCREMENT_CHARACTER, unsigned char idecrement_char=GLUT_PC_DECREMENT_CHARACTER)
 
static void camera_submenu_glut (int i)
 This callback will be executed any time an entry of the camera submenu is selected. This is automatically called. Within this function the user defined callback will be called. More...
 
static void keyboard_callback (unsigned char key)
 This is the keyboard_callback for this camera submenu. The user HAS to call this in the GLUT keyboard callback when appropriate. More...
 
static void enable_camera ()
 Enables the camera. When the camera is not enabled all submenu selections and the submenu keyboard callback have no effect. More...
 
static void disable_camera ()
 Disable the camera. When the camera is not enabled all submenu selections and the submenu keyboard callback have no effect. More...
 
static double retrieve_translation_x_increment ()
 returns the increment step used for the x-coordinate of the camera centre More...
 
static double retrieve_translation_y_increment ()
 returns the increment step used for the y-coordinate of the camera centre More...
 
static double retrieve_translation_z_increment ()
 returns the increment step used for the z-coordinate of the camera centre More...
 
static double retrieve_pitch_increment ()
 returns the increment step used for the pitch More...
 
static double retrieve_yaw_increment ()
 returns the increment step used for the yaw More...
 
static double retrieve_roll_increment ()
 returns the increment step used for the roll More...
 
static double retrieve_focal_length_increment ()
 returns the increment step used for the focal length More...
 
static double retrieve_principal_point_x_increment ()
 returns the increment step used for the x coordinate of the principal point More...
 
static double retrieve_principal_point_y_increment ()
 returns the increment step used for the y coordinate of the principal point More...
 
static double retrieve_skew_increment ()
 returns the increment step used for the skew More...
 
static double retrieve_aspect_ratio_increment ()
 returns the increment step used for the aspect ratio More...
 
static double retrieve_world_scale_increment ()
 returns the increment step used for the world scale More...
 
static double retrieve_near_clipping_increment ()
 returns the increment step used for the near clipping plane More...
 
static double retrieve_far_clipping_increment ()
 returns the increment step used for the far clipping plane More...
 
static double retrieve_width_increment ()
 returns the increment step used for the viewport width More...
 
static double retrieve_height_increment ()
 returns the increment step used for the viewport height More...
 
static void update_translation_x_increment (double iincrement)
 sets the increment step used for the x-coordinate of the camera centre More...
 
static void update_translation_y_increment (double iincrement)
 sets the increment step used for the y-coordinate of the camera centre More...
 
static void update_translation_z_increment (double iincrement)
 sets the increment step used for the z-coordinate of the camera centre More...
 
static void update_pitch_increment (double iincrement)
 sets the increment step used for the pitch More...
 
static void update_yaw_increment (double iincrement)
 sets the increment step used for the yaw More...
 
static void update_roll_increment (double iincrement)
 sets the increment step used for the roll More...
 
static void update_focal_length_increment (double iincrement)
 sets the increment step used for the focal length More...
 
static void update_principal_point_x_increment (double iincrement)
 sets the increment step used for the x coordinate of the principal point More...
 
static void update_principal_point_y_increment (double iincrement)
 sets the increment step used for the y coordinate of the principal point More...
 
static void update_skew_increment (double iincrement)
 sets the increment step used for the skew More...
 
static void update_aspect_ratio_increment (double iincrement)
 sets the increment step used for the aspect ratio More...
 
static void update_world_scale_increment (double iincrement)
 sets the increment step used for the world scale More...
 
static void update_near_clipping_increment (double iincrement)
 sets the increment step used for the near clipping plane More...
 
static void update_far_clipping_increment (double iincrement)
 sets the increment step used for the far clipping plane More...
 
static void update_width_increment (double iincrement)
 sets the increment step used for the viewport width More...
 
static void update_height_increment (double iincrement)
 sets the increment step used for the viewport height More...
 

Detailed Description

provides an easy way to add a glut submenu that handles a full perspective camera to your application. This class only creates the menu, it's up to the user to add it to the main glut menu. Upon creation of the submenu, the user has to provide a callback (camera_submenu_callback) that will be called every time one entry in the camera submenu will be selected. Optionally, an empty callback can be passed, if the user does not need to take any further action. It is also up to the user to call the keyboard_callback provided in this class the glut keyboard callback when appropriate. This class provides a submenu entry for each parameter of the camera. Upon selection, the keys 'j' and 'k' allow the user to increment or decrement the value of each parameter by the increment_step for that parameter. Each increment_step can be specified by the user. The user can also decide to use different characters (ie characters other than 'j' and 'k').

Member Function Documentation

void Glut_perspective_camera::camera_submenu_glut ( int  i)
static

This callback will be executed any time an entry of the camera submenu is selected. This is automatically called. Within this function the user defined callback will be called.

This is called everytime a submenu entry is selected. It selects the appropriate parameter and calls the user defined callback.

int Glut_perspective_camera::create_glut_perspective_camera_submenu ( void(*)(int i icamera_submenu_callback,
kjb::Perspective_camera pc,
bool  enable_translation = true,
bool  enable_pitch = true,
bool  enable_yaw = true,
bool  enable_roll = true,
bool  enable_focal_length = true,
bool  enable_principal_point = true,
bool  enable_skew = true,
bool  enable_aspect_ratio = true,
bool  enable_world_scale = true,
bool  enable_clipping = true,
bool  enable_viewport = true,
bool  icentre_when_scaling_viewport = true,
unsigned char  iincrement_char = GLUT_PC_INCREMENT_CHARACTER,
unsigned char  idecrement_char = GLUT_PC_DECREMENT_CHARACTER 
)
static
static void kjb::Glut_perspective_camera::disable_camera ( )
inlinestatic

Disable the camera. When the camera is not enabled all submenu selections and the submenu keyboard callback have no effect.

static void kjb::Glut_perspective_camera::enable_camera ( )
inlinestatic

Enables the camera. When the camera is not enabled all submenu selections and the submenu keyboard callback have no effect.

void Glut_perspective_camera::keyboard_callback ( unsigned char  key)
static

This is the keyboard_callback for this camera submenu. The user HAS to call this in the GLUT keyboard callback when appropriate.

This should be called in the GLUT main keyboard callback

static double kjb::Glut_perspective_camera::retrieve_aspect_ratio_increment ( )
inlinestatic

returns the increment step used for the aspect ratio

static double kjb::Glut_perspective_camera::retrieve_far_clipping_increment ( )
inlinestatic

returns the increment step used for the far clipping plane

static double kjb::Glut_perspective_camera::retrieve_focal_length_increment ( )
inlinestatic

returns the increment step used for the focal length

static double kjb::Glut_perspective_camera::retrieve_height_increment ( )
inlinestatic

returns the increment step used for the viewport height

static double kjb::Glut_perspective_camera::retrieve_near_clipping_increment ( )
inlinestatic

returns the increment step used for the near clipping plane

static double kjb::Glut_perspective_camera::retrieve_pitch_increment ( )
inlinestatic

returns the increment step used for the pitch

static double kjb::Glut_perspective_camera::retrieve_principal_point_x_increment ( )
inlinestatic

returns the increment step used for the x coordinate of the principal point

static double kjb::Glut_perspective_camera::retrieve_principal_point_y_increment ( )
inlinestatic

returns the increment step used for the y coordinate of the principal point

static double kjb::Glut_perspective_camera::retrieve_roll_increment ( )
inlinestatic

returns the increment step used for the roll

static double kjb::Glut_perspective_camera::retrieve_skew_increment ( )
inlinestatic

returns the increment step used for the skew

static double kjb::Glut_perspective_camera::retrieve_translation_x_increment ( )
inlinestatic

returns the increment step used for the x-coordinate of the camera centre

static double kjb::Glut_perspective_camera::retrieve_translation_y_increment ( )
inlinestatic

returns the increment step used for the y-coordinate of the camera centre

static double kjb::Glut_perspective_camera::retrieve_translation_z_increment ( )
inlinestatic

returns the increment step used for the z-coordinate of the camera centre

static double kjb::Glut_perspective_camera::retrieve_width_increment ( )
inlinestatic

returns the increment step used for the viewport width

static double kjb::Glut_perspective_camera::retrieve_world_scale_increment ( )
inlinestatic

returns the increment step used for the world scale

static double kjb::Glut_perspective_camera::retrieve_yaw_increment ( )
inlinestatic

returns the increment step used for the yaw

static void kjb::Glut_perspective_camera::update_aspect_ratio_increment ( double  iincrement)
inlinestatic

sets the increment step used for the aspect ratio

static void kjb::Glut_perspective_camera::update_far_clipping_increment ( double  iincrement)
inlinestatic

sets the increment step used for the far clipping plane

static void kjb::Glut_perspective_camera::update_focal_length_increment ( double  iincrement)
inlinestatic

sets the increment step used for the focal length

static void kjb::Glut_perspective_camera::update_height_increment ( double  iincrement)
inlinestatic

sets the increment step used for the viewport height

static void kjb::Glut_perspective_camera::update_near_clipping_increment ( double  iincrement)
inlinestatic

sets the increment step used for the near clipping plane

static void kjb::Glut_perspective_camera::update_pitch_increment ( double  iincrement)
inlinestatic

sets the increment step used for the pitch

static void kjb::Glut_perspective_camera::update_principal_point_x_increment ( double  iincrement)
inlinestatic

sets the increment step used for the x coordinate of the principal point

static void kjb::Glut_perspective_camera::update_principal_point_y_increment ( double  iincrement)
inlinestatic

sets the increment step used for the y coordinate of the principal point

static void kjb::Glut_perspective_camera::update_roll_increment ( double  iincrement)
inlinestatic

sets the increment step used for the roll

static void kjb::Glut_perspective_camera::update_skew_increment ( double  iincrement)
inlinestatic

sets the increment step used for the skew

static void kjb::Glut_perspective_camera::update_translation_x_increment ( double  iincrement)
inlinestatic

sets the increment step used for the x-coordinate of the camera centre

static void kjb::Glut_perspective_camera::update_translation_y_increment ( double  iincrement)
inlinestatic

sets the increment step used for the y-coordinate of the camera centre

static void kjb::Glut_perspective_camera::update_translation_z_increment ( double  iincrement)
inlinestatic

sets the increment step used for the z-coordinate of the camera centre

static void kjb::Glut_perspective_camera::update_width_increment ( double  iincrement)
inlinestatic

sets the increment step used for the viewport width

static void kjb::Glut_perspective_camera::update_world_scale_increment ( double  iincrement)
inlinestatic

sets the increment step used for the world scale

static void kjb::Glut_perspective_camera::update_yaw_increment ( double  iincrement)
inlinestatic

sets the increment step used for the yaw


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