1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0032926: Coding, StdPrs_ToolTriangulatedShape::Normal() - range of "for" not correspond to the NCollection index which run in "for"

Obsolete method has been removed.
This commit is contained in:
kgv 2022-04-09 15:04:23 +03:00 committed by smoskvin
parent 7021de2fe7
commit 08d9c0ae45
3 changed files with 7 additions and 40 deletions

View 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()`.

View 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 :

View 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);