Use is<T>() when possible
This commit is contained in:
@@ -46,15 +46,16 @@ std::string PythonConverter::convert(const Part::Geometry* geo, Mode mode)
|
||||
command = boost::str(boost::format("addGeometry(%s,%s)\n") % sg.creation
|
||||
% (sg.construction ? "True" : "False"));
|
||||
|
||||
if ((geo->getTypeId() != Part::GeomEllipse::getClassTypeId()
|
||||
|| geo->getTypeId() != Part::GeomArcOfEllipse::getClassTypeId()
|
||||
|| geo->getTypeId() != Part::GeomArcOfHyperbola::getClassTypeId()
|
||||
|| geo->getTypeId() != Part::GeomArcOfParabola::getClassTypeId()
|
||||
|| geo->getTypeId() != Part::GeomBSplineCurve::getClassTypeId())
|
||||
&& mode == Mode::CreateInternalGeometry) {
|
||||
// clang-format off: keep line breaks for readability
|
||||
if ((!geo->is<Part::GeomEllipse>()
|
||||
|| !geo->is<Part::GeomArcOfEllipse>()
|
||||
|| !geo->is<Part::GeomArcOfHyperbola>()
|
||||
|| !geo->is<Part::GeomArcOfParabola>()
|
||||
|| !geo->is<Part::GeomBSplineCurve>()) && mode == Mode::CreateInternalGeometry) {
|
||||
command +=
|
||||
boost::str(boost::format("exposeInternalGeometry(len(ActiveSketch.Geometry))\n"));
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
return command;
|
||||
}
|
||||
@@ -149,15 +150,17 @@ std::string PythonConverter::convert(const std::string& doc,
|
||||
if (mode == Mode::CreateInternalGeometry) {
|
||||
for (auto geo : geos) {
|
||||
index++;
|
||||
if (geo->getTypeId() != Part::GeomEllipse::getClassTypeId()
|
||||
|| geo->getTypeId() != Part::GeomArcOfEllipse::getClassTypeId()
|
||||
|| geo->getTypeId() != Part::GeomArcOfHyperbola::getClassTypeId()
|
||||
|| geo->getTypeId() != Part::GeomArcOfParabola::getClassTypeId()
|
||||
|| geo->getTypeId() != Part::GeomBSplineCurve::getClassTypeId()) {
|
||||
// clang-format off: keep line breaks for readability
|
||||
if (!geo->is<Part::GeomEllipse>()
|
||||
|| !geo->is<Part::GeomArcOfEllipse>()
|
||||
|| !geo->is<Part::GeomArcOfHyperbola>()
|
||||
|| !geo->is<Part::GeomArcOfParabola>()
|
||||
|| !geo->is<Part::GeomBSplineCurve>()) {
|
||||
std::string newcommand =
|
||||
boost::str(boost::format("exposeInternalGeometry(lastGeoId + %d)\n") % (index));
|
||||
command += newcommand;
|
||||
}
|
||||
// clang-format on
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user