diff --git a/src/Gui/ViewProvider.h b/src/Gui/ViewProvider.h index c5e7a6ff39..51d23d9cf4 100644 --- a/src/Gui/ViewProvider.h +++ b/src/Gui/ViewProvider.h @@ -79,10 +79,10 @@ enum ViewStatus { /** General interface for all visual stuff in FreeCAD - * This class is used to generate and handle all around - * visualizing and presenting objects from the FreeCAD - * App layer to the user. This class and its descendents - * have to be implemented for any object type in order to + * This class is used to generate and handle all around + * visualizing and presenting objects from the FreeCAD + * App layer to the user. This class and its descendents + * have to be implemented for any object type in order to * show them in the 3DView and TreeView. */ class GuiExport ViewProvider : public App::TransactionalObject @@ -98,7 +98,7 @@ public: // returns the root node of the Provider (3D) virtual SoSeparator* getRoot(void){return pcRoot;} - // returns the root for the Annotations. + // returns the root for the Annotations. SoSeparator* getAnnotation(void); // returns the root node of the Provider (3D) virtual SoSeparator* getFrontRoot(void) const; @@ -107,17 +107,17 @@ public: // returns the root node of the Provider (3D) virtual SoSeparator* getBackRoot(void) const; /** deliver the children belonging to this object - * this method is used to deliver the objects to - * the 3DView which should be grouped under its - * scene graph. This affects the visibility and the 3D - * position of the object. + * this method is used to deliver the objects to + * the 3DView which should be grouped under its + * scene graph. This affects the visibility and the 3D + * position of the object. */ virtual std::vector claimChildren3D(void) const; /** @name Selection handling * This group of methods do the selection handling. * Here you can define how the selection for your ViewProfider - * works. + * works. */ //@{ @@ -152,7 +152,7 @@ public: /** @name Methods used by the Tree - * If you want to take control over the + * If you want to take control over the * appearance of your object in the tree you * can reimplemnt these methods. */ @@ -160,10 +160,10 @@ public: /// deliver the icon shown in the tree view virtual QIcon getIcon(void) const; /** deliver the children belonging to this object - * this method is used to deliver the objects to - * the tree framework which should be grouped under its + * this method is used to deliver the objects to + * the tree framework which should be grouped under its * label. Obvious is the usage in the group but it can - * be used for any kind of grouping needed for a special + * be used for any kind of grouping needed for a special * purpose. */ virtual std::vector claimChildren(void) const; @@ -211,7 +211,7 @@ public: /** update the content of the ViewProvider * this method have to implement the recalculation - * of the ViewProvider. There are different reasons to + * of the ViewProvider. There are different reasons to * update. E.g. only the view attribute has changed, or * the data has manipulated. */ @@ -228,7 +228,7 @@ public: std::string toString() const; PyObject* getPyObject(); - /** @name Display mode methods + /** @name Display mode methods */ //@{ std::string getActiveDisplayMode(void) const; @@ -280,8 +280,8 @@ public: virtual void unsetEditViewer(View3DInventorViewer*); //@} - /** @name Task panel - * With this interface the ViewProvider can steer the + /** @name Task panel + * With this interface the ViewProvider can steer the * appearance of widgets in the task view */ //@{ @@ -295,14 +295,14 @@ public: virtual bool doubleClicked(void) { return false; } /// is called when the provider is in edit and the mouse is moved virtual bool mouseMove(const SbVec2s &cursorPos, View3DInventorViewer* viewer); - /// is called when the Provider is in edit and the mouse is clicked + /// is called when the Provider is in edit and the mouse is clicked virtual bool mouseButtonPressed(int button, bool pressed, const SbVec2s &cursorPos, const View3DInventorViewer* viewer); /// set up the context-menu with the supported edit modes virtual void setupContextMenu(QMenu*, QObject*, const char*) {} /** @name direct handling methods - * This group of methods is to direct influence the + * This group of methods is to direct influence the * appearance of the viewed content. It's only for fast * interactions! If you want to set the visual parameters * you have to do it on the object viewed by this provider! @@ -317,8 +317,9 @@ public: public: // this method is called by the viewer when the ViewProvider is in edit static void eventCallback(void * ud, SoEventCallback * node); - - //restoring the object from document: this may itnerest extensions, hence call them + + //restoring the object from document: + //this may be of interest to extensions, hence call them virtual void Restore(Base::XMLReader& reader); bool isRestoring() {return testStatus(Gui::isRestoring);} @@ -331,7 +332,7 @@ public: * values are displayed by one display mask mode that handles color values. */ //@{ - /// Adds a new display mask mode + /// Adds a new display mask mode void addDisplayMaskMode( SoNode *node, const char* type ); /// Activates the display mask mode \a type void setDisplayMaskMode( const char* type ); @@ -341,7 +342,7 @@ public: std::vector getDisplayMaskModes() const; void setDefaultMode(int); //@} - + protected: /** Helper method to check that the node is valid, i.e. it must not cause * and infinite recursion. @@ -386,4 +387,3 @@ private: } // namespace Gui #endif // GUI_VIEWPROVIDER_H - diff --git a/src/Mod/Arch/ArchStairs.py b/src/Mod/Arch/ArchStairs.py index 1db75eb2ed..46bbcefe27 100644 --- a/src/Mod/Arch/ArchStairs.py +++ b/src/Mod/Arch/ArchStairs.py @@ -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] diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 43078b2499..fd491d694a 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -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 diff --git a/src/Mod/Fem/femsolver/calculix/writer.py b/src/Mod/Fem/femsolver/calculix/writer.py index d0909853fb..1c4bd5cc5e 100644 --- a/src/Mod/Fem/femsolver/calculix/writer.py +++ b/src/Mod/Fem/femsolver/calculix/writer.py @@ -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'] diff --git a/src/Mod/TechDraw/Gui/QGIView.cpp b/src/Mod/TechDraw/Gui/QGIView.cpp index ac1bfd2754..64eb8efe7e 100644 --- a/src/Mod/TechDraw/Gui/QGIView.cpp +++ b/src/Mod/TechDraw/Gui/QGIView.cpp @@ -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( parentItem() ) ); if (parentClip) { @@ -445,7 +445,7 @@ void QGIView::drawBorder() if (feat == nullptr) { return; } - + drawCaption(); //show neither auto vp = static_cast(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()) {