diff options
author | Michael Reifenberger <mr@FreeBSD.org> | 2021-11-13 18:54:19 +0100 |
---|---|---|
committer | Michael Reifenberger <mr@FreeBSD.org> | 2021-11-13 18:56:31 +0100 |
commit | f25bb5dc813304822ec6bb9811f4d4165240b065 (patch) | |
tree | 3d0b5d988629374d2f4e2324de5379146e822042 /cad/kicad-devel | |
parent | d98fae49127b1d9944f21d2e6a58599b5d037471 (diff) | |
download | freebsd-ports-f25bb5dc813304822ec6bb9811f4d4165240b065.zip |
cad/kicad-devel: Add a patch for compatibility with opencascade 7.6
Diffstat (limited to 'cad/kicad-devel')
-rw-r--r-- | cad/kicad-devel/files/patch-plugins_3d_oce_loadmodel.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/cad/kicad-devel/files/patch-plugins_3d_oce_loadmodel.cpp b/cad/kicad-devel/files/patch-plugins_3d_oce_loadmodel.cpp new file mode 100644 index 000000000000..b80f6901bd75 --- /dev/null +++ b/cad/kicad-devel/files/patch-plugins_3d_oce_loadmodel.cpp @@ -0,0 +1,45 @@ +--- plugins/3d/oce/loadmodel.cpp.orig 2021-11-13 17:46:24 UTC ++++ plugins/3d/oce/loadmodel.cpp +@@ -74,6 +74,8 @@ + #include <TDF_LabelSequence.hxx> + #include <TDF_ChildIterator.hxx> + ++#include <Standard_Version.hxx> ++ + #include "plugins/3dapi/ifsg_all.h" + + // log mask for wxLogTrace +@@ -960,8 +962,10 @@ bool processFace( const TopoDS_Face& face, DATA& data, + else + S3D::AddSGNodeRef( vshape.GetRawPtr(), ocolor ); + ++#if OCC_VERSION_HEX < 0x070600 + const TColgp_Array1OfPnt& arrPolyNodes = triangulation->Nodes(); + const Poly_Array1OfTriangle& arrTriangles = triangulation->Triangles(); ++#endif + + std::vector< SGPOINT > vertices; + std::vector< int > indices; +@@ -970,14 +974,22 @@ bool processFace( const TopoDS_Face& face, DATA& data, + + for( int i = 1; i <= triangulation->NbNodes(); i++ ) + { ++#if OCC_VERSION_HEX < 0x070600 + gp_XYZ v( arrPolyNodes(i).Coord() ); ++#else ++ gp_XYZ v( triangulation->Node(i).Coord() ); ++#endif + vertices.emplace_back( v.X(), v.Y(), v.Z() ); + } + + for( int i = 1; i <= triangulation->NbTriangles(); i++ ) + { + int a, b, c; ++#if OCC_VERSION_HEX < 0x070600 + arrTriangles( i ).Get( a, b, c ); ++#else ++ triangulation->Triangle(i).Get(a, b, c); ++#endif + a--; + + if( reverse ) |