Assignments Assignments

Public Types | Static Public Member Functions | Static Public Attributes | Private Types | Static Private Attributes | List of all members
Ray::Window Class Reference

`#include <window.h>`

## Public Types
enum | { NO_CULL , CULL_BACK_FACE , CULL_FRONT_FACE }

## Static Public Member Functions
static int | PrintError (int showNoError=0)
static void | WriteLeftString (int x, int y, const std::string &str)
static void | WriteRightString (int x, int y, const std::string &str)
static Image::Image32 | TakeSnapshot (void)
static void | IdleFunction (void)
static void | VisibilityFunction (int state)
static void | SetEvaluators (void)
static void | MouseFunction (int button, int state, int x, int y)
static void | MotionFunction (int x, int y)
static void | PassiveMotionFunction (int x, int y)
static void | KeyboardFunction (unsigned char c, int x, int y)
static void | SpecialFunction (int key, int x, int y)
static void | DrawModeMenu (int entry)
static void | CullModeMenu (int entry)
static void | InterpolationTypeMenu (int entry)
static void | ParametrizationTypeMenu (int entry)
static void | MainMenu (int entry)
static void | DisplayFunction (void)
static void | ReshapeFunction (int width, int height)
static void | View (Scene &scene, int width, int height)

## Static Public Attributes
static const char | KEY_ESCAPE = '\033'
static Scene * | scene = NULL
static Mouse | mouse
static Util::Point3D | center
static double | radius
static bool | isVisible
static int | frameCount
static Util::Timer | frameCountTimer
static double | frameRate
static Util::Timer | timer
static int | interpolationType = Interpolation::NEAREST
static int | parametrizationType = RotationParameters::TRIVIAL

## Private Types
enum | { QUIT , RAY_TRACE , WRITE_SCENE }

## Static Private Attributes
static int | _width
static int | _height

## Detailed Description

This class represents the OpenGL window within which the 3D models are drawn.

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum
| private

Main menu selection options

Enumerator
QUIT |
RAY_TRACE |
WRITE_SCENE |

## ◆ anonymous enum

anonymous enum

Culling selection options

Enumerator
NO_CULL |
CULL_BACK_FACE |
CULL_FRONT_FACE |

## Member Function Documentation

## ◆ CullModeMenu()

void Window::CullModeMenu | ( | int | entry | ) |
| static

This function is called when the user updates the cull mode in the drop-down menu.

## ◆ DisplayFunction()

void Window::DisplayFunction | ( | void |  | ) |
| static

This function draws the OpenGL window.

## ◆ DrawModeMenu()

void Window::DrawModeMenu | ( | int | entry | ) |
| static

This function is called when the user updates the draw mode in the drop-down menu.

## ◆ IdleFunction()

void Window::IdleFunction | ( | void |  | ) |
| static

This function is called when no events need to be processed.

## ◆ InterpolationTypeMenu()

void Window::InterpolationTypeMenu | ( | int | entry | ) |
| static

This function is called when the user updates the curve fitting method in the drop-down menu.

## ◆ KeyboardFunction()

void Window::KeyboardFunction | ( | unsigned char | c,
|  | int | x,
|  | int | y )
| static

This function is called when the user presses a key.

## ◆ MainMenu()

void Window::MainMenu | ( | int | entry | ) |
| static

This function is called when the user selects one of the main menu options in the drop-down menu.

## ◆ MotionFunction()

void Window::MotionFunction | ( | int | x,
|  | int | y )
| static

This function is called when one of the mouse buttons is depressed and the mouse is moved.

## ◆ MouseFunction()

void Window::MouseFunction | ( | int | button,
|  | int | state,
|  | int | x,
|  | int | y )
| static

This function is called when the state of a mouse button is changed

## ◆ ParametrizationTypeMenu()

void Window::ParametrizationTypeMenu | ( | int | entry | ) |
| static

This function is called when the user updates the rotation parametrization method in the drop-down menu.

## ◆ PassiveMotionFunction()

void Window::PassiveMotionFunction | ( | int | x,
|  | int | y )
| static

This function is called when the mouse is moved moved but no buttons are depressed.

## ◆ PrintError()

int Window::PrintError | ( | int | showNoError = 0 | ) |
| static

This function prints out the state of the OpenGL error.

## ◆ ReshapeFunction()

void Window::ReshapeFunction | ( | int | width,
|  | int | height )
| static

This function is called when the window is resized.

## ◆ SetEvaluators()

void Window::SetEvaluators | ( | void |  | ) |
| static

This function (re)sets the evaluators

## ◆ SpecialFunction()

void Window::SpecialFunction | ( | int | key,
|  | int | x,
|  | int | y )
| static

This function is called when the user presses one of the special keys.

## ◆ TakeSnapshot()

Image32 Window::TakeSnapshot | ( | void |  | ) |
| static

This function reads the current frame buffer and sets the pixels of the image accordingly.

## ◆ View()

void Window::View | ( | Scene & | scene,
|  | int | width,
|  | int | height )
| static

This function instantiates the OpenGL window, reading in the Scene from the specified file and setting the initial OpenGL window size. The function never returns.

## ◆ VisibilityFunction()

void Window::VisibilityFunction | ( | int | state | ) |
| static

This function is called when the visibility state of the window changes.

## ◆ WriteLeftString()

void Window::WriteLeftString | ( | int | x,
|  | int | y,
|  | const std::string & | str )
| static

This function writes out the specified string, left-aligned, at the specified location, onto the OpenGL window.

## ◆ WriteRightString()

void Window::WriteRightString | ( | int | x,
|  | int | y,
|  | const std::string & | str )
| static

This function writes out the specified string, right-aligned, at the specified location, onto the OpenGL window.

## Member Data Documentation

## ◆ _height

int Window::_height
| static private

## ◆ _width

int Window::_width
| static private

The dimensions of the window

## ◆ center

Point3D Window::center
| static

The center of the bounding box of the drawn Scene

## ◆ frameCount

int Window::frameCount
| static

The number of frames that have been drawn since the last updated frame rate

## ◆ frameCountTimer

Util::Timer Window::frameCountTimer
| static

The time of the last updated frame rate

## ◆ frameRate

double Window::frameRate
| static

The current frame rate

## ◆ interpolationType

int Window::interpolationType = Interpolation::NEAREST
| static

The type of interpolation to be used for animation

## ◆ isVisible

bool Window::isVisible
| static

Is the window visible

## ◆ KEY_ESCAPE

const char Window::KEY_ESCAPE = '\033'
| static

The ascii value of the escape character

## ◆ mouse

Mouse Window::mouse
| static

The current state of the mouse

## ◆ parametrizationType

int Window::parametrizationType = RotationParameters::TRIVIAL
| static

The type of parametrization to be used for animation

## ◆ radius

double Window::radius
| static

The radius of the bounding box of the drawn Scene

## ◆ scene

Scene * Window::scene = NULL
| static

A pointer to the scene that is drawn.

## ◆ timer

Util::Timer Window::timer
| static

A timer for tracking the frame type

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

- Assignments/Ray/window.h
- Assignments/Ray/window.cpp