Skip to content

Commit

Permalink
Misc. source comment typo and whitespace fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
luzpaz authored and abdullahtahiriyo committed May 6, 2019
1 parent f7b89fd commit 519bbfe
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 51 deletions.
50 changes: 25 additions & 25 deletions src/Gui/ViewProvider.h
Expand Up @@ -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
Expand All @@ -98,7 +98,7 @@ class GuiExport ViewProvider : public App::TransactionalObject

// 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;
Expand All @@ -107,17 +107,17 @@ class GuiExport ViewProvider : public App::TransactionalObject
// 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<App::DocumentObject*> 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.
*/
//@{

Expand Down Expand Up @@ -152,18 +152,18 @@ class GuiExport ViewProvider : public App::TransactionalObject


/** @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.
*/
//@{
/// 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<App::DocumentObject*> claimChildren(void) const;
Expand Down Expand Up @@ -211,7 +211,7 @@ class GuiExport ViewProvider : public App::TransactionalObject

/** 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.
*/
Expand All @@ -228,7 +228,7 @@ class GuiExport ViewProvider : public App::TransactionalObject
std::string toString() const;
PyObject* getPyObject();

/** @name Display mode methods
/** @name Display mode methods
*/
//@{
std::string getActiveDisplayMode(void) const;
Expand Down Expand Up @@ -280,8 +280,8 @@ class GuiExport ViewProvider : public App::TransactionalObject
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
*/
//@{
Expand All @@ -295,14 +295,14 @@ class GuiExport ViewProvider : public App::TransactionalObject
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!
Expand All @@ -317,8 +317,9 @@ class GuiExport ViewProvider : public App::TransactionalObject
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);}

Expand All @@ -331,7 +332,7 @@ class GuiExport ViewProvider : public App::TransactionalObject
* 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 );
Expand All @@ -341,7 +342,7 @@ class GuiExport ViewProvider : public App::TransactionalObject
std::vector<std::string> getDisplayMaskModes() const;
void setDefaultMode(int);
//@}

protected:
/** Helper method to check that the node is valid, i.e. it must not cause
* and infinite recursion.
Expand Down Expand Up @@ -386,4 +387,3 @@ class GuiExport ViewProvider : public App::TransactionalObject
} // namespace Gui

#endif // GUI_VIEWPROVIDER_H

6 changes: 3 additions & 3 deletions src/Mod/Arch/ArchStairs.py
Expand Up @@ -332,7 +332,7 @@ def setProperties(self,obj):
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"):
Expand Down Expand Up @@ -701,7 +701,7 @@ def returnOutlines(stairsObj, edges, align="Left", mode=None, widthFirstSegment=
#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 '''
Expand Down Expand Up @@ -1402,7 +1402,7 @@ def connectRailingVector(self, obj, outlineRailL, outlineRailR, pArcRailL, pArcR
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]
Expand Down
30 changes: 15 additions & 15 deletions src/Mod/Draft/Draft.py
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -4492,7 +4492,7 @@ def execute(self, obj):
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()
Expand Down Expand Up @@ -4526,7 +4526,7 @@ def execute(self, obj):
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()
Expand Down Expand Up @@ -4566,7 +4566,7 @@ def execute(self, obj):
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()
Expand Down Expand Up @@ -4694,7 +4694,7 @@ def execute(self, obj):
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
Expand Down Expand Up @@ -4883,7 +4883,7 @@ def execute(self, obj):
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()
Expand Down Expand Up @@ -5016,14 +5016,14 @@ def execute(self, obj):
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()
Expand Down Expand Up @@ -5111,7 +5111,7 @@ def createGeometry(self,fp):
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

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Fem/femsolver/calculix/writer.py
Expand Up @@ -505,7 +505,7 @@ def write_node_sets_constraints_planerotation(self, f):
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']
Expand Down
14 changes: 7 additions & 7 deletions src/Mod/TechDraw/Gui/QGIView.cpp
Expand Up @@ -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) {
Expand Down Expand Up @@ -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())) {
Expand All @@ -187,15 +187,15 @@ 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;

// 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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -445,7 +445,7 @@ void QGIView::drawBorder()
if (feat == nullptr) {
return;
}

drawCaption();
//show neither
auto vp = static_cast<ViewProviderDrawingView*>(getViewProvider(getViewObject()));
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit 519bbfe

Please sign in to comment.