Files
Work/engine/LINE3D.HPP
2024-08-07 09:16:27 -04:00

86 lines
1.5 KiB
C++

#ifndef _ENGINE_LINE3D_HPP_
#define _ENGINE_LINE3D_HPP_
#ifndef _ENGINE_POINT3D_HPP_
#include <engine/point3d.hpp>
#endif
class Line3D
{
public:
Line3D(void);
Line3D(const Line3D &someLine3D);
Line3D(const Point3D &firstPoint,const Point3D &secondPoint);
virtual ~Line3D();
Line3D &operator=(const Line3D &someLine3D);
BOOL operator==(const Line3D &someLine3D)const;
const Point3D &firstPoint(void)const;
void firstPoint(const Point3D &firstPoint);
const Point3D &secondPoint(void)const;
void secondPoint(const Point3D &secondPoint);
private:
Point3D mFirstPoint;
Point3D mSecondPoint;
};
inline
Line3D::Line3D(void)
{
}
inline
Line3D::Line3D(const Line3D &someLine3D)
{
*this=someLine3D;
}
inline
Line3D::Line3D(const Point3D &firstPoint,const Point3D &secondPoint)
: mFirstPoint(firstPoint), mSecondPoint(secondPoint)
{
}
inline
Line3D::~Line3D()
{
}
inline
Line3D &Line3D::operator=(const Line3D &someLine3D)
{
firstPoint(someLine3D.firstPoint());
secondPoint(someLine3D.secondPoint());
return *this;
}
inline
BOOL Line3D::operator==(const Line3D &someLine3D)const
{
return (firstPoint()==someLine3D.firstPoint()&&
secondPoint()==someLine3D.secondPoint());
}
inline
const Point3D &Line3D::firstPoint(void)const
{
return mFirstPoint;
}
inline
void Line3D::firstPoint(const Point3D &firstPoint)
{
mFirstPoint=firstPoint;
}
inline
const Point3D &Line3D::secondPoint(void)const
{
return mSecondPoint;
}
inline
void Line3D::secondPoint(const Point3D &secondPoint)
{
mSecondPoint=secondPoint;
}
#endif