Clang's warnings.

--HG--
branch : develop
This commit is contained in:
dismine 2014-06-01 10:56:11 +03:00
parent c349a93a73
commit b32e01f3a6
3 changed files with 85 additions and 70 deletions

View File

@ -486,7 +486,6 @@ CONFIG(debug, debug|release){
-Wunused-value \ -Wunused-value \
-Wunused-variable \ -Wunused-variable \
-Wunused-volatile-lvalue \ -Wunused-volatile-lvalue \
-Wused-but-marked-unused \
-Wuser-defined-literals \ -Wuser-defined-literals \
-Wvarargs \ -Wvarargs \
-Wvariadic-macros \ -Wvariadic-macros \

View File

@ -30,11 +30,22 @@
#include <QDebug> #include <QDebug>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/**
* @brief VSplinePoint default constructor.
*/
VSplinePoint::VSplinePoint() VSplinePoint::VSplinePoint()
:pSpline(VPointF()), angle1(0), angle2(180), kAsm1(1), kAsm2(1) :pSpline(VPointF()), angle1(0), angle2(180), kAsm1(1), kAsm2(1)
{} {}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/**
* @brief VSplinePoint constructor.
* @param pSpline spline point.
* @param kAsm1 coefficient of length first control line.
* @param angle1 first angle control line.
* @param kAsm2 coefficient of length second control line.
* @param angle2 second angle control line.
*/
VSplinePoint::VSplinePoint(VPointF pSpline, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2) VSplinePoint::VSplinePoint(VPointF pSpline, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
:pSpline(pSpline), angle1(0), angle2(180), kAsm1(kAsm1), kAsm2(kAsm2) :pSpline(pSpline), angle1(0), angle2(180), kAsm1(kAsm1), kAsm2(kAsm2)
{ {
@ -46,11 +57,30 @@ VSplinePoint::VSplinePoint(VPointF pSpline, qreal kAsm1, qreal angle1, qreal kAs
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/**
* @brief VSplinePoint copy constructor
* @param point point
*/
VSplinePoint::VSplinePoint(const VSplinePoint &point) VSplinePoint::VSplinePoint(const VSplinePoint &point)
:pSpline(point.P()), angle1(point.Angle1()), angle2(point.Angle2()), kAsm1(point.KAsm1()), kAsm2(point.KAsm2()) :pSpline(point.P()), angle1(point.Angle1()), angle2(point.Angle2()), kAsm1(point.KAsm1()), kAsm2(point.KAsm2())
{} {}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VSplinePoint &VSplinePoint::operator=(const VSplinePoint &point)
{
this->pSpline = point.P();
this->angle1 = point.Angle1();
this->angle2 = point.Angle2();
this->kAsm1 = point.KAsm1();
this->kAsm2 = point.KAsm2();
return *this;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief SetAngle1 set first angle of spline.
* @param value angle.
*/
void VSplinePoint::SetAngle1(const qreal &value) void VSplinePoint::SetAngle1(const qreal &value)
{ {
QLineF line(0, 0, 100, 0); QLineF line(0, 0, 100, 0);
@ -62,6 +92,10 @@ void VSplinePoint::SetAngle1(const qreal &value)
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/**
* @brief SetAngle2 set second angle of spline.
* @param value angle.
*/
void VSplinePoint::SetAngle2(const qreal &value) void VSplinePoint::SetAngle2(const qreal &value)
{ {
QLineF line(0, 0, 100, 0); QLineF line(0, 0, 100, 0);

View File

@ -39,131 +39,113 @@
class VSplinePoint class VSplinePoint
{ {
public: public:
/** VSplinePoint();
* @brief VSplinePoint default constructor.
*/
VSplinePoint();
/**
* @brief VSplinePoint constructor.
* @param pSpline spline point.
* @param angle second angle control line.
* @param factor coefficient of length second control line.
*/
VSplinePoint(VPointF pSpline, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2); VSplinePoint(VPointF pSpline, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
/**
* @brief VSplinePoint copy constructor
* @param point point
*/
VSplinePoint(const VSplinePoint &point); VSplinePoint(const VSplinePoint &point);
VSplinePoint &operator=(const VSplinePoint &point);
~VSplinePoint() {} ~VSplinePoint() {}
/**
* @brief P return point.
* @return point.
*/
VPointF P() const; VPointF P() const;
/**
* @brief SetP set point.
* @param value point.
*/
void SetP(const VPointF &value); void SetP(const VPointF &value);
/**
* @brief Angle1 return first angle of spline.
* @return angle.
*/
qreal Angle1() const; qreal Angle1() const;
/**
* @brief SetAngle1 set first angle of spline.
* @param value angle.
*/
void SetAngle1(const qreal &value); void SetAngle1(const qreal &value);
/**
* @brief SetAngle2 set second angle of spline.
* @param value angle.
*/
void SetAngle2(const qreal &value); void SetAngle2(const qreal &value);
/**
* @brief Angle2 return second angle of spline.
* @return angle.
*/
qreal Angle2() const; qreal Angle2() const;
/**
* @brief KAsm1 return coefficient of length first control line.
* @return coefficient.
*/
qreal KAsm1() const; qreal KAsm1() const;
/**
* @brief SetKAsm1 set coefficient of length first control line.
* @param value coefficient.
*/
void SetKAsm1(const qreal &value); void SetKAsm1(const qreal &value);
/**
* @brief KAsm2 return coefficient of length second control line.
* @return coefficient.
*/
qreal KAsm2() const; qreal KAsm2() const;
/**
* @brief SetKAsm2 set coefficient of length second control line.
* @param value coefficient.
*/
void SetKAsm2(const qreal &value); void SetKAsm2(const qreal &value);
protected: protected:
/** /** @brief pSpline point. */
* @brief pSpline point.
*/
VPointF pSpline; VPointF pSpline;
/**
* @brief angle1 first angle spline. /** @brief angle1 first angle spline. */
*/
qreal angle1; qreal angle1;
/**
* @brief angle2 second angle spline. /** @brief angle2 second angle spline. */
*/
qreal angle2; qreal angle2;
/**
* @brief kAsm1 coefficient of length first control line. /** @brief kAsm1 coefficient of length first control line. */
*/
qreal kAsm1; qreal kAsm1;
/**
* @brief kAsm2 coefficient of length second control line. /** @brief kAsm2 coefficient of length second control line. */
*/
qreal kAsm2; qreal kAsm2;
}; };
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief P return point.
* @return point.
*/
inline VPointF VSplinePoint::P() const inline VPointF VSplinePoint::P() const
{ {
return pSpline; return pSpline;
} }
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief SetP set point.
* @param value point.
*/
inline void VSplinePoint::SetP(const VPointF &value) inline void VSplinePoint::SetP(const VPointF &value)
{ {
pSpline = value; pSpline = value;
} }
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Angle1 return first angle of spline.
* @return angle.
*/
inline qreal VSplinePoint::Angle1() const inline qreal VSplinePoint::Angle1() const
{ {
return angle1; return angle1;
} }
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Angle2 return second angle of spline.
* @return angle.
*/
inline qreal VSplinePoint::Angle2() const inline qreal VSplinePoint::Angle2() const
{ {
return angle2; return angle2;
} }
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief KAsm1 return coefficient of length first control line.
* @return coefficient.
*/
inline qreal VSplinePoint::KAsm1() const inline qreal VSplinePoint::KAsm1() const
{ {
return kAsm1; return kAsm1;
} }
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief SetKAsm1 set coefficient of length first control line.
* @param value coefficient.
*/
inline void VSplinePoint::SetKAsm1(const qreal &value) inline void VSplinePoint::SetKAsm1(const qreal &value)
{ {
kAsm1 = value; kAsm1 = value;
} }
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief KAsm2 return coefficient of length second control line.
* @return coefficient.
*/
inline qreal VSplinePoint::KAsm2() const inline qreal VSplinePoint::KAsm2() const
{ {
return kAsm2; return kAsm2;
} }
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief SetKAsm2 set coefficient of length second control line.
* @param value coefficient.
*/
inline void VSplinePoint::SetKAsm2(const qreal &value) inline void VSplinePoint::SetKAsm2(const qreal &value)
{ {
kAsm2 = value; kAsm2 = value;