From b32e01f3a625257ce8995950c47bcb3c0c13a661 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 1 Jun 2014 10:56:11 +0300 Subject: [PATCH] Clang's warnings. --HG-- branch : develop --- src/app/app.pro | 1 - src/app/geometry/vsplinepoint.cpp | 34 +++++++++ src/app/geometry/vsplinepoint.h | 120 +++++++++++++----------------- 3 files changed, 85 insertions(+), 70 deletions(-) diff --git a/src/app/app.pro b/src/app/app.pro index e503e877e..00bed2a59 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -486,7 +486,6 @@ CONFIG(debug, debug|release){ -Wunused-value \ -Wunused-variable \ -Wunused-volatile-lvalue \ --Wused-but-marked-unused \ -Wuser-defined-literals \ -Wvarargs \ -Wvariadic-macros \ diff --git a/src/app/geometry/vsplinepoint.cpp b/src/app/geometry/vsplinepoint.cpp index a25417c5f..daeaca28d 100644 --- a/src/app/geometry/vsplinepoint.cpp +++ b/src/app/geometry/vsplinepoint.cpp @@ -30,11 +30,22 @@ #include //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VSplinePoint default constructor. + */ VSplinePoint::VSplinePoint() :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) :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) :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) { 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) { QLineF line(0, 0, 100, 0); diff --git a/src/app/geometry/vsplinepoint.h b/src/app/geometry/vsplinepoint.h index 509d63f26..95a07a911 100644 --- a/src/app/geometry/vsplinepoint.h +++ b/src/app/geometry/vsplinepoint.h @@ -39,131 +39,113 @@ class VSplinePoint { public: - /** - * @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(); VSplinePoint(VPointF pSpline, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2); - /** - * @brief VSplinePoint copy constructor - * @param point point - */ VSplinePoint(const VSplinePoint &point); + VSplinePoint &operator=(const VSplinePoint &point); ~VSplinePoint() {} - /** - * @brief P return point. - * @return point. - */ VPointF P() const; - /** - * @brief SetP set point. - * @param value point. - */ void SetP(const VPointF &value); - /** - * @brief Angle1 return first angle of spline. - * @return angle. - */ qreal Angle1() const; - /** - * @brief SetAngle1 set first angle of spline. - * @param value angle. - */ void SetAngle1(const qreal &value); - /** - * @brief SetAngle2 set second angle of spline. - * @param value angle. - */ void SetAngle2(const qreal &value); - /** - * @brief Angle2 return second angle of spline. - * @return angle. - */ qreal Angle2() const; - /** - * @brief KAsm1 return coefficient of length first control line. - * @return coefficient. - */ qreal KAsm1() const; - /** - * @brief SetKAsm1 set coefficient of length first control line. - * @param value coefficient. - */ void SetKAsm1(const qreal &value); - /** - * @brief KAsm2 return coefficient of length second control line. - * @return coefficient. - */ qreal KAsm2() const; - /** - * @brief SetKAsm2 set coefficient of length second control line. - * @param value coefficient. - */ void SetKAsm2(const qreal &value); protected: - /** - * @brief pSpline point. - */ + /** @brief pSpline point. */ VPointF pSpline; - /** - * @brief angle1 first angle spline. - */ + + /** @brief angle1 first angle spline. */ qreal angle1; - /** - * @brief angle2 second angle spline. - */ + + /** @brief angle2 second angle spline. */ qreal angle2; - /** - * @brief kAsm1 coefficient of length first control line. - */ + + /** @brief kAsm1 coefficient of length first control line. */ qreal kAsm1; - /** - * @brief kAsm2 coefficient of length second control line. - */ + + /** @brief kAsm2 coefficient of length second control line. */ qreal kAsm2; }; +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief P return point. + * @return point. + */ inline VPointF VSplinePoint::P() const { return pSpline; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief SetP set point. + * @param value point. + */ inline void VSplinePoint::SetP(const VPointF &value) { pSpline = value; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Angle1 return first angle of spline. + * @return angle. + */ inline qreal VSplinePoint::Angle1() const { return angle1; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Angle2 return second angle of spline. + * @return angle. + */ inline qreal VSplinePoint::Angle2() const { return angle2; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief KAsm1 return coefficient of length first control line. + * @return coefficient. + */ inline qreal VSplinePoint::KAsm1() const { return kAsm1; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief SetKAsm1 set coefficient of length first control line. + * @param value coefficient. + */ inline void VSplinePoint::SetKAsm1(const qreal &value) { kAsm1 = value; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief KAsm2 return coefficient of length second control line. + * @return coefficient. + */ inline qreal VSplinePoint::KAsm2() const { return kAsm2; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief SetKAsm2 set coefficient of length second control line. + * @param value coefficient. + */ inline void VSplinePoint::SetKAsm2(const qreal &value) { kAsm2 = value;