Skip to content

Commit

Permalink
Base: fix compilation error with OpenCascade < 7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Feb 24, 2025
1 parent 1394b63 commit 3b7fe0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/app/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ QDialog* runMessageBox(
QStyle::StandardPixmap dlgIcon;
QString title;
switch (icon) {
case QMessageBox::NoIcon:
case QMessageBox::Information:
dlgIcon = QStyle::SP_MessageBoxInformation;
title = MainWindow::tr("Information");
Expand Down
9 changes: 7 additions & 2 deletions src/base/geom_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <Adaptor3d_Curve.hxx>
#include <gp_Trsf.hxx>
#include <Standard_Version.hxx>
#include <TopLoc_Location.hxx>

#include <algorithm>
Expand Down Expand Up @@ -49,9 +50,13 @@ std::pair<gp_Pnt, gp_Vec> GeomUtils::d0d1(const Adaptor3d_Curve& curve, double u

bool GeomUtils::hasScaling(const gp_Trsf& trsf)
{
#if OCC_VERSION_HEX >= 0x070600
const double scalePrec = TopLoc_Location::ScalePrec();
#else
constexpr double scalePrec = 1.e-14;
#endif
// This test comes from implementation of TopoDS_Shape::Location() function
return std::abs(std::abs(trsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()
|| trsf.IsNegative();
return std::abs(std::abs(trsf.ScaleFactor()) - 1.) > scalePrec || trsf.IsNegative();
}

} // namespace Mayo::GeomUtils

0 comments on commit 3b7fe0a

Please sign in to comment.