Part: Attacher1D: new attachment mode "Normal to face"

addresses #3175
https://freecadweb.org/tracker/view.php?id=3175

Also, renames Datum Line's "Normal" attachment mode to "Normal to edge"
in Gui, for the name to be specific.
This commit is contained in:
DeepSOIC
2017-09-01 15:40:31 +03:00
committed by wmayer
parent 4277c83b20
commit 8284e60401
3 changed files with 13 additions and 1 deletions

View File

@@ -120,6 +120,8 @@ const char* AttachEngine::eMapModeStrings[]= {
"InertialCS",
"FaceNormal",
NULL};
//this list must be in sync with eRefType enum.
@@ -1565,6 +1567,8 @@ AttachEngineLine::AttachEngineLine()
modeRefTypes[mm1AxisInertia2] = modeRefTypes[mm1AxisInertia1];
modeRefTypes[mm1AxisInertia3] = modeRefTypes[mm1AxisInertia1];
modeRefTypes[mm1FaceNormal] = attacher3D.modeRefTypes[mmTangentPlane];
this->EnableAllSupportedModes();
@@ -1613,6 +1617,9 @@ Base::Placement AttachEngineLine::calculateAttachedPlacement(Base::Placement ori
case mm1Tangent:
mmode = mmNormalToPath;
break;
case mm1FaceNormal:
mmode = mmTangentPlane;
break;
default:
bReUsed = false;
break;

View File

@@ -99,6 +99,8 @@ enum eMapMode {
mmInertialCS,
mm1FaceNormal,
mmDummy_NumberOfModes//a value useful to check the validity of mode value
};//see also eMapModeStrings[] definition in .cpp

View File

@@ -191,7 +191,7 @@ TextSet getUIStrings(Base::Type attacherType, eMapMode mmode)
return TwoStrings(qApp->translate("Attacher1D", "Tangent","AttachmentLine mode caption"),
qApp->translate("Attacher1D", "Line tangent to an edge. Optional vertex link defines where.","AttachmentLine mode tooltip"));
case mm1Normal:
return TwoStrings(qApp->translate("Attacher1D", "Normal","AttachmentLine mode caption"),
return TwoStrings(qApp->translate("Attacher1D", "Normal to edge","AttachmentLine mode caption"),
qApp->translate("Attacher1D", "Align to N vector of Frenet-Serret coordinate system of curved edge. Optional vertex link defines where.","AttachmentLine mode tooltip"));
case mm1Binormal:
return TwoStrings(qApp->translate("Attacher1D", "Binormal","AttachmentLine mode caption"),
@@ -220,6 +220,9 @@ TextSet getUIStrings(Base::Type attacherType, eMapMode mmode)
case mm1AxisInertia3:
return TwoStrings(qApp->translate("Attacher1D", "3rd principal axis","AttachmentLine mode caption"),
qApp->translate("Attacher1D", "Line follows third principal axis of inertia.","AttachmentLine mode tooltip"));
case mm1FaceNormal:
return TwoStrings(qApp->translate("Attacher1D", "Normal to surface","AttachmentLine mode caption"),
qApp->translate("Attacher1D", "Line perpendicular to surface at point set by vertex.","AttachmentLine mode tooltip"));
default:
break;
}