]> OCCT Git - occt.git/commitdiff
0032926: Coding, StdPrs_ToolTriangulatedShape::Normal() - range of "for" not correspo...
authorkgv <kgv@opencascade.com>
Sat, 9 Apr 2022 12:04:23 +0000 (15:04 +0300)
committersmoskvin <smoskvin@opencascade.com>
Tue, 12 Apr 2022 17:46:27 +0000 (20:46 +0300)
Obsolete method has been removed.

dox/upgrade/upgrade.md
src/StdPrs/StdPrs_ToolTriangulatedShape.cxx
src/StdPrs/StdPrs_ToolTriangulatedShape.hxx

index 72720303c3eda287803ab6aaa90ceea03869fd2a..329bbacb9f9b295d59761b70018bafb904e20df2 100644 (file)
@@ -2333,3 +2333,8 @@ Applications extending OCCT 3D Viewer and calling OpenGL functions directly (lik
 This header, as well as `OpenGl_GlCore20.hxx` and similar, no more include system OpenGL / OpenGL ES headers to define function table.
 Application code calling OpenGL functions directly should be changed to either use `OpenGl_Context::core11fwd` (as designed)
 or to include system OpenGL headers in advance (with help of `OpenGl_GlNative.hxx`).
+
+@subsection upgrade_occt770_tooltriangulatedshape StdPrs_ToolTriangulatedShape
+
+Method `StdPrs_ToolTriangulatedShape::Normal()` has been removed.
+Please use `BRepLib_ToolTriangulatedShape::ComputeNormals()` to fill in normal attributes in triangulation and fetch them directly using `Poly_Triangulation::Normal()`.
index 4dcc0916375172071cb3a7bb1b622ab3d29b93c8..109417b4cf88867c789d37a4770306cee0f93fdf 100644 (file)
@@ -119,36 +119,6 @@ Standard_Boolean StdPrs_ToolTriangulatedShape::IsClosed (const TopoDS_Shape& the
   }
 }
 
-//=======================================================================
-//function : Normal
-//purpose  :
-//=======================================================================
-void StdPrs_ToolTriangulatedShape::Normal (const TopoDS_Face&  theFace,
-                                           Poly_Connect&       thePolyConnect,
-                                           TColgp_Array1OfDir& theNormals)
-{
-  const Handle(Poly_Triangulation)& aPolyTri = thePolyConnect.Triangulation();
-  if (!aPolyTri->HasNormals())
-  {
-    ComputeNormals (theFace, aPolyTri, thePolyConnect);
-  }
-
-  gp_Vec3f aNormal;
-  for (Standard_Integer aNodeIter = 1; aNodeIter <= aPolyTri->NbNodes(); ++aNodeIter)
-  {
-    aPolyTri->Normal (aNodeIter, aNormal);
-    theNormals.ChangeValue (aNodeIter).SetCoord (aNormal.x(), aNormal.y(), aNormal.z());
-  }
-
-  if (theFace.Orientation() == TopAbs_REVERSED)
-  {
-    for (Standard_Integer aNodeIter = 1; aNodeIter <= aPolyTri->NbNodes(); ++aNodeIter)
-    {
-      theNormals.ChangeValue (aNodeIter).Reverse();
-    }
-  }
-}
-
 //=======================================================================
 //function : GetDeflection
 //purpose  :
index 7e59fd3cd52ec48cd4c2ad491374f41ebbdb42c3..1f75067ca10da4750b978e2a5919c07d454c93bc 100644 (file)
@@ -32,14 +32,6 @@ public:
   //! @return true if shape is closed manifold Solid or compound of such Solids. <br>
   Standard_EXPORT static Standard_Boolean IsClosed (const TopoDS_Shape& theShape);
 
-  //! Evaluate normals for a triangle of a face.
-  //! @param[in]  theFace the face.
-  //! @param[in]  thePolyConnect the definition of a face triangulation.
-  //! @param[out] theNormals the array of normals for each triangle.
-  Standard_EXPORT static void Normal (const TopoDS_Face& theFace,
-                                      Poly_Connect& thePolyConnect,
-                                      TColgp_Array1OfDir& theNormals);
-
   //! Computes the absolute deflection value depending on the type of deflection in theDrawer:
   //! <ul>
   //! <li><b>Aspect_TOD_RELATIVE</b>: the absolute deflection is computed using the relative
@@ -49,7 +41,7 @@ public:
   //! In case of the type of deflection in theDrawer computed relative deflection for shape is stored as absolute deflection.
   //! It is necessary to use it later on for sub-shapes.
   //! This function should always be used to compute the deflection value for building
-  //! discrete representations of the shape (triangualtion, wireframe) to avoid incosistencies
+  //! discrete representations of the shape (triangulation, wireframe) to avoid inconsistencies
   //! between different representations of the shape and undesirable visual artifacts.
   Standard_EXPORT static Standard_Real GetDeflection (const TopoDS_Shape& theShape,
                                                       const Handle(Prs3d_Drawer)& theDrawer);
@@ -63,7 +55,7 @@ public:
   //! Validates triangulation within the shape and performs tessellation if necessary.
   //! @param theShape [in] the shape.
   //! @param theDrawer [in] the display settings.
-  //! @return true if tesselation was recomputed and false otherwise.
+  //! @return true if tessellation was recomputed and false otherwise.
   Standard_EXPORT static Standard_Boolean Tessellate (const TopoDS_Shape& theShape,
                                                       const Handle(Prs3d_Drawer)& theDrawer);