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:
@@ -206,7 +206,7 @@ PyDoc_STRVAR(FreeCAD_doc,
|
||||
PyDoc_STRVAR(Console_doc,
|
||||
"FreeCAD Console\n"
|
||||
);
|
||||
|
||||
|
||||
PyDoc_STRVAR(Base_doc,
|
||||
"The Base module contains the classes for the geometric basics\n"
|
||||
"like vector, matrix, bounding box, placement, rotation, axis, ...\n"
|
||||
@@ -2415,8 +2415,8 @@ std::string Application::FindHomePath(const char* sCall)
|
||||
absPath = path;
|
||||
}
|
||||
else {
|
||||
// Find the path of the executable. Theoretically, there could occur a
|
||||
// race condition when using readlink, but we only use this method to
|
||||
// Find the path of the executable. Theoretically, there could occur a
|
||||
// race condition when using readlink, but we only use this method to
|
||||
// get the absolute path of the executable to compute the actual home
|
||||
// path. In the worst case we simply get q wrong path and FreeCAD is not
|
||||
// able to load its modules.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#define FLEX_BETA
|
||||
#endif
|
||||
|
||||
/* First, we deal with platform-specific or compiler-specific issues. */
|
||||
/* First, we deal with platform-specific or compiler-specific issues. */
|
||||
|
||||
/* begin standard C headers. */
|
||||
#include <stdio.h>
|
||||
@@ -2183,19 +2183,19 @@ static void yy_fatal_error (yyconst char* msg )
|
||||
} \
|
||||
while ( 0 )
|
||||
|
||||
/* Accessor methods (get/set functions) to struct members. */
|
||||
/* Accessor methods (get/set functions) to struct members. */
|
||||
|
||||
/** Get the current line number.
|
||||
*
|
||||
*
|
||||
*/
|
||||
int yyget_lineno (void)
|
||||
{
|
||||
|
||||
|
||||
return yylineno;
|
||||
}
|
||||
|
||||
/** Get the input stream.
|
||||
*
|
||||
*
|
||||
*/
|
||||
FILE *yyget_in (void)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Parser for the FreeCAD Units language */
|
||||
/* (c) 2013 Juergen Riegel LGPL */
|
||||
/* Parser for the FreeCAD Units language */
|
||||
/* (c) 2013 Juergen Riegel LGPL */
|
||||
|
||||
|
||||
/* Represents the many different ways we can access our data */
|
||||
@@ -36,30 +36,30 @@
|
||||
| unit { QuantResult = $1 ; }
|
||||
| quantity { QuantResult = $1 ; }
|
||||
| quantity quantity { QuantResult = $1 + $2; }
|
||||
;
|
||||
;
|
||||
num: NUM { $$ = $1; }
|
||||
| ONE { $$ = $1; }
|
||||
| num '+' num { $$ = Quantity($1.getValue() + $3.getValue()); }
|
||||
| num MINUSSIGN num { $$ = Quantity($1.getValue() - $3.getValue()); }
|
||||
| num MINUSSIGN num { $$ = Quantity($1.getValue() - $3.getValue()); }
|
||||
| num '*' num { $$ = Quantity($1.getValue() * $3.getValue()); }
|
||||
| num '/' num { $$ = Quantity($1.getValue() / $3.getValue()); }
|
||||
| MINUSSIGN num %prec NEG { $$ = Quantity(-$2.getValue()); }
|
||||
| MINUSSIGN num %prec NEG { $$ = Quantity(-$2.getValue()); }
|
||||
| num '^' num { $$ = Quantity(pow ($1.getValue(), $3.getValue()));}
|
||||
| '(' num ')' { $$ = $2; }
|
||||
| ACOS '(' num ')' { $$ = Quantity(acos($3.getValue())); }
|
||||
| ASIN '(' num ')' { $$ = Quantity(asin($3.getValue())); }
|
||||
| ATAN '(' num ')' { $$ = Quantity(atan($3.getValue())); }
|
||||
| ABS '(' num ')' { $$ = Quantity(fabs($3.getValue())); }
|
||||
| EXP '(' num ')' { $$ = Quantity(exp($3.getValue())); }
|
||||
| LOG '(' num ')' { $$ = Quantity(log($3.getValue())); }
|
||||
| LOG10 '(' num ')' { $$ = Quantity(log10($3.getValue())); }
|
||||
| SIN '(' num ')' { $$ = Quantity(sin($3.getValue())); }
|
||||
| SINH '(' num ')' { $$ = Quantity(sinh($3.getValue())); }
|
||||
| TAN '(' num ')' { $$ = Quantity(tan($3.getValue())); }
|
||||
| TANH '(' num ')' { $$ = Quantity(tanh($3.getValue())); }
|
||||
| SQRT '(' num ')' { $$ = Quantity(sqrt($3.getValue())); }
|
||||
| COS '(' num ')' { $$ = Quantity(cos($3.getValue())); }
|
||||
;
|
||||
| ACOS '(' num ')' { $$ = Quantity(acos($3.getValue())); }
|
||||
| ASIN '(' num ')' { $$ = Quantity(asin($3.getValue())); }
|
||||
| ATAN '(' num ')' { $$ = Quantity(atan($3.getValue())); }
|
||||
| ABS '(' num ')' { $$ = Quantity(fabs($3.getValue())); }
|
||||
| EXP '(' num ')' { $$ = Quantity(exp($3.getValue())); }
|
||||
| LOG '(' num ')' { $$ = Quantity(log($3.getValue())); }
|
||||
| LOG10 '(' num ')' { $$ = Quantity(log10($3.getValue())); }
|
||||
| SIN '(' num ')' { $$ = Quantity(sin($3.getValue())); }
|
||||
| SINH '(' num ')' { $$ = Quantity(sinh($3.getValue())); }
|
||||
| TAN '(' num ')' { $$ = Quantity(tan($3.getValue())); }
|
||||
| TANH '(' num ')' { $$ = Quantity(tanh($3.getValue())); }
|
||||
| SQRT '(' num ')' { $$ = Quantity(sqrt($3.getValue())); }
|
||||
| COS '(' num ')' { $$ = Quantity(cos($3.getValue())); }
|
||||
;
|
||||
|
||||
unit: UNIT { $$ = $1; }
|
||||
| ONE '/' unit { $$ = Quantity(1.0)/$3; }
|
||||
@@ -69,7 +69,7 @@
|
||||
| '(' unit ')' { $$ = $2; }
|
||||
;
|
||||
quantity: num unit { $$ = $1*$2; }
|
||||
;
|
||||
;
|
||||
|
||||
|
||||
%%
|
||||
|
||||
@@ -121,8 +121,8 @@ public:
|
||||
protected:
|
||||
/** @name Attributes set by the inherited constructor.
|
||||
*
|
||||
* They set up the most important properties of the command.
|
||||
* In the constructor are set default values.
|
||||
* They set up the most important properties of the command.
|
||||
* In the constructor are set default values.
|
||||
* The real values should be set in the constructor of the inheriting class.
|
||||
*/
|
||||
//@{
|
||||
|
||||
@@ -1120,8 +1120,8 @@ void StdCmdDelete::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//check for inactive objects in selection Mantis #3477
|
||||
|
||||
//check for inactive objects in selection (Mantis #3477)
|
||||
std::set<QString> inactiveLabels;
|
||||
App::Application& app = App::GetApplication();
|
||||
App::Document* actDoc = app.getActiveDocument();
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -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."
|
||||
));
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -220,7 +220,7 @@ double Ellipse::getRadMaj(const DeriVector2 ¢er, 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++;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -798,7 +798,7 @@ PyObject *@self.export.Name@::_getattr(const char *attr) // __getattr__ functi
|
||||
int @self.export.Name@::_setattr(const char *attr, PyObject *value) // __setattr__ function: note only need to handle new state
|
||||
{
|
||||
try {
|
||||
// setter for special Attributes (e.g. dynamic ones)
|
||||
// setter for special Attributes (e.g. dynamic ones)
|
||||
int r = setCustomAttributes(attr, value);
|
||||
// r = 1: handled
|
||||
// r = -1: error
|
||||
|
||||
Reference in New Issue
Block a user