[PD] Set up-to-face when opening revolution/grove task box
This commit is contained in:
committed by
Adrián Insaurralde Avalos
parent
8023c0595d
commit
f66261b598
@@ -115,6 +115,34 @@ void TaskRevolutionParameters::setupDialog()
|
||||
ui->revolveAngle->setMaximum(propAngle->getMaximum());
|
||||
ui->revolveAngle->setMinimum(propAngle->getMinimum());
|
||||
|
||||
App::DocumentObject* obj = propUpToFace->getValue();
|
||||
std::vector<std::string> subStrings = propUpToFace->getSubValues();
|
||||
std::string upToFace;
|
||||
int faceId = -1;
|
||||
if (obj && !subStrings.empty()) {
|
||||
upToFace = subStrings.front();
|
||||
if (upToFace.compare(0, 4, "Face") == 0)
|
||||
faceId = std::atoi(&upToFace[4]);
|
||||
}
|
||||
|
||||
// Set object labels
|
||||
if (obj && PartDesign::Feature::isDatum(obj)) {
|
||||
ui->lineFaceName->setText(QString::fromUtf8(obj->Label.getValue()));
|
||||
ui->lineFaceName->setProperty("FeatureName", QByteArray(obj->getNameInDocument()));
|
||||
}
|
||||
else if (obj && faceId >= 0) {
|
||||
ui->lineFaceName->setText(QString::fromLatin1("%1:%2%3")
|
||||
.arg(QString::fromUtf8(obj->Label.getValue()),
|
||||
tr("Face"),
|
||||
QString::number(faceId)));
|
||||
ui->lineFaceName->setProperty("FeatureName", QByteArray(obj->getNameInDocument()));
|
||||
}
|
||||
else {
|
||||
ui->lineFaceName->clear();
|
||||
ui->lineFaceName->setProperty("FeatureName", QVariant());
|
||||
}
|
||||
|
||||
ui->lineFaceName->setProperty("FaceName", QByteArray(upToFace.c_str()));
|
||||
int index = 0;
|
||||
|
||||
// TODO: This should also be implemented for groove
|
||||
|
||||
Reference in New Issue
Block a user