Misc. typo and whitespace fixes

ref: https://forum.freecadweb.org/viewtopic.php?f=3&t=30988#p256964
along with other misc. fixes
This commit is contained in:
luz.paz
2018-09-18 09:56:12 -04:00
committed by wmayer
parent 3e7079d9cd
commit 360e581672
15 changed files with 78 additions and 78 deletions

File diff suppressed because one or more lines are too long

View File

@@ -88,7 +88,7 @@ PartDesign::Body *getBody(bool messageIfNot, bool autoActivate, bool assertModer
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No active Body"),
QObject::tr("In order to use PartDesign you need an active Body object in the document. "
"Please make one active (double click) or create one.\n\nIf you have a legacy document "
"with PartDesign objects without Body, use the transfer function in "
"with PartDesign objects without Body, use the migrate function in "
"PartDesign to put them into a Body."
));
}

View File

@@ -185,7 +185,7 @@ class ObjectDressup:
return results
def getLeadEnd(self, obj, queue, action):
'''returns the Gcode of LeadOut.'''
'''returns the Gcode of LeadOut.'''
global currLocation
results = []
horizFeed = PathDressup.toolController(obj.Base).HorizFeed.Value

View File

@@ -311,7 +311,7 @@ class ObjectSurface(PathOp.ObjectOp):
return True
def opSetDefaultValues(self, obj, job):
'''opSetDefaultValues(obj, job) ... initialize defauts'''
'''opSetDefaultValues(obj, job) ... initialize defaults'''
# obj.ZigZagAngle = 45.0
obj.StepOver = 50

View File

@@ -725,7 +725,7 @@ typedef std::list<MeshObjectConstRef> MeshObjectConstRefList;
typedef std::vector<MeshObjectConstRef> MeshObjectConstRefArray;
}
struct MeshObject_greater : public std::binary_function<const Mesh::MeshObjectConstRef&,
struct MeshObject_greater : public std::binary_function<const Mesh::MeshObjectConstRef&,
const Mesh::MeshObjectConstRef&, bool>
{
bool operator()(const Mesh::MeshObjectConstRef& x,
@@ -1033,7 +1033,7 @@ public:
setAttribute(Qt::WA_NativeWindow);
#endif
}
QPaintEngine *paintEngine() const {
QPaintEngine *paintEngine() const {
return 0;
}
protected:
@@ -1427,8 +1427,8 @@ CmdTestGraphicsView::CmdTestGraphicsView()
{
sGroup = QT_TR_NOOP("Standard-Test");
sMenuText = QT_TR_NOOP("Create new graphics view");
sToolTipText= QT_TR_NOOP("Creates a new view window for the active document");
sStatusTip = QT_TR_NOOP("Creates a new view window for the active document");
sToolTipText= QT_TR_NOOP("Creates a new view window for the active document");
sStatusTip = QT_TR_NOOP("Creates a new view window for the active document");
}
void CmdTestGraphicsView::activated(int)

View File

@@ -220,7 +220,7 @@ double Ellipse::getRadMaj(const DeriVector2 &center, const DeriVector2 &f1, doub
double cf, dcf;
cf = f1.subtr(center).length(dcf);
DeriVector2 hack (b, cf,
db, dcf);//hack = a nonsense vector to calculate major radius with derivatives, useful just because the calculation formula is the same as vector length formula
db, dcf);//hack = a nonsense vector to calculate major radius with derivatives, useful just because the calculation formula is the same as vector length formula
return hack.length(ret_dRadMaj);
}
@@ -403,17 +403,17 @@ DeriVector2 Hyperbola::CalculateNormal(Point &p, double* derivparam)
DeriVector2 cv (center, derivparam);
DeriVector2 f1v (focus1, derivparam);
DeriVector2 pv (p, derivparam);
//calculation.
//focus2:
DeriVector2 f2v = cv.linCombi(2.0, f1v, -1.0); // 2*cv - f1v
//pf1, pf2 = vectors from p to focus1,focus2
DeriVector2 pf1 = f1v.subtr(pv).mult(-1.0); // <--- differs from ellipse normal calculation code by inverting this vector
DeriVector2 pf2 = f2v.subtr(pv);
//return sum of normalized pf2, pf2
DeriVector2 ret = pf1.getNormalized().sum(pf2.getNormalized());
return ret;
}
@@ -486,7 +486,7 @@ int ArcOfHyperbola::PushOwnParams(VEC_pD &pvec)
pvec.push_back(startAngle); cnt++;
pvec.push_back(endAngle); cnt++;
return cnt;
}
void ArcOfHyperbola::ReconstructOnNewPvec(VEC_pD &pvec, int &cnt)
{
@@ -512,14 +512,14 @@ DeriVector2 Parabola::CalculateNormal(Point &p, double* derivparam)
DeriVector2 cv (vertex, derivparam);
DeriVector2 f1v (focus1, derivparam);
DeriVector2 pv (p, derivparam);
// the normal is the vector from the focus to the intersection of ano thru the point p and direction
// of the symmetry axis of the parabola with the directrix.
// As both point to directrix and point to focus are of equal magnitude, we can work with unitary vectors
// to calculate the normal, substraction of those vectors.
DeriVector2 ret = cv.subtr(f1v).getNormalized().subtr(f1v.subtr(pv).getNormalized());
return ret;
}
@@ -527,27 +527,27 @@ DeriVector2 Parabola::Value(double u, double du, double* derivparam)
{
//In local coordinate system, value() of parabola is:
//P(U) = O + U*U/(4.*F)*XDir + U*YDir
//P(U) = O + U*U/(4.*F)*XDir + U*YDir
DeriVector2 c(this->vertex, derivparam);
DeriVector2 f1(this->focus1, derivparam);
DeriVector2 fv = f1.subtr(c);
double f,df;
f = fv.length(df);
DeriVector2 xdir = fv.getNormalized();
DeriVector2 ydir = xdir.rotate90ccw();
DeriVector2 dirx = xdir.multD(u,du).multD(u,du).divD(4*f,4*df);
DeriVector2 diry = ydir.multD(u,du);
DeriVector2 diry = ydir.multD(u,du);
DeriVector2 dir = dirx.sum(diry);
DeriVector2 ret; //point of parabola at parameter value of u, in global coordinates
ret = c.sum( dir );
return ret;
@@ -589,7 +589,7 @@ int ArcOfParabola::PushOwnParams(VEC_pD &pvec)
pvec.push_back(startAngle); cnt++;
pvec.push_back(endAngle); cnt++;
return cnt;
}
void ArcOfParabola::ReconstructOnNewPvec(VEC_pD &pvec, int &cnt)
{
@@ -612,21 +612,21 @@ DeriVector2 BSpline::CalculateNormal(Point& p, double* derivparam)
{
// place holder
DeriVector2 ret;
// even if this method is call CalculateNormal, the returned vector is not the normal strictu sensus
// but a normal vector, where the vector should point to the left when one walks along the curve from
// but a normal vector, where the vector should point to the left when one walks along the curve from
// start to end.
//
// https://forum.freecadweb.org/viewtopic.php?f=10&t=26312#p209486
if (mult[0] > degree && mult[mult.size()-1] > degree) {
// if endpoints through end poles
// if endpoints through end poles
if(*p.x == *start.x && *p.y == *start.y) {
// and you are asking about the normal at start point
// then tangency is defined by first to second poles
DeriVector2 endpt(this->poles[1], derivparam);
DeriVector2 spt(this->poles[0], derivparam);
DeriVector2 tg = endpt.subtr(spt);
ret = tg.rotate90ccw();
}
@@ -635,7 +635,7 @@ DeriVector2 BSpline::CalculateNormal(Point& p, double* derivparam)
// then tangency is defined by last to last but one poles
DeriVector2 endpt(this->poles[poles.size()-1], derivparam);
DeriVector2 spt(this->poles[poles.size()-2], derivparam);
DeriVector2 tg = endpt.subtr(spt);
ret = tg.rotate90ccw();
} else {
@@ -676,7 +676,7 @@ int BSpline::PushOwnParams(VEC_pD &pvec)
pvec.insert(pvec.end(), knots.begin(), knots.end());
cnt = cnt + knots.size();
pvec.push_back(start.x); cnt++;
pvec.push_back(start.y); cnt++;
pvec.push_back(end.x); cnt++;
@@ -699,7 +699,7 @@ void BSpline::ReconstructOnNewPvec(VEC_pD &pvec, int &cnt)
for(VEC_pD::iterator it = knots.begin(); it != knots.end(); ++it) {
(*it) = pvec[cnt]; cnt++;
}
start.x=pvec[cnt]; cnt++;
start.y=pvec[cnt]; cnt++;
end.x=pvec[cnt]; cnt++;

View File

@@ -3231,7 +3231,7 @@ public:
enum SelectMode {
STATUS_SEEK_First, /**< enum value ----. */
STATUS_SEEK_Second, /**< enum value ----. */
STATUS_SEEK_Third, /**< enum value ----. */
STATUS_SEEK_Third, /**< enum value ----. */
STATUS_SEEK_Fourth, /**< enum value ----. */
STATUS_Close
};
@@ -7034,24 +7034,24 @@ public:
"conList.append(Sketcher.Constraint('%s',%i))\n"
"conList.append(Sketcher.Constraint('Equal',%i,%i))\n"
"App.ActiveDocument.%s.addConstraint(conList)\n",
StartPos.x,StartPos.y, // center of the arc1
StartPos.x,StartPos.y, // center of the arc1
fabs(r), // radius arc1
start,end, // start and end angle of arc1
StartPos.x+lx,StartPos.y+ly, // center of the arc2
StartPos.x+lx,StartPos.y+ly, // center of the arc2
fabs(r), // radius arc2
end,start, // start and end angle of arc2
EditCurve[16].x,EditCurve[16].y,EditCurve[17].x,EditCurve[17].y, // line1
EditCurve[0].x,EditCurve[0].y,EditCurve[34].x,EditCurve[34].y, // line2
sketchgui->getObject()->getNameInDocument(), // the sketch
geometryCreationMode==Construction?"True":"False", // geometry as construction or not
geometryCreationMode==Construction?"True":"False", // geometry as construction or not
firstCurve,firstCurve+3, // tangent1
firstCurve,firstCurve+2, // tangent2
firstCurve+2,firstCurve+1, // tangent3
firstCurve+3,firstCurve+1, // tangent4
(fabs(lx)>fabs(ly))?"Horizontal":"Vertical", firstCurve+2, // vertical or horizontal constraint
firstCurve,firstCurve+1, // equal constraint
sketchgui->getObject()->getNameInDocument()); // the sketch
sketchgui->getObject()->getNameInDocument()); // the sketch
Gui::Command::commitCommand();
// add auto constraints at the start of the first side

View File

@@ -447,9 +447,9 @@ class Spreadsheet:
#msg = ex.message
#raise Exception(msg) #would discard the type
return result
def recompute(self,obj):
"Fills the controlled cells and properties"
"Fills the controlled cells and properties"
if obj:
if hasattr(obj,"Controllers"):
import Draft

View File

@@ -382,7 +382,7 @@ class DocumentSaveRestoreCases(unittest.TestCase):
self.failUnless(self.Doc.Label_2.Link == self.Doc.Label_3)
self.failUnless(self.Doc.Label_1.LinkSub == (self.Doc.Label_2,["Sub1","Sub2"]))
self.failUnless(self.Doc.Label_2.LinkSub == (self.Doc.Label_3,["Sub3","Sub4"]))
# do NOT save transient properties
# do NOT save transient properties
self.failUnless(self.Doc.Label_1.TypeTransient == 4711)
self.failUnless(self.Doc == FreeCAD.getDocument(self.Doc.Name))