From: mpv Date: Tue, 11 Oct 2016 11:24:31 +0000 (+0300) Subject: Fix for the issue #1818: checking angle for fillet on Linux. X-Git-Tag: V_2.5.1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f3fa014cb639143f47a71e37bccae8870c5a285c;p=modules%2Fshaper.git Fix for the issue #1818: checking angle for fillet on Linux. --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index e5147561b..b682efc1c 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -413,7 +413,7 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptr aSketchDir = aPlanarEdges->norm(); if(aDirEdge->isLine()) { std::shared_ptr aDir = aDirEdge->line()->direction(); - isParallel = abs(aSketchDir->angle(aDir) - M_PI / 2.0) < 10e-7; + isParallel = fabs(aSketchDir->angle(aDir) - M_PI / 2.0) < 10e-7; } else { isParallel = false; } diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index 5f89c141e..729424d96 100755 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -691,9 +691,9 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut aFirstEndPnt = std::dynamic_pointer_cast(aFirstFeature->attribute(anEndAttr))->pnt(); aSecondStartPnt = std::dynamic_pointer_cast(aSecondFeature->attribute(aStartAttr))->pnt(); aSecondEndPnt = std::dynamic_pointer_cast(aSecondFeature->attribute(anEndAttr))->pnt(); - double aCheck1 = abs((aFirstEndPnt->x() - aFirstStartPnt->x()) * (aSecondStartPnt->y() - aFirstStartPnt->y()) - + double aCheck1 = fabs((aFirstEndPnt->x() - aFirstStartPnt->x()) * (aSecondStartPnt->y() - aFirstStartPnt->y()) - (aSecondStartPnt->x() - aFirstStartPnt->x()) * (aFirstEndPnt->y() - aFirstStartPnt->y())); - double aCheck2 = abs((aFirstEndPnt->x() - aFirstStartPnt->x()) * (aSecondEndPnt->y() - aFirstStartPnt->y()) - + double aCheck2 = fabs((aFirstEndPnt->x() - aFirstStartPnt->x()) * (aSecondEndPnt->y() - aFirstStartPnt->y()) - (aSecondEndPnt->x() - aFirstStartPnt->x()) * (aFirstEndPnt->y() - aFirstStartPnt->y())); if(aCheck1 < 1.e-7 && aCheck2 < 1.e-7) { return false; diff --git a/src/XGUI/XGUI_Tools.h b/src/XGUI/XGUI_Tools.h index a8d51f2d5..e64e324e2 100644 --- a/src/XGUI/XGUI_Tools.h +++ b/src/XGUI/XGUI_Tools.h @@ -19,21 +19,19 @@ class ModuleBase_IWorkshop; /*! \ingroup GUI + \brief Commonly used methods in XGUI package and higher. + */ +namespace XGUI_Tools { + +/** \brief Return directory part of the file path. If the file path does not include directory part (the file is in the current directory), null string is returned. \param path file path - \param abs if true (default) \a path parameter is treated as absolute file path + \param isAbs if true (default) \a path parameter is treated as absolute file path \return directory part of the file path - */ -namespace XGUI_Tools { - -/** -* Returns directory name from name of file -* \param path a path to a file -* \param isAbs is absolute or relative path */ QString XGUI_EXPORT dir(const QString& path, bool isAbs = true);