Error messages have been added in throw statements.
const Standard_Boolean Periodic)
{
if (Degree < 1 || Degree > Geom_BSplineCurve::MaxDegree()) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("BSpline curve: invalid degree");
}
- if (CPoles.Length() < 2) throw Standard_ConstructionError();
- if (CKnots.Length() != CMults.Length()) throw Standard_ConstructionError();
+ if (CPoles.Length() < 2) throw Standard_ConstructionError("BSpline curve: at least 2 poles required");
+ if (CKnots.Length() != CMults.Length()) throw Standard_ConstructionError("BSpline curve: Knot and Mult array size mismatch");
for (Standard_Integer I = CKnots.Lower(); I < CKnots.Upper(); I++) {
if (CKnots (I+1) - CKnots (I) <= Epsilon (Abs(CKnots (I)))) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("BSpline curve: Knots interval values too close");
}
}
if (CPoles.Length() != BSplCLib::NbPoles(Degree,Periodic,CMults))
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("BSpline curve: # Poles and degree mismatch");
}
//=======================================================================
Periodic);
if (Weights.Length() != Poles.Length())
- throw Standard_ConstructionError("Geom_BSplineCurve");
+ throw Standard_ConstructionError("Geom_BSplineCurve: Weights and Poles array size mismatch");
Standard_Integer i;
for (i = Weights.Lower(); i <= Weights.Upper(); i++) {
if (Weights(i) <= gp::Resolution())
- throw Standard_ConstructionError("Geom_BSplineCurve");
+ throw Standard_ConstructionError("Geom_BSplineCurve: Weights values too small");
}
// check really rational
if (Degree == deg) return;
if (Degree < deg || Degree > Geom_BSplineCurve::MaxDegree()) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("BSpline curve: IncreaseDegree: bad degree value");
}
Standard_Integer FromK1 = FirstUKnotIndex ();
Standard_Integer ToK2 = LastUKnotIndex ();
Standard_Integer I2 = LastUKnotIndex ();
if ( !periodic && (Index <= I1 || Index >= I2) ) {
- throw Standard_OutOfRange();
+ throw Standard_OutOfRange("BSpline curve: RemoveKnot: index out of range");
}
else if ( periodic && (Index < I1 || Index > I2)) {
- throw Standard_OutOfRange();
+ throw Standard_OutOfRange("BSpline curve: RemoveKnot: index out of range");
}
const TColgp_Array1OfPnt & oldpoles = poles->Array1();
(const Standard_Integer Index,
const Standard_Real K)
{
- if (Index < 1 || Index > knots->Length()) throw Standard_OutOfRange();
+ if (Index < 1 || Index > knots->Length()) throw Standard_OutOfRange("BSpline curve: SetKnot: Index and #knots mismatch");
Standard_Real DK = Abs(Epsilon (K));
if (Index == 1) {
- if (K >= knots->Value(2) - DK) throw Standard_ConstructionError();
+ if (K >= knots->Value(2) - DK) throw Standard_ConstructionError("BSpline curve: SetKnot: K out of range");
}
else if (Index == knots->Length()) {
if (K <= knots->Value (knots->Length()-1) + DK) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("BSpline curve: SetKnot: K out of range");
}
}
else {
if (K <= knots->Value(Index-1) + DK ||
K >= knots->Value(Index+1) - DK ) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("BSpline curve: SetKnot: K out of range");
}
}
if (K != knots->Value (Index)) {
(const Standard_Integer Index,
const gp_Pnt& P)
{
- if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange();
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve: SetPole: index and #pole mismatch");
poles->SetValue (Index, P);
maxderivinvok = 0;
}
(const Standard_Integer Index,
const Standard_Real W)
{
- if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange();
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve: SetWeight: Index and #pole mismatch");
- if (W <= gp::Resolution ()) throw Standard_ConstructionError();
+ if (W <= gp::Resolution ()) throw Standard_ConstructionError("BSpline curve: SetWeight: Weight too small");
Standard_Boolean rat = IsRational() || (Abs(W - 1.) > gp::Resolution());
{
if (Index1 < 1 || Index1 > poles->Length() ||
Index2 < 1 || Index2 > poles->Length() || Index1 > Index2) {
- throw Standard_OutOfRange();
+ throw Standard_OutOfRange("BSpline curve: MovePoint: Index and #pole mismatch");
}
TColgp_Array1OfPnt npoles(1, poles->Length());
gp_Pnt P0;
{
if (UDegree < 1 || UDegree > Geom_BSplineSurface::MaxDegree () ||
VDegree < 1 || VDegree > Geom_BSplineSurface::MaxDegree ()) {
- throw Standard_ConstructionError("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface: invalid degree");
}
if (SPoles.ColLength () < 2 || SPoles.RowLength () < 2) {
- throw Standard_ConstructionError("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface: at least 2 poles required");
}
if (SUKnots.Length() != SUMults.Length() ||
SVKnots.Length() != SVMults.Length()) {
- throw Standard_ConstructionError("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface: Knot and Mult array size mismatch");
}
Standard_Integer i;
for (i = SUKnots.Lower(); i < SUKnots.Upper(); i++) {
if (SUKnots(i+1) - SUKnots(i) <= Epsilon(Abs(SUKnots(i)))) {
- throw Standard_ConstructionError("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface: UKnots interval values too close");
}
}
for (i = SVKnots.Lower(); i < SVKnots.Upper(); i++) {
if (SVKnots(i+1) - SVKnots(i) <= Epsilon(Abs(SVKnots(i)))) {
- throw Standard_ConstructionError("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface: VKnots interval values too close");
}
}
if (SPoles.ColLength() != BSplCLib::NbPoles(UDegree,UPeriodic,SUMults))
- throw Standard_ConstructionError("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface: # U Poles and degree mismatch");
if (SPoles.RowLength() != BSplCLib::NbPoles(VDegree,VPeriodic,SVMults))
- throw Standard_ConstructionError("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface: # V Poles and degree mismatch");
}
//=======================================================================
// check weights
if (Weights.ColLength() != Poles.ColLength())
- throw Standard_ConstructionError("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface: U Weights and Poles array size mismatch");
if (Weights.RowLength() != Poles.RowLength())
- throw Standard_ConstructionError("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface: V Weights and Poles array size mismatch");
Standard_Integer i,j;
for (i = Weights.LowerRow(); i <= Weights.UpperRow(); i++) {
for (j = Weights.LowerCol(); j <= Weights.UpperCol(); j++) {
if (Weights(i,j) <= gp::Resolution())
- throw Standard_ConstructionError("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface: Weights values too small");
}
}
{
if (UDegree != udeg) {
if ( UDegree < udeg || UDegree > Geom_BSplineSurface::MaxDegree())
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::IncreaseDegree: bad U degree value");
Standard_Integer FromK1 = FirstUKnotIndex();
Standard_Integer ToK2 = LastUKnotIndex();
if (VDegree != vdeg) {
if ( VDegree < vdeg || VDegree > Geom_BSplineSurface::MaxDegree())
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::IncreaseDegree: bad V degree value");
Standard_Integer FromK1 = FirstVKnotIndex();
Standard_Integer ToK2 = LastVKnotIndex();
(const Standard_Integer UIndex,
const Standard_Real K )
{
- if (UIndex < 1 || UIndex > uknots->Length()) throw Standard_OutOfRange();
+ if (UIndex < 1 || UIndex > uknots->Length())
+ throw Standard_OutOfRange("Geom_BSplineSurface::SetUKnot: Index and #knots mismatch");
Standard_Integer NewIndex = UIndex;
Standard_Real DU = Abs(Epsilon (K));
if (UIndex == 1) {
- if (K >= uknots->Value (2) - DU) throw Standard_ConstructionError();
+ if (K >= uknots->Value (2) - DU)
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetUKnot: K out of range");
}
else if (UIndex == uknots->Length()) {
if (K <= uknots->Value (uknots->Length()-1) + DU) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetUKnot: K out of range");
}
}
else {
if (K <= uknots->Value (NewIndex-1) + DU ||
K >= uknots->Value (NewIndex+1) - DU ) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetUKnot: K out of range");
}
}
Standard_Integer Upper = UK.Upper();
if (Lower < 1 || Lower > uknots->Length() ||
Upper < 1 || Upper > uknots->Length() ) {
- throw Standard_OutOfRange();
+ throw Standard_OutOfRange("Geom_BSplineSurface::SetUKnots: invalid array dimension");
}
if (Lower > 1) {
if (Abs (UK (Lower) - uknots->Value (Lower-1)) <= gp::Resolution()) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetUKnots: invalid knot value");
}
}
if (Upper < uknots->Length ()) {
if (Abs (UK (Upper) - uknots->Value (Upper+1)) <= gp::Resolution()) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetUKnots: invalid knot value");
}
}
Standard_Real K1 = UK (Lower);
uknots->SetValue (i, UK(i));
if (i != Lower) {
if (Abs (UK(i) - K1) <= gp::Resolution()) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetUKnots: invalid knot value");
}
K1 = UK (i);
}
(const Standard_Integer VIndex,
const Standard_Real K)
{
- if (VIndex < 1 || VIndex > vknots->Length()) throw Standard_OutOfRange();
+ if (VIndex < 1 || VIndex > vknots->Length())
+ throw Standard_OutOfRange("Geom_BSplineSurface::SetVKnot: Index and #knots mismatch");
Standard_Integer NewIndex = VIndex + vknots->Lower() - 1;
Standard_Real DV = Abs(Epsilon (K));
if (VIndex == 1) {
if (K >= vknots->Value (2) - DV) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetVKnot: K out of range");
}
}
else if (VIndex == vknots->Length()) {
if (K <= vknots->Value (vknots->Length()-1) + DV) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetVKnot: K out of range");
}
}
else {
if (K <= vknots->Value (NewIndex-1) + DV ||
K >= vknots->Value (NewIndex+1) - DV ) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetVKnot: K out of range");
}
}
Standard_Integer Upper = VK.Upper();
if (Lower < 1 || Lower > vknots->Length() ||
Upper < 1 || Upper > vknots->Length() ) {
- throw Standard_OutOfRange();
+ throw Standard_OutOfRange("Geom_BSplineSurface::SetVKnots: invalid array dimension");
}
if (Lower > 1) {
if (Abs (VK (Lower) - vknots->Value (Lower-1)) <= gp::Resolution()) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetVKnots: invalid knot value");
}
}
if (Upper < vknots->Length ()) {
if (Abs (VK (Upper) - vknots->Value (Upper+1)) <= gp::Resolution()) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetVKnots: invalid knot value");
}
}
Standard_Real K1 = VK (Lower);
vknots->SetValue (i, VK(i));
if (i != Lower) {
if (Abs (VK(i) - K1) <= gp::Resolution()) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetVKnots: invalid knot value");
}
K1 = VK (i);
}
const Standard_Integer VIndex,
const Standard_Real Weight)
{
- if (Weight <= gp::Resolution()) throw Standard_ConstructionError();
+ if (Weight <= gp::Resolution())
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetWeight: Weight too small");
TColStd_Array2OfReal & Weights = weights->ChangeArray2();
if (UIndex < 1 || UIndex > Weights.ColLength() ||
VIndex < 1 || VIndex > Weights.RowLength() ) {
- throw Standard_OutOfRange();
+ throw Standard_OutOfRange("Geom_BSplineSurface::SetWeight: Index and #pole mismatch");
}
Weights (UIndex+Weights.LowerRow()-1, VIndex+Weights.LowerCol()-1) = Weight;
Rational(Weights, urational, vrational);
{
TColStd_Array2OfReal & Weights = weights->ChangeArray2();
if (VIndex < 1 || VIndex > Weights.RowLength()) {
- throw Standard_OutOfRange();
+ throw Standard_OutOfRange("Geom_BSplineSurface::SetWeightCol: Index and #pole mismatch");
}
if (CPoleWeights.Lower() < 1 ||
CPoleWeights.Lower() > Weights.ColLength() ||
CPoleWeights.Upper() < 1 ||
CPoleWeights.Upper() > Weights.ColLength() ) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetWeightCol: invalid array dimension");
}
Standard_Integer I = CPoleWeights.Lower();
while (I <= CPoleWeights.Upper()) {
if (CPoleWeights(I) <= gp::Resolution()) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetWeightCol: Weight too small");
}
Weights (I+Weights.LowerRow()-1, VIndex+Weights.LowerCol()-1) =
CPoleWeights (I);
{
TColStd_Array2OfReal & Weights = weights->ChangeArray2();
if (UIndex < 1 || UIndex > Weights.ColLength()) {
- throw Standard_OutOfRange();
+ throw Standard_OutOfRange("Geom_BSplineSurface::SetWeightRow: Index and #pole mismatch");
}
if (CPoleWeights.Lower() < 1 ||
CPoleWeights.Lower() > Weights.RowLength() ||
CPoleWeights.Upper() < 1 ||
CPoleWeights.Upper() > Weights.RowLength() ) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetWeightRow: invalid array dimension");
}
Standard_Integer I = CPoleWeights.Lower();
while (I <= CPoleWeights.Upper()) {
if (CPoleWeights(I)<=gp::Resolution()) {
- throw Standard_ConstructionError();
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetWeightRow: Weight too small");
}
Weights (UIndex+Weights.LowerRow()-1, I+Weights.LowerCol()-1) =
CPoleWeights (I);
void Geom_BSplineSurface::SetUOrigin(const Standard_Integer Index)
{
if (!uperiodic)
- throw Standard_NoSuchObject("Geom_BSplineSurface::SetUOrigin");
+ throw Standard_NoSuchObject("Geom_BSplineSurface::SetUOrigin: surface is not U periodic");
Standard_Integer i,j,k;
Standard_Integer first = FirstUKnotIndex();
Standard_Integer last = LastUKnotIndex();
if ((Index < first) || (Index > last))
- throw Standard_DomainError("Geom_BSplineCurve::SetUOrigin");
+ throw Standard_DomainError("Geom_BSplineCurve::SetUOrigin: Index out of range");
Standard_Integer nbknots = uknots->Length();
Standard_Integer nbpoles = poles->ColLength();
void Geom_BSplineSurface::SetVOrigin(const Standard_Integer Index)
{
if (!vperiodic)
- throw Standard_NoSuchObject("Geom_BSplineSurface::SetVOrigin");
+ throw Standard_NoSuchObject("Geom_BSplineSurface::SetVOrigin: surface is not V periodic");
Standard_Integer i,j,k;
Standard_Integer first = FirstVKnotIndex();
Standard_Integer last = LastVKnotIndex();
if ((Index < first) || (Index > last))
- throw Standard_DomainError("Geom_BSplineCurve::SetVOrigin");
+ throw Standard_DomainError("Geom_BSplineCurve::SetVOrigin: Index out of range");
Standard_Integer nbknots = vknots->Length();
Standard_Integer nbpoles = poles->RowLength();
void Geom_BSplineSurface::SetPoleCol (const Standard_Integer VIndex,
const TColgp_Array1OfPnt& CPoles)
{
- if (VIndex < 1 || VIndex > poles->RowLength()) {
- throw Standard_OutOfRange();
- }
+ if (VIndex < 1 || VIndex > poles->RowLength())
+ {
+ throw Standard_OutOfRange("Geom_BSplineSurface::SetPoleCol: VIndex out of range");
+ }
if (CPoles.Lower() < 1 || CPoles.Lower() > poles->ColLength() ||
- CPoles.Upper() < 1 || CPoles.Upper() > poles->ColLength()) {
- throw Standard_ConstructionError();
- }
+ CPoles.Upper() < 1 || CPoles.Upper() > poles->ColLength())
+ {
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetPoleCol: invalid array dimension");
+ }
TColgp_Array2OfPnt & Poles = poles->ChangeArray2();
void Geom_BSplineSurface::SetPoleRow (const Standard_Integer UIndex,
const TColgp_Array1OfPnt& CPoles)
{
- if (UIndex < 1 || UIndex > poles->ColLength() ) {
- throw Standard_OutOfRange();
- }
+ if (UIndex < 1 || UIndex > poles->ColLength())
+ {
+ throw Standard_OutOfRange("Geom_BSplineSurface::SetPoleRow: UIndex out of range");
+ }
if (CPoles.Lower() < 1 || CPoles.Lower() > poles->RowLength() ||
- CPoles.Upper() < 1 || CPoles.Upper() > poles->RowLength() ) {
- throw Standard_ConstructionError();
- }
+ CPoles.Upper() < 1 || CPoles.Upper() > poles->RowLength())
+ {
+ throw Standard_ConstructionError("Geom_BSplineSurface::SetPoleRow: invalid array dimension");
+ }
TColgp_Array2OfPnt & Poles = poles->ChangeArray2();
if (UIndex1 < 1 || UIndex1 > poles->UpperRow() ||
UIndex2 < 1 || UIndex2 > poles->UpperRow() || UIndex1 > UIndex2 ||
VIndex1 < 1 || VIndex1 > poles->UpperCol() ||
- VIndex2 < 1 || VIndex2 > poles->UpperCol() || VIndex1 > VIndex2) {
- throw Standard_OutOfRange();
+ VIndex2 < 1 || VIndex2 > poles->UpperCol() || VIndex1 > VIndex2)
+ {
+ throw Standard_OutOfRange ("Geom_BSplineSurface::MovePoint: Index and #pole mismatch");
}
TColgp_Array2OfPnt npoles(1, poles->UpperRow(), 1, poles->UpperCol());
Standard_Integer I1 = FirstUKnotIndex ();
Standard_Integer I2 = LastUKnotIndex ();
- if ( !uperiodic && (Index <= I1 || Index >= I2) ) {
- throw Standard_OutOfRange();
+ if ( !uperiodic && (Index <= I1 || Index >= I2) )
+ {
+ throw Standard_OutOfRange("Geom_BSplineSurface::RemoveUKnot: invalid Index");
}
- else if ( uperiodic && (Index < I1 || Index > I2)) {
- throw Standard_OutOfRange();
+ else if ( uperiodic && (Index < I1 || Index > I2))
+ {
+ throw Standard_OutOfRange("Geom_BSplineSurface::RemoveUKnot: invalid Index for periodic case");
}
const TColgp_Array2OfPnt & oldpoles = poles->Array2();
Standard_Integer I1 = FirstVKnotIndex ();
Standard_Integer I2 = LastVKnotIndex ();
- if ( !vperiodic && (Index <= I1 || Index >= I2) ) {
- throw Standard_OutOfRange();
+ if ( !vperiodic && (Index <= I1 || Index >= I2) )
+ {
+ throw Standard_OutOfRange("Geom_BSplineSurface::RemoveVKnot: invalid Index");
}
else if ( vperiodic && (Index < I1 || Index > I2)) {
- throw Standard_OutOfRange();
+ throw Standard_OutOfRange("Geom_BSplineSurface::RemoveVKnot: invalid Index for periodic case");
}
const TColgp_Array2OfPnt & oldpoles = poles->Array2();
const Standard_Boolean Periodic)
{
if (Degree < 1 || Degree > Geom2d_BSplineCurve::MaxDegree()) {
- throw Standard_ConstructionError("BSpline curve : invalid degree");
+ throw Standard_ConstructionError("BSpline curve: invalid degree");
}
- if (CPoles.Length() < 2) throw Standard_ConstructionError("BSpline curve : at least 2 poles required");
- if (CKnots.Length() != CMults.Length()) throw Standard_ConstructionError("BSpline curve : Knot and Mult array size mismatch");
+ if (CPoles.Length() < 2) throw Standard_ConstructionError("BSpline curve: at least 2 poles required");
+ if (CKnots.Length() != CMults.Length()) throw Standard_ConstructionError("BSpline curve: Knot and Mult array size mismatch");
for (Standard_Integer I = CKnots.Lower(); I < CKnots.Upper(); I++) {
if (CKnots (I+1) - CKnots (I) <= Epsilon (Abs(CKnots (I)))) {
- throw Standard_ConstructionError("BSpline curve : Knots interval values too close");
+ throw Standard_ConstructionError("BSpline curve: Knots interval values too close");
}
}
if (CPoles.Length() != BSplCLib::NbPoles(Degree,Periodic,CMults))
- throw Standard_ConstructionError("BSpline curve : # Poles and degree mismatch");
+ throw Standard_ConstructionError("BSpline curve: # Poles and degree mismatch");
}
//=======================================================================
Periodic);
if (Weights.Length() != Poles.Length())
- throw Standard_ConstructionError("Geom2d_BSplineCurve :Weights and Poles array size mismatch");
+ throw Standard_ConstructionError("Geom2d_BSplineCurve: Weights and Poles array size mismatch");
Standard_Integer i;
for (i = Weights.Lower(); i <= Weights.Upper(); i++) {
if (Degree == deg) return;
if (Degree < deg || Degree > Geom2d_BSplineCurve::MaxDegree()) {
- throw Standard_ConstructionError("BSpline curve : IncreaseDegree : bad degree value");
+ throw Standard_ConstructionError("BSpline curve: IncreaseDegree: bad degree value");
}
Standard_Integer FromK1 = FirstUKnotIndex ();
Standard_Integer I2 = LastUKnotIndex ();
if (Index < I1 || Index > I2) {
- throw Standard_OutOfRange("BSpline curve : RemoveKnot : index out of range");
+ throw Standard_OutOfRange("BSpline curve: RemoveKnot: index out of range");
}
const TColgp_Array1OfPnt2d & oldpoles = poles->Array1();
const gp_Pnt2d& P,
const Standard_Real Weight)
{
- if (Index < 0 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve : InsertPoleAfter: Index and #pole mismatch");
+ if (Index < 0 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve: InsertPoleAfter: Index and #pole mismatch");
- if (Weight <= gp::Resolution()) throw Standard_ConstructionError("BSpline curve : InsertPoleAfter: Weight too small");
+ if (Weight <= gp::Resolution()) throw Standard_ConstructionError("BSpline curve: InsertPoleAfter: Weight too small");
if (knotSet == GeomAbs_NonUniform || knotSet == GeomAbs_PiecewiseBezier) {
- throw Standard_ConstructionError("BSpline curve : InsertPoleAfter : bad knotSet type");
+ throw Standard_ConstructionError("BSpline curve: InsertPoleAfter: bad knotSet type");
}
const TColStd_Array1OfReal& cknots = knots->Array1();
void Geom2d_BSplineCurve::RemovePole
(const Standard_Integer Index)
{
- if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve :RemovePole : Index and #pole mismatch");
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve: RemovePole: Index and #pole mismatch");
- if (poles->Length() <= 2) throw Standard_ConstructionError("BSpline curve : RemovePole : #pole is already minimum");
+ if (poles->Length() <= 2) throw Standard_ConstructionError("BSpline curve: RemovePole: #pole is already minimum");
if (knotSet == GeomAbs_NonUniform || knotSet == GeomAbs_PiecewiseBezier)
- throw Standard_ConstructionError("BSpline curve : RemovePole: bad knotSet type");
+ throw Standard_ConstructionError("BSpline curve: RemovePole: bad knotSet type");
Standard_Integer i;
Handle(TColStd_HArray1OfReal) nknots =
(const Standard_Integer Index,
const Standard_Real K)
{
- if (Index < 1 || Index > knots->Length()) throw Standard_OutOfRange("BSpline curve : SetKnot: Index and #pole mismatch");
+ if (Index < 1 || Index > knots->Length()) throw Standard_OutOfRange("BSpline curve: SetKnot: Index and #knots mismatch");
Standard_Real DK = Abs(Epsilon (K));
if (Index == 1) {
- if (K >= knots->Value(2) - DK) throw Standard_ConstructionError("BSpline curve :SetKnot :K out of range");
+ if (K >= knots->Value(2) - DK) throw Standard_ConstructionError("BSpline curve: SetKnot: K out of range");
}
else if (Index == knots->Length()) {
if (K <= knots->Value (knots->Length()-1) + DK) {
- throw Standard_ConstructionError("BSpline curve : SetKnot : K out of range");
+ throw Standard_ConstructionError("BSpline curve: SetKnot: K out of range");
}
}
else {
if (K <= knots->Value(Index-1) + DK ||
K >= knots->Value(Index+1) - DK ) {
- throw Standard_ConstructionError("BSpline curve : SetKnot: K out of range");
+ throw Standard_ConstructionError("BSpline curve: SetKnot: K out of range");
}
}
if (K != knots->Value (Index)) {
(const Standard_Integer Index,
const gp_Pnt2d& P)
{
- if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve : SetPole : index and #pole mismatch");
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve: SetPole: index and #pole mismatch");
poles->SetValue (Index, P);
maxderivinvok = 0;
}
(const Standard_Integer Index,
const Standard_Real W)
{
- if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve : SetWeight: Index and #pole mismatch");
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve: SetWeight: Index and #pole mismatch");
- if (W <= gp::Resolution ()) throw Standard_ConstructionError("BSpline curve : SetWeight: Weight too small");
+ if (W <= gp::Resolution ()) throw Standard_ConstructionError("BSpline curve: SetWeight: Weight too small");
Standard_Boolean rat = IsRational() || (Abs(W - 1.) > gp::Resolution());
{
if (Index1 < 1 || Index1 > poles->Length() ||
Index2 < 1 || Index2 > poles->Length() || Index1 > Index2) {
- throw Standard_OutOfRange("BSpline curve : MovePoint: Index and #pole mismatch");
+ throw Standard_OutOfRange("BSpline curve: MovePoint: Index and #pole mismatch");
}
TColgp_Array1OfPnt2d npoles(1, poles->Length());
gp_Pnt2d P0;