#include "dms/SimpleTransform.h"

namespace dms
{

SimpleTransform::SimpleTransform(void)
    {
    setTranslation(0,0,0);
    setRotation(0,1,0,0);
    setScaling(1);
    }


void SimpleTransform::apply(void)
    {
    glTranslatef(translate_[0], translate_[1], translate_[2]);
    glRotatef(rotateAngle_, rotateAxis_[0], rotateAxis_[1], rotateAxis_[2]);
    glScalef(scale_[0], scale_[1], scale_[2]);
    }


void SimpleTransform::setTranslation(GLfloat x,GLfloat y,GLfloat z)
    {
    translate_[0] = x;
    translate_[1] = y;
    translate_[2] = z;
    }


void SimpleTransform::setRotation(GLfloat angle,GLfloat x,GLfloat y,GLfloat z)
    {
    rotateAngle_ = angle;
    rotateAxis_[0] = x;
    rotateAxis_[1] = y;
    rotateAxis_[2] = z;
    }


void SimpleTransform::setScaling(GLfloat x,GLfloat y,GLfloat z)
    {
    scale_[0] = x;
    scale_[1] = y;
    scale_[2] = z;
    }

}
