mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0024219: Strange if-statement in BrepMesh_IncrementalMesh
Simplifying if-statement in the Update(const TopoDS_Face& F) and Update(const TopoDS_Edge& F) methods from BrepMesh_IncrementalMesh class. Translating French comment to English.
This commit is contained in:
parent
2a54ebbf29
commit
ab58a62baa
@ -345,20 +345,25 @@ void BRepMesh_IncrementalMesh::Update(const TopoDS_Edge& E)
|
|||||||
do {
|
do {
|
||||||
BRep_Tool::PolygonOnTriangulation(E, Poly, T, l, i);
|
BRep_Tool::PolygonOnTriangulation(E, Poly, T, l, i);
|
||||||
i++;
|
i++;
|
||||||
if (!T.IsNull() && !Poly.IsNull()) {
|
if (!T.IsNull() && !Poly.IsNull())
|
||||||
if (!defined) {
|
{
|
||||||
|
if (!defined)
|
||||||
|
{
|
||||||
if (myRelative)
|
if (myRelative)
|
||||||
defedge = BRepMesh_FastDiscret::RelativeEdgeDeflection(E, myDeflection,
|
defedge = BRepMesh_FastDiscret::RelativeEdgeDeflection(E, myDeflection,
|
||||||
mydtotale, cdef);
|
mydtotale, cdef);
|
||||||
else
|
else
|
||||||
defedge = myDeflection;
|
defedge = myDeflection;
|
||||||
|
|
||||||
mymapedge.Bind(E, defedge);
|
mymapedge.Bind(E, defedge);
|
||||||
defined = Standard_True;
|
defined = Standard_True;
|
||||||
}
|
}
|
||||||
if ((!myRelative && Poly->Deflection() <= 1.1*defedge) ||
|
if (Poly->Deflection() <= 1.1 * defedge)
|
||||||
(myRelative && Poly->Deflection() <= 1.1*defedge))
|
{
|
||||||
found = Standard_True;
|
found = Standard_True;
|
||||||
else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
myModified = Standard_True;
|
myModified = Standard_True;
|
||||||
B.UpdateEdge(E, NullPoly, T, l);
|
B.UpdateEdge(E, NullPoly, T, l);
|
||||||
}
|
}
|
||||||
@ -411,21 +416,27 @@ void BRepMesh_IncrementalMesh::Update(const TopoDS_Face& F)
|
|||||||
else
|
else
|
||||||
defface = myDeflection;
|
defface = myDeflection;
|
||||||
|
|
||||||
if (!T.IsNull()) {
|
if (!T.IsNull())
|
||||||
if ((!myRelative && T->Deflection() <= 1.1*defface) ||
|
{
|
||||||
(myRelative && T->Deflection() <= 1.1*defface)) {
|
if (T->Deflection() <= 1.1 * defface)
|
||||||
for (ex.Init(F, TopAbs_EDGE); ex.More(); ex.Next()) {
|
{
|
||||||
const TopoDS_Shape& E = ex.Current();
|
for (ex.Init(F, TopAbs_EDGE); ex.More(); ex.Next())
|
||||||
Poly = BRep_Tool::PolygonOnTriangulation(TopoDS::Edge(E), T, l);
|
{
|
||||||
if (Poly.IsNull() || myMap.Contains(E)) {
|
const TopoDS_Shape& anEdge = ex.Current();
|
||||||
|
Poly = BRep_Tool::PolygonOnTriangulation(TopoDS::Edge(anEdge), T, l);
|
||||||
|
|
||||||
|
if (Poly.IsNull() || myMap.Contains(anEdge))
|
||||||
|
{
|
||||||
|
// Triangulation is built but edge hasn't representation on it.
|
||||||
WillBeTriangulated = Standard_True;
|
WillBeTriangulated = Standard_True;
|
||||||
// cas un peu special. la triangulation est bonne, mais
|
|
||||||
// l'edge n'a pas de representation polygonalisee sur celle-ci.
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else WillBeTriangulated = Standard_True;
|
else
|
||||||
|
{
|
||||||
|
WillBeTriangulated = Standard_True;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WillBeTriangulated || T.IsNull()) {
|
if (WillBeTriangulated || T.IsNull()) {
|
||||||
@ -494,6 +505,7 @@ void BRepMesh_IncrementalMesh::Update(const TopoDS_Face& F)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Discret
|
//function : Discret
|
||||||
//purpose :
|
//purpose :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user