fix for OCCT 7.4 and older

This commit is contained in:
Joachim Schoeberl 2021-08-31 00:55:59 +02:00
parent 08993ae5e2
commit 56fb4a72fc
2 changed files with 22 additions and 8 deletions

View File

@ -105,8 +105,8 @@ void ExtractEdgeData( const TopoDS_Edge & edge, int index, std::vector<double> *
int nbnodes = poly -> NbNodes();
for (int j = 1; j < nbnodes; j++)
{
auto p0 = occ2ng((T -> Node(poly->Node(j))).Transformed(loc));
auto p1 = occ2ng((T -> Node(poly->Node(j+1))).Transformed(loc));
auto p0 = occ2ng((T -> Node(poly->Nodes()(j))).Transformed(loc));
auto p1 = occ2ng((T -> Node(poly->Nodes()(j+1))).Transformed(loc));
for(auto k : Range(3))
{
p[0].push_back(p0[k]);

View File

@ -463,8 +463,11 @@ namespace netgen
glBegin (GL_LINE_STRIP);
for (int j = 1; j <= nbnodes; j++)
{
// gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
gp_Pnt p = (T -> Node(aEdgePoly->Nodes()(j))).Transformed(aEdgeLoc);
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5
gp_Pnt p = T -> Node(aEdgePoly->Node(j)).Transformed(aEdgeLoc);
#else
gp_Pnt p = T -> Nodes())(aEdgePoly->Nodes()(j).Transformed(aEdgeLoc);
#endif
glVertex3f (p.X(), p.Y(), p.Z());
}
glEnd ();
@ -511,8 +514,11 @@ namespace netgen
glBegin (GL_LINE_STRIP);
for (int j = 1; j <= nbnodes; j++)
{
// gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
gp_Pnt p = (T -> Node(aEdgePoly->Node(j))).Transformed(aEdgeLoc);
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5
gp_Pnt p = T -> Node(aEdgePoly->Node(j)).Transformed(aEdgeLoc);
#else
gp_Pnt p = (T -> Nodes())(aEdgePoly->Nodes()(j)).Transformed(aEdgeLoc);
#endif
glVertex3f (p.X(), p.Y(), p.Z());
}
glEnd ();
@ -587,15 +593,23 @@ namespace netgen
int ntriangles = triangulation -> NbTriangles();
for (int j = 1; j <= ntriangles; j++)
{
Poly_Triangle triangle = (triangulation -> Triangle(j));
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5
Poly_Triangle triangle = triangulation -> Triangle(j);
#else
Poly_Triangle triangle = triangulation -> Triangles()(j);
#endif
gp_Pnt p[3];
for (int k = 1; k <= 3; k++)
p[k-1] = (triangulation -> Node(triangle(k))).Transformed(loc);
for (int k = 1; k <= 3; k++)
{
// uv = (triangulation -> UVNodes())(triangle(k));
#if OCC_VERSION_MAJOR>=7 && OCC_VERSION_MINOR>=5
uv = triangulation -> UVNode(triangle(k));
#else
uv = triangulation -> UVNodes())(triangle(k);
#endif
prop.SetParameters (uv.X(), uv.Y());
// surf->D0 (uv.X(), uv.Y(), pnt);