Part: replace PyObject_Not with Base::asBoolean
This commit is contained in:
@@ -1244,7 +1244,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
|
||||
Standard_Integer index = 1;
|
||||
for (Py::Sequence::iterator it = multssq.begin(); it != multssq.end() && index <= occmults.Length(); ++it) {
|
||||
Py::Long mult(*it);
|
||||
if (index < occmults.Length() || PyObject_Not(periodic)) {
|
||||
if (index < occmults.Length() || !Base::asBoolean(periodic)) {
|
||||
sum_of_mults += static_cast<int>(mult); //sum up the mults to compare them against the number of poles later
|
||||
}
|
||||
occmults(index++) = static_cast<int>(mult);
|
||||
@@ -1254,7 +1254,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
|
||||
for (int i=1; i<=occmults.Length(); i++){
|
||||
occmults.SetValue(i,1);
|
||||
}
|
||||
if (PyObject_Not(periodic) && occmults.Length() > 0) {
|
||||
if (!Base::asBoolean(periodic) && occmults.Length() > 0) {
|
||||
occmults.SetValue(1, degree+1);
|
||||
occmults.SetValue(occmults.Length(), degree+1);
|
||||
sum_of_mults = occmults.Length()+2*degree;
|
||||
@@ -1301,7 +1301,7 @@ PyObject* BSplineCurvePy::buildFromPolesMultsKnots(PyObject *args, PyObject *key
|
||||
}
|
||||
// check if the number of poles matches the sum of mults
|
||||
if ((Base::asBoolean(periodic) && sum_of_mults != number_of_poles) ||
|
||||
((PyObject_Not(periodic) ? true : false) && sum_of_mults - degree -1 != number_of_poles)) {
|
||||
(!Base::asBoolean(periodic) && sum_of_mults - degree -1 != number_of_poles)) {
|
||||
Standard_Failure::Raise("number of poles and sum of mults mismatch");
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
@@ -1412,7 +1412,7 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
Standard_Integer index = 1;
|
||||
for (Py::Sequence::iterator it = umultssq.begin(); it != umultssq.end() && index <= occumults.Length(); ++it) {
|
||||
Py::Long mult(*it);
|
||||
if (index < occumults.Length() || PyObject_Not(uperiodic)) {
|
||||
if (index < occumults.Length() || !Base::asBoolean(uperiodic)) {
|
||||
sum_of_umults += static_cast<int>(mult); //sum up the mults to compare them against the number of poles later
|
||||
}
|
||||
occumults(index++) = static_cast<int>(mult);
|
||||
@@ -1421,7 +1421,7 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
index = 1;
|
||||
for (Py::Sequence::iterator it = vmultssq.begin(); it != vmultssq.end() && index <= occvmults.Length(); ++it) {
|
||||
Py::Long mult(*it);
|
||||
if (index < occvmults.Length() || PyObject_Not(vperiodic)) {
|
||||
if (index < occvmults.Length() || !Base::asBoolean(vperiodic)) {
|
||||
sum_of_vmults += static_cast<int>(mult); //sum up the mults to compare them against the number of poles later
|
||||
}
|
||||
occvmults(index++) = static_cast<int>(mult);
|
||||
@@ -1454,9 +1454,9 @@ PyObject* BSplineSurfacePy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
}
|
||||
}
|
||||
if ((Base::asBoolean(uperiodic) && sum_of_umults != lu) ||
|
||||
((PyObject_Not(uperiodic) ? true : false) && sum_of_umults - udegree -1 != lu) ||
|
||||
(!Base::asBoolean(uperiodic) && sum_of_umults - udegree -1 != lu) ||
|
||||
(Base::asBoolean(vperiodic) && sum_of_vmults != lv) ||
|
||||
((PyObject_Not(vperiodic) ? true : false) && sum_of_vmults - vdegree -1 != lv)) {
|
||||
(!Base::asBoolean(vperiodic) && sum_of_vmults - vdegree -1 != lv)) {
|
||||
Standard_Failure::Raise("number of poles and sum of mults mismatch");
|
||||
}
|
||||
// check multiplicity of inner knots
|
||||
|
||||
@@ -1145,7 +1145,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
Standard_Integer index = 1;
|
||||
for (Py::Sequence::iterator it = multssq.begin(); it != multssq.end() && index <= occmults.Length(); ++it) {
|
||||
Py::Long mult(*it);
|
||||
if (index < occmults.Length() || PyObject_Not(periodic)) {
|
||||
if (index < occmults.Length() || !Base::asBoolean(periodic)) {
|
||||
sum_of_mults += (int)mult; //sum up the mults to compare them against the number of poles later
|
||||
}
|
||||
occmults(index++) = mult;
|
||||
@@ -1155,7 +1155,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
for (int i=1; i<=occmults.Length(); i++){
|
||||
occmults.SetValue(i,1);
|
||||
}
|
||||
if (PyObject_Not(periodic) && occmults.Length() > 0) {
|
||||
if (!Base::asBoolean(periodic) && occmults.Length() > 0) {
|
||||
occmults.SetValue(1, degree+1);
|
||||
occmults.SetValue(occmults.Length(), degree+1);
|
||||
sum_of_mults = occmults.Length()+2*degree;
|
||||
@@ -1194,7 +1194,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
}
|
||||
// check if the number of poles matches the sum of mults
|
||||
if (((Base::asBoolean(periodic)) && sum_of_mults != number_of_poles) ||
|
||||
((PyObject_Not(periodic) ? true : false) && sum_of_mults - degree -1 != number_of_poles)) {
|
||||
(!Base::asBoolean(periodic) && sum_of_mults - degree -1 != number_of_poles)) {
|
||||
Standard_Failure::Raise("number of poles and sum of mults mismatch");
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user