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

0028467: Improve UnifySameDomain performance

This patch turns off some not needed modes of fix in the called ShapeFix_Face algorithm.

It stores pcurves on planes in the edges to avoid repeated computation of the same pcurves many times (it is done only when SafeInputMode is false).

It avoids unnecessary replace/apply actions in the modification context.

It removes the code that makes decomposition of surface of the face on several faces.

The new command buildpcurvesonplane has been added, which builds and stores pcurves of edges on planar faces. This is useful for investigations how presence of pcurves on planes influence performance of algorithms.

Make drawing of dimension line in snowflake test independent on the order of vertices in the result.
This commit is contained in:
msv
2017-02-17 11:26:25 +03:00
committed by bugmaster
parent 2b8832bb0e
commit f16a6cc5aa
20 changed files with 324 additions and 395 deletions

View File

@@ -270,19 +270,16 @@ const Handle(Poly_Polygon3D)& BRep_Tool::Polygon3D(const TopoDS_Edge& E,
Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
const TopoDS_Face& F,
Standard_Real& First,
Standard_Real& Last)
Standard_Real& Last,
Standard_Boolean* theIsStored)
{
TopLoc_Location l;
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F,l);
TopoDS_Edge aLocalEdge = E;
if (F.Orientation() == TopAbs_REVERSED) {
aLocalEdge.Reverse();
// return CurveOnSurface(E,S,l,First,Last);
}
// return CurveOnSurface(TopoDS::Edge(E.Reversed()),S,l,First,Last);
// else
// return CurveOnSurface(E,S,l,First,Last);
return CurveOnSurface(aLocalEdge,S,l,First,Last);
return CurveOnSurface(aLocalEdge, S, l, First, Last, theIsStored);
}
//=======================================================================
@@ -299,10 +296,13 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
const Handle(Geom_Surface)& S,
const TopLoc_Location& L,
Standard_Real& First,
Standard_Real& Last)
Standard_Real& Last,
Standard_Boolean* theIsStored)
{
TopLoc_Location loc = L.Predivided(E.Location());
Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED);
if (theIsStored)
*theIsStored = Standard_True;
// find the representation
const BRep_TEdge* TE = static_cast<const BRep_TEdge*>(E.TShape().get());
@@ -322,6 +322,8 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
}
// Curve is not found. Try projection on plane
if (theIsStored)
*theIsStored = Standard_False;
return CurveOnPlane(E, S, L, First, Last);
}

View File

@@ -96,13 +96,28 @@ public:
//! parametric space of the face. Returns a NULL
//! handle if this curve does not exist. Returns in
//! <First> and <Last> the parameter range.
Standard_EXPORT static Handle(Geom2d_Curve) CurveOnSurface (const TopoDS_Edge& E, const TopoDS_Face& F, Standard_Real& First, Standard_Real& Last);
//! If the surface is a plane the curve can be not stored but created a new
//! each time. The flag pointed by <theIsStored> serves to indicate storage status.
//! It is valued if the pointer is non-null.
Standard_EXPORT static Handle(Geom2d_Curve) CurveOnSurface (const TopoDS_Edge& E,
const TopoDS_Face& F,
Standard_Real& First,
Standard_Real& Last,
Standard_Boolean* theIsStored = NULL);
//! Returns the curve associated to the edge in the
//! parametric space of the surface. Returns a NULL
//! handle if this curve does not exist. Returns in
//! <First> and <Last> the parameter range.
Standard_EXPORT static Handle(Geom2d_Curve) CurveOnSurface (const TopoDS_Edge& E, const Handle(Geom_Surface)& S, const TopLoc_Location& L, Standard_Real& First, Standard_Real& Last);
//! If the surface is a plane the curve can be not stored but created a new
//! each time. The flag pointed by <theIsStored> serves to indicate storage status.
//! It is valued if the pointer is non-null.
Standard_EXPORT static Handle(Geom2d_Curve) CurveOnSurface(const TopoDS_Edge& E,
const Handle(Geom_Surface)& S,
const TopLoc_Location& L,
Standard_Real& First,
Standard_Real& Last,
Standard_Boolean* theIsStored = NULL);
//! For the planar surface builds the 2d curve for the edge
//! by projection of the edge on plane.