Issue #4473: Expose openCommand() CommandConstraints.cpp to translation
`Sketcher/Gui/CommandConstraints.cpp` will now be parsed for translation. Based on https://github.com/FreeCAD/FreeCAD/pull/3993#issuecomment-715906238 ( ref. Issue #4473 )
This commit is contained in:
@@ -1120,7 +1120,7 @@ void CmdSketcherConstrainHorizontal::activated(int iMsg)
|
||||
// if there is at least one edge selected, ignore the point alignment functionality
|
||||
if (!edgegeoids.empty()) {
|
||||
// undo command open
|
||||
openCommand("Add horizontal constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add horizontal constraint"));
|
||||
for (std::vector<int>::iterator it=edgegeoids.begin(); it != edgegeoids.end(); it++) {
|
||||
// issue the actual commands to create the constraint
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
@@ -1129,7 +1129,7 @@ void CmdSketcherConstrainHorizontal::activated(int iMsg)
|
||||
}
|
||||
else if (fixedpoints <= 1) { // pointgeoids
|
||||
// undo command open
|
||||
openCommand("Add horizontal alignment");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add horizontal alignment"));
|
||||
std::vector<int>::iterator it;
|
||||
std::vector<Sketcher::PointPos>::iterator itp;
|
||||
for (it=pointgeoids.begin(), itp=pointpos.begin(); it != std::prev(pointgeoids.end()) && itp != std::prev(pointpos.end()); it++,itp++) {
|
||||
@@ -1195,7 +1195,7 @@ void CmdSketcherConstrainHorizontal::applyConstraint(std::vector<SelIdPair> &sel
|
||||
}
|
||||
|
||||
// undo command open
|
||||
Gui::Command::openCommand("Add horizontal constraint");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add horizontal constraint"));
|
||||
// issue the actual commands to create the constraint
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Horizontal',%d)) ",CrvId);
|
||||
// finish the transaction and update
|
||||
@@ -1221,7 +1221,7 @@ void CmdSketcherConstrainHorizontal::applyConstraint(std::vector<SelIdPair> &sel
|
||||
}
|
||||
|
||||
// undo command open
|
||||
Gui::Command::openCommand("Add horizontal alignment");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add horizontal alignment"));
|
||||
// issue the actual commands to create the constraint
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject()
|
||||
,"addConstraint(Sketcher.Constraint('Horizontal',%d,%d,%d,%d)) "
|
||||
@@ -1357,7 +1357,7 @@ void CmdSketcherConstrainVertical::activated(int iMsg)
|
||||
// if there is at least one edge selected, ignore the point alignment functionality
|
||||
if (!edgegeoids.empty()) {
|
||||
// undo command open
|
||||
openCommand("Add vertical constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add vertical constraint"));
|
||||
for (std::vector<int>::iterator it=edgegeoids.begin(); it != edgegeoids.end(); it++) {
|
||||
// issue the actual commands to create the constraint
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"addConstraint(Sketcher.Constraint('Vertical',%d)) ", *it);
|
||||
@@ -1365,7 +1365,7 @@ void CmdSketcherConstrainVertical::activated(int iMsg)
|
||||
}
|
||||
else if (fixedpoints <= 1) { // vertex mode, maximum one fixed point
|
||||
// undo command open
|
||||
openCommand("Add vertical alignment");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add vertical alignment"));
|
||||
std::vector<int>::iterator it;
|
||||
std::vector<Sketcher::PointPos>::iterator itp;
|
||||
for (it=pointgeoids.begin(), itp=pointpos.begin(); it != std::prev(pointgeoids.end()) && itp != std::prev(pointpos.end()); it++,itp++) {
|
||||
@@ -1431,7 +1431,7 @@ void CmdSketcherConstrainVertical::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
}
|
||||
|
||||
// undo command open
|
||||
Gui::Command::openCommand("Add vertical constraint");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add vertical constraint"));
|
||||
// issue the actual commands to create the constraint
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Vertical',%d)) ", CrvId);
|
||||
// finish the transaction and update
|
||||
@@ -1456,7 +1456,7 @@ void CmdSketcherConstrainVertical::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
}
|
||||
|
||||
// undo command open
|
||||
Gui::Command::openCommand("Add horizontal alignment");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add horizontal alignment"));
|
||||
// issue the actual commands to create the constraint
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject()
|
||||
,"addConstraint(Sketcher.Constraint('Vertical',%d,%d,%d,%d)) "
|
||||
@@ -1570,7 +1570,7 @@ void CmdSketcherConstrainLock::activated(int iMsg)
|
||||
Base::Vector3d pnt = Obj->getPoint(GeoId[0],PosId[0]);
|
||||
|
||||
// undo command open
|
||||
openCommand("Add 'Lock' constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add 'Lock' constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('DistanceX',%d,%d,%f)) ",
|
||||
GeoId[0],PosId[0],pnt.x);
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('DistanceY',%d,%d,%f)) ",
|
||||
@@ -1611,7 +1611,7 @@ void CmdSketcherConstrainLock::activated(int iMsg)
|
||||
Base::Vector3d pnt = Obj->getPoint(*itg,*itp);
|
||||
|
||||
// undo command open
|
||||
openCommand("Add relative 'Lock' constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add relative 'Lock' constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('DistanceX',%d,%d,%d,%d,%f)) ",
|
||||
*itg,*itp,GeoId.back(),PosId.back(),pntr.x-pnt.x);
|
||||
|
||||
@@ -1656,7 +1656,7 @@ void CmdSketcherConstrainLock::applyConstraint(std::vector<SelIdPair> &selSeq, i
|
||||
Base::Vector3d pnt = Obj->getPoint(selSeq.front().GeoId, selSeq.front().PosId);
|
||||
|
||||
// undo command open
|
||||
Gui::Command::openCommand("Add fixed constraint");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add fixed constraint"));
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('DistanceX', %d, %d, %f)) ",
|
||||
selSeq.front().GeoId, selSeq.front().PosId, pnt.x);
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('DistanceY', %d, %d, %f)) ",
|
||||
@@ -1798,7 +1798,7 @@ void CmdSketcherConstrainBlock::activated(int iMsg)
|
||||
|
||||
for (std::vector<int>::iterator itg = GeoId.begin(); itg != GeoId.end(); ++itg) {
|
||||
// undo command open
|
||||
openCommand("Add 'Block' constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add 'Block' constraint"));
|
||||
|
||||
try {
|
||||
|
||||
@@ -1842,7 +1842,7 @@ void CmdSketcherConstrainBlock::applyConstraint(std::vector<SelIdPair> &selSeq,
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Add block constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add block constraint"));
|
||||
|
||||
try {
|
||||
|
||||
@@ -1988,7 +1988,7 @@ public:
|
||||
Sketcher::SketchObject* Obj = static_cast<Sketcher::SketchObject*>(sketchgui->getObject());
|
||||
|
||||
// undo command open
|
||||
Gui::Command::openCommand("Add coincident constraint");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add coincident constraint"));
|
||||
|
||||
// check if this coincidence is already enforced (even indirectly)
|
||||
bool constraintExists = Obj->arePointsCoincident(GeoId1,PosId1,GeoId2,PosId2);
|
||||
@@ -2088,7 +2088,7 @@ void CmdSketcherConstrainCoincident::activated(int iMsg)
|
||||
|
||||
// undo command open
|
||||
bool constraintsAdded = false;
|
||||
openCommand("Add coincident constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add coincident constraint"));
|
||||
for (std::size_t i=1; i<SubNames.size(); i++) {
|
||||
getIdsFromName(SubNames[i], Obj, GeoId2, PosId2);
|
||||
|
||||
@@ -2112,7 +2112,7 @@ void CmdSketcherConstrainCoincident::activated(int iMsg)
|
||||
(((*it)->First == GeoId1 && (*it)->Second == GeoId2) ||
|
||||
((*it)->Second == GeoId1 && (*it)->First == GeoId2)) ) {
|
||||
|
||||
Gui::Command::openCommand("Swap edge tangency with ptp tangency");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Swap edge tangency with ptp tangency"));
|
||||
|
||||
if(constraintExists) {
|
||||
// try to remove any pre-existing direct coincident constraints
|
||||
@@ -2177,7 +2177,7 @@ void CmdSketcherConstrainCoincident::applyConstraint(std::vector<SelIdPair> &sel
|
||||
}
|
||||
|
||||
// undo command open
|
||||
Gui::Command::openCommand("Add coincident constraint");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add coincident constraint"));
|
||||
|
||||
// check if this coincidence is already enforced (even indirectly)
|
||||
bool constraintExists = Obj->arePointsCoincident(GeoId1, PosId1, GeoId2, PosId2);
|
||||
@@ -2283,7 +2283,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg)
|
||||
if (GeoId1 == Sketcher::GeoEnum::HAxis && PosId1 == Sketcher::none) {
|
||||
PosId1 = Sketcher::start;
|
||||
|
||||
openCommand("Add distance from horizontal axis constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add distance from horizontal axis constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"addConstraint(Sketcher.Constraint('DistanceY',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,pnt2.y);
|
||||
@@ -2291,7 +2291,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg)
|
||||
else if (GeoId1 == Sketcher::GeoEnum::VAxis && PosId1 == Sketcher::none) {
|
||||
PosId1 = Sketcher::start;
|
||||
|
||||
openCommand("Add distance from vertical axis constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add distance from vertical axis constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"addConstraint(Sketcher.Constraint('DistanceX',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,pnt2.x);
|
||||
@@ -2299,7 +2299,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg)
|
||||
else {
|
||||
Base::Vector3d pnt1 = Obj->getPoint(GeoId1,PosId1);
|
||||
|
||||
openCommand("Add point to point distance constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add point to point distance constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"addConstraint(Sketcher.Constraint('Distance',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,(pnt2-pnt1).Length());
|
||||
@@ -2334,7 +2334,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg)
|
||||
Base::Vector3d d = pnt2-pnt1;
|
||||
double ActDist = std::abs(-pnt.x*d.y+pnt.y*d.x+pnt1.x*pnt2.y-pnt2.x*pnt1.y) / d.Length();
|
||||
|
||||
openCommand("Add point to line Distance constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add point to line Distance constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"addConstraint(Sketcher.Constraint('Distance',%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,ActDist);
|
||||
@@ -2368,7 +2368,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg)
|
||||
lineSeg = static_cast<const Part::GeomLineSegment*>(geom);
|
||||
double ActLength = (lineSeg->getEndPoint()-lineSeg->getStartPoint()).Length();
|
||||
|
||||
openCommand("Add length constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add length constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('Distance',%d,%f)) ",
|
||||
GeoId1,ActLength);
|
||||
|
||||
@@ -2415,21 +2415,21 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
if (GeoId1 == Sketcher::GeoEnum::HAxis && PosId1 == Sketcher::none) {
|
||||
PosId1 = Sketcher::start;
|
||||
|
||||
openCommand("Add distance from horizontal axis constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add distance from horizontal axis constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj,"addConstraint(Sketcher.Constraint('DistanceY',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,pnt2.y);
|
||||
}
|
||||
else if (GeoId1 == Sketcher::GeoEnum::VAxis && PosId1 == Sketcher::none) {
|
||||
PosId1 = Sketcher::start;
|
||||
|
||||
openCommand("Add distance from vertical axis constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add distance from vertical axis constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj,"addConstraint(Sketcher.Constraint('DistanceX',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,pnt2.x);
|
||||
}
|
||||
else {
|
||||
Base::Vector3d pnt1 = Obj->getPoint(GeoId1,PosId1);
|
||||
|
||||
openCommand("Add point to point distance constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add point to point distance constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj,"addConstraint(Sketcher.Constraint('Distance',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,(pnt2-pnt1).Length());
|
||||
}
|
||||
@@ -2461,7 +2461,7 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
lineSeg = static_cast<const Part::GeomLineSegment*>(geom);
|
||||
double ActLength = (lineSeg->getEndPoint()-lineSeg->getStartPoint()).Length();
|
||||
|
||||
openCommand("Add length constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add length constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj,"addConstraint(Sketcher.Constraint('Distance',%d,%f)) ",
|
||||
GeoId1,ActLength);
|
||||
|
||||
@@ -2504,7 +2504,7 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
Base::Vector3d d = pnt2-pnt1;
|
||||
double ActDist = std::abs(-pnt.x*d.y+pnt.y*d.x+pnt1.x*pnt2.y-pnt2.x*pnt1.y) / d.Length();
|
||||
|
||||
openCommand("Add point to line Distance constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add point to line Distance constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj,"addConstraint(Sketcher.Constraint('Distance',%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,ActDist);
|
||||
|
||||
@@ -2619,7 +2619,7 @@ void CmdSketcherConstrainPointOnObject::activated(int iMsg)
|
||||
if ((points.size() == 1 && curves.size() >= 1) ||
|
||||
(points.size() >= 1 && curves.size() == 1)) {
|
||||
|
||||
openCommand("Add point on object constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add point on object constraint"));
|
||||
int cnt = 0;
|
||||
for (std::size_t iPnt = 0; iPnt < points.size(); iPnt++) {
|
||||
for (std::size_t iCrv = 0; iCrv < curves.size(); iCrv++) {
|
||||
@@ -2693,7 +2693,7 @@ void CmdSketcherConstrainPointOnObject::applyConstraint(std::vector<SelIdPair> &
|
||||
SketcherGui::ViewProviderSketch* sketchgui = static_cast<SketcherGui::ViewProviderSketch*>(getActiveGuiDocument()->getInEdit());
|
||||
Sketcher::SketchObject* Obj = sketchgui->getSketchObject();
|
||||
|
||||
openCommand("Add point on object constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add point on object constraint"));
|
||||
bool allOK = true;
|
||||
|
||||
if (areBothPointsOrSegmentsFixed(Obj, GeoIdVt, GeoIdCrv)){
|
||||
@@ -2853,7 +2853,7 @@ void CmdSketcherConstrainDistanceX::activated(int iMsg)
|
||||
ActLength = -ActLength;
|
||||
}
|
||||
|
||||
openCommand("Add point to point horizontal distance constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add point to point horizontal distance constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('DistanceX',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,ActLength);
|
||||
|
||||
@@ -2884,7 +2884,7 @@ void CmdSketcherConstrainDistanceX::activated(int iMsg)
|
||||
|
||||
arebothpointsorsegmentsfixed=isPointOrSegmentFixed(Obj,GeoId1);
|
||||
|
||||
openCommand("Add fixed x-coordinate constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add fixed x-coordinate constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('DistanceX',%d,%d,%f)) ",
|
||||
GeoId1,PosId1,ActX);
|
||||
|
||||
@@ -2955,7 +2955,7 @@ void CmdSketcherConstrainDistanceX::applyConstraint(std::vector<SelIdPair> &selS
|
||||
ActLength = -ActLength;
|
||||
}
|
||||
|
||||
openCommand("Add point to point horizontal distance constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add point to point horizontal distance constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj,"addConstraint(Sketcher.Constraint('DistanceX',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,ActLength);
|
||||
|
||||
@@ -3102,7 +3102,7 @@ void CmdSketcherConstrainDistanceY::activated(int iMsg)
|
||||
ActLength = -ActLength;
|
||||
}
|
||||
|
||||
openCommand("Add point to point vertical distance constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add point to point vertical distance constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"addConstraint(Sketcher.Constraint('DistanceY',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,ActLength);
|
||||
|
||||
@@ -3132,7 +3132,7 @@ void CmdSketcherConstrainDistanceY::activated(int iMsg)
|
||||
|
||||
arebothpointsorsegmentsfixed=isPointOrSegmentFixed(Obj,GeoId1);
|
||||
|
||||
openCommand("Add fixed y-coordinate constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add fixed y-coordinate constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('DistanceY',%d,%d,%f)) ",
|
||||
GeoId1,PosId1,ActY);
|
||||
|
||||
@@ -3204,7 +3204,7 @@ void CmdSketcherConstrainDistanceY::applyConstraint(std::vector<SelIdPair> &selS
|
||||
ActLength = -ActLength;
|
||||
}
|
||||
|
||||
openCommand("Add point to point vertical distance constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add point to point vertical distance constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj,"addConstraint(Sketcher.Constraint('DistanceY',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,ActLength);
|
||||
|
||||
@@ -3333,7 +3333,7 @@ void CmdSketcherConstrainParallel::activated(int iMsg)
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Add parallel constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add parallel constraint"));
|
||||
for (int i=0; i < int(ids.size()-1); i++) {
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('Parallel',%d,%d)) ",
|
||||
ids[i],ids[i+1]);
|
||||
@@ -3374,7 +3374,7 @@ void CmdSketcherConstrainParallel::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Add parallel constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add parallel constraint"));
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Parallel',%d,%d)) ",
|
||||
GeoId1, GeoId2);
|
||||
// finish the transaction and update
|
||||
@@ -3492,7 +3492,7 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg)
|
||||
|
||||
if (isEdge(GeoId1, PosId1) && isEdge(GeoId2, PosId2) && isVertex(GeoId3, PosId3)) {
|
||||
|
||||
openCommand("Add perpendicular constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add perpendicular constraint"));
|
||||
|
||||
try{
|
||||
//add missing point-on-object constraints
|
||||
@@ -3560,7 +3560,7 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg)
|
||||
// GeoId1 is the B-spline now
|
||||
} // end of code supports simple B-spline endpoint tangency
|
||||
|
||||
openCommand("Add perpendicular constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add perpendicular constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('Perpendicular',%d,%d,%d,%d)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2);
|
||||
commitCommand();
|
||||
@@ -3591,7 +3591,7 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg)
|
||||
return;
|
||||
}
|
||||
|
||||
openCommand("Add perpendicularity constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add perpendicularity constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('Perpendicular',%d,%d,%d)) ",
|
||||
GeoId1,PosId1,GeoId2);
|
||||
commitCommand();
|
||||
@@ -3702,7 +3702,7 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg)
|
||||
PoO = Base::Vector3d(center.x+majord*cos(tapprox)*cos(phi)-minord*sin(tapprox)*sin(phi),
|
||||
center.y+majord*cos(tapprox)*sin(phi)+minord*sin(tapprox)*cos(phi), 0);
|
||||
}
|
||||
openCommand("Add perpendicular constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add perpendicular constraint"));
|
||||
|
||||
try {
|
||||
// Add a point
|
||||
@@ -3738,7 +3738,7 @@ void CmdSketcherConstrainPerpendicular::activated(int iMsg)
|
||||
|
||||
}
|
||||
|
||||
openCommand("Add perpendicular constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add perpendicular constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('Perpendicular',%d,%d)) ",
|
||||
GeoId1,GeoId2);
|
||||
commitCommand();
|
||||
@@ -3877,7 +3877,7 @@ void CmdSketcherConstrainPerpendicular::applyConstraint(std::vector<SelIdPair> &
|
||||
PoO = Base::Vector3d(center.x+majord*cos(tapprox)*cos(phi)-minord*sin(tapprox)*sin(phi),
|
||||
center.y+majord*cos(tapprox)*sin(phi)+minord*sin(tapprox)*cos(phi), 0);
|
||||
}
|
||||
openCommand("Add perpendicular constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add perpendicular constraint"));
|
||||
|
||||
try {
|
||||
// Add a point
|
||||
@@ -3911,7 +3911,7 @@ void CmdSketcherConstrainPerpendicular::applyConstraint(std::vector<SelIdPair> &
|
||||
|
||||
}
|
||||
|
||||
openCommand("Add perpendicular constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add perpendicular constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj, "addConstraint(Sketcher.Constraint('Perpendicular',%d,%d)) ",
|
||||
GeoId1,GeoId2);
|
||||
commitCommand();
|
||||
@@ -3947,7 +3947,7 @@ void CmdSketcherConstrainPerpendicular::applyConstraint(std::vector<SelIdPair> &
|
||||
|
||||
if (isEdge(GeoId1, PosId1) && isEdge(GeoId2, PosId2) && isVertex(GeoId3, PosId3)) {
|
||||
|
||||
openCommand("Add perpendicular constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add perpendicular constraint"));
|
||||
|
||||
try{
|
||||
//add missing point-on-object constraints
|
||||
@@ -4096,7 +4096,7 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
|
||||
if (isEdge(GeoId1, PosId1) && isEdge(GeoId2, PosId2) && isVertex(GeoId3, PosId3)) {
|
||||
|
||||
openCommand("Add tangent constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint"));
|
||||
|
||||
try{
|
||||
//add missing point-on-object constraints
|
||||
@@ -4148,7 +4148,7 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
return;
|
||||
}
|
||||
|
||||
openCommand("Add tangent constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint"));
|
||||
doEndpointTangency(Obj, selection[0], GeoId1, GeoId2, PosId1, PosId2);
|
||||
commitCommand();
|
||||
tryAutoRecompute(Obj);
|
||||
@@ -4178,7 +4178,7 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
return;
|
||||
}
|
||||
|
||||
openCommand("Add tangent constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('Tangent',%d,%d,%d)) ",
|
||||
GeoId1,PosId1,GeoId2);
|
||||
commitCommand();
|
||||
@@ -4215,7 +4215,7 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
int first = (*it)->First;
|
||||
int firstpos = static_cast<int>((*it)->FirstPos);
|
||||
|
||||
Gui::Command::openCommand("Swap coincident+tangency with ptp tangency");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Swap coincident+tangency with ptp tangency"));
|
||||
|
||||
doEndpointTangency(Obj, selection[0], (*it)->First, (*it)->Second, (*it)->FirstPos, (*it)->SecondPos);
|
||||
|
||||
@@ -4252,21 +4252,21 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
geom2->getTypeId() == Part::GeomCircle::getClassTypeId() ||
|
||||
geom2->getTypeId() == Part::GeomArcOfCircle::getClassTypeId() ) {
|
||||
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToEllipseviaNewPoint(Obj,static_cast<const Part::GeomEllipse *>(geom1), geom2,
|
||||
GeoId1, GeoId2);
|
||||
getSelection().clearSelection();
|
||||
return;
|
||||
}
|
||||
else if( geom2->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() ) {
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfHyperbolaviaNewPoint(Obj, static_cast<const Part::GeomArcOfHyperbola *>(geom2),
|
||||
geom1, GeoId2, GeoId1);
|
||||
getSelection().clearSelection();
|
||||
return;
|
||||
}
|
||||
else if( geom2->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ) {
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfParabolaviaNewPoint(Obj,static_cast<const Part::GeomArcOfParabola *>(geom2),
|
||||
geom1, GeoId2, GeoId1);
|
||||
getSelection().clearSelection();
|
||||
@@ -4290,7 +4290,7 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
geom2->getTypeId() == Part::GeomArcOfCircle::getClassTypeId() ||
|
||||
geom2->getTypeId() == Part::GeomLineSegment::getClassTypeId() ) {
|
||||
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfEllipseviaNewPoint(Obj,
|
||||
static_cast<const Part::GeomArcOfEllipse *>(geom1), geom2, GeoId1, GeoId2);
|
||||
|
||||
@@ -4298,7 +4298,7 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
return;
|
||||
}
|
||||
else if( geom2->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ) {
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfParabolaviaNewPoint(Obj,
|
||||
static_cast<const Part::GeomArcOfParabola *>(geom2),
|
||||
geom1, GeoId2, GeoId1);
|
||||
@@ -4323,7 +4323,7 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
geom2->getTypeId() == Part::GeomArcOfCircle::getClassTypeId() ||
|
||||
geom2->getTypeId() == Part::GeomLineSegment::getClassTypeId() ) {
|
||||
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfHyperbolaviaNewPoint(Obj,
|
||||
static_cast<const Part::GeomArcOfHyperbola *>(geom1),
|
||||
geom2, GeoId1, GeoId2);
|
||||
@@ -4331,7 +4331,7 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
return;
|
||||
}
|
||||
else if( geom2->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ) {
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfParabolaviaNewPoint(Obj,
|
||||
static_cast<const Part::GeomArcOfParabola *>(geom2),
|
||||
geom1, GeoId2, GeoId1);
|
||||
@@ -4358,7 +4358,7 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
geom2->getTypeId() == Part::GeomArcOfCircle::getClassTypeId() ||
|
||||
geom2->getTypeId() == Part::GeomLineSegment::getClassTypeId() ) {
|
||||
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfParabolaviaNewPoint(Obj, static_cast<const Part::GeomArcOfParabola *>(geom1),
|
||||
geom2, GeoId1, GeoId2);
|
||||
getSelection().clearSelection();
|
||||
@@ -4366,7 +4366,7 @@ void CmdSketcherConstrainTangent::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
|
||||
openCommand("Add tangent constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"addConstraint(Sketcher.Constraint('Tangent',%d,%d)) ",
|
||||
GeoId1,GeoId2);
|
||||
@@ -4438,21 +4438,21 @@ void CmdSketcherConstrainTangent::applyConstraint(std::vector<SelIdPair> &selSeq
|
||||
geom2->getTypeId() == Part::GeomCircle::getClassTypeId() ||
|
||||
geom2->getTypeId() == Part::GeomArcOfCircle::getClassTypeId() ) {
|
||||
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToEllipseviaNewPoint(Obj, static_cast<const Part::GeomEllipse *>(geom1),
|
||||
geom2, GeoId1, GeoId2);
|
||||
getSelection().clearSelection();
|
||||
return;
|
||||
}
|
||||
else if( geom2->getTypeId() == Part::GeomArcOfHyperbola::getClassTypeId() ) {
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfHyperbolaviaNewPoint(Obj, static_cast<const Part::GeomArcOfHyperbola *>(geom2),
|
||||
geom1, GeoId2, GeoId1);
|
||||
getSelection().clearSelection();
|
||||
return;
|
||||
}
|
||||
else if( geom2->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ) {
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfParabolaviaNewPoint(Obj, static_cast<const Part::GeomArcOfParabola *>(geom2),
|
||||
geom1, GeoId2, GeoId1);
|
||||
getSelection().clearSelection();
|
||||
@@ -4476,14 +4476,14 @@ void CmdSketcherConstrainTangent::applyConstraint(std::vector<SelIdPair> &selSeq
|
||||
geom2->getTypeId() == Part::GeomArcOfCircle::getClassTypeId() ||
|
||||
geom2->getTypeId() == Part::GeomLineSegment::getClassTypeId() ) {
|
||||
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfHyperbolaviaNewPoint(Obj, static_cast<const Part::GeomArcOfHyperbola *>(geom1),
|
||||
geom2, GeoId1, GeoId2);
|
||||
getSelection().clearSelection();
|
||||
return;
|
||||
}
|
||||
else if( geom2->getTypeId() == Part::GeomArcOfParabola::getClassTypeId() ) {
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfParabolaviaNewPoint(Obj, static_cast<const Part::GeomArcOfParabola *>(geom2),
|
||||
geom1, GeoId2, GeoId1);
|
||||
getSelection().clearSelection();
|
||||
@@ -4509,7 +4509,7 @@ void CmdSketcherConstrainTangent::applyConstraint(std::vector<SelIdPair> &selSeq
|
||||
geom2->getTypeId() == Part::GeomArcOfCircle::getClassTypeId() ||
|
||||
geom2->getTypeId() == Part::GeomLineSegment::getClassTypeId() ) {
|
||||
|
||||
Gui::Command::openCommand("Add tangent constraint point");
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint point"));
|
||||
makeTangentToArcOfParabolaviaNewPoint(Obj, static_cast<const Part::GeomArcOfParabola *>(geom1),
|
||||
geom2, GeoId1, GeoId2);
|
||||
getSelection().clearSelection();
|
||||
@@ -4517,7 +4517,7 @@ void CmdSketcherConstrainTangent::applyConstraint(std::vector<SelIdPair> &selSeq
|
||||
}
|
||||
}
|
||||
|
||||
openCommand("Add tangent constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj, "addConstraint(Sketcher.Constraint('Tangent',%d,%d)) ",
|
||||
GeoId1,GeoId2);
|
||||
commitCommand();
|
||||
@@ -4575,7 +4575,7 @@ void CmdSketcherConstrainTangent::applyConstraint(std::vector<SelIdPair> &selSeq
|
||||
// GeoId1 is the B-spline now
|
||||
} // end of code supports simple B-spline endpoint tangency
|
||||
|
||||
openCommand("Add tangent constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj, "addConstraint(Sketcher.Constraint('Tangent',%d,%d,%d,%d)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2);
|
||||
commitCommand();
|
||||
@@ -4590,7 +4590,7 @@ void CmdSketcherConstrainTangent::applyConstraint(std::vector<SelIdPair> &selSeq
|
||||
|
||||
if (isEdge(GeoId1, PosId1) && isEdge(GeoId2, PosId2) && isVertex(GeoId3, PosId3)) {
|
||||
|
||||
openCommand("Add tangent constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add tangent constraint"));
|
||||
|
||||
try{
|
||||
//add missing point-on-object constraints
|
||||
@@ -4751,7 +4751,7 @@ void CmdSketcherConstrainRadius::activated(int iMsg)
|
||||
|
||||
if(!externalGeoIdRadiusMap.empty()) {
|
||||
// Create the non-driving radius constraints now
|
||||
openCommand("Add radius constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add radius constraint"));
|
||||
commandopened=true;
|
||||
unsigned int constrSize = 0;
|
||||
|
||||
@@ -4811,7 +4811,7 @@ void CmdSketcherConstrainRadius::activated(int iMsg)
|
||||
double radius = geoIdRadiusMap.front().second;
|
||||
|
||||
if(!commandopened)
|
||||
openCommand("Add radius constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add radius constraint"));
|
||||
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('Radius',%d,%f)) ",
|
||||
refGeoId,radius);
|
||||
@@ -4826,7 +4826,7 @@ void CmdSketcherConstrainRadius::activated(int iMsg)
|
||||
else {
|
||||
// Create the radius constraints now
|
||||
if(!commandopened)
|
||||
openCommand("Add radius constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add radius constraint"));
|
||||
for (std::vector< std::pair<int, double> >::iterator it = geoIdRadiusMap.begin(); it != geoIdRadiusMap.end(); ++it) {
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('Radius',%d,%f)) ",
|
||||
it->first,it->second);
|
||||
@@ -4972,7 +4972,7 @@ void CmdSketcherConstrainRadius::applyConstraint(std::vector<SelIdPair> &selSeq,
|
||||
}
|
||||
|
||||
// Create the radius constraint now
|
||||
openCommand("Add radius constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add radius constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj, "addConstraint(Sketcher.Constraint('Radius',%d,%f)) ",
|
||||
GeoId, radius);
|
||||
|
||||
@@ -5209,7 +5209,7 @@ void CmdSketcherConstrainDiameter::activated(int iMsg)
|
||||
|
||||
if(!externalGeoIdDiameterMap.empty()) {
|
||||
// Create the non-driving radius constraints now
|
||||
openCommand("Add diameter constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add diameter constraint"));
|
||||
commandopened=true;
|
||||
unsigned int constrSize = 0;
|
||||
|
||||
@@ -5268,7 +5268,7 @@ void CmdSketcherConstrainDiameter::activated(int iMsg)
|
||||
double diameter = geoIdDiameterMap.front().second;
|
||||
|
||||
if(!commandopened)
|
||||
openCommand("Add diameter constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add diameter constraint"));
|
||||
|
||||
Gui::cmdAppObjectArgs(Obj, "addConstraint(Sketcher.Constraint('Diameter',%d,%f)) ", refGeoId,diameter);
|
||||
|
||||
@@ -5280,7 +5280,7 @@ void CmdSketcherConstrainDiameter::activated(int iMsg)
|
||||
else {
|
||||
// Create the diameter constraints now
|
||||
if(!commandopened)
|
||||
openCommand("Add diameter constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add diameter constraint"));
|
||||
for (std::vector< std::pair<int, double> >::iterator it = geoIdDiameterMap.begin(); it != geoIdDiameterMap.end(); ++it) {
|
||||
Gui::cmdAppObjectArgs(Obj, "addConstraint(Sketcher.Constraint('Diameter',%d,%f)) ",
|
||||
it->first,it->second);
|
||||
@@ -5429,7 +5429,7 @@ void CmdSketcherConstrainDiameter::applyConstraint(std::vector<SelIdPair> &selSe
|
||||
}
|
||||
|
||||
// Create the diameter constraint now
|
||||
openCommand("Add diameter constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add diameter constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj, "addConstraint(Sketcher.Constraint('Diameter',%d,%f)) ",
|
||||
GeoId, diameter);
|
||||
|
||||
@@ -5754,7 +5754,7 @@ void CmdSketcherConstrainAngle::activated(int iMsg)
|
||||
if (isEdge(GeoId1, PosId1) && isEdge(GeoId2, PosId2) && isVertex(GeoId3, PosId3)) {
|
||||
double ActAngle = 0.0;
|
||||
|
||||
openCommand("Add angle constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add angle constraint"));
|
||||
|
||||
//add missing point-on-object constraints
|
||||
if (!IsPointAlreadyOnCurve(GeoId1, GeoId3, PosId3, Obj)) {
|
||||
@@ -5881,7 +5881,7 @@ void CmdSketcherConstrainAngle::activated(int iMsg)
|
||||
std::swap(PosId1,PosId2);
|
||||
}
|
||||
|
||||
openCommand("Add angle constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add angle constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"addConstraint(Sketcher.Constraint('Angle',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,ActAngle);
|
||||
|
||||
@@ -5911,7 +5911,7 @@ void CmdSketcherConstrainAngle::activated(int iMsg)
|
||||
Base::Vector3d dir = lineSeg->getEndPoint()-lineSeg->getStartPoint();
|
||||
double ActAngle = atan2(dir.y,dir.x);
|
||||
|
||||
openCommand("Add angle constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add angle constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),"addConstraint(Sketcher.Constraint('Angle',%d,%f)) ",
|
||||
GeoId1,ActAngle);
|
||||
|
||||
@@ -5935,7 +5935,7 @@ void CmdSketcherConstrainAngle::activated(int iMsg)
|
||||
arc->getRange(startangle, endangle, /*EmulateCCWXY=*/true);
|
||||
double angle = endangle - startangle;
|
||||
|
||||
openCommand("Add angle constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add angle constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('Angle',%d,%f)) ",
|
||||
GeoId1,angle);
|
||||
|
||||
@@ -6048,7 +6048,7 @@ void CmdSketcherConstrainAngle::applyConstraint(std::vector<SelIdPair> &selSeq,
|
||||
std::swap(PosId1,PosId2);
|
||||
}
|
||||
|
||||
openCommand("Add angle constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add angle constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj, "addConstraint(Sketcher.Constraint('Angle',%d,%d,%d,%d,%f)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,ActAngle);
|
||||
|
||||
@@ -6095,7 +6095,7 @@ void CmdSketcherConstrainAngle::applyConstraint(std::vector<SelIdPair> &selSeq,
|
||||
if (isEdge(GeoId1, PosId1) && isEdge(GeoId2, PosId2) && isVertex(GeoId3, PosId3)) {
|
||||
double ActAngle = 0.0;
|
||||
|
||||
openCommand("Add angle constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add angle constraint"));
|
||||
|
||||
//add missing point-on-object constraints
|
||||
if(! IsPointAlreadyOnCurve(GeoId1, GeoId3, PosId3, Obj)){
|
||||
@@ -6298,7 +6298,7 @@ void CmdSketcherConstrainEqual::activated(int iMsg)
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Add equality constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add equality constraint"));
|
||||
for (int i=0; i < int(ids.size()-1); i++) {
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(), "addConstraint(Sketcher.Constraint('Equal',%d,%d)) ",
|
||||
ids[i],ids[i+1]);
|
||||
@@ -6333,7 +6333,7 @@ void CmdSketcherConstrainEqual::applyConstraint(std::vector<SelIdPair> &selSeq,
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Add equality constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add equality constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj, "addConstraint(Sketcher.Constraint('Equal',%d,%d)) ",
|
||||
GeoId1, GeoId2);
|
||||
// finish the transaction and update
|
||||
@@ -6449,7 +6449,7 @@ void CmdSketcherConstrainSymmetric::activated(int iMsg)
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Add symmetric constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add symmetric constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"addConstraint(Sketcher.Constraint('Symmetric',%d,%d,%d,%d,%d,%d)) ",
|
||||
GeoId1,Sketcher::start,GeoId1,Sketcher::end,GeoId2,PosId2);
|
||||
@@ -6501,7 +6501,7 @@ void CmdSketcherConstrainSymmetric::activated(int iMsg)
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Add symmetric constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add symmetric constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"addConstraint(Sketcher.Constraint('Symmetric',%d,%d,%d,%d,%d)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,GeoId3);
|
||||
@@ -6517,7 +6517,7 @@ void CmdSketcherConstrainSymmetric::activated(int iMsg)
|
||||
}
|
||||
else if (isVertex(GeoId3,PosId3)) {
|
||||
// undo command open
|
||||
openCommand("Add symmetric constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add symmetric constraint"));
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
"addConstraint(Sketcher.Constraint('Symmetric',%d,%d,%d,%d,%d,%d)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,GeoId3,PosId3);
|
||||
@@ -6588,7 +6588,7 @@ void CmdSketcherConstrainSymmetric::applyConstraint(std::vector<SelIdPair> &selS
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Add symmetric constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add symmetric constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj,"addConstraint(Sketcher.Constraint('Symmetric',%d,%d,%d,%d,%d)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,GeoId3);
|
||||
|
||||
@@ -6623,7 +6623,7 @@ void CmdSketcherConstrainSymmetric::applyConstraint(std::vector<SelIdPair> &selS
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Add symmetric constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add symmetric constraint"));
|
||||
Gui::cmdAppObjectArgs(Obj,"addConstraint(Sketcher.Constraint('Symmetric',%d,%d,%d,%d,%d,%d)) ",
|
||||
GeoId1,PosId1,GeoId2,PosId2,GeoId3,PosId3);
|
||||
|
||||
@@ -6755,7 +6755,7 @@ void CmdSketcherConstrainSnellsLaw::activated(int iMsg)
|
||||
n2divn1 = newQuant.getValue();
|
||||
|
||||
//add constraint
|
||||
openCommand("Add Snell's law constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add Snell's law constraint"));
|
||||
|
||||
if (! IsPointAlreadyOnCurve(GeoId2,GeoId1,PosId1,Obj))
|
||||
Gui::cmdAppObjectArgs(selection[0].getObject(),
|
||||
@@ -6964,7 +6964,7 @@ void CmdSketcherConstrainInternalAlignment::activated(int iMsg)
|
||||
if((!(focus1 && focus2) && pointids.size() >= 1) ||
|
||||
(!(major && minor) && lineids.size() >= 1) ){
|
||||
|
||||
openCommand("Add internal alignment constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add internal alignment constraint"));
|
||||
|
||||
if(pointids.size()>=1)
|
||||
{
|
||||
@@ -7142,7 +7142,7 @@ void CmdSketcherConstrainInternalAlignment::activated(int iMsg)
|
||||
if((!(focus1 && focus2) && pointids.size() >= 1) ||
|
||||
(!(major && minor) && lineids.size() >= 1) ){
|
||||
|
||||
openCommand("Add internal alignment constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Add internal alignment constraint"));
|
||||
|
||||
if(pointids.size()>=1)
|
||||
{
|
||||
@@ -7348,7 +7348,7 @@ void CmdSketcherToggleDrivingConstraint::activated(int iMsg)
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Toggle constraint to driving/reference");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Toggle constraint to driving/reference"));
|
||||
|
||||
int successful=SubNames.size();
|
||||
// go through the selected subelements
|
||||
@@ -7432,7 +7432,7 @@ void CmdSketcherToggleActiveConstraint::activated(int iMsg)
|
||||
}
|
||||
|
||||
// undo command open
|
||||
openCommand("Activate/Deactivate constraint");
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Activate/Deactivate constraint"));
|
||||
|
||||
int successful=SubNames.size();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user