Loading LrRay.cpp +49 −43 Changes for LrRay.cpp: 49 added lines, 43 removed lines. Original line number Diff line number Diff line /** * @brief Classe pour la gestion des rayons * @file LrRay.cpp * @date Jeudi 14 février 2008 * @note * @author Josselin Francois * @author Michael Nauge * @author Axel Richard * @author Hervé Souchaud * @author Emeric Verschuur * * Cette classe représente le rayon qui est défini par une direction de type * LrVector, et un point d'origine de type LrPoint. */ #if defined HAVE_CONFIG_H #include "config.h" #endif /***************************************************************************** * class LrRay : Cette structure représente le rayon * * qui est défini par une direction de type LrVector, * * et un point d'origine de type LrPoint. * * * * author : J.Francois, M.Nauge, A.Richard, H.Souchaud, E.Vershuur * * creation : Thursday, February 14 2008 (2/14/2008) * * note : * *****************************************************************************/ #include "LrRay.h" /*---------------------------------------------------------------------------* * constructors and destructor * *---------------------------------------------------------------------------*/ // ############################################################################ LrRay::LrRay() : m_direction(), Loading @@ -24,6 +28,8 @@ LrRay::LrRay() { } // ############################################################################ LrRay::LrRay(const LrRay &source) : m_direction(source.m_direction), Loading @@ -31,12 +37,15 @@ LrRay::LrRay(const LrRay &source) { } LrRay * LrRay::clone() const // ############################################################################ LrRay* LrRay::clone() const { return new LrRay(*this); } // ############################################################################ LrRay::LrRay(const LrVector &direction, const LrPoint &origin) : m_direction(direction), Loading @@ -44,16 +53,15 @@ LrRay::LrRay(const LrVector &direction, const LrPoint &origin) { } // ############################################################################ LrRay::~LrRay() { } // ############################################################################ /*---------------------------------------------------------------------------* * assignement operator(s) * *---------------------------------------------------------------------------*/ LrRay & LrRay::operator = (const LrRay &source) LrRay& LrRay::operator = (const LrRay &source) { if (this == &source) return *this; Loading @@ -64,57 +72,55 @@ LrRay::operator = (const LrRay &source) return *this; } // ############################################################################ /*---------------------------------------------------------------------------* * comparison operator(s) * *---------------------------------------------------------------------------*/ bool operator == (const LrRay &lhs, const LrRay &rhs) bool operator == (const LrRay &lhs, const LrRay &rhs) { return ( (lhs.m_direction == rhs.m_direction) && (lhs.m_origin == rhs.m_origin)); } bool operator != (const LrRay &lhs, const LrRay &rhs) // ############################################################################ bool operator != (const LrRay &lhs, const LrRay &rhs) { return (! (lhs == rhs)); } // ############################################################################ /*---------------------------------------------------------------------------* * accessors * *---------------------------------------------------------------------------*/ LrVector LrRay::getDirection() const LrVector LrRay::getDirection() const { return m_direction; } void LrRay::setDirection(const LrVector &direction) // ############################################################################ void LrRay::setDirection(const LrVector &direction) { m_direction = direction; } LrPoint LrRay::getOrigin() const // ############################################################################ LrPoint LrRay::getOrigin() const { return m_origin; } void LrRay::setOrigin(const LrPoint &origin) // ############################################################################ void LrRay::setOrigin(const LrPoint &origin) { m_origin = origin; } //obtenir les coordonées du point situe a une distance k LrPoint LrRay::getPoint(Real distanceK)const // ############################################################################ LrPoint LrRay::getPoint(Real distanceK)const { //Pres = Porigine + K*V return LrPoint::translate(m_origin, (distanceK*m_direction)); } // ############################################################################ LrRay.h +52 −16 Changes for LrRay.h: 52 added lines, 16 removed lines. Original line number Diff line number Diff line /***************************************************************************** * class LrRay : Cette structure représente le rayon * * qui est défini par une direction de type LrVector, * * et un point d'origine de type LrPoint. * * * * author : J.Francois, M.Nauge, A.Richard, H.Souchaud, E.Vershuur * * creation : Thursday, February 14 2008 (2/14/2008) * * note : * *****************************************************************************/ /** * @brief Classe pour la gestion des rayons * @file LrRay.h * @date Jeudi 14 février 2008 * @note * @author Josselin Francois * @author Michael Nauge * @author Axel Richard * @author Hervé Souchaud * @author Emeric Verschuur * * Cette classe représente le rayon qui est défini par une direction de type * LrVector, et un point d'origine de type LrPoint. */ #ifndef LRRAY_H #define LRRAY_H Loading @@ -14,12 +19,16 @@ #include "LrVector.h" #include "LrPoint.h" /** * @brief RAY : Classe pour la gestion des rayons * * Cette classe représente le rayon qui est défini par une direction de type * LrVector, et un point d'origine de type LrPoint. */ class LrRay { public: /** * @brief LrRay constructor. */ Loading Loading @@ -50,26 +59,51 @@ public: virtual ~LrRay(); /** * @brief assignement operator(s) * @brief Opérateur d'affectation * @param source LrRay modèle * @return Retourne une nouveau rayon */ LrRay & operator = (const LrRay &source); /** * @brief comparison operator(s) * @brief Opérateur d'égalité * @param lhs Opérande gauche de type LrRay * @param rhs Opérande droite de type LrRay * @return Retourne vrai si lhs et rhs sont égaux */ friend bool operator == (const LrRay &lhs, const LrRay &rhs); friend bool operator != (const LrRay &lhs, const LrRay &rhs); /** * @brief Opérateur d'égalité * @param lhs Opérande gauche de type LrRay * @param rhs Opérande droite de type LrRay * @return Retourne vrai si lhs et rhs sont différents */ friend bool operator != (const LrRay &lhs, const LrRay &rhs); /** * @brief accessors * @brief Accesseur sur le vecteur de direction * @return Le vecteur de direction sous forme de LrVector */ LrVector getDirection() const; /** * @brief Modifie le vecteur de direction du rayon * @param direction LrVector pour modifier le vecteur de direction du rayon */ void setDirection(const LrVector &direction); /** * @brief Accesseur sur le point d'origine * @return Le point d'origine sous forme de LrVector */ LrPoint getOrigin() const; void setOrigin(const LrPoint &origin); /** * @brief Modifie le point d'origine du rayon * @param origin LrPoint pour modifier le point d'origine du rayon */ void setOrigin(const LrPoint &origin); /** * @brief obtenir les coordonées du point situe a une distance k Loading @@ -78,7 +112,9 @@ public: LrPoint getPoint(Real distanceK)const; private: //Vecteur de direction du rayon LrVector m_direction; //Point d'origine du rayon LrPoint m_origin; }; Loading Loading
LrRay.cpp +49 −43 Changes for LrRay.cpp: 49 added lines, 43 removed lines. Original line number Diff line number Diff line /** * @brief Classe pour la gestion des rayons * @file LrRay.cpp * @date Jeudi 14 février 2008 * @note * @author Josselin Francois * @author Michael Nauge * @author Axel Richard * @author Hervé Souchaud * @author Emeric Verschuur * * Cette classe représente le rayon qui est défini par une direction de type * LrVector, et un point d'origine de type LrPoint. */ #if defined HAVE_CONFIG_H #include "config.h" #endif /***************************************************************************** * class LrRay : Cette structure représente le rayon * * qui est défini par une direction de type LrVector, * * et un point d'origine de type LrPoint. * * * * author : J.Francois, M.Nauge, A.Richard, H.Souchaud, E.Vershuur * * creation : Thursday, February 14 2008 (2/14/2008) * * note : * *****************************************************************************/ #include "LrRay.h" /*---------------------------------------------------------------------------* * constructors and destructor * *---------------------------------------------------------------------------*/ // ############################################################################ LrRay::LrRay() : m_direction(), Loading @@ -24,6 +28,8 @@ LrRay::LrRay() { } // ############################################################################ LrRay::LrRay(const LrRay &source) : m_direction(source.m_direction), Loading @@ -31,12 +37,15 @@ LrRay::LrRay(const LrRay &source) { } LrRay * LrRay::clone() const // ############################################################################ LrRay* LrRay::clone() const { return new LrRay(*this); } // ############################################################################ LrRay::LrRay(const LrVector &direction, const LrPoint &origin) : m_direction(direction), Loading @@ -44,16 +53,15 @@ LrRay::LrRay(const LrVector &direction, const LrPoint &origin) { } // ############################################################################ LrRay::~LrRay() { } // ############################################################################ /*---------------------------------------------------------------------------* * assignement operator(s) * *---------------------------------------------------------------------------*/ LrRay & LrRay::operator = (const LrRay &source) LrRay& LrRay::operator = (const LrRay &source) { if (this == &source) return *this; Loading @@ -64,57 +72,55 @@ LrRay::operator = (const LrRay &source) return *this; } // ############################################################################ /*---------------------------------------------------------------------------* * comparison operator(s) * *---------------------------------------------------------------------------*/ bool operator == (const LrRay &lhs, const LrRay &rhs) bool operator == (const LrRay &lhs, const LrRay &rhs) { return ( (lhs.m_direction == rhs.m_direction) && (lhs.m_origin == rhs.m_origin)); } bool operator != (const LrRay &lhs, const LrRay &rhs) // ############################################################################ bool operator != (const LrRay &lhs, const LrRay &rhs) { return (! (lhs == rhs)); } // ############################################################################ /*---------------------------------------------------------------------------* * accessors * *---------------------------------------------------------------------------*/ LrVector LrRay::getDirection() const LrVector LrRay::getDirection() const { return m_direction; } void LrRay::setDirection(const LrVector &direction) // ############################################################################ void LrRay::setDirection(const LrVector &direction) { m_direction = direction; } LrPoint LrRay::getOrigin() const // ############################################################################ LrPoint LrRay::getOrigin() const { return m_origin; } void LrRay::setOrigin(const LrPoint &origin) // ############################################################################ void LrRay::setOrigin(const LrPoint &origin) { m_origin = origin; } //obtenir les coordonées du point situe a une distance k LrPoint LrRay::getPoint(Real distanceK)const // ############################################################################ LrPoint LrRay::getPoint(Real distanceK)const { //Pres = Porigine + K*V return LrPoint::translate(m_origin, (distanceK*m_direction)); } // ############################################################################
LrRay.h +52 −16 Changes for LrRay.h: 52 added lines, 16 removed lines. Original line number Diff line number Diff line /***************************************************************************** * class LrRay : Cette structure représente le rayon * * qui est défini par une direction de type LrVector, * * et un point d'origine de type LrPoint. * * * * author : J.Francois, M.Nauge, A.Richard, H.Souchaud, E.Vershuur * * creation : Thursday, February 14 2008 (2/14/2008) * * note : * *****************************************************************************/ /** * @brief Classe pour la gestion des rayons * @file LrRay.h * @date Jeudi 14 février 2008 * @note * @author Josselin Francois * @author Michael Nauge * @author Axel Richard * @author Hervé Souchaud * @author Emeric Verschuur * * Cette classe représente le rayon qui est défini par une direction de type * LrVector, et un point d'origine de type LrPoint. */ #ifndef LRRAY_H #define LRRAY_H Loading @@ -14,12 +19,16 @@ #include "LrVector.h" #include "LrPoint.h" /** * @brief RAY : Classe pour la gestion des rayons * * Cette classe représente le rayon qui est défini par une direction de type * LrVector, et un point d'origine de type LrPoint. */ class LrRay { public: /** * @brief LrRay constructor. */ Loading Loading @@ -50,26 +59,51 @@ public: virtual ~LrRay(); /** * @brief assignement operator(s) * @brief Opérateur d'affectation * @param source LrRay modèle * @return Retourne une nouveau rayon */ LrRay & operator = (const LrRay &source); /** * @brief comparison operator(s) * @brief Opérateur d'égalité * @param lhs Opérande gauche de type LrRay * @param rhs Opérande droite de type LrRay * @return Retourne vrai si lhs et rhs sont égaux */ friend bool operator == (const LrRay &lhs, const LrRay &rhs); friend bool operator != (const LrRay &lhs, const LrRay &rhs); /** * @brief Opérateur d'égalité * @param lhs Opérande gauche de type LrRay * @param rhs Opérande droite de type LrRay * @return Retourne vrai si lhs et rhs sont différents */ friend bool operator != (const LrRay &lhs, const LrRay &rhs); /** * @brief accessors * @brief Accesseur sur le vecteur de direction * @return Le vecteur de direction sous forme de LrVector */ LrVector getDirection() const; /** * @brief Modifie le vecteur de direction du rayon * @param direction LrVector pour modifier le vecteur de direction du rayon */ void setDirection(const LrVector &direction); /** * @brief Accesseur sur le point d'origine * @return Le point d'origine sous forme de LrVector */ LrPoint getOrigin() const; void setOrigin(const LrPoint &origin); /** * @brief Modifie le point d'origine du rayon * @param origin LrPoint pour modifier le point d'origine du rayon */ void setOrigin(const LrPoint &origin); /** * @brief obtenir les coordonées du point situe a une distance k Loading @@ -78,7 +112,9 @@ public: LrPoint getPoint(Real distanceK)const; private: //Vecteur de direction du rayon LrVector m_direction; //Point d'origine du rayon LrPoint m_origin; }; Loading