+++ /dev/null
-# Copyright (C) 2017-2022 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-SET(PYTHON_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/python_test_driver.py")
-SET(COMPONENT_NAME GEOM)
-SET(TIMEOUT 300)
-
-SUBDIRS(examples xao other)
--- /dev/null
+# Copyright (C) 2017-2022 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(OpenCASCADE_VERSION @OpenCASCADE_VERSION@)
+SET(OpenCASCADE_SP_VERSION @OpenCASCADE_SP_VERSION@)
+
+SET(PYTHON_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/python_test_driver.py")
+SET(COMPONENT_NAME GEOM)
+SET(TIMEOUT 300)
+
+SUBDIRS(examples xao other)
#include "GEOMImpl_ICanonicalRecognition.hxx"
+#include <Basics_OCCTVersion.hxx>
+
#include "GEOM_Function.hxx"
#include "GEOM_Object.hxx"
#include "GEOM_PythonDump.hxx"
-#include <TDataStd_ListIteratorOfListOfExtendedString.hxx>
+#if OCC_VERSION_LARGE > 0x07050303
#include <ShapeAnalysis_CanonicalRecognition.hxx>
+#endif
+
+#include <TDataStd_ListIteratorOfListOfExtendedString.hxx>
#include <gp_Pln.hxx>
#include <utilities.h>
return false;
}
TopoDS_Shape aShape = theShape->GetValue();
- if (aShape.IsNull())
- {
+ if (aShape.IsNull()) {
+ SetErrorCode("Error: NULL shape");
return false;
}
+#if OCC_VERSION_LARGE < 0x07050304
+ SetErrorCode("Shape type detection aborted. Improper OCCT version: please, use OCCT 7.5.3p5 or newer.");
+ return false;
+#else
ShapeAnalysis_CanonicalRecognition aRecognition(aShape);
SetErrorCode(OK);
return aRecognition.GetStatus() == 0 && aRecognition.IsPlane(theTolerance, thePln);
+#endif
}
//=============================================================================
return false;
}
TopoDS_Shape aShape = theShape->GetValue();
- if (aShape.IsNull())
- {
+ if (aShape.IsNull()) {
+ SetErrorCode("Error: NULL shape");
return false;
}
+#if OCC_VERSION_LARGE < 0x07050304
+ SetErrorCode("Shape type detection aborted. Improper OCCT version: please, use OCCT 7.5.3p5 or newer.");
+ return false;
+#else
ShapeAnalysis_CanonicalRecognition aRecognition(aShape);
SetErrorCode(OK);
return aRecognition.GetStatus() == 0 && aRecognition.IsSphere(theTolerance, theSphere);
+#endif
}
//=============================================================================
return false;
}
TopoDS_Shape aShape = theShape->GetValue();
- if (aShape.IsNull())
- {
+ if (aShape.IsNull()) {
+ SetErrorCode("Error: NULL shape");
return false;
}
+#if OCC_VERSION_LARGE < 0x07050304
+ SetErrorCode("Shape type detection aborted. Improper OCCT version: please, use OCCT 7.5.3p5 or newer.");
+ return false;
+#else
ShapeAnalysis_CanonicalRecognition aRecognition(aShape);
SetErrorCode(OK);
return aRecognition.GetStatus() == 0 && aRecognition.IsCone(theTolerance, theCone);
+#endif
}
//=============================================================================
return false;
}
TopoDS_Shape aShape = theShape->GetValue();
- if (aShape.IsNull())
- {
+ if (aShape.IsNull()) {
+ SetErrorCode("Error: NULL shape");
return false;
}
+#if OCC_VERSION_LARGE < 0x07050304
+ SetErrorCode("Shape type detection aborted. Improper OCCT version: please, use OCCT 7.5.3p5 or newer.");
+ return false;
+#else
ShapeAnalysis_CanonicalRecognition aRecognition(aShape);
SetErrorCode(OK);
return aRecognition.GetStatus() == 0 && aRecognition.IsCylinder(theTolerance, theCylinder);
+#endif
}
//=============================================================================
return false;
}
TopoDS_Shape aShape = theEdge->GetValue();
- if (aShape.IsNull())
- {
+ if (aShape.IsNull()) {
+ SetErrorCode("Error: NULL shape");
return false;
}
+#if OCC_VERSION_LARGE < 0x07050304
+ SetErrorCode("Shape type detection aborted. Improper OCCT version: please, use OCCT 7.5.3p5 or newer.");
+ return false;
+#else
ShapeAnalysis_CanonicalRecognition aRecognition(aShape);
SetErrorCode(OK);
return aRecognition.GetStatus() == 0 && aRecognition.IsLine(theTolerance, theLine);
+#endif
}
//=============================================================================
return false;
}
TopoDS_Shape aShape = theEdge->GetValue();
- if (aShape.IsNull())
- {
+ if (aShape.IsNull()) {
+ SetErrorCode("Error: NULL shape");
return false;
}
+#if OCC_VERSION_LARGE < 0x07050304
+ SetErrorCode("Shape type detection aborted. Improper OCCT version: please, use OCCT 7.5.3p5 or newer.");
+ return false;
+#else
ShapeAnalysis_CanonicalRecognition aRecognition(aShape);
SetErrorCode(OK);
return aRecognition.GetStatus() == 0 && aRecognition.IsCircle(theTolerance, theCircle);
+#endif
}
//=============================================================================
return false;
}
TopoDS_Shape aShape = theEdge->GetValue();
- if (aShape.IsNull())
- {
+ if (aShape.IsNull()) {
+ SetErrorCode("Error: NULL shape");
return false;
}
+#if OCC_VERSION_LARGE < 0x07050304
+ SetErrorCode("Shape type detection aborted. Improper OCCT version: please, use OCCT 7.5.3p5 or newer.");
+ return false;
+#else
ShapeAnalysis_CanonicalRecognition aRecognition(aShape);
SetErrorCode(OK);
return aRecognition.GetStatus() == 0 && aRecognition.IsEllipse(theTolerance, theElips);
+#endif
}