Commit 4d77fb29 authored by Emeric Verschuur's avatar Emeric Verschuur

--no commit message

--no commit message
parent 89369c28
/*****************************************************************************
* class LrVector3d (specification) *
* *
* author : Gilles Subrenat *
* creation : Sunday, March 2 2008 (3/2/2008) *
* note : *
*****************************************************************************/
#ifndef LRVECTOR3D_H
#define LRVECTOR3D_H
class LrPoint3d;
class LrVector3d
{
public:
// constants
// *********
static const LrVector3d ZERO;
static const LrVector3d I;
static const LrVector3d J;
static const LrVector3d K;
// constructors and destructor
// ***************************
LrVector3d();
LrVector3d(const LrVector3d &source);
LrVector3d(Real x, Real y, Real z);
LrVector3d(const LrPoint3d &p1, const LrPoint3d &p2);
explicit LrVector3d(const LrPoint3d &p);
virtual ~LrVector3d();
// assignement operator(s)
// ***********************
LrVector3d & operator = (const LrVector3d &source);
LrVector3d & operator += (const LrVector3d &source);
LrVector3d & operator -= (const LrVector3d &source);
LrVector3d & operator *= (Real source);
LrVector3d & operator /= (Real source);
// comparison operator(s)
// **********************
friend bool operator == (const LrVector3d &lhs, const LrVector3d &rhs);
friend bool operator != (const LrVector3d &lhs, const LrVector3d &rhs);
// unary and binary operator(s)
// ****************************
friend LrVector3d operator + (const LrVector3d &rhs);
friend LrVector3d operator - (const LrVector3d &rhs);
friend LrVector3d operator + (const LrVector3d &lhs,
const LrVector3d &rhs);
friend LrVector3d operator - (const LrVector3d &lhs,
const LrVector3d &rhs);
friend Real operator * (const LrVector3d &lhs, const LrVector3d &rhs);
friend LrVector3d operator * (Real lhs, const LrVector3d &rhs);
friend LrVector3d operator * (const LrVector3d &lhs, Real rhs);
friend LrVector3d operator / (const LrVector3d &lhs, Real rhs);
friend LrVector3d operator ^ (const LrVector3d &lhs,
const LrVector3d &rhs);
// accessors
// *********
Real getX() const;
void setX(Real x);
Real getY() const;
void setY(Real y);
Real getZ() const;
void setZ(Real z);
void setXYZ(Real x, Real y, Real z);
// miscellaneous functions
// ***********************
Real length() const;
Real lengthSquare() const;
void normalize();
// data
// ****
// public members EXCEPTIONNALY : to simplify use of this class
Real x, y, z;
private:
// data
// ****
// see public part
};
#endif
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