Merge pull request #21713 from 3x380V/pd_fixes

PartDesign: Random fixes
This commit is contained in:
Chris Hennes
2025-09-29 10:54:46 -05:00
committed by GitHub
13 changed files with 466 additions and 266 deletions

View File

@@ -57,7 +57,6 @@ namespace sp = std::placeholders;
TaskHoleParameters::TaskHoleParameters(ViewProviderHole* HoleView, QWidget* parent)
: TaskSketchBasedParameters(HoleView, parent, "PartDesign_Hole", tr("Hole Parameters"))
, observer(new Observer(this, getObject<PartDesign::Hole>()))
, isApplying(false)
, ui(new Ui_TaskHoleParameters)
{
// we need a separate container widget to add all controls to
@@ -1087,8 +1086,6 @@ void TaskHoleParameters::apply()
{
auto hole = getObject<PartDesign::Hole>();
isApplying = true;
ui->Diameter->apply();
ui->HoleCutDiameter->apply();
ui->HoleCutDepth->apply();
@@ -1152,8 +1149,6 @@ void TaskHoleParameters::apply()
if (!hole->BaseProfileType.isReadOnly()) {
FCMD_OBJ_CMD(hole, "BaseProfileType = " << getBaseProfileType());
}
isApplying = false;
}
void TaskHoleParameters::updateHoleCutLimits(PartDesign::Hole* hole)

View File

@@ -143,7 +143,6 @@ private:
Connection connectPropChanged;
std::unique_ptr<Observer> observer;
bool isApplying;
QWidget* proxy;
std::unique_ptr<Ui_TaskHoleParameters> ui;

View File

@@ -188,7 +188,7 @@ void TaskRevolutionParameters::setupDialog()
void TaskRevolutionParameters::translateModeList(int index)
{
ui->changeMode->clear();
ui->changeMode->addItem(tr("Dimension"));
ui->changeMode->addItem(tr("Angle"));
if (!isGroove) {
ui->changeMode->addItem(tr("To last"));
}
@@ -197,7 +197,7 @@ void TaskRevolutionParameters::translateModeList(int index)
}
ui->changeMode->addItem(tr("To first"));
ui->changeMode->addItem(tr("Up to face"));
ui->changeMode->addItem(tr("Two dimensions"));
ui->changeMode->addItem(tr("Two angles"));
ui->changeMode->setCurrentIndex(index);
}
@@ -294,7 +294,7 @@ void TaskRevolutionParameters::setCheckboxes(PartDesign::Revolution::RevolMethod
bool isReversedEnabled = false;
bool isFaceEditEnabled = false;
if (mode == PartDesign::Revolution::RevolMethod::Dimension) {
if (mode == PartDesign::Revolution::RevolMethod::Angle) {
isRevolveAngleVisible = true;
ui->revolveAngle->selectNumber();
QMetaObject::invokeMethod(ui->revolveAngle, "setFocus", Qt::QueuedConnection);
@@ -320,7 +320,7 @@ void TaskRevolutionParameters::setCheckboxes(PartDesign::Revolution::RevolMethod
ui->buttonFace->setChecked(true);
}
}
else if (mode == PartDesign::Revolution::RevolMethod::TwoDimensions) {
else if (mode == PartDesign::Revolution::RevolMethod::TwoAngles) {
isRevolveAngleVisible = true;
isRevolveAngle2Visible = true;
isReversedEnabled = true;
@@ -624,7 +624,7 @@ void TaskRevolutionParameters::onModeChanged(int index)
: &(getObject<PartDesign::Revolution>()->Type);
switch (static_cast<PartDesign::Revolution::RevolMethod>(index)) {
case PartDesign::Revolution::RevolMethod::Dimension:
case PartDesign::Revolution::RevolMethod::Angle:
propEnum->setValue("Angle");
break;
case PartDesign::Revolution::RevolMethod::ToLast:
@@ -636,7 +636,7 @@ void TaskRevolutionParameters::onModeChanged(int index)
case PartDesign::Revolution::RevolMethod::ToFace:
propEnum->setValue("UpToFace");
break;
case PartDesign::Revolution::RevolMethod::TwoDimensions:
case PartDesign::Revolution::RevolMethod::TwoAngles:
propEnum->setValue("TwoAngles");
break;
}
@@ -809,12 +809,12 @@ void TaskRevolutionParameters::setGizmoVisibility()
auto type = static_cast<PartDesign::Revolution::RevolMethod>(ui->changeMode->currentIndex());
switch (type) {
case PartDesign::Revolution::RevolMethod::Dimension:
case PartDesign::Revolution::RevolMethod::Angle:
gizmoContainer->visible = true;
rotationGizmo->setVisibility(true);
rotationGizmo2->setVisibility(false);
break;
case PartDesign::Revolution::RevolMethod::TwoDimensions:
case PartDesign::Revolution::RevolMethod::TwoAngles:
gizmoContainer->visible = true;
rotationGizmo->setVisibility(true);
rotationGizmo2->setVisibility(true);

View File

@@ -27,7 +27,7 @@
<widget class="QComboBox" name="changeMode">
<item>
<property name="text">
<string>Dimension</string>
<string notr="true">Angle</string>
</property>
</item>
</widget>
@@ -139,7 +139,7 @@
<double>10.000000000000000</double>
</property>
<property name="value">
<double>60.000000000000000</double>
<double>0.000000000000000</double>
</property>
</widget>
</item>

View File

@@ -162,6 +162,19 @@ void Workbench::activated()
"PartDesign_Body"
));
const char* Vertex1[] = {
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
nullptr};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT Part::Feature SUBELEMENT Vertex COUNT 1..",
Vertex1,
"Datum objects",
"PartDesign_CoordinateSystem"
));
const char* Edge[] = {
"PartDesign_Fillet",
"PartDesign_Chamfer",
@@ -177,6 +190,19 @@ void Workbench::activated()
"PartDesign_Body"
));
const char* Edge1[] = {
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
nullptr};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT Part::Feature SUBELEMENT Edge COUNT 1..",
Edge1,
"Datum objects",
"PartDesign_CoordinateSystem"
));
const char* Face[] = {
"PartDesign_NewSketch",
"PartDesign_Fillet",
@@ -195,6 +221,19 @@ void Workbench::activated()
"PartDesign_Body"
));
const char* Face1[] = {
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
nullptr};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT Part::Feature SUBELEMENT Face COUNT 1",
Face1,
"Datum objects",
"PartDesign_CoordinateSystem"
));
const char* Body[] = {
"PartDesign_NewSketch",
nullptr};
@@ -228,6 +267,7 @@ void Workbench::activated()
"Helper Tools",
"PartDesign_Body"
));
const char* Plane2[] = {
"PartDesign_NewSketch",
"Part_DatumPoint",
@@ -242,6 +282,32 @@ void Workbench::activated()
"PartDesign_Body"
));
const char* Plane3[] = {
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
nullptr};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT App::Plane COUNT 1",
Plane3,
"Datum objects",
"PartDesign_CoordinateSystem"
));
const char* Plane4[] = {
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
nullptr};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT PartDesign::Plane COUNT 1",
Plane4,
"Datum objects",
"PartDesign_CoordinateSystem"
));
const char* Line[] = {
"Part_DatumPoint",
"Part_DatumLine",
@@ -254,6 +320,18 @@ void Workbench::activated()
"PartDesign_Body"
));
const char* Line1[] = {
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
nullptr};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT PartDesign::Line COUNT 1",
Line1,
"Datum objects",
"PartDesign_CoordinateSystem"
));
const char* Point[] = {
"Part_DatumPoint",
"Part_DatumLine",
@@ -267,6 +345,19 @@ void Workbench::activated()
"PartDesign_Body"
));
const char* Point1[] = {
"PartDesign_Point",
"PartDesign_Line",
"PartDesign_Plane",
"PartDesign_CoordinateSystem",
nullptr};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT PartDesign::Point COUNT 1",
Point1,
"Datum objects",
"PartDesign_CoordinateSystem"
));
const char* NoSel[] = {
"PartDesign_Body",
nullptr};
@@ -296,10 +387,10 @@ void Workbench::activated()
"PartDesign_Hole",
"PartDesign_Revolution",
"PartDesign_Groove",
"PartDesign_AdditivePipe",
"PartDesign_SubtractivePipe",
"PartDesign_AdditiveLoft",
"PartDesign_SubtractiveLoft",
"PartDesign_AdditivePipe",
"PartDesign_SubtractivePipe",
"PartDesign_AdditiveHelix",
"PartDesign_SubtractiveHelix",
nullptr};
@@ -310,6 +401,53 @@ void Workbench::activated()
"PartDesign_Body"
));
const char* Sketches[] = {
"PartDesign_AdditiveLoft",
"PartDesign_SubtractiveLoft",
"PartDesign_AdditivePipe",
"PartDesign_SubtractivePipe",
nullptr};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT Sketcher::SketchObject COUNT 2..",
Sketches,
"Modeling tools",
"PartDesign_Body"
));
const char* ShapeBinder[] = {
"PartDesign_Pad",
"PartDesign_Pocket",
"PartDesign_Revolution",
"PartDesign_Groove",
"PartDesign_AdditiveLoft",
"PartDesign_SubtractiveLoft",
"PartDesign_AdditivePipe",
"PartDesign_SubtractivePipe",
nullptr};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT PartDesign::ShapeBinder COUNT 1",
ShapeBinder,
"Modeling tools",
"PartDesign_Body"
));
const char* SubShapeBinder[] = {
"PartDesign_Pad",
"PartDesign_Pocket",
"PartDesign_Revolution",
"PartDesign_Groove",
"PartDesign_AdditiveLoft",
"PartDesign_SubtractiveLoft",
"PartDesign_AdditivePipe",
"PartDesign_SubtractivePipe",
nullptr};
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
"SELECT PartDesign::SubShapeBinder COUNT 1",
SubShapeBinder,
"Modeling tools",
"PartDesign_Body"
));
const char* Transformed[] = {
"PartDesign_Mirrored",
"PartDesign_LinearPattern",