1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0022769: Optimization of sewing algorithm

This commit is contained in:
ama 2011-12-02 14:29:24 +00:00 committed by bugmaster
parent d4cc0c5eb5
commit 041bfce9c0
11 changed files with 159 additions and 44 deletions

View File

@ -1625,9 +1625,15 @@ void BRepLib::EncodeRegularity(const TopoDS_Shape& S,
}
if(found){
if(BRep_Tool::Continuity(E,F1,F2)<=GeomAbs_C0){
if(tgtfaces(E, F1, F2, TolAng, couture)){
B.Continuity(E,F1,F2,GeomAbs_G1);
}
try {
if(tgtfaces(E, F1, F2, TolAng, couture)){
B.Continuity(E,F1,F2,GeomAbs_G1);
}
}
catch(Standard_Failure)
{
}
}
}
}
@ -1645,9 +1651,14 @@ void BRepLib::EncodeRegularity(TopoDS_Edge& E,
{
BRep_Builder B;
if(BRep_Tool::Continuity(E,F1,F2)<=GeomAbs_C0){
if( tgtfaces(E, F1, F2, TolAng, F1.IsEqual(F2))) {
B.Continuity(E,F1,F2,GeomAbs_G1);
}
try {
if( tgtfaces(E, F1, F2, TolAng, F1.IsEqual(F2))) {
B.Continuity(E,F1,F2,GeomAbs_G1);
}
}
catch(Standard_Failure)
{
}
}
}

View File

@ -973,13 +973,21 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
Geom2dAdaptor_Curve anOtherPCurve;
if (IShape == aData->IndexOfS1())
{
anOtherPCurve.Load (aData->InterferenceOnS1().PCurveOnFace(),
const Handle(Geom2d_Curve)& aPCurve = aData->InterferenceOnS1().PCurveOnFace();
if(aPCurve.IsNull())
continue;
anOtherPCurve.Load (aPCurve,
aData->InterferenceOnS1().FirstParameter(),
aData->InterferenceOnS1().LastParameter());
}
else if (IShape == aData->IndexOfS2())
{
anOtherPCurve.Load (aData->InterferenceOnS2().PCurveOnFace(),
const Handle(Geom2d_Curve)& aPCurve = aData->InterferenceOnS2().PCurveOnFace();
if(aPCurve.IsNull())
continue;
anOtherPCurve.Load (aPCurve,
aData->InterferenceOnS2().FirstParameter(),
aData->InterferenceOnS2().LastParameter());
}

View File

@ -45,10 +45,12 @@ is
---Purpose: ConstructionError is raised if Ufirst>Ulast
Load(me : in out; C : Curve from Geom2d);
---C++: inline
Load(me : in out; C : Curve from Geom2d; UFirst,ULast : Real)
raises
ConstructionError from Standard;
---C++: inline
---Purpose: ConstructionError is raised if Ufirst>Ulast
Curve(me) returns Curve from Geom2d
@ -228,6 +230,9 @@ is
LocalContinuity(me; U1, U2 : Real) returns Shape from GeomAbs
is static private;
load(me : in out; C : Curve from Geom2d; UFirst,ULast : Real)
is private;
fields

View File

@ -34,6 +34,7 @@
#include <Standard_OutOfRange.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_NotImplemented.hxx>
#define myBspl (*((Handle(Geom2d_BSplineCurve)*)&myCurve))
@ -109,6 +110,9 @@ GeomAbs_Shape Geom2dAdaptor_Curve::LocalContinuity(const Standard_Real U1,
//=======================================================================
Geom2dAdaptor_Curve::Geom2dAdaptor_Curve()
: myTypeCurve(GeomAbs_OtherCurve),
myFirst(0.),
myLast(0.)
{
}
@ -117,8 +121,9 @@ Geom2dAdaptor_Curve::Geom2dAdaptor_Curve()
//purpose :
//=======================================================================
Geom2dAdaptor_Curve::Geom2dAdaptor_Curve(const Handle(Geom2d_Curve)& C) {
Load(C,C->FirstParameter(),C->LastParameter());
Geom2dAdaptor_Curve::Geom2dAdaptor_Curve(const Handle(Geom2d_Curve)& C)
{
Load(C);
}
//=======================================================================
@ -128,29 +133,21 @@ Geom2dAdaptor_Curve::Geom2dAdaptor_Curve(const Handle(Geom2d_Curve)& C) {
Geom2dAdaptor_Curve::Geom2dAdaptor_Curve(const Handle(Geom2d_Curve)& C,
const Standard_Real UFirst,
const Standard_Real ULast) {
if ( UFirst > ULast) Standard_ConstructionError::Raise();
const Standard_Real ULast)
{
Load(C,UFirst,ULast);
}
//=======================================================================
//function : Load
//purpose :
//=======================================================================
void Geom2dAdaptor_Curve::Load(const Handle(Geom2d_Curve)& C) {
Load(C,C->FirstParameter(),C->LastParameter());
}
//=======================================================================
//function : Load
//purpose :
//=======================================================================
void Geom2dAdaptor_Curve::Load(const Handle(Geom2d_Curve)& C,
const Standard_Real UFirst,
const Standard_Real ULast) {
if ( UFirst > ULast) Standard_ConstructionError::Raise();
void Geom2dAdaptor_Curve::load(const Handle(Geom2d_Curve)& C,
const Standard_Real UFirst,
const Standard_Real ULast)
{
myFirst = UFirst;
myLast = ULast;

View File

@ -6,6 +6,8 @@
#include <gp_Pnt2d.hxx>
#include <Geom2d_Curve.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NullObject.hxx>
//=======================================================================
//function : FirstParameter
@ -47,3 +49,30 @@ inline GeomAbs_CurveType Geom2dAdaptor_Curve::GetType() const
return myTypeCurve;
}
//=======================================================================
//function : Load
//purpose :
//=======================================================================
inline void Geom2dAdaptor_Curve::Load(const Handle(Geom2d_Curve)& C)
{
if ( C.IsNull()) Standard_NullObject::Raise();
load(C,C->FirstParameter(),C->LastParameter());
}
//=======================================================================
//function : Load
//purpose :
//=======================================================================
inline void Geom2dAdaptor_Curve::Load(const Handle(Geom2d_Curve)& C,
const Standard_Real UFirst,
const Standard_Real ULast)
{
if ( C.IsNull()) Standard_NullObject::Raise();
if ( UFirst > ULast) Standard_ConstructionError::Raise();
load(C,UFirst,ULast);
}

View File

@ -52,6 +52,7 @@ is
Load(me : in out; C : Curve from Geom; UFirst,ULast : Real)
raises
ConstructionError from Standard;
---C++: inline
---Purpose: ConstructionError is raised if Ufirst>Ulast
Curve(me) returns Curve from Geom
@ -263,6 +264,9 @@ is
LocalContinuity(me; U1, U2 : Real) returns Shape from GeomAbs
is static private;
load(me : in out; C : Curve from Geom; UFirst,ULast : Real)
is private;
fields

View File

@ -34,6 +34,7 @@
#include <Standard_OutOfRange.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_NotImplemented.hxx>
#include <Geom_OffsetCurve.hxx>
@ -109,11 +110,10 @@ GeomAbs_Shape GeomAdaptor_Curve::LocalContinuity(const Standard_Real U1,
//purpose :
//=======================================================================
void GeomAdaptor_Curve::Load(const Handle(Geom_Curve)& C,
void GeomAdaptor_Curve::load(const Handle(Geom_Curve)& C,
const Standard_Real UFirst,
const Standard_Real ULast)
{
if ( UFirst > ULast) Standard_ConstructionError::Raise();
myFirst = UFirst;
myLast = ULast;

View File

@ -5,6 +5,9 @@
#include <gp_Pnt.hxx>
#include <Geom_Curve.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_ConstructionError.hxx>
//=======================================================================
//function : GeomAdaptor_Curve
@ -12,6 +15,9 @@
//=======================================================================
inline GeomAdaptor_Curve::GeomAdaptor_Curve()
: myTypeCurve(GeomAbs_OtherCurve),
myFirst(0.),
myLast(0.)
{
}
@ -22,7 +28,7 @@ inline GeomAdaptor_Curve::GeomAdaptor_Curve()
inline GeomAdaptor_Curve::GeomAdaptor_Curve(const Handle(Geom_Curve)& C)
{
Load(C,C->FirstParameter(),C->LastParameter());
Load(C);
}
//=======================================================================
@ -34,7 +40,6 @@ inline GeomAdaptor_Curve::GeomAdaptor_Curve(const Handle(Geom_Curve)& C,
const Standard_Real UFirst,
const Standard_Real ULast)
{
if (UFirst > ULast) Standard_ConstructionError::Raise();
Load(C,UFirst,ULast);
}
@ -45,9 +50,28 @@ inline GeomAdaptor_Curve::GeomAdaptor_Curve(const Handle(Geom_Curve)& C,
inline void GeomAdaptor_Curve::Load(const Handle(Geom_Curve)& C)
{
Load(C,C->FirstParameter(),C->LastParameter());
if ( C.IsNull()) Standard_NullObject::Raise();
load(C,C->FirstParameter(),C->LastParameter());
}
//=======================================================================
//function : Load
//purpose :
//=======================================================================
inline void GeomAdaptor_Curve::Load(const Handle(Geom_Curve)& C,
const Standard_Real UFirst,
const Standard_Real ULast)
{
if ( C.IsNull()) Standard_NullObject::Raise();
if ( UFirst > ULast) Standard_ConstructionError::Raise();
load(C,UFirst,ULast);
}
//=======================================================================
//function : FirstParameter
//purpose :

View File

@ -59,7 +59,8 @@ is
TolU : Real = 0.0;
TolV : Real = 0.0)
raises ConstructionError from Standard;
---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast
---C++: inline
---Purpose: ConstructionError is raised if UFirst>ULast or VFirst>VLast
Surface(me) returns Surface from Geom
---C++: return const&
@ -358,17 +359,22 @@ is
is redefined static;
Span (me;Side :Integer; Ideb,Ifin:Integer;
OutIdeb,OutIfin:out Integer;
NbKnots : Integer )
is private;
Span (me;Side :Integer; Ideb,Ifin:Integer;
OutIdeb,OutIfin:out Integer;
NbKnots : Integer )
is private;
IfUVBound (me;U,V :Real;Ideb,Ifin,IVdeb,IVfin :out Integer;
USide,VSide: Integer)
returns Boolean from Standard
is private;
is private;
load (me : in out; S : Surface from Geom;
UFirst,ULast,VFirst,VLast : Real;
TolU : Real = 0.0;
TolV : Real = 0.0)
is private;
fields
mySurface : Surface from Geom;

View File

@ -43,6 +43,7 @@
#include <BSplCLib.hxx>
#include <Precision.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NullObject.hxx>
#define myBspl (*((Handle(Geom_BSplineSurface)*)&mySurface))
#define myExtSurf (*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))
@ -97,7 +98,7 @@ GeomAbs_Shape LocalContinuity(Standard_Integer Degree,
//purpose :
//=======================================================================
void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S,
void GeomAdaptor_Surface::load(const Handle(Geom_Surface)& S,
const Standard_Real UFirst,
const Standard_Real ULast,
const Standard_Real VFirst,
@ -105,9 +106,6 @@ void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S,
const Standard_Real TolU,
const Standard_Real TolV)
{
if(UFirst>ULast || VFirst>VLast)
Standard_ConstructionError::Raise("GeomAdaptor_Surface::Load");
myTolU = TolU;
myTolV = TolV;
myUFirst = UFirst;

View File

@ -4,6 +4,8 @@
// Copyright: OPEN CASCADE 1993
#include <Geom_Surface.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_ConstructionError.hxx>
//=======================================================================
//function : GeomAdaptor_Surface
@ -11,8 +13,15 @@
//=======================================================================
inline GeomAdaptor_Surface::GeomAdaptor_Surface()
: myTolU(0.), myTolV(0.)
{}
: mySurfaceType(GeomAbs_OtherSurface),
myUFirst(0.),
myULast(0.),
myVFirst(0.),
myVLast (0.),
myTolU(0.),
myTolV(0.)
{
}
//=======================================================================
//function : GeomAdaptor_Surface
@ -48,11 +57,35 @@ inline GeomAdaptor_Surface::GeomAdaptor_Surface(const Handle(Geom_Surface)& S,
inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S)
{
if ( S.IsNull()) Standard_NullObject::Raise("GeomAdaptor_Surface::Load");
Standard_Real U1,U2,V1,V2;
S->Bounds(U1,U2,V1,V2);
Load(S,U1,U2,V1,V2);
load(S,U1,U2,V1,V2);
}
//=======================================================================
//function : Load
//purpose :
//=======================================================================
inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S,
const Standard_Real UFirst,
const Standard_Real ULast,
const Standard_Real VFirst,
const Standard_Real VLast,
const Standard_Real TolU,
const Standard_Real TolV)
{
if ( S.IsNull()) Standard_NullObject::Raise("GeomAdaptor_Surface::Load");
if(UFirst>ULast || VFirst>VLast)
Standard_ConstructionError::Raise("GeomAdaptor_Surface::Load");
load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
}
//=======================================================================
//function : Surface
//purpose :