MatrixStack.h
Go to the documentation of this file.
1 #ifndef B_MATRIX_STACK_H
2 #define B_MATRIX_STACK_H
3 
4 #include <memory>
5 #include <iostream>
6 #include "vmmlib/util.hpp"
7 #include "vmmlib/vector.hpp"
8 
9 
14 {
15 public:
16 
17  /* Functions */
18 
22 
25  virtual ~MatrixStack(){}
26 
30  virtual void pushMatrix(const vmml::Matrix4f &matrix);
31 
34  virtual void popMatrix();
35 
38  virtual void clearMatrixStack();
39 
42  virtual vmml::Matrix4f getMatrix();
43 
44 private:
45 
46  /* Variables */
47 
48  std::vector<vmml::Matrix4f> _matrixStack;
49 };
50 
51 typedef std::shared_ptr<MatrixStack> MatrixStackPtr;
52 
53 #endif /* defined(B_MATRIX_STACK_H) */
virtual void pushMatrix(const vmml::Matrix4f &matrix)
Push a matrix to the stack.
Definition: MatrixStack.cpp:3
virtual ~MatrixStack()
Virtual destructor.
Definition: MatrixStack.h:25
virtual void clearMatrixStack()
Deletes all matrices in the stack.
Definition: MatrixStack.cpp:13
virtual vmml::Matrix4f getMatrix()
Returns the matrix as the product of all pushed transformations.
Definition: MatrixStack.cpp:19
virtual void popMatrix()
Delete last element on the stack.
Definition: MatrixStack.cpp:8
This is a matrix stack to temporarily store transformation matrices.
Definition: MatrixStack.h:13
std::shared_ptr< MatrixStack > MatrixStackPtr
Definition: MatrixStack.h:51
MatrixStack()
Constructor.
Definition: MatrixStack.h:21