Commit 816cc8ae authored by maesius's avatar maesius

Premiere création rapide de la classe LrCamera. (Seulement la mere, les filles...

Premiere création rapide de la classe LrCamera. (Seulement la mere, les filles LRCameraPlan et LRCameraCylinder vont suivrent)
parent ff3636ba
#if defined HAVE_CONFIG_H
#include "config.h"
#endif
/*****************************************************************************
* class LrCamera (body) *
* *
* Ray Tracing Project - Master 1 (2007/2008) *
* UFR Sciences Fondamentales et Appliques de l'Universit de Poitiers *
* author : J.Francois, M.Nauge, A.Richard, H.Souchaud, E.Vershuur *
* creation : Friday, March 7 2008 (3/7/2008) *
*---------------------------------------------------------------------------*
* $Id$
*---------------------------------------------------------------------------*
* Log : see end of file *
*****************************************************************************/
#include "LrCamera.h"
/*---------------------------------------------------------------------------*
* constructors and destructor *
*---------------------------------------------------------------------------*/
LrCamera::LrCamera()
:
m_m_position(),
m_m_vertical(),
m_m_direction(),
m_m_angleX(),
m_m_angleY()
{
}
LrCamera::LrCamera(const LrCamera &source)
:
m_m_position(source.m_m_position),
m_m_vertical(source.m_m_vertical),
m_m_direction(source.m_m_direction),
m_m_angleX(source.m_m_angleX),
m_m_angleY(source.m_m_angleY)
{
}
LrCamera *
LrCamera::clone() const
{
return new LrCamera(*this);
}
LrCamera::LrCamera(const LrPoint &m_position, const LrVector &m_vertical, const LrVector &m_direction, real m_angleX, real m_angleY)
:
m_m_position(m_position),
m_m_vertical(m_vertical),
m_m_direction(m_direction),
m_m_angleX(m_angleX),
m_m_angleY(m_angleY)
{
}
LrCamera::~LrCamera()
{
}
/*---------------------------------------------------------------------------*
* assignement operator(s) *
*---------------------------------------------------------------------------*/
LrCamera &
LrCamera::operator = (const LrCamera &source)
{
if (this == &source)
return *this;
m_m_position = source.m_m_position;
m_m_vertical = source.m_m_vertical;
m_m_direction = source.m_m_direction;
m_m_angleX = source.m_m_angleX;
m_m_angleY = source.m_m_angleY;
return *this;
}
/*---------------------------------------------------------------------------*
* comparison operator(s) *
*---------------------------------------------------------------------------*/
bool
operator == (const LrCamera &lhs, const LrCamera &rhs)
{
return (lhs.m_m_position == rhs.m_m_position)
&& (lhs.m_m_vertical == rhs.m_m_vertical)
&& (lhs.m_m_direction == rhs.m_m_direction)
&& (lhs.m_m_angleX == rhs.m_m_angleX)
&& (lhs.m_m_angleY == rhs.m_m_angleY);
}
bool
operator != (const LrCamera &lhs, const LrCamera &rhs)
{
return (! (lhs == rhs));
}
/*---------------------------------------------------------------------------*
* accessors *
*---------------------------------------------------------------------------*/
LrPoint
LrCamera::getM_position() const
{
return m_m_position;
}
void
LrCamera::setM_position(const LrPoint &m_position)
{
m_m_position = m_position;
}
LrVector
LrCamera::getM_vertical() const
{
return m_m_vertical;
}
void
LrCamera::setM_vertical(const LrVector &m_vertical)
{
m_m_vertical = m_vertical;
}
LrVector
LrCamera::getM_direction() const
{
return m_m_direction;
}
void
LrCamera::setM_direction(const LrVector &m_direction)
{
m_m_direction = m_direction;
}
real
LrCamera::getM_angleX() const
{
return m_m_angleX;
}
void
LrCamera::setM_angleX(real m_angleX)
{
m_m_angleX = m_angleX;
}
real
LrCamera::getM_angleY() const
{
return m_m_angleY;
}
void
LrCamera::setM_angleY(real m_angleY)
{
m_m_angleY = m_angleY;
}
/*****************************************************************************
* $Log$
*****************************************************************************/
/*****************************************************************************
* class LrCamera (specification) *
* *
* Ray Tracing Project - Master 1 (2007/2008) *
* UFR Sciences Fondamentales et Appliques de l'Universit de Poitiers *
* author : J.Francois, M.Nauge, A.Richard, H.Souchaud, E.Vershuur *
* creation : Friday, March 7 2008 (3/7/2008) *
*---------------------------------------------------------------------------*
* $Id$
*---------------------------------------------------------------------------*
* Log : see end of file *
*****************************************************************************/
#ifndef LRCAMERA_H
#define LRCAMERA_H
#include "LrPoint.h"
#include "LrVector.h"
class LrCamera
{
public:
// constructors and destructor
// ***************************
LrCamera();
LrCamera(const LrCamera &source);
LrCamera * clone() const;
LrCamera(const LrPoint &m_position, const LrVector &m_vertical, const LrVector &m_direction, real m_angleX, real m_angleY);
virtual ~LrCamera();
// assignement operator(s)
// ***********************
LrCamera & operator = (const LrCamera &source);
// comparison operator(s)
// **********************
friend bool operator == (const LrCamera &lhs, const LrCamera &rhs);
friend bool operator != (const LrCamera &lhs, const LrCamera &rhs);
// accessors
// *********
LrPoint getM_position() const;
void setM_position(const LrPoint &m_position);
LrVector getM_vertical() const;
void setM_vertical(const LrVector &m_vertical);
LrVector getM_direction() const;
void setM_direction(const LrVector &m_direction);
real getM_angleX() const;
void setM_angleX(real m_angleX);
real getM_angleY() const;
void setM_angleY(real m_angleY);
//
// *****************
LrRay getRay(real u, real v) const;
private:
// data
// ****
LrPoint m_m_position;
LrVector m_m_vertical;
LrVector m_m_direction;
real m_m_angleX;
real m_m_angleY;
};
#endif
/*****************************************************************************
* $Log$
*****************************************************************************/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment