Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2012-11-19 0:05

Class SpiderGL.Space.ViewportStack

The SpiderGL.Space.ViewportStack is a stack for viewport rectangles.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a SpiderGL.Space.ViewportStack.
Field Summary
Field Attributes Field Name and Description
<readonly>  
Gets a copy of the matrix at the top of the stack.
<readonly>  
Gets a reference to the rectangle at the top of the stack.
<readonly>  
Gets the stack depth.
<readonly>  
top
Alias for #rect.
<readonly>  
Alias for #rect$.
Fields borrowed from class SpiderGL.Core.ObjectBase:
uid

Method Summary

Method Attributes Method Name and Description
 
inner(m)
Replace the rectangle r at the top of the stack with Post-multiplies the matrix at the top with the passed matrix The matrix a at the top will be replaced by a * m.
 
load(m)
Replaces the rectangle at the top with a clone of the passed rectangle.
 
Replaces the rectangle at the top with the identity rectangle, that is, [0, 0, 1, 1].
 
pop()
Pops the stack.
 
push()
Pushes into the stack the rectangle at its top.
 
Resets the stack.
Event Summary
Event Attributes Event Name and Description
 
Gets/Sets the callback invoked whenever the top rectangle changes.

Class Detail

SpiderGL.Space.ViewportStack(onChange)
Creates a SpiderGL.Space.ViewportStack. SpiderGL.Space.ViewportStack is a stack for viewport rectangles, specified with lower and left coordinates, width and height. Initially, the stack depth is one and contains a rectangle with lower-eft coordinates equal to zero and width and height equal to one, that is, the array [0, 0, 1, 1]. Every method or getter to access the top rectangle returns a copy of the internal rectangle. For performance reasons, variants of the above accessors (having the same identifier with the postfix "$" appended) that return a reference to the internal rectangle are also present.
var s  = new SpiderGL.Space.ViewportStack();
var dw = width  / nx;
var dh = height / ny;
s.load(x, y, width, height);
for (var x=0; x
						
					
				
					
						
Parameters:
{function(this)} onChange Optional
A callback function called whenever the stack is modified.
See:
reset
SpiderGL.Space.TransformationStack

Field Detail

<readonly> {array} rect
Gets a copy of the matrix at the top of the stack. Initially, the stack has depth one and contains the identity rectangle, that is, [0, 0, 1, 1].
See:
#rect$
<readonly> {array} rect$
Gets a reference to the rectangle at the top of the stack. The returned array MUST NOT be changed. Initially, the stack has depth one and contains the identity rectangle, that is, [0, 0, 1, 1].
See:
#rect
<readonly> {number} size
Gets the stack depth. Initially, the stack contains the identity rectangle, that is, [0, 0, 1, 1].
<readonly> {array} top
Alias for #rect.
See:
#top$
#rect
<readonly> {array} top$
Alias for #rect$.
See:
#top
#rect$

Method Detail

  • inner(m)
    Replace the rectangle r at the top of the stack with Post-multiplies the matrix at the top with the passed matrix The matrix a at the top will be replaced by a * m.
    Parameters:
    {array} m
    The matrix to post-multiply.
    See:
    #load
  • load(m)
    Replaces the rectangle at the top with a clone of the passed rectangle.
    Parameters:
    {array} m
    The rectangle whose clone will be set as the top of the stack.
    See:
    #loadIdentity
    #inner
  • loadIdentity()
    Replaces the rectangle at the top with the identity rectangle, that is, [0, 0, 1, 1].
    See:
    #load
    #inner
  • pop()
    Pops the stack. After a pop operation, the stack depth is decremented by one. Nothing is done if the stack has only one element.
    See:
    #push
  • push()
    Pushes into the stack the rectangle at its top. After a push operation, the stack depth is incremented by one and the two rectangle at its top are identical. There is no limit on the depth the stack can reach.
    See:
    #pop
  • reset()
    Resets the stack. The stack is reset to its initial state, that is, a stack with depth one containing the identity rectangle, that is, [0, 0, 1, 1].
    See:
    #loadIdentity

Event Detail

onChange()
Gets/Sets the callback invoked whenever the top rectangle changes. Initially, no callback is defined.