From 12152d433103c85051628927f47f5d2eb4ad5d3a Mon Sep 17 00:00:00 2001 From: Christoph Moench-Tegeder <cmt@burggraben.net> Date: Tue, 16 Nov 2021 18:08:17 +0100 Subject: [PATCH] Adapt OCE 3D plugin to OpenCascade 7.6.0 In line with https://dev.opencascade.org/doc/overview/html/occt__upgrade.html#upgrade_occt760_poly the Poly_Triangulation does not provide direct access to the internal arrays anymore - use the accessor functions instead. --- plugins/3d/oce/loadmodel.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/3d/oce/loadmodel.cpp b/plugins/3d/oce/loadmodel.cpp index e60e311786..79ddca3ce9 100644 --- a/plugins/3d/oce/loadmodel.cpp +++ b/plugins/3d/oce/loadmodel.cpp @@ -80,6 +80,8 @@ #include <TDF_Tool.hxx> #include <TDataStd_Name.hxx> +#include <Standard_Version.hxx> + #include "plugins/3dapi/ifsg_all.h" @@ -1116,8 +1118,10 @@ bool processFace( const TopoDS_Face& face, DATA& data, SGNODE* parent, 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; @@ -1126,14 +1130,22 @@ bool processFace( const TopoDS_Face& face, DATA& data, SGNODE* parent, 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 )