1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0026931: [Regression in 6.9.0] Exporting a face throws an exception

Writing periodic BSpline surfaces to IGES:
Replace segmentation of surface to setting new origin.
Fix face bounds if its length (in U or V) is more than period.

Segmentation of BSpline curve/surface:
Throw exception if segment length more than period.

Fix test case bugs moddata_1 bug14782:
bounds of segmentation must be the same as curve bounds, according to issue description.

Changes in classes Geom2d_BSplineCurve, Geom_BSplineCurve, Geom_BSplineSurface:
- Replace *Raise_if macros with unconditional exceptions where it does not affect on performance.
- Update comments in .hxx files in regard of raised exceptions.
This commit is contained in:
ika
2015-12-03 11:35:42 +03:00
committed by bugmaster
parent 83bb023e8d
commit 369a38aac2
10 changed files with 130 additions and 133 deletions

View File

@@ -685,7 +685,8 @@ Standard_Real Geom2d_BSplineCurve::ReversedParameter( const Standard_Real U) con
void Geom2d_BSplineCurve::Segment(const Standard_Real aU1,
const Standard_Real aU2)
{
Standard_DomainError_Raise_if ( aU2 < aU1, "Geom2d_BSplineCurve::Segment");
if (aU2 < aU1)
Standard_DomainError::Raise("Geom2d_BSplineCurve::Segment");
//
Standard_Real AbsUMax = Max(Abs(FirstParameter()),Abs(LastParameter()));
Standard_Real Eps = Max (Epsilon(AbsUMax), Precision::PConfusion());
@@ -725,12 +726,10 @@ void Geom2d_BSplineCurve::Segment(const Standard_Real aU1,
if (periodic) {
Standard_Real Period = LastParameter() - FirstParameter();
DU = U2 - U1;
while (DU > Period) {
DU -= Period;
}
if (DU <= Epsilon(Period)) {
if (DU - Period > Precision::PConfusion())
Standard_DomainError::Raise("Geom2d_BSplineCurve::Segment");
if (DU > Period)
DU = Period;
}
}
//
index = 0;
@@ -946,14 +945,14 @@ void Geom2d_BSplineCurve::SetPeriodic ()
void Geom2d_BSplineCurve::SetOrigin(const Standard_Integer Index)
{
Standard_NoSuchObject_Raise_if( !periodic,
"Geom2d_BSplineCurve::SetOrigin");
if (!periodic)
Standard_NoSuchObject::Raise("Geom2d_BSplineCurve::SetOrigin");
Standard_Integer i,k;
Standard_Integer first = FirstUKnotIndex();
Standard_Integer last = LastUKnotIndex();
Standard_DomainError_Raise_if( (Index < first) || (Index > last),
"Geom2d_BSplineCurve::SetOrigine");
if ((Index < first) || (Index > last))
Standard_DomainError::Raise("Geom2d_BSplineCurve::SetOrigin");
Standard_Integer nbknots = knots->Length();
Standard_Integer nbpoles = poles->Length();

View File

@@ -367,6 +367,8 @@ public:
//! Exceptions
//! Standard_DomainError if U2 is less than U1.
//! raises if U2 < U1.
//! Standard_DomainError if U2 - U1 exceeds the period for periodic curves.
//! i.e. ((U2 - U1) - Period) > Precision::PConfusion().
Standard_EXPORT void Segment (const Standard_Real U1, const Standard_Real U2);
//! Modifies this BSpline curve by assigning the value K
@@ -609,38 +611,27 @@ public:
Standard_EXPORT gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
//! Raised if FromK1 = ToK2.
//!
//! Raised if FromK1 and ToK2 are not in the range
//! [FirstUKnotIndex, LastUKnotIndex].
Standard_EXPORT gp_Pnt2d LocalValue (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2) const;
//! Raised if FromK1 = ToK2.
Standard_EXPORT void LocalD0 (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2, gp_Pnt2d& P) const;
//! Raised if the local continuity of the curve is not C1
//! between the knot K1 and the knot K2.
//! Raised if FromK1 = ToK2.
//!
//! Raised if FromK1 and ToK2 are not in the range
//! [FirstUKnotIndex, LastUKnotIndex].
Standard_EXPORT void LocalD1 (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2, gp_Pnt2d& P, gp_Vec2d& V1) const;
//! Raised if the local continuity of the curve is not C2
//! between the knot K1 and the knot K2.
//! Raised if FromK1 = ToK2.
//!
//! Raised if FromK1 and ToK2 are not in the range
//! [FirstUKnotIndex, LastUKnotIndex].
Standard_EXPORT void LocalD2 (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const;
//! Raised if the local continuity of the curve is not C3
//! between the knot K1 and the knot K2.
//! Raised if FromK1 = ToK2.
//!
//! Raised if FromK1 and ToK2 are not in the range
//! [FirstUKnotIndex, LastUKnotIndex].
Standard_EXPORT void LocalD3 (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const;
@@ -648,9 +639,6 @@ public:
//! between the knot K1 and the knot K2.
//! Raised if FromK1 = ToK2.
//! Raised if N < 1.
//!
//! Raises if FromK1 and ToK2 are not in the range
//! [FirstUKnotIndex, LastUKnotIndex].
Standard_EXPORT gp_Vec2d LocalDN (const Standard_Real U, const Standard_Integer FromK1, const Standard_Integer ToK2, const Standard_Integer N) const;
@@ -684,7 +672,8 @@ public:
//! returns the knot values of the B-spline curve;
//!
//! Raised if the length of K is not equal to the number of knots.
//! Raised K.Lower() is less than number of first knot or
//! K.Upper() is more than number of last knot.
Standard_EXPORT void Knots (TColStd_Array1OfReal& K) const;
//! returns the knot values of the B-spline curve;
@@ -696,7 +685,9 @@ public:
//! Example :
//! K = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
//!
//! Raised if the length of K is not equal to NbPoles + Degree + 1
//! Raised if K.Lower() is less than number of first knot
//! in knot sequence with repetitions or K.Upper() is more
//! than number of last knot in knot sequence with repetitions.
Standard_EXPORT void KnotSequence (TColStd_Array1OfReal& K) const;
//! Returns the knots sequence.