#include "MESH_DrawerStateVariables.h" #include namespace X3DTK { namespace MESH { DrawerStateVariables::DrawerStateVariables() : StateVariables(), _selectionMode(false), _oneColorPerMesh(true), _primitiveType(1) {} void DrawerStateVariables::initTraversal() { _matrixStack.push_front(SFMatrix34f::identity); _matrixVector.clear(); _meshVector.clear(); } void DrawerStateVariables::finishTraversal() { _matrixStack.pop_front(); if (_matrixStack.size() != 0) { qWarning("Non empty matrix stack at the end of Drawer traversal"); _matrixStack.clear(); } } void DrawerStateVariables::pushMatrix(const SFMatrix34f &transformation) { _matrixStack.push_front(_matrixStack.front()*transformation); } void DrawerStateVariables::popMatrix() { _matrixStack.pop_front(); } void DrawerStateVariables::storeMesh(Mesh* mesh) { _matrixVector.push_back(_matrixStack.front()); _meshVector.push_back(mesh); } int DrawerStateVariables::getCurrentMeshId() { return _matrixVector.size() - 1; } } }