revised antenna API

This commit is contained in:
Nicola Baldo committed 2011-12-16 18:49:47 +01:00
1 parent 03e6599d83
commit a32ed29e05
1 file changed
+69 -57
+69 -57
View File
@@ -23,60 +23,11 @@
#include <ns3/object.h>
#include <ns3/mobility-model.h>
#include <ns3/spectrum-value.h>
#include <ns3/vector.h>
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