From a32ed29e05711c8b66a88198154cb31b8a2e0cb7 Mon Sep 17 00:00:00 2001 From: Nicola Baldo Date: Fri, 16 Dec 2011 18:49:47 +0100 Subject: [PATCH] revised antenna API --- src/antenna/model/antenna-model.h | 126 ++++++++++++++++-------------- 1 file changed, 69 insertions(+), 57 deletions(-) diff --git a/src/antenna/model/antenna-model.h b/src/antenna/model/antenna-model.h index 11e2fc27b..fd0f49ee2 100644 --- a/src/antenna/model/antenna-model.h +++ b/src/antenna/model/antenna-model.h @@ -23,60 +23,11 @@ #include -#include -#include +#include namespace ns3 { -/** - * - * \ingroup antenna - * - * struct holding the azimuth and elevation angles of spherical - * coordinates. The notation is the one used in "Antenna Theory - Analysis - * and Design", C.A. Balanis, Wiley, 2nd Ed., section 2.2 "Radiation pattern". - * - */ -struct Angles -{ - /** - * default constructor, will inizialize phi and theta to zero - * - */ - Angles (); - - /** - * this constructor allows to specify phi and theta - * - * \param phi - * \param theta - * - */ - Angles (double phi, double theta); - - /** - * this constructor will initialize phi and theta by converting the - * given 3D vector from cartesian coordinates to spherical coordinates - * - * \param c the 3D vector in cartesian coordinates - * - */ - Angles (Vector c); - - /** - * the azimuth angle in radians - * - */ - double phi; - - /** - * the elevation angle in radians - * - */ - double theta; -}; - /** * \ingroup antenna * @@ -88,17 +39,82 @@ struct Angles * angles. This choice is the one proposed "Antenna Theory - Analysis * and Design", C.A. Balanis, Wiley, 2nd Ed., see in particular * section 2.2 "Radiation pattern". + * + * */ class AntennaModel : public Object { public: + + + /** + * + * struct holding the azimuth and elevation angles of spherical + * coordinates. The notation is the one used in "Antenna Theory - Analysis + * and Design", C.A. Balanis, Wiley, 2nd Ed., section 2.2 "Radiation pattern". + * + * ^ + * z | + * |_ theta + * | \ + * | /| + * |/ | y + * +--------> + * / \| + * /___/ + * x / phi + * |/ + * + */ + struct Angles + { + /** + * default constructor, will inizialize phi and theta to zero + * + */ + Angles (); + + /** + * this constructor allows to specify phi and theta + * + * \param phi the azimuth angle in radians + * \param theta the elevation angle in radians + * + */ + Angles (double phi, double theta); + + /** + * this constructor will initialize phi and theta by converting the + * given 3D vector from cartesian coordinates to spherical coordinates + * + * \param c the 3D vector in cartesian coordinates + * + */ + Angles (Vector c); + + /** + * the azimuth angle in radians + * + */ + double phi; + + /** + * the elevation angle in radians + * + */ + double theta; + }; + + AntennaModel (); virtual ~AntennaModel (); // inherited from Object static TypeId GetTypeId (); + /** + * this method is expected to be re-implemented by each antenna model * * \param the spherical angles at which the radiation pattern should * be evaluated @@ -107,13 +123,9 @@ public: */ virtual double GetGainDb (Angles a) = 0; - /** - * Set the boresight of the antenna, i.e., is orientation. - * - * \param a the spherical angles specifyint the boresight of the antenna - */ - virtual void SetBoresight (Angles a) = 0; -} +}; } // namespace ns3 + +#endif // ANTENNA_MODEL_H