#include "MESH_MyStructureComputerStateVariables.h" namespace X3DTK { namespace MESH { MyStructureComputerStateVariables::MyStructureComputerStateVariables() : StateVariables(), _mesh(0), _decal(0) { } void MyStructureComputerStateVariables::init() { _mesh = new MySimpleMesh(); _matrixStack.push_front(SFMatrix34f::identity); } void MyStructureComputerStateVariables::finish() { _matrixStack.clear(); } void MyStructureComputerStateVariables::beginNewMesh() { _decal = _mesh->getVertexArray().size(); } void MyStructureComputerStateVariables::addFace(const MyFace &face) { MyFace decalFace = face; for (MyFace::iterator it = decalFace.begin(); it != decalFace.end(); ++it) *it = _decal + *it; _mesh->addFace(decalFace); }; void MyStructureComputerStateVariables::pushMatrix(const SFMatrix34f &transformation) { _matrixStack.push_front(_matrixStack.front()*transformation); } void MyStructureComputerStateVariables::popMatrix() { _matrixStack.pop_front(); } } }