Misc. source comment typo and whitespace fixes

This commit is contained in:
luz.paz
2019-05-05 13:35:42 -04:00
committed by abdullahtahiriyo
parent f7b89fdbe1
commit 519bbfe503
5 changed files with 51 additions and 51 deletions

View File

@@ -332,7 +332,7 @@ class _Stairs(ArchComponent.Component):
obj.setEditorMode("OutlineRight",1)
# Can't accept 'None' in list, need NaN
#if not hasattr(obj,"OutlineRailArcLeft"):
#if not hasattr(obj,"OutlineRailArcLeft"):
#obj.addProperty("App::PropertyVectorList","OutlineRailArcLeft","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'left outline' 'arc points' of stairs railing"))
#obj.setEditorMode("OutlineRailArcLeft",1)
#if not hasattr(obj,"OutlineRailArcRight"):
@@ -701,7 +701,7 @@ class _Stairs(ArchComponent.Component):
#vBase2vec = (vBase2-vBase[i]) # - would not be correct if Align is not Left
''' (1a) calc & append vLength - Need v (vec) '''
vLength.append(Vector(v[i].x,v[i].y,v[i].z)) # TODO check all function below ok with curve? # TODO vLength in this f() is 3d
vLength.append(Vector(v[i].x,v[i].y,v[i].z)) # TODO check all function below ok with curve? # TODO vLength in this f() is 3d
''' (1b, 2a) calc & append vWidth - Need vLength, netWidthI '''
@@ -1402,7 +1402,7 @@ class _Stairs(ArchComponent.Component):
if obj.LastSegment.Proxy.OutlineRailArcLeftAll: # need if?
outlineRailArcLeftAll.extend(obj.LastSegment.Proxy.OutlineRailArcLeftAll)
if (outlineLeftAll[-1] - obj.OutlineLeft[0]).Length < 0.01: # To avoid 2 points overlapping fail creating LineSegment # TODO to allow tolerence Part.LineSegment / edge.toShape() allow?
if (outlineLeftAll[-1] - obj.OutlineLeft[0]).Length < 0.01: # To avoid 2 points overlapping fail creating LineSegment # TODO to allow tolerance Part.LineSegment / edge.toShape() allow?
# no need abs() after .Length right?
del outlineLeftAll[-1]
del outlineRailArcLeftAll[-1]

View File

@@ -365,7 +365,7 @@ def shapify(obj):
def getGroupContents(objectslist,walls=False,addgroups=False,spaces=False,noarchchild=False):
'''getGroupContents(objectlist,[walls,addgroups]): if any object of the given list
is a group, its content is appened to the list, which is returned. If walls is True,
is a group, its content is appended to the list, which is returned. If walls is True,
walls and structures are also scanned for included windows or rebars. If addgroups
is true, the group itself is also included in the list.'''
def getWindows(obj):
@@ -656,7 +656,7 @@ def loadTexture(filename,size=None):
byteList.append(chr(QtGui.qBlue( rgb )).encode('latin-1'))
byteList.append(chr(QtGui.qAlpha( rgb )).encode('latin-1'))
#line += numcomponents
bytes = b"".join(byteList)
img.setValue(size, numcomponents, bytes)
except:
@@ -725,16 +725,16 @@ def makeCircle(radius, placement=None, face=None, startangle=None, endangle=None
placement = FreeCAD.Placement(edge.Placement)
delta = edge.Curve.Center.sub(placement.Base)
placement.move(delta)
# Rotation of the edge
# Rotation of the edge
rotOk = FreeCAD.Rotation(edge.Curve.XAxis, edge.Curve.YAxis, edge.Curve.Axis, "ZXY")
placement.Rotation = rotOk
if len(edge.Vertexes) > 1:
v0 = edge.Curve.XAxis
v1 = (edge.Vertexes[0].Point).sub(edge.Curve.Center)
v2 = (edge.Vertexes[-1].Point).sub(edge.Curve.Center)
# Angle between edge.Curve.XAxis and the vector from center to start of arc
# Angle between edge.Curve.XAxis and the vector from center to start of arc
a0 = math.degrees(FreeCAD.Vector.getAngle(v0, v1))
# Angle between edge.Curve.XAxis and the vector from center to end of arc
# Angle between edge.Curve.XAxis and the vector from center to end of arc
a1 = math.degrees(FreeCAD.Vector.getAngle(v0, v2))
obj.FirstAngle = a0
obj.LastAngle = a1
@@ -882,7 +882,7 @@ def makeAngularDimension(center,angles,p3,normal=None):
_ViewProviderAngularDimension(obj.ViewObject)
formatObject(obj)
select(obj)
return obj
def makeWire(pointslist,closed=False,placement=None,face=None,support=None):
@@ -1364,7 +1364,7 @@ def joinWires(wires, joinAttempts = 0):
'''joinWires(objects): merges a set of wires where possible, if any of those
wires have a coincident start and end point'''
if joinAttempts > len(wires):
return
return
joinAttempts += 1
for wire1Index, wire1 in enumerate(wires):
for wire2Index, wire2 in enumerate(wires):
@@ -4492,7 +4492,7 @@ class _Rectangle(_DraftObject):
else:
shape = Part.Face(shape)
obj.Shape = shape
if hasattr(obj,"Area") and hasattr(shape,"Area"):
if hasattr(obj,"Area") and hasattr(shape,"Area"):
obj.Area = shape.Area
obj.Placement = plm
obj.positionBySupport()
@@ -4526,7 +4526,7 @@ class _Circle(_DraftObject):
else:
shape = Part.Face(shape)
obj.Shape = shape
if hasattr(obj,"Area") and hasattr(shape,"Area"):
if hasattr(obj,"Area") and hasattr(shape,"Area"):
obj.Area = shape.Area
obj.Placement = plm
obj.positionBySupport()
@@ -4566,7 +4566,7 @@ class _Ellipse(_DraftObject):
else:
shape = Part.Face(shape)
obj.Shape = shape
if hasattr(obj,"Area") and hasattr(shape,"Area"):
if hasattr(obj,"Area") and hasattr(shape,"Area"):
obj.Area = shape.Area
obj.Placement = plm
obj.positionBySupport()
@@ -4694,7 +4694,7 @@ class _Wire(_DraftObject):
shape = w
if shape:
obj.Shape = shape
if hasattr(obj,"Area") and hasattr(shape,"Area"):
if hasattr(obj,"Area") and hasattr(shape,"Area"):
obj.Area = shape.Area
if hasattr(obj,"Length"):
obj.Length = shape.Length
@@ -4883,7 +4883,7 @@ class _Polygon(_DraftObject):
else:
shape = Part.Face(shape)
obj.Shape = shape
if hasattr(obj,"Area") and hasattr(shape,"Area"):
if hasattr(obj,"Area") and hasattr(shape,"Area"):
obj.Area = shape.Area
obj.Placement = plm
obj.positionBySupport()
@@ -5016,14 +5016,14 @@ class _BSpline(_DraftObject):
except Part.OCCError:
pass
obj.Shape = shape
if hasattr(obj,"Area") and hasattr(shape,"Area"):
if hasattr(obj,"Area") and hasattr(shape,"Area"):
obj.Area = shape.Area
else:
spline = Part.BSplineCurve()
spline.interpolate(obj.Points, PeriodicFlag = False, Parameters = self.knotSeq)
shape = spline.toShape()
obj.Shape = shape
if hasattr(obj,"Area") and hasattr(shape,"Area"):
if hasattr(obj,"Area") and hasattr(shape,"Area"):
obj.Area = shape.Area
obj.Placement = plm
obj.positionBySupport()
@@ -5111,7 +5111,7 @@ class _BezCurve(_DraftObject):
except Part.OCCError:
pass
fp.Shape = w
if hasattr(obj,"Area") and hasattr(w,"Area"):
if hasattr(obj,"Area") and hasattr(w,"Area"):
obj.Area = w.Area
fp.Placement = plm

View File

@@ -505,7 +505,7 @@ class FemInputWriterCcx(FemInputWriter.FemInputWriter):
f.write('** written by {} function\n'.format(sys._getframe().f_code.co_name))
# info about self.constraint_conflict_nodes:
# is used to check if MPC and constraint fixed and constraint displacement share same nodes,
# because MPC's and constriants fixed and constraints displacement can't share same nodes.
# because MPC's and constraints fixed and constraints displacement can't share same nodes.
# Thus call write_node_sets_constraints_planerotation has to be after constraint fixed and constraint displacement
for femobj in self.planerotation_objects: # femobj --> dict, FreeCAD document object is femobj['Object']
l_nodes = femobj['Nodes']

View File

@@ -125,7 +125,7 @@ QGIView::~QGIView()
signalSelectPoint.disconnect_all_slots();
}
void QGIView::isVisible(bool state)
void QGIView::isVisible(bool state)
{
auto feat = getViewObject();
if (feat != nullptr) {
@@ -172,7 +172,7 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
newPos.setY(pos().y());
return newPos;
}
// TODO find a better data structure for this
// this is just a pair isn't it?
if (getViewObject()->isDerivedFrom(TechDraw::DrawProjGroupItem::getClassTypeId())) {
@@ -187,7 +187,7 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
} else if(alignMode == QString::fromLatin1("Horizontal")) {
newPos.setY(item->pos().y());
} else if(alignMode == QString::fromLatin1("45slash")) {
//this logic is wrong since the constained movement direction is not necessarily 45*
//this logic is wrong since the constrained movement direction is not necessarily 45*
// Base::Console().Message("QGIV::itemChange - oblique BL-TR\n");
// double dist = ( (newPos.x() - item->pos().x()) +
// (item->pos().y() - newPos.y()) ) / 2.0;
@@ -195,7 +195,7 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
// newPos.setX( item->pos().x() + dist);
// newPos.setY( item->pos().y() - dist );
} else if(alignMode == QString::fromLatin1("45backslash")) {
//this logic is wrong since the constained movement direction is not necessarily 45*
//this logic is wrong since the constrained movement direction is not necessarily 45*
// Base::Console().Message("QGIV::itemChange - oblique TL-BR\n");
// double dist = ( (newPos.x() - item->pos().x()) +
// (newPos.y() - item->pos().y()) ) / 2.0;
@@ -305,7 +305,7 @@ QGIViewClip* QGIView::getClipGroup(void)
"(%s) not in Clip\n", getViewName() );
return nullptr;
}
QGIViewClip* result = nullptr;
auto parentClip( dynamic_cast<QGCustomClip*>( parentItem() ) );
if (parentClip) {
@@ -445,7 +445,7 @@ void QGIView::drawBorder()
if (feat == nullptr) {
return;
}
drawCaption();
//show neither
auto vp = static_cast<ViewProviderDrawingView*>(getViewProvider(getViewObject()));
@@ -494,7 +494,7 @@ void QGIView::drawBorder()
displayArea.top(),
frameWidth,
frameHeight);
double lockX = labelArea.left();
double lockY = labelArea.bottom() - (2 * m_lockHeight);
if (feat->isLocked()) {