Changed order of samples directory, started with aviation classes.

This commit is contained in:
Klaus Basan
2013-04-01 21:53:35 +02:00
parent f77258343d
commit 943872ff67
34 changed files with 911 additions and 147 deletions

87
src/blackmisc/avtrack.h Normal file
View File

@@ -0,0 +1,87 @@
#ifndef AVTRACK_H
#define AVTRACK_H
#include "blackmisc/pqangle.h"
namespace BlackMisc {
/*!
* \brief Track as used in aviation, can be true or magnetic Track
* \remarks Intentionally allowing +/- CAngle , and >= / <= CAngle.
*/
class CTrack : public CAngle
{
private:
bool m_magnetic; //!< magnetic or true Track?
protected:
/*!
* \brief Specific stream operation for Track
* \return
*/
virtual QString stringForStreamingOperator() const;
public:
/*!
* \brief Default constructor: 0 Track true
*/
CTrack() : CAngle(0, CAngleUnit::rad()), m_magnetic(true) {}
/*!
* \brief Constructor
* \param value
* \param magnetic
* \param unit
*/
CTrack(double value, bool magnetic, const CAngleUnit &unit) : CAngle(value, unit), m_magnetic(magnetic) {}
/*!
* \brief Constructor
* \param value
* \param magnetic
* \param unit
*/
CTrack(int value, bool magnetic, const CAngleUnit &unit) : CAngle(value, unit), m_magnetic(magnetic) {}
/*!
* \brief Constructor by CAngle
* \param Track
* \param magnetic
*/
CTrack(CAngle track, bool magnetic) : CAngle(), m_magnetic(magnetic) {
CAngle::operator =(track);
}
/*!
* \brief Copy constructor
* \param otherTrack
*/
CTrack(const CTrack &otherTrack) : CAngle(otherTrack), m_magnetic(otherTrack.m_magnetic) {}
/*!
* \brief Assignment operator =
* \param otherQuantity
* @return
*/
CTrack &operator =(const CTrack &otherTrack);
/*!
* \brief Equal operator ==
* \param otherQuantity
* @return
*/
bool operator ==(const CTrack &otherTrack);
/*!
* \brief Unequal operator ==
* \param otherQuantity
* @return
*/
bool operator !=(const CTrack &otherTrack);
/*!
* \brief Magnetic Track?
* \return
*/
bool isMagneticTrack() const { return this->m_magnetic; }
/*!
* \brief True Track?
* \return
*/
bool isTrueTrack() const { return !this->m_magnetic; }
};
} // namespace
#endif // AVTRACK_H