Home | Download | Screen shots | Discussion | Documentation
--- | --- | --- | --- | ---

# openvrml::gl::viewer::modelview_matrix_stack Class Reference

Encapsulates an extended modelview matrix stack. More...

`#include <openvrml/gl/viewer.h>`

List of all members.

## Public Member Functions

| modelview_matrix_stack ()
| Construct.
void | push ()
| Push the current matrix onto the stack.
void | pop ()
| Pop the current matrix off of the stack.

## Private Attributes

size_t | size
| The current stack depth.
std::stack< mat4f > | spillover
| Any matrices that won't fit on the OpenGL modelview matrix stack get pushed onto this stack.

## Detailed Description

Encapsulates an extended modelview matrix stack.

OpenGL requires that implementations have a modelview matrix stack with a maximum depth of only 32. Regardless of that, the maximum depth can be expected to vary between implementations; and we don't want nesting of Transform nodes in VRML worlds to be constrained by this limit.

`modelview_matrix_stack` uses the OpenGL modelview matrix stack until it fills up, at which point any additional matrices that spill over are pushed onto a conventional stack of `mat4f`.

## Constructor & Destructor Documentation

openvrml::gl::viewer::modelview_matrix_stack::modelview_matrix_stack | ( |  | ) |

Construct.

## Member Function Documentation

void openvrml::gl::viewer::modelview_matrix_stack::push | ( |  | ) |

Push the current matrix onto the stack.

Precondition:
  The current matrix is the modelview matrix.

void openvrml::gl::viewer::modelview_matrix_stack::pop | ( |  | ) |

Pop the current matrix off of the stack.

Precondition:
  The current matrix is the modelview matrix.

## Member Data Documentation

size_t openvrml::gl::viewer::modelview_matrix_stack::size`[private]`

The current stack depth.

std::stack< openvrml::mat4f > openvrml::gl::viewer::modelview_matrix_stack::spillover`[private]`

Any matrices that won't fit on the OpenGL modelview matrix stack get pushed onto this stack.