#include <GL/glu.h>
#include "dms/OrthoCamera.h"

namespace dms
{

OrthoCamera::OrthoCamera(void)
    {
    left_ = 0;
    right_ = 1;
    bottom_ = 0;
    top_ = 1;
    near_ = -1;
    far_ = 1;
    }


OrthoCamera::OrthoCamera(GLdouble left, GLdouble right, GLdouble bottom,
                         GLdouble top, GLdouble near, GLdouble far)
    {
    left_ = left;
    right_ = right;
    bottom_ = bottom;
    top_ = top;
    near_ = near;
    far_ = far;
    }


void OrthoCamera::applyProjection(void) const
    {
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(left_, right_, bottom_, top_, near_, far_);
    glMatrixMode(GL_MODELVIEW);
    }


void OrthoCamera::setEdges(GLdouble left, GLdouble right, GLdouble bottom,
                           GLdouble top, GLdouble near, GLdouble far)
    {
    left_ = left;
    right_ = right;
    bottom_ = bottom;
    top_ = top;
    near_ = near;
    far_ = far;
    }


void OrthoCamera::setLeft(GLdouble v)
    {
    left_ = v;
    }


void OrthoCamera::setRight(GLdouble v)
    {
    right_ = v;
    }


void OrthoCamera::setBottom(GLdouble v)
    {
    bottom_ = v;
    }


void OrthoCamera::setTop(GLdouble v)
    {
    top_ = v;
    }


void OrthoCamera::setNear(GLdouble v)
    {
    near_ = v;
    }


void OrthoCamera::setFar(GLdouble v)
    {
    far_ = v;
    }

}
