[PD] Support adding solid faces for loft and pipe sections

With these changes, one face per solid can be added as either the first
"profile" or subsequent sections in loft and pipe.

This commit depends on `App::PropertyXLinkSubList` preserving the order in which
sections are added.

A minor change this also adds is that when a solid's face is selected that face
is mentioned in the fields instead of the solid (eg `Box:Face1` instead of
`Box`).
This commit is contained in:
Ajinkya Dahale
2021-11-07 03:39:56 -05:00
committed by Uwe
parent 5c77af421d
commit 03a8ff7841
8 changed files with 129 additions and 88 deletions

View File

@@ -220,6 +220,20 @@ QString TaskSketchBasedParameters::getFaceReference(const QString& obj, const QS
.arg(QString::fromLatin1(doc->getName()), o, sub);
}
QString TaskSketchBasedParameters::make2DLabel(const App::DocumentObject* section,
const std::vector<std::string>& subValues)
{
if(section->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
return QString::fromUtf8(section->Label.getValue());
else {
if(subValues.empty())
throw Base::ValueError("No valid subelement linked in Part::Feature");
return QString::fromUtf8((std::string(section->getNameInDocument())
+ ":" + subValues[0]).c_str());
}
}
TaskSketchBasedParameters::~TaskSketchBasedParameters()
{
Gui::Selection().rmvSelectionGate();