Part::Geometry: ArcOfParabola CCW emulation support/fix

=========================================================

Correction of the emulation so that arcs of parabola are always CCW.
This commit is contained in:
Abdullah Tahiri 2016-12-24 16:11:15 +01:00
parent 9e7d86f1b8
commit 82259f31da

View File

@ -2374,9 +2374,9 @@ Base::Vector3d GeomArcOfParabola::getFocus(void) const
} }
void GeomArcOfParabola::getRange(double& u, double& v, bool /*emulateCCWXY*/) const void GeomArcOfParabola::getRange(double& u, double& v, bool emulateCCWXY) const
{ {
#if 0 //#if 0
try { try {
if (emulateCCWXY) { if (emulateCCWXY) {
if (isReversed()) { if (isReversed()) {
@ -2390,17 +2390,17 @@ void GeomArcOfParabola::getRange(double& u, double& v, bool /*emulateCCWXY*/) co
Handle_Standard_Failure e = Standard_Failure::Caught(); Handle_Standard_Failure e = Standard_Failure::Caught();
throw Base::Exception(e->GetMessageString()); throw Base::Exception(e->GetMessageString());
} }
#endif //#endif
u = myCurve->FirstParameter(); u = myCurve->FirstParameter();
v = myCurve->LastParameter(); v = myCurve->LastParameter();
} }
void GeomArcOfParabola::setRange(double u, double v, bool /*emulateCCWXY*/) void GeomArcOfParabola::setRange(double u, double v, bool emulateCCWXY)
{ {
try { try {
myCurve->SetTrim(u, v); myCurve->SetTrim(u, v);
#if 0 //#if 0
if (emulateCCWXY) { if (emulateCCWXY) {
if (isReversed()) { if (isReversed()) {
Handle_Geom_Parabola c = Handle_Geom_Parabola::DownCast(myCurve->BasisCurve()); Handle_Geom_Parabola c = Handle_Geom_Parabola::DownCast(myCurve->BasisCurve());
@ -2408,7 +2408,7 @@ void GeomArcOfParabola::setRange(double u, double v, bool /*emulateCCWXY*/)
c->Reverse(); c->Reverse();
} }
} }
#endif //#endif
} }
catch (Standard_Failure) { catch (Standard_Failure) {
Handle_Standard_Failure e = Standard_Failure::Caught(); Handle_Standard_Failure e = Standard_Failure::Caught();