# OPENCASCADE_INCLUDE_DIRS
# OPENCASCADE_LIBRARIES
# OPENCASCADE_VERSION
+# OPENCASCADE_VERSION_MAJOR
+# OPENCASCADE_VERSION_MINOR
+# OPENCASCADE_VERSION_SUBMINOR
#
"#define OCC_VERSION_COMPLETE.*\"(.*)\"" "\\1"
OPENCASCADE_VERSION "${OPENCASCADE_VERSION}"
)
+ STRING(REGEX REPLACE
+ "^([0-9]+).*$" "\\1"
+ OPENCASCADE_VERSION_MAJOR "${OPENCASCADE_VERSION}"
+ )
+ STRING(REGEX REPLACE
+ "^[0-9]+\\.([0-9]+).*$" "\\1"
+ OPENCASCADE_VERSION_MINOR "${OPENCASCADE_VERSION}"
+ )
+ STRING(REGEX REPLACE
+ "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
+ OPENCASCADE_VERSION_SUBMINOR "${OPENCASCADE_VERSION}"
+ )
ENDIF()
# These seem to be pretty much the only required ones.
DEAL_II_MPI_VERSION_MINOR=0 \
DEAL_II_WITH_MUPARSER=1 \
DEAL_II_WITH_OPENCASCADE=1 \
+ DEAL_II_OPENCASCADE_VERSION_MAJOR=7 \
+ DEAL_II_OPENCASCADE_VERSION_MINOR=6 \
+ DEAL_II_OPENCASCADE_VERSION_SUBMINOR=0 \
+ DEAL_II_OPENCASCADE_VERSION_GTE=1 \
DEAL_II_WITH_P4EST=1 \
DEAL_II_P4EST_VERSION_MAJOR=2 \
DEAL_II_P4EST_VERSION_MINOR=0 \
# define DEAL_II_GMSH_EXECUTABLE_PATH "@GMSH_EXECUTABLE@"
#endif
+/**
+ * OpenCASCADE:
+ */
+
+#ifdef DEAL_II_WITH_OPENCASCADE
+# define DEAL_II_OPENCASCADE_VERSION_MAJOR @OPENCASCADE_VERSION_MAJOR@
+# define DEAL_II_OPENCASCADE_VERSION_MINOR @OPENCASCADE_VERSION_MINOR@
+# define DEAL_II_OPENCASCADE_VERSION_SUBMINOR @OPENCASCADE_VERSION_SUBMINOR@
+
+# define DEAL_II_OPENCASCADE_VERSION_GTE(major,minor,subminor) \
+ ((DEAL_II_OPENCASCADE_VERSION_MAJOR * 10000 + \
+ DEAL_II_OPENCASCADE_VERSION_MINOR * 100 + \
+ DEAL_II_OPENCASCADE_VERSION_SUBMINOR) \
+ >= \
+ (major)*10000 + (minor)*100 + (subminor))
+#endif
+
/*
* p4est:
*/
// ---------------------------------------------------------------------
+#include <deal.II/base/config.h>
+
#include <deal.II/opencascade/manifold_lib.h>
#ifdef DEAL_II_WITH_OPENCASCADE
# include <GCPnts_AbscissaPoint.hxx>
# include <ShapeAnalysis_Curve.hxx>
# include <ShapeAnalysis_Surface.hxx>
-# include <Standard_Version.hxx>
# include <TopoDS.hxx>
-# if (OCC_VERSION_MAJOR < 7)
+# if !DEAL_II_OPENCASCADE_VERSION_GTE(7, 0, 0)
# include <Handle_Adaptor3d_HCurve.hxx>
# endif
//
// ---------------------------------------------------------------------
+#include <deal.II/base/config.h>
+
#include <deal.II/opencascade/utilities.h>
#ifdef DEAL_II_WITH_OPENCASCADE
# include <STEPControl_Controller.hxx>
# include <STEPControl_Reader.hxx>
# include <STEPControl_Writer.hxx>
-# include <Standard_Version.hxx>
# include <TopExp_Explorer.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Edge.hxx>
# include <cstdio>
# include <iostream>
# include <set>
-# if (OCC_VERSION_MAJOR < 7)
-# include <Handle_Standard_Transient.hxx>
-# else
+# if DEAL_II_OPENCASCADE_VERSION_GTE(7, 0, 0)
# include <Standard_Transient.hxx>
+# else
+# include <Handle_Standard_Transient.hxx>
# endif
# include <BRepAdaptor_Curve.hxx>
StlAPI_Writer writer;
-# if ((OCC_VERSION_MAJOR * 100 + OCC_VERSION_MINOR * 10) >= 690)
+# if DEAL_II_OPENCASCADE_VERSION_GTE(6, 9, 0)
// opencascade versions 6.9.0 onwards return an error status
const auto error = writer.Write(shape_to_be_written, filename.c_str());
// which is a custom type between 6.9.0 and 7.1.0
-# if ((OCC_VERSION_MAJOR * 100 + OCC_VERSION_MINOR * 10) < 720)
+# if !DEAL_II_OPENCASCADE_VERSION_GTE(7, 2, 0)
AssertThrow(error == StlAPI_StatusOK,
ExcMessage("Error writing STL from shape."));
# else