diff --git a/TIGLViewer/src/TIGLAISTriangulation.cpp b/TIGLViewer/src/TIGLAISTriangulation.cpp index 252c2e9ab..479e0ae16 100755 --- a/TIGLViewer/src/TIGLAISTriangulation.cpp +++ b/TIGLViewer/src/TIGLAISTriangulation.cpp @@ -119,22 +119,21 @@ void TIGLAISTriangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& a ); - gp_Vec3f aNormal; if (hasVNormals) { if (hasVColors) { const TColStd_Array1OfInteger& colors = myColor->Array1(); for (int i = 1; i <= myTriangulation->NbNodes(); i++ ) { anArray->AddVertex(myTriangulation->Node(i), AttenuateColor(colors(i), ambient)); - myTriangulation->Normal(i, aNormal); - anArray->SetVertexNormal(i, aNormal.x(), aNormal.y(), aNormal.z()); + auto aNormal = myTriangulation->Normal(i); + anArray->SetVertexNormal(i, aNormal.X(), aNormal.Y(), aNormal.Z()); } } // !hasVColors else { for (int i = 1; i <= myTriangulation->NbNodes(); i++ ) { anArray->AddVertex(myTriangulation->Node(i)); - myTriangulation->Normal(i, aNormal); - anArray->SetVertexNormal(i, aNormal.x(), aNormal.y(), aNormal.z()); + auto aNormal = myTriangulation->Normal(i); + anArray->SetVertexNormal(i, aNormal.X(), aNormal.Y(), aNormal.Z()); } } diff --git a/src/common/tiglcommonfunctions.cpp b/src/common/tiglcommonfunctions.cpp index fb0827b3c..4a8098d5c 100644 --- a/src/common/tiglcommonfunctions.cpp +++ b/src/common/tiglcommonfunctions.cpp @@ -58,7 +58,13 @@ #include "TopTools_IndexedMapOfShape.hxx" #include "TopTools_HSequenceOfShape.hxx" #include "GeomAdaptor_Curve.hxx" + +#if OCC_VERSION_HEX >= VERSION_HEX_CODE(7,6,0) #include "BRepAdaptor_CompCurve.hxx" +#else +#include "BRepAdaptor_HCompCurve.hxx" +#endif + #include "BRepAdaptor_Curve.hxx" #include "GCPnts_AbscissaPoint.hxx" #include "BRep_Builder.hxx" @@ -1102,8 +1108,13 @@ TopoDS_Face BuildRuledFace(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) // Wrap the adaptor in a class which manages curve access via handle (HCurve). According to doxygen // this is required by the algorithms +#if OCC_VERSION_HEX >= VERSION_HEX_CODE(7,6,0) const Handle(Adaptor3d_Curve) curve1 = new BRepAdaptor_CompCurve(compCurve1); const Handle(Adaptor3d_Curve) curve2 = new BRepAdaptor_CompCurve(compCurve2); +#else + Handle(Adaptor3d_HCurve) curve1 = new BRepAdaptor_HCompCurve(compCurve1); + Handle(Adaptor3d_HCurve) curve2 = new BRepAdaptor_HCompCurve(compCurve2); +#endif // We have to generate an approximated curve now from the wire using the adaptor // NOTE: last parameter value unknown