mirror of
https://github.com/NGSolve/netgen.git
synced 2025-05-25 11:40:50 +05:00
occ version test for v8.0
This commit is contained in:
parent
3d3eecba3c
commit
299fdbafdf
@ -1,6 +1,12 @@
|
|||||||
#ifndef FILE_OCC_UTILS_INCLUDED
|
#ifndef FILE_OCC_UTILS_INCLUDED
|
||||||
#define FILE_OCC_UTILS_INCLUDED
|
#define FILE_OCC_UTILS_INCLUDED
|
||||||
|
|
||||||
|
#define NETGEN_OCC_VERSION_AT_LEAST(MAYOR, MINOR) \
|
||||||
|
MAYOR > OCC_VERSION_MAYOR || \
|
||||||
|
(MAYOR == OCC_VERSION_MAYOR && MINOR >= OCC_VERSION_MINOR)
|
||||||
|
#define NETGEN_OCC_VERSION_AT_LEAST_MAYOR(MAYOR) \
|
||||||
|
NETGEN_OCC_VERSION_AT_LEAST(MAYOR, 0)
|
||||||
|
|
||||||
#include <variant>
|
#include <variant>
|
||||||
|
|
||||||
// #pragma clang diagnostic push
|
// #pragma clang diagnostic push
|
||||||
@ -21,7 +27,7 @@
|
|||||||
|
|
||||||
#include "meshing.hpp"
|
#include "meshing.hpp"
|
||||||
|
|
||||||
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4
|
#if NETGEN_OCC_VERSION_AT_LEAST(7, 4)
|
||||||
#define OCC_HAVE_DUMP_JSON
|
#define OCC_HAVE_DUMP_JSON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6
|
#if NETGEN_OCC_VERSION_AT_LEAST(7, 6)
|
||||||
#include <BinTools_ShapeWriter.hxx>
|
#include <BinTools_ShapeWriter.hxx>
|
||||||
#endif // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=4
|
#endif // NETGEN_OCC_VERSION_AT_LEAST(7, 6)
|
||||||
#include <BOPAlgo_Builder.hxx>
|
#include <BOPAlgo_Builder.hxx>
|
||||||
#include <BOPTools_AlgoTools.hxx>
|
#include <BOPTools_AlgoTools.hxx>
|
||||||
#include <BRepAlgoAPI_Common.hxx>
|
#include <BRepAlgoAPI_Common.hxx>
|
||||||
@ -865,16 +865,16 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
|||||||
{
|
{
|
||||||
if(binary)
|
if(binary)
|
||||||
{
|
{
|
||||||
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6
|
#if NETGEN_OCC_VERSION_AT_LEAST(7, 6)
|
||||||
BinTools_FormatVersion v = version ? BinTools_FormatVersion(*version) : BinTools_FormatVersion_CURRENT;
|
BinTools_FormatVersion v = version ? BinTools_FormatVersion(*version) : BinTools_FormatVersion_CURRENT;
|
||||||
BinTools::Write(shape, filename.c_str(), withTriangles, withNormals, v);
|
BinTools::Write(shape, filename.c_str(), withTriangles, withNormals, v);
|
||||||
# else // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6
|
# else // NETGEN_OCC_VERSION_AT_LEAST(7, 6)
|
||||||
throw Exception("Binary BREP export not supported in this version of OpenCascade");
|
throw Exception("Binary BREP export not supported in this version of OpenCascade");
|
||||||
#endif // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6
|
#endif // NETGEN_OCC_VERSION_AT_LEAST(7, 6)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6
|
#if NETGEN_OCC_VERSION_AT_LEAST(7, 6)
|
||||||
TopTools_FormatVersion v = version ? (TopTools_FormatVersion)(*version) : TopTools_FormatVersion_CURRENT;
|
TopTools_FormatVersion v = version ? (TopTools_FormatVersion)(*version) : TopTools_FormatVersion_CURRENT;
|
||||||
BRepTools::Write(shape, filename.c_str(), withTriangles, withNormals, v);
|
BRepTools::Write(shape, filename.c_str(), withTriangles, withNormals, v);
|
||||||
#else // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6
|
#else // OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=6
|
||||||
|
Loading…
x
Reference in New Issue
Block a user