Gui: prevent crashes on MacOS using boost::format
This commit is contained in:
@@ -174,8 +174,8 @@ bool OffsetWidget::accept()
|
||||
double offsetValue = d->ui.spinOffset->value().getValue();
|
||||
Gui::cmdAppObjectArgs(d->offset, "Value = %f", offsetValue);
|
||||
d->ui.spinOffset->apply();
|
||||
Gui::cmdAppObjectArgs(d->offset, "Mode = %i", d->ui.modeType->currentIndex());
|
||||
Gui::cmdAppObjectArgs(d->offset, "Join = %i", d->ui.joinType->currentIndex());
|
||||
Gui::cmdAppObjectArgs(d->offset, "Mode = %d", d->ui.modeType->currentIndex());
|
||||
Gui::cmdAppObjectArgs(d->offset, "Join = %d", d->ui.joinType->currentIndex());
|
||||
Gui::cmdAppObjectArgs(d->offset, "Intersection = %s", d->ui.intersection->isChecked() ? "True" : "False");
|
||||
Gui::cmdAppObjectArgs(d->offset, "SelfIntersection = %s", d->ui.selfIntersection->isChecked() ? "True" : "False");
|
||||
Gui::cmdAppObjectArgs(d->offset, "Fill = %s", d->ui.fillOffset->isChecked() ? "True" : "False");
|
||||
|
||||
@@ -221,8 +221,8 @@ bool ThicknessWidget::accept()
|
||||
Gui::cmdAppObjectArgs(d->thickness, "Faces = %s", d->selection.c_str());
|
||||
}
|
||||
Gui::cmdAppObjectArgs(d->thickness, "Value = %f", d->ui.spinOffset->value().getValue());
|
||||
Gui::cmdAppObjectArgs(d->thickness, "Mode = %i", d->ui.modeType->currentIndex());
|
||||
Gui::cmdAppObjectArgs(d->thickness, "Join = %i", d->ui.joinType->currentIndex());
|
||||
Gui::cmdAppObjectArgs(d->thickness, "Mode = %d", d->ui.modeType->currentIndex());
|
||||
Gui::cmdAppObjectArgs(d->thickness, "Join = %d", d->ui.joinType->currentIndex());
|
||||
Gui::cmdAppObjectArgs(d->thickness, "Intersection = %s",
|
||||
d->ui.intersection->isChecked() ? "True" : "False");
|
||||
Gui::cmdAppObjectArgs(d->thickness, "SelfIntersection = %s",
|
||||
|
||||
@@ -1444,10 +1444,10 @@ void CmdSketcherConstrainLock::activated(int iMsg)
|
||||
|| constraintCreationMode==Reference) {
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)",
|
||||
lastconstraintindex-1,"False");
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)",
|
||||
lastconstraintindex,"False");
|
||||
}
|
||||
}
|
||||
@@ -1483,10 +1483,10 @@ void CmdSketcherConstrainLock::activated(int iMsg)
|
||||
if ( (refpointfixed && pointfixed) || constraintCreationMode==Reference) {
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)",
|
||||
lastconstraintindex-1,"False");
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)",
|
||||
lastconstraintindex,"False");
|
||||
}
|
||||
}
|
||||
@@ -1527,9 +1527,9 @@ void CmdSketcherConstrainLock::applyConstraint(std::vector<SelIdPair> &selSeq, i
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "setDriving(%i, %s)", ConStr.size()-2, "False");
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "setDriving(%d, %s)", ConStr.size()-2, "False");
|
||||
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "setDriving(%i, %s)", ConStr.size()-1, "False");
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "setDriving(%d, %s)", ConStr.size()-1, "False");
|
||||
}
|
||||
|
||||
// finish the transaction and update
|
||||
@@ -1929,10 +1929,10 @@ bool CmdSketcherConstrainCoincident::substituteConstraintCombinations(SketchObje
|
||||
|
||||
if( constraintExists ) {
|
||||
// try to remove any pre-existing direct coincident constraints
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraintOnPoint(%i,%i)", GeoId1, static_cast<int>(PosId1));
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraintOnPoint(%d,%d)", GeoId1, static_cast<int>(PosId1));
|
||||
}
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraint(%i)", j);
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraint(%d)", j);
|
||||
|
||||
doEndpointTangency(Obj, GeoId1, GeoId2, PosId1, PosId2);
|
||||
|
||||
@@ -1951,7 +1951,7 @@ bool CmdSketcherConstrainCoincident::substituteConstraintCombinations(SketchObje
|
||||
|
||||
// if a similar tangency already exists this must result in bad constraints
|
||||
if ((*it)->SecondPos == Sketcher::PointPos::none) {
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraint(%i)", j);
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraint(%d)", j);
|
||||
|
||||
doEndpointTangency(Obj, GeoId1, GeoId2, PosId1, PosId2);
|
||||
|
||||
@@ -2247,7 +2247,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg)
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"setDriving(%i,%s)",
|
||||
"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -2280,7 +2280,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg)
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"setDriving(%i,%s)",
|
||||
"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -2329,7 +2329,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg)
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"setDriving(%i,%s)",
|
||||
"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -2364,7 +2364,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg)
|
||||
constraintCreationMode==Reference) {
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -2426,7 +2426,7 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -2459,7 +2459,7 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -2503,7 +2503,7 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -2553,7 +2553,7 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
if (arebothpointsorsegmentsfixed || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -2640,7 +2640,7 @@ bool CmdSketcherConstrainPointOnObject::substituteConstraintCombinations( Sket
|
||||
// NOTE: This function does not either open or commit a command as it is used for group addition
|
||||
// it relies on such infrastructure being provided by the caller.
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraint(%i)", cid);
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraint(%d)", cid);
|
||||
|
||||
doEndpointToEdgeTangency(Obj, GeoId1, PosId1, GeoId2);
|
||||
|
||||
@@ -2951,7 +2951,7 @@ void CmdSketcherConstrainDistanceX::activated(int iMsg)
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -2984,7 +2984,7 @@ void CmdSketcherConstrainDistanceX::activated(int iMsg)
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -3057,7 +3057,7 @@ void CmdSketcherConstrainDistanceX::applyConstraint(std::vector<SelIdPair> &selS
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -3206,7 +3206,7 @@ void CmdSketcherConstrainDistanceY::activated(int iMsg)
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -3238,7 +3238,7 @@ void CmdSketcherConstrainDistanceY::activated(int iMsg)
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -3310,7 +3310,7 @@ void CmdSketcherConstrainDistanceY::applyConstraint(std::vector<SelIdPair> &selS
|
||||
if (areBothPointsOrSegmentsFixed(Obj,GeoId1, GeoId2) || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -4204,7 +4204,7 @@ bool CmdSketcherConstrainTangent::substituteConstraintCombinations(SketchObject
|
||||
|
||||
doEndpointTangency(Obj, (*it)->First, (*it)->Second, (*it)->FirstPos, (*it)->SecondPos);
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraintOnPoint(%i,%i)", first, firstpos);
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraintOnPoint(%d,%d)", first, firstpos);
|
||||
|
||||
commitCommand();
|
||||
Obj->solve(); // The substitution requires a solve() so that the autoremove redundants works when Autorecompute not active.
|
||||
@@ -4223,7 +4223,7 @@ bool CmdSketcherConstrainTangent::substituteConstraintCombinations(SketchObject
|
||||
|
||||
doEndpointToEdgeTangency(Obj, (*it)->First, (*it)->FirstPos, (*it)->Second);
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraint(%i)", cid); // remove the preexisting point on object constraint.
|
||||
Gui::cmdAppObjectArgs(Obj, "delConstraint(%d)", cid); // remove the preexisting point on object constraint.
|
||||
|
||||
commitCommand();
|
||||
|
||||
@@ -5073,7 +5073,7 @@ void CmdSketcherConstrainRadius::activated(int iMsg)
|
||||
|
||||
constrSize=ConStr.size();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"setDriving(%i,%s)", constrSize-1,"False");
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"setDriving(%d,%s)", constrSize-1,"False");
|
||||
}
|
||||
|
||||
|
||||
@@ -5121,7 +5121,7 @@ void CmdSketcherConstrainRadius::activated(int iMsg)
|
||||
|
||||
if (constraintCreationMode==Reference) {
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)", ConStr.size()-1,"False");
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)", ConStr.size()-1,"False");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5187,7 +5187,7 @@ void CmdSketcherConstrainRadius::applyConstraint(std::vector<SelIdPair> &selSeq,
|
||||
|
||||
bool fixed = isPointOrSegmentFixed(Obj,GeoId);
|
||||
if(fixed || constraintCreationMode==Reference) {
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%d,%s)",
|
||||
ConStr.size()-1, "False");
|
||||
|
||||
updateNeeded=true; // We do need to update the solver DoF after setting the constraint driving.
|
||||
@@ -5365,7 +5365,7 @@ void CmdSketcherConstrainDiameter::activated(int iMsg)
|
||||
|
||||
constrSize=ConStr.size();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%i,%s)",constrSize-1,"False");
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%d,%s)",constrSize-1,"False");
|
||||
}
|
||||
|
||||
finishDatumConstraint (this, Obj, false, externalGeoIdDiameterMap.size());
|
||||
@@ -5404,7 +5404,7 @@ void CmdSketcherConstrainDiameter::activated(int iMsg)
|
||||
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%i,%s)", ConStr.size()-1,"False");
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%d,%s)", ConStr.size()-1,"False");
|
||||
|
||||
}
|
||||
|
||||
@@ -5473,7 +5473,7 @@ void CmdSketcherConstrainDiameter::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
|
||||
bool fixed = isPointOrSegmentFixed(Obj,GeoId);
|
||||
if(fixed || constraintCreationMode==Reference) {
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%i,%s)", ConStr.size()-1, "False");
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%d,%s)", ConStr.size()-1, "False");
|
||||
updateNeeded=true; // We do need to update the solver DoF after setting the constraint driving.
|
||||
}
|
||||
|
||||
@@ -5664,7 +5664,7 @@ void CmdSketcherConstrainRadiam::activated(int iMsg)
|
||||
|
||||
constrSize=ConStr.size();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%i,%s)",constrSize-1,"False");
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%d,%s)",constrSize-1,"False");
|
||||
}
|
||||
|
||||
finishDatumConstraint (this, Obj, false, externalGeoIdRadiamMap.size());
|
||||
@@ -5719,7 +5719,7 @@ void CmdSketcherConstrainRadiam::activated(int iMsg)
|
||||
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%i,%s)", ConStr.size()-1,"False");
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%d,%s)", ConStr.size()-1,"False");
|
||||
|
||||
}
|
||||
|
||||
@@ -5794,7 +5794,7 @@ void CmdSketcherConstrainRadiam::applyConstraint(std::vector<SelIdPair> &selSeq,
|
||||
|
||||
bool fixed = isPointOrSegmentFixed(Obj,GeoId);
|
||||
if(fixed || constraintCreationMode==Reference) {
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%i,%s)", ConStr.size()-1, "False");
|
||||
Gui::cmdAppObjectArgs(Obj, "setDriving(%d,%s)", ConStr.size()-1, "False");
|
||||
updateNeeded=true; // We do need to update the solver DoF after setting the constraint driving.
|
||||
}
|
||||
|
||||
@@ -6107,7 +6107,7 @@ void CmdSketcherConstrainAngle::activated(int iMsg)
|
||||
if (bothexternal || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -6216,7 +6216,7 @@ void CmdSketcherConstrainAngle::activated(int iMsg)
|
||||
if (bothexternal || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -6249,7 +6249,7 @@ void CmdSketcherConstrainAngle::activated(int iMsg)
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -6273,7 +6273,7 @@ void CmdSketcherConstrainAngle::activated(int iMsg)
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -6390,7 +6390,7 @@ void CmdSketcherConstrainAngle::applyConstraint(std::vector<SelIdPair> &selSeq,
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
@@ -6475,7 +6475,7 @@ void CmdSketcherConstrainAngle::applyConstraint(std::vector<SelIdPair> &selSeq,
|
||||
// it is a constraint on a external line, make it non-driving
|
||||
const std::vector<Sketcher::Constraint *> &ConStr = Obj->Constraints.getValues();
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%i,%s)",
|
||||
Gui::cmdAppObjectArgs(Obj,"setDriving(%d,%s)",
|
||||
ConStr.size()-1,"False");
|
||||
finishDatumConstraint (this, Obj, false);
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ void DrawSketchHandler::createAutoConstraints(const std::vector<AutoConstraint>
|
||||
if (posId1 == Sketcher::PointPos::none)
|
||||
continue;
|
||||
// If the auto constraint has a point create a coincident otherwise it is an edge on a point
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Coincident',%i,%i,%i,%i)) "
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Coincident',%d,%d,%d,%d)) "
|
||||
, geoId1, static_cast<int>(posId1), it->GeoId, static_cast<int>(it->PosId));
|
||||
} break;
|
||||
case Sketcher::PointOnObject: {
|
||||
@@ -817,18 +817,18 @@ void DrawSketchHandler::createAutoConstraints(const std::vector<AutoConstraint>
|
||||
std::swap(posId1,posId2);
|
||||
}
|
||||
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('PointOnObject',%i,%i,%i)) "
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('PointOnObject',%d,%d,%d)) "
|
||||
, geoId1, static_cast<int>(posId1), geoId2);
|
||||
} break;
|
||||
// In special case of Horizontal/Vertical constraint, geoId2 is normally unused and should be 'Constraint::GeoUndef'
|
||||
// However it can be used as a way to require the function to apply these constraints on another geometry
|
||||
// In this case the caller as to set geoId2, then it will be used as target instead of geoId2
|
||||
case Sketcher::Horizontal: {
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Horizontal',%i)) ",
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Horizontal',%d)) ",
|
||||
geoId2 != GeoEnum::GeoUndef ? geoId2 : geoId1);
|
||||
} break;
|
||||
case Sketcher::Vertical: {
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Vertical',%i)) ",
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Vertical',%d)) ",
|
||||
geoId2 != GeoEnum::GeoUndef ? geoId2 : geoId1);
|
||||
} break;
|
||||
case Sketcher::Tangent: {
|
||||
@@ -883,7 +883,7 @@ void DrawSketchHandler::createAutoConstraints(const std::vector<AutoConstraint>
|
||||
}
|
||||
}
|
||||
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Tangent',%i, %i)) "
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Tangent',%d, %d)) "
|
||||
, geoId1, it->GeoId);
|
||||
} break;
|
||||
default:
|
||||
@@ -1001,4 +1001,4 @@ Sketcher::SketchObject * DrawSketchHandler::getSketchObject()
|
||||
void DrawSketchHandler::setAngleSnapping(bool enable, Base::Vector2d referencePoint)
|
||||
{
|
||||
ViewProviderSketchDrawSketchHandlerAttorney::setAngleSnapping(*sketchgui, enable, referencePoint);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe
|
||||
if (GeoId != Sketcher::GeoEnum::GeoUndef && PosId != Sketcher::PointPos::none) {
|
||||
getDocument()->openCommand(QT_TRANSLATE_NOOP("Command", "Drag Point"));
|
||||
try {
|
||||
Gui::cmdAppObjectArgs(getObject(), "movePoint(%i,%i,App.Vector(%f,%f,0),%i)"
|
||||
Gui::cmdAppObjectArgs(getObject(), "movePoint(%d,%d,App.Vector(%f,%f,0),%d)"
|
||||
,GeoId, static_cast<int>(PosId), x-drag.xInit, y-drag.yInit, 0);
|
||||
|
||||
getDocument()->commitCommand();
|
||||
@@ -867,7 +867,7 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe
|
||||
}
|
||||
|
||||
try {
|
||||
Gui::cmdAppObjectArgs(getObject(), "movePoint(%i,%i,App.Vector(%f,%f,0),%i)"
|
||||
Gui::cmdAppObjectArgs(getObject(), "movePoint(%d,%d,App.Vector(%f,%f,0),%d)"
|
||||
,drag.DragCurve, static_cast<int>(Sketcher::PointPos::none), vec.x, vec.y, drag.relative ? 1 : 0);
|
||||
|
||||
getDocument()->commitCommand();
|
||||
@@ -3384,7 +3384,7 @@ bool ViewProviderSketch::onDelete(const std::vector<std::string> &subList)
|
||||
|
||||
for (rit = delConstraints.rbegin(); rit != delConstraints.rend(); ++rit) {
|
||||
try {
|
||||
Gui::cmdAppObjectArgs(getObject(), "delConstraint(%i)", *rit);
|
||||
Gui::cmdAppObjectArgs(getObject(), "delConstraint(%d)", *rit);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
@@ -3408,7 +3408,7 @@ bool ViewProviderSketch::onDelete(const std::vector<std::string> &subList)
|
||||
if (((*it)->Type == Sketcher::Coincident) && (((*it)->First == GeoId && (*it)->FirstPos == PosId) ||
|
||||
((*it)->Second == GeoId && (*it)->SecondPos == PosId)) ) {
|
||||
try {
|
||||
Gui::cmdAppObjectArgs(getObject(), "delConstraintOnPoint(%i,%i)", GeoId, (int)PosId);
|
||||
Gui::cmdAppObjectArgs(getObject(), "delConstraintOnPoint(%d,%d)", GeoId, (int)PosId);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
@@ -3443,7 +3443,7 @@ bool ViewProviderSketch::onDelete(const std::vector<std::string> &subList)
|
||||
|
||||
for (rit = delExternalGeometries.rbegin(); rit != delExternalGeometries.rend(); ++rit) {
|
||||
try {
|
||||
Gui::cmdAppObjectArgs(getObject(), "delExternal(%i)", *rit);
|
||||
Gui::cmdAppObjectArgs(getObject(), "delExternal(%d)", *rit);
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
|
||||
Reference in New Issue
Block a user