1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +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

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