From 69f6d1ab9844271cf0555115331500abbdfac267 Mon Sep 17 00:00:00 2001 From: vro Date: Thu, 11 Feb 2021 09:35:59 +0300 Subject: [PATCH] 0025936: Modeling Data - reusable data structure for 2D tesselation (3- and 4-nodal mesh) // A warning is removed about SetNormals() --- src/VrmlData/VrmlData_IndexedFaceSet.cxx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/VrmlData/VrmlData_IndexedFaceSet.cxx b/src/VrmlData/VrmlData_IndexedFaceSet.cxx index 5194e8e945..9af2efd55a 100644 --- a/src/VrmlData/VrmlData_IndexedFaceSet.cxx +++ b/src/VrmlData/VrmlData_IndexedFaceSet.cxx @@ -229,17 +229,12 @@ const Handle(TopoDS_TShape)& VrmlData_IndexedFaceSet::TShape () } else { // Copy the normals. Currently only normals-per-vertex are supported. - Handle(TShort_HArray1OfShortReal) Normals = - new TShort_HArray1OfShortReal(1, 3 * nbNodes); if (myNormalPerVertex) { if (myArrNormalInd == 0L) { for (i = 0; i < nbNodes; i++) { - Standard_Integer anIdx = i * 3 + 1; - const gp_XYZ& aNormal = myNormals->Normal(i); - Normals->SetValue(anIdx + 0, Standard_ShortReal(aNormal.X())); - Normals->SetValue(anIdx + 1, Standard_ShortReal(aNormal.Y())); - Normals->SetValue(anIdx + 2, Standard_ShortReal(aNormal.Z())); + const gp_XYZ& aNormal = myNormals->Normal (i); + aTriangulation->SetNormal (i + 1, aNormal); } } else @@ -254,10 +249,7 @@ const Handle(TopoDS_TShape)& VrmlData_IndexedFaceSet::TShape () int nbn = IndiceNormals(i, arrIndice); for (Standard_Integer j = 0; j < nbn; j++) { const gp_XYZ& aNormal = myNormals->Normal(arrIndice[j]); - Standard_Integer anInd = mapIdId(anArrNodes[j]) * 3 + 1; - Normals->SetValue(anInd + 0, Standard_ShortReal(aNormal.X())); - Normals->SetValue(anInd + 1, Standard_ShortReal(aNormal.Y())); - Normals->SetValue(anInd + 2, Standard_ShortReal(aNormal.Z())); + aTriangulation->SetNormal (mapIdId (anArrNodes[j]) + 1, aNormal); } } } @@ -266,7 +258,6 @@ const Handle(TopoDS_TShape)& VrmlData_IndexedFaceSet::TShape () else { //TODO .. } - aTriangulation->SetNormals(Normals); } myIsModified = Standard_False; -- 2.39.5