namespace X3DTK {
namespace MESH {

template<class MData, class VData, class EData, class FData, bool RW>
TemplateNormalsDrawerStateVariables<MData, VData, EData, FData, RW>::TemplateNormalsDrawerStateVariables() : StateVariables(), _amplitude(1.0f)
{
}

template<class MData, class VData, class EData, class FData, bool RW>
void TemplateNormalsDrawerStateVariables<MData, VData, EData, FData, RW>::init()
{
  _matrixStack.push_front(SFMatrix34f::identity);
}

template<class MData, class VData, class EData, class FData, bool RW>
void TemplateNormalsDrawerStateVariables<MData, VData, EData, FData, RW>::finish()
{
  _matrixStack.pop_front();
  if (_matrixStack.size() != 0)
  {
    cx3d << "TemplateNormalsDrawerStateVariables::finishTraversal: Non empty matrix stack at the end of TemplateNormalsDrawer traversal" << std::endl;
    _matrixStack.clear();
  }
}

template<class MData, class VData, class EData, class FData, bool RW>
void TemplateNormalsDrawerStateVariables<MData, VData, EData, FData, RW>::setAmplitude(float amplitude)
{
  _amplitude = amplitude;
}

template<class MData, class VData, class EData, class FData, bool RW>
float TemplateNormalsDrawerStateVariables<MData, VData, EData, FData, RW>::getAmplitude() const {return _amplitude;};

template<class MData, class VData, class EData, class FData, bool RW>
void TemplateNormalsDrawerStateVariables<MData, VData, EData, FData, RW>::pushMatrix(const SFMatrix34f &transformation)
{
  _matrixStack.push_front(_matrixStack.front()*transformation);
}

template<class MData, class VData, class EData, class FData, bool RW>
void TemplateNormalsDrawerStateVariables<MData, VData, EData, FData, RW>::popMatrix()
{
  _matrixStack.pop_front();
}

}
}
