1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0032133: Modeling Data - Restriction of access to internal arrays for Poly_Triangulation, revision of API

Removed methods from Poly_Triangulation/Poly_PolygonOnTriangulation giving access to internal arrays of 2d and 3d nodes, triangles and normals.
This commit is contained in:
vro
2021-02-16 14:24:15 +03:00
committed by bugmaster
parent 008210c3e2
commit a8b605eb5e
73 changed files with 1235 additions and 1445 deletions

View File

@@ -149,20 +149,19 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
if (useTriangulation && !Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
{
const TColStd_Array1OfInteger& Indices = Poly->Nodes();
const TColgp_Array1OfPnt& Nodes = T->Nodes();
nbNodes = Indices.Length();
if (l.IsIdentity())
{
for (i = 1; i <= nbNodes; i++)
{
B.Add(Nodes(Indices[i]));
B.Add (T->Node (Indices[i]));
}
}
else
{
for (i = 1; i <= nbNodes; i++)
{
B.Add(Nodes(Indices[i]).Transformed(l));
B.Add (T->Node (Indices[i]).Transformed (l));
}
}
// B.Enlarge(T->Deflection());
@@ -341,12 +340,17 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
if (useTriangulation && !Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
{
const TColStd_Array1OfInteger& Indices = Poly->Nodes();
const TColgp_Array1OfPnt& Nodes = T->Nodes();
nbNodes = Indices.Length();
for (i = 1; i <= nbNodes; i++)
{
if (l.IsIdentity()) aLocBox.Add(Nodes(Indices[i]));
else aLocBox.Add(Nodes(Indices[i]).Transformed(l));
if (l.IsIdentity())
{
aLocBox.Add (T->Node (Indices[i]));
}
else
{
aLocBox.Add (T->Node (Indices[i]).Transformed (l));
}
}
Standard_Real Tol = useShapeTolerance? BRep_Tool::Tolerance(E) : 0.;
aLocBox.Enlarge(Poly->Deflection() + Tol);

View File

@@ -185,23 +185,26 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
}
// Use triangulation of the face
const Handle(Poly_Triangulation) &aTrng = BRep_Tool::Triangulation(aF, aLoc);
const Handle(Poly_Triangulation)& aTrng = BRep_Tool::Triangulation (aF, aLoc);
if (aTrng.IsNull())
{
// no triangulation on the face
return 0;
}
const Standard_Integer aCNode = aTrng->NbNodes();
const TColgp_Array1OfPnt& aNodesArr = aTrng->Nodes();
const gp_Trsf aTrsf = aLoc;
for (Standard_Integer i = 1; i <= aCNode; i++)
{
if (thePts)
if (thePts != NULL)
{
const gp_Pnt aP = aLoc.IsIdentity() ? aNodesArr[i] :
aNodesArr[i].Transformed(aLoc);
const gp_Pnt aP = aTrsf.Form() == gp_Identity
? aTrng->Node (i)
: aTrng->Node (i).Transformed (aTrsf);
(*thePts)(aRetVal) = aP;
}
if (theArrOfToler)
if (theArrOfToler != NULL)
{
(*theArrOfToler) (aRetVal) = aTrng->Deflection();
}