1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-06 18:26:22 +03:00

0029304: Draw Harness, DBRep_DrawableShape - fix inappropriate use of unordered map

TColStd_DataMapOfIntegerInteger has been replaced by NCollection_Vector.
This commit is contained in:
kgv 2017-11-09 10:18:49 +03:00 committed by bugmaster
parent b6a0525bcb
commit 182bd7bc42

View File

@ -1075,13 +1075,9 @@ void DBRep_DrawableShape::display(const Handle(Poly_Triangulation)& T,
// allocate the arrays // allocate the arrays
TColStd_Array1OfInteger Free (1, Max (1, 2 * nFree)); TColStd_Array1OfInteger Free (1, Max (1, 2 * nFree));
NCollection_Vector< NCollection_Vec2<Standard_Integer> > anInternal;
// array is replaced on map because it is impossible Standard_Integer fr = 1;
// to calculate number of internal edges in advance
// due to "internal edges"
TColStd_DataMapOfIntegerInteger Internal;
Standard_Integer fr = 1, in = 1;
const Poly_Array1OfTriangle& triangles = T->Triangles(); const Poly_Array1OfTriangle& triangles = T->Triangles();
Standard_Integer n[3]; Standard_Integer n[3];
for (i = 1; i <= nbTriangles; i++) { for (i = 1; i <= nbTriangles; i++) {
@ -1096,9 +1092,7 @@ void DBRep_DrawableShape::display(const Handle(Poly_Triangulation)& T,
} }
// internal edge if this triangle has a lower index than the adjacent // internal edge if this triangle has a lower index than the adjacent
else if (i < t[j]) { else if (i < t[j]) {
Internal.Bind(in, n[j]); anInternal.Append (NCollection_Vec2<Standard_Integer> (n[j], n[k]));
Internal.Bind(in+1, n[k]);
in += 2;
} }
} }
} }
@ -1119,15 +1113,11 @@ void DBRep_DrawableShape::display(const Handle(Poly_Triangulation)& T,
// internal edges // internal edges
dis.SetColor(Draw_bleu); dis.SetColor(Draw_bleu);
TColStd_DataMapIteratorOfDataMapOfIntegerInteger aIt(Internal); for (NCollection_Vector< NCollection_Vec2<Standard_Integer> >::Iterator anInterIter (anInternal); anInterIter.More(); anInterIter.Next())
for (; aIt.More(); aIt.Next()) { {
Standard_Integer n1 = aIt.Value(); const Standard_Integer n1 = anInterIter.Value()[0];
//alvays pair is put const Standard_Integer n2 = anInterIter.Value()[1];
aIt.Next(); dis.Draw (Nodes(n1).Transformed(tr), Nodes(n2).Transformed(tr));
Standard_Integer n2 = aIt.Value();
dis.Draw(Nodes(n1).Transformed(tr),
Nodes(n2).Transformed(tr));
} }
} }