Sketcher: Carbon Copy - Allow cross-body sketcher links

=======================================================

The instructions are shown on the status bar.

press CTRL to allow cross-body link

press ALT to by-pass directional requirements

press CTRL+ALT to allow a cross-body link and by-pass directional requirements
This commit is contained in:
Abdullah Tahiri
2017-04-10 17:07:50 +02:00
committed by wmayer
parent 17098d011c
commit 8e4ac4dd70
2 changed files with 7 additions and 7 deletions

View File

@@ -2047,7 +2047,7 @@ bool SketchObject::isCarbonCopyAllowed(App::Document *pDoc, App::DocumentObject
App::Part* part_obj = App::Part::getPartOfObject(pObj, true);
if (part_this == part_obj){ //either in the same part, or in the root of document
if (body_this != NULL) {
if (body_this != body_obj) {
if ((body_this != body_obj) && !this->allowOtherBody) {
if (rsn)
*rsn = rlOtherBody;
return false;

View File

@@ -6198,8 +6198,8 @@ namespace SketcherGui {
Q_UNUSED(sSubName);
Sketcher::SketchObject *sketch = static_cast<Sketcher::SketchObject*>(object);
sketch->allowOtherBody = false;
sketch->allowUnaligned = (QApplication::keyboardModifiers() == Qt::ControlModifier);
sketch->allowOtherBody = (QApplication::keyboardModifiers() == Qt::ControlModifier || QApplication::keyboardModifiers() == (Qt::ControlModifier | Qt::AltModifier));
sketch->allowUnaligned = (QApplication::keyboardModifiers() == Qt::AltModifier || QApplication::keyboardModifiers() == (Qt::ControlModifier | Qt::AltModifier));
this->notAllowedReason = "";
Sketcher::SketchObject::eReasonList msg;
@@ -6214,19 +6214,19 @@ namespace SketcherGui {
this->notAllowedReason = QT_TR_NOOP("This object is in another document.");
break;
case Sketcher::SketchObject::rlOtherBody:
this->notAllowedReason = QT_TR_NOOP("This object belongs to another body.");
this->notAllowedReason = QT_TR_NOOP("This object belongs to another body. Hold Ctrl to allow crossreferences.");
break;
case Sketcher::SketchObject::rlOtherPart:
this->notAllowedReason = QT_TR_NOOP("This object belongs to another part.");
break;
case Sketcher::SketchObject::rlNonParallel:
this->notAllowedReason = QT_TR_NOOP("The selected sketch is not parallel to this sketch. Hold Ctrl to allow non-parallel sketchs.");
this->notAllowedReason = QT_TR_NOOP("The selected sketch is not parallel to this sketch. Hold Alt to allow non-parallel sketchs.");
break;
case Sketcher::SketchObject::rlAxesMisaligned:
this->notAllowedReason = QT_TR_NOOP("The XY axes of the selected sketch do not have the same direction as this sketch. Hold Ctrl to disregard it.");
this->notAllowedReason = QT_TR_NOOP("The XY axes of the selected sketch do not have the same direction as this sketch. Hold Alt to disregard it.");
break;
case Sketcher::SketchObject::rlOriginsMisaligned:
this->notAllowedReason = QT_TR_NOOP("The origin of the selected sketch is not aligned with the origin of this sketch. Hold Ctrl to disregard it.");
this->notAllowedReason = QT_TR_NOOP("The origin of the selected sketch is not aligned with the origin of this sketch. Hold Alt to disregard it.");
break;
default:
break;