Merge branch 'master' into master

This commit is contained in:
mlampert
2020-04-30 10:14:45 -07:00
committed by GitHub
23 changed files with 163 additions and 52 deletions

View File

@@ -113,6 +113,8 @@ SET(Draft_objects
SET(Draft_view_providers
draftviewproviders/__init__.py
draftviewproviders/view_base.py
draftviewproviders/view_bezcurve.py
draftviewproviders/view_bspline.py
draftviewproviders/view_circulararray.py
draftviewproviders/view_clone.py
draftviewproviders/view_facebinder.py

View File

@@ -222,15 +222,15 @@ if FreeCAD.GuiUp:
from draftmake.make_bspline import make_bspline, makeBSpline
from draftobjects.bspline import BSpline, _BSpline
if FreeCAD.GuiUp:
# for compatibility with older versions
_ViewProviderBSpline = ViewProviderWire
from draftviewproviders.view_bspline import ViewProviderBSpline
from draftviewproviders.view_bspline import _ViewProviderBSpline
# bezcurve
from draftmake.make_bezcurve import make_bezcurve, makeBezCurve
from draftobjects.bezcurve import BezCurve, _BezCurve
if FreeCAD.GuiUp:
# for compatibility with older versions
_ViewProviderBezCurve = ViewProviderWire
from draftviewproviders.view_bezcurve import ViewProviderBezCurve
from draftviewproviders.view_bezcurve import _ViewProviderBezCurve
# clone
from draftmake.make_clone import make_clone, clone

View File

@@ -130,8 +130,8 @@ class DraftWorkbench(FreeCADGui.Workbench):
FreeCADGui.draftToolBar.Activated()
if hasattr(FreeCADGui, "Snapper"):
FreeCADGui.Snapper.show()
import draftutils.init_draft_statusbar as dsb
dsb.show_draft_statusbar()
import draftutils.init_draft_statusbar as dsb
dsb.show_draft_statusbar()
FreeCAD.Console.PrintLog("Draft workbench activated.\n")
def Deactivated(self):
@@ -140,8 +140,8 @@ class DraftWorkbench(FreeCADGui.Workbench):
FreeCADGui.draftToolBar.Deactivated()
if hasattr(FreeCADGui, "Snapper"):
FreeCADGui.Snapper.hide()
import draftutils.init_draft_statusbar as dsb
dsb.hide_draft_statusbar()
import draftutils.init_draft_statusbar as dsb
dsb.hide_draft_statusbar()
FreeCAD.Console.PrintLog("Draft workbench deactivated.\n")
def ContextMenu(self, recipient):

View File

@@ -30,7 +30,7 @@ that is displayed in a drawing page in the Drawing Workbench.
This command should be considered obsolete as the Drawing Workbench
is obsolete since 0.17.
A similar command is not planed for the TechDraw Workbench because
A similar command is not planned for the TechDraw Workbench because
it is not really necessary. TechDraw has its own set of tools
to create 2D projections of 2D and 3D objects.
"""

View File

@@ -134,7 +134,7 @@ class Move(gui_base_original.Modifier):
self.handle_mouse_click_event(arg)
def handle_mouse_move_event(self, arg):
"""Hande the mouse when moving."""
"""Handle the mouse when moving."""
for ghost in self.ghosts:
ghost.off()
self.point, ctrlPoint, info = gui_tool_utils.getPoint(self, arg)
@@ -150,7 +150,7 @@ class Move(gui_base_original.Modifier):
gui_tool_utils.redraw3DView()
def handle_mouse_click_event(self, arg):
"""Hande the mouse when the first button is clicked."""
"""Handle the mouse when the first button is clicked."""
if not self.ghosts:
self.set_ghosts()
if not self.point:

View File

@@ -22,14 +22,14 @@
# * USA *
# * *
# ***************************************************************************
"""Provides tools for offseting objects with the Draft Workbench.
"""Provides tools for offsetting objects with the Draft Workbench.
It mostly works on lines, polylines, and similar objects with
regular geometrical shapes, like rectangles.
"""
## @package gui_offset
# \ingroup DRAFT
# \brief Provides tools for offseting objects with the Draft Workbench.
# \brief Provides tools for offsetting objects with the Draft Workbench.
import math
from PySide.QtCore import QT_TRANSLATE_NOOP

View File

@@ -123,7 +123,7 @@ class Rotate(gui_base_original.Modifier):
self.handle_mouse_click_event(arg)
def handle_mouse_move_event(self, arg):
"""Hande the mouse when moving."""
"""Handle the mouse when moving."""
plane = App.DraftWorkingPlane
for ghost in self.ghosts:
@@ -175,7 +175,7 @@ class Rotate(gui_base_original.Modifier):
gui_tool_utils.redraw3DView()
def handle_mouse_click_event(self, arg):
"""Hande the mouse when the first button is clicked."""
"""Handle the mouse when the first button is clicked."""
if not self.point:
return
if self.step == 0:

View File

@@ -79,7 +79,7 @@ class Scale(gui_base_original.Modifier):
self.get_object_selection()
def get_object_selection(self):
"""Get object selection and proceed if succesful."""
"""Get object selection and proceed if successful."""
if Gui.Selection.getSelection():
return self.proceed()
self.ui.selectUi()

View File

@@ -36,8 +36,7 @@ from draftutils.translate import translate
from draftobjects.bezcurve import BezCurve
if App.GuiUp:
# from draftviewproviders.view_bezcurve import ViewProviderBezCurve
from draftviewproviders.view_wire import ViewProviderWire
from draftviewproviders.view_bezcurve import ViewProviderBezCurve
def make_bezcurve(pointslist, closed=False, placement=None, face=None, support=None, degree=None):

View File

@@ -35,9 +35,9 @@ from draftutils.utils import type_check
from draftutils.translate import translate
from draftobjects.bspline import BSpline
if App.GuiUp:
# from draftviewproviders.view_bspline import ViewProviderBSpline
from draftviewproviders.view_wire import ViewProviderWire
from draftviewproviders.view_bspline import ViewProviderBSpline
def make_bspline(pointslist, closed=False, placement=None, face=None, support=None):

View File

@@ -124,7 +124,7 @@ class DraftObject(object):
By default it does nothing.
Paramaters
Parameters
----------
obj : the scripted object.
This commonly may be of types `Part::Part2DObjectPython`,
@@ -140,7 +140,7 @@ class DraftObject(object):
By default it does nothing.
Paramaters
Parameters
----------
obj : the scripted object.
This commonly may be of types `Part::Part2DObjectPython`,

View File

@@ -155,7 +155,7 @@ class ViewProviderDraft(object):
Override this method to set up a custom scene.
Paramaters
Parameters
----------
vobj : the view provider of the scripted object.
This is `obj.ViewObject`.
@@ -196,7 +196,7 @@ class ViewProviderDraft(object):
By default it returns an empty list.
Paramaters
Parameters
----------
vobj : the view provider of the scripted object.
This is `obj.ViewObject`.
@@ -232,7 +232,7 @@ class ViewProviderDraft(object):
By default since they have the same names nothing needs to be done,
and it just returns the input `mode`.
Paramaters
Parameters
----------
str
A string defining a display mode such as
@@ -252,7 +252,7 @@ class ViewProviderDraft(object):
the properties `TextureImage`, `Pattern`, `DiffuseColor`,
and `PatternSize` change.
Paramaters
Parameters
----------
vobj : the view provider of the scripted object.
This is `obj.ViewObject`.
@@ -341,7 +341,7 @@ class ViewProviderDraft(object):
By default it does nothing.
Paramaters
Parameters
----------
vobj : the view provider of the scripted object.
This is `obj.ViewObject`.
@@ -361,7 +361,7 @@ class ViewProviderDraft(object):
::
Gui.runCommand('Draft_Edit')
Paramaters
Parameters
----------
vobj : the view provider of the scripted object.
This is `obj.ViewObject`.
@@ -374,7 +374,7 @@ class ViewProviderDraft(object):
Returns
-------
bool
It is `True` if `mode` is 0, and `Draft_Edit` ran succesfully.
It is `True` if `mode` is 0, and `Draft_Edit` ran successfully.
It is `False` otherwise.
"""
if mode == 0 and App.GuiUp: #remove guard after splitting every viewprovider
@@ -401,7 +401,7 @@ class ViewProviderDraft(object):
App.activeDraftCommand.finish()
Gui.Control.closeDialog()
Paramaters
Parameters
----------
vobj : the view provider of the scripted object.
This is `obj.ViewObject`.
@@ -487,7 +487,7 @@ _ViewProviderDraft = ViewProviderDraft
class ViewProviderDraftAlt(ViewProviderDraft):
"""A view provider that doesn't absorb its base object in the tree view.
The `claimChildren` method is overriden to return an empty list.
The `claimChildren` method is overridden to return an empty list.
"""
def __init__(self, vobj):
@@ -504,7 +504,7 @@ _ViewProviderDraftAlt = ViewProviderDraftAlt
class ViewProviderDraftPart(ViewProviderDraftAlt):
"""A view provider that displays a Part icon instead of a Draft icon.
The `getIcon` method is overriden to provide `Tree_Part.svg`.
The `getIcon` method is overridden to provide `Tree_Part.svg`.
"""
def __init__(self, vobj):

View File

@@ -0,0 +1,41 @@
# ***************************************************************************
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *
# * as published by the Free Software Foundation; either version 2 of *
# * the License, or (at your option) any later version. *
# * for detail see the LICENCE text file. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU Library General Public License for more details. *
# * *
# * You should have received a copy of the GNU Library General Public *
# * License along with this program; if not, write to the Free Software *
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# ***************************************************************************
"""Provides the view provider code for Bezier curve objects.
At the moment this view provider subclasses the Wire view provider,
and behaves the same as it. In the future this could change
if another behavior is desired.
"""
## @package view_bezier
# \ingroup DRAFT
# \brief Provides the view provider code for Bezier curve objects.
from draftviewproviders.view_wire import ViewProviderWire
class ViewProviderBezCurve(ViewProviderWire):
"""The view provider for the Bezier curve object."""
def __init__(self, vobj):
super(ViewProviderBezCurve, self).__init__(vobj)
_ViewProviderBezCurve = ViewProviderBezCurve

View File

@@ -0,0 +1,41 @@
# ***************************************************************************
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *
# * as published by the Free Software Foundation; either version 2 of *
# * the License, or (at your option) any later version. *
# * for detail see the LICENCE text file. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU Library General Public License for more details. *
# * *
# * You should have received a copy of the GNU Library General Public *
# * License along with this program; if not, write to the Free Software *
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# ***************************************************************************
"""Provides the view provider code for BSpline objects.
At the moment this view provider subclasses the Wire view provider,
and behaves the same as it. In the future this could change
if another behavior is desired.
"""
## @package view_bspline
# \ingroup DRAFT
# \brief Provides the view provider code for BSpline objects.
from draftviewproviders.view_wire import ViewProviderWire
class ViewProviderBSpline(ViewProviderWire):
"""The view provider for the BSpline object."""
def __init__(self, vobj):
super(ViewProviderBSpline, self).__init__(vobj)
_ViewProviderBSpline = ViewProviderBSpline

View File

@@ -187,7 +187,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
# mesh
def write_mesh(self, inpfile_split=None):
# write mesh to file
element_param = 1 # hightest element order only
element_param = 1 # highest element order only
group_param = False # do not write mesh group data
if inpfile_split is True:
write_name = "femesh"

View File

@@ -201,7 +201,7 @@ CylinderSurfaceFit::CylinderSurfaceFit()
/*!
* \brief CylinderSurfaceFit::CylinderSurfaceFit
* Set a pre-defined cylinder. Internal cylinder fits are not done, then.
* Set a predefined cylinder. Internal cylinder fits are not done, then.
*/
CylinderSurfaceFit::CylinderSurfaceFit(const Base::Vector3f& b, const Base::Vector3f& a, float r)
: basepoint(b)

View File

@@ -37,7 +37,7 @@ namespace Mesh
/*! The MeshTexture class.
This algorithm is useful to update the material after a mesh has been modified
by removing points or facets. If the coordinates of points have changed or if
new points have been added then a pre-defined color will be set.
new points have been added then a predefined color will be set.
@author Werner Mayer
*/
class MeshExport MeshTexture