From 27fc2e89fb4786f6c901d6d9ef42098abd71f9d8 Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Tue, 30 Jun 2020 21:50:24 -0500 Subject: [PATCH] Draft: add modules of draftobjects to the proper Doxygen group This includes `array`, `base`, `bezcurve`, `block`, `bspline`, `circle`, `clone`, `dimension`, `draft_annotation`, `draftlink`, `drawingview`, `ellipse`, `facebinder`, `fillet`, `label`, `patharray`, `point`, `pointarray`, `polygon`, `rectangle`, `shape2dview`, `shapestring`, `text`, `wire`, `wwproxy`. These are added to the `draftobjects` Doxygen group so that the functions and classes contained in each module are listed appropriately in the automatically generated documentation. --- src/Mod/Draft/draftobjects/array.py | 10 +++++-- src/Mod/Draft/draftobjects/base.py | 21 +++++++++----- src/Mod/Draft/draftobjects/bezcurve.py | 17 ++++++----- src/Mod/Draft/draftobjects/block.py | 13 ++++++--- src/Mod/Draft/draftobjects/bspline.py | 17 ++++++----- src/Mod/Draft/draftobjects/circle.py | 17 ++++++----- src/Mod/Draft/draftobjects/clone.py | 13 +++++---- src/Mod/Draft/draftobjects/dimension.py | 10 +++++-- .../Draft/draftobjects/draft_annotation.py | 10 +++++-- src/Mod/Draft/draftobjects/draftlink.py | 11 +++++-- src/Mod/Draft/draftobjects/drawingview.py | 23 +++++++++++---- src/Mod/Draft/draftobjects/ellipse.py | 17 ++++++----- src/Mod/Draft/draftobjects/facebinder.py | 16 ++++++---- src/Mod/Draft/draftobjects/fillet.py | 7 ++++- src/Mod/Draft/draftobjects/label.py | 11 +++++-- src/Mod/Draft/draftobjects/patharray.py | 12 ++++++-- src/Mod/Draft/draftobjects/point.py | 26 ++++++++--------- src/Mod/Draft/draftobjects/pointarray.py | 14 ++++++--- src/Mod/Draft/draftobjects/polygon.py | 15 +++++----- src/Mod/Draft/draftobjects/rectangle.py | 14 +++++---- src/Mod/Draft/draftobjects/shape2dview.py | 29 ++++++++++--------- src/Mod/Draft/draftobjects/shapestring.py | 21 +++++++------- src/Mod/Draft/draftobjects/text.py | 10 +++++-- src/Mod/Draft/draftobjects/wire.py | 18 ++++++------ src/Mod/Draft/draftobjects/wpproxy.py | 11 ++++--- 25 files changed, 240 insertions(+), 143 deletions(-) diff --git a/src/Mod/Draft/draftobjects/array.py b/src/Mod/Draft/draftobjects/array.py index d6fb491f36..946d474804 100644 --- a/src/Mod/Draft/draftobjects/array.py +++ b/src/Mod/Draft/draftobjects/array.py @@ -21,16 +21,18 @@ # * USA * # * * # *************************************************************************** -"""Provides the object code for the Draft Array object. +"""Provides the object code for the Array object. The `Array` class currently handles three types of arrays, orthogonal, polar, and circular. In the future, probably they should be split in separate classes so that they are easier to manage. """ ## @package array -# \ingroup DRAFT -# \brief Provides the object code for the Draft Array object. +# \ingroup draftobjects +# \brief Provides the object code for the Array object. +## \addtogroup draftobjects +# @{ import math from PySide.QtCore import QT_TRANSLATE_NOOP @@ -527,3 +529,5 @@ def circ_placements(base_placement, placements.append(npl) return placements + +## @} diff --git a/src/Mod/Draft/draftobjects/base.py b/src/Mod/Draft/draftobjects/base.py index fab8375b47..e6c691bc13 100644 --- a/src/Mod/Draft/draftobjects/base.py +++ b/src/Mod/Draft/draftobjects/base.py @@ -20,11 +20,14 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for the basic Draft object. -""" +"""Provides the object code for the base Draft object.""" ## @package base -# \ingroup DRAFT -# \brief This module provides the object code for the basic Draft object. +# \ingroup draftobjects +# \brief Provides the object code for the base Draft object. + +## \addtogroup draftobjects +# @{ + class DraftObject(object): """The base class for Draft objects. @@ -71,6 +74,7 @@ class DraftObject(object): This class attribute is accessible through the `Proxy` object: `obj.Proxy.Type`. """ + def __init__(self, obj, tp="Unknown"): # This class is assigned to the Proxy attribute if obj: @@ -109,7 +113,7 @@ class DraftObject(object): self.Type = state Parameters - --------- + ---------- state : state A serialized object. """ @@ -117,7 +121,7 @@ class DraftObject(object): self.Type = state def execute(self, obj): - """This method is run when the object is created or recomputed. + """Run this method when the object is created or recomputed. Override this method to produce effects when the object is newly created, and whenever the document is recomputed. @@ -133,7 +137,7 @@ class DraftObject(object): pass def onChanged(self, obj, prop): - """This method is run when a property is changed. + """Run this method when a property is changed. Override this method to handle the behavior of the object depending on changes that occur to its properties. @@ -152,4 +156,7 @@ class DraftObject(object): pass +# Alias for compatibility with v0.18 and earlier _DraftObject = DraftObject + +## @} diff --git a/src/Mod/Draft/draftobjects/bezcurve.py b/src/Mod/Draft/draftobjects/bezcurve.py index 984666c56b..60f0623055 100644 --- a/src/Mod/Draft/draftobjects/bezcurve.py +++ b/src/Mod/Draft/draftobjects/bezcurve.py @@ -20,17 +20,17 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft BezCurve. -""" +"""Provides the object code for the BezCurve object.""" ## @package bezcurve -# \ingroup DRAFT -# \brief This module provides the object code for Draft BezCurve. +# \ingroup draftobjects +# \brief Provides the object code for the BezCurve object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App - -from draftutils.utils import get_param +import draftutils.utils as utils from draftobjects.base import DraftObject @@ -69,7 +69,7 @@ class BezCurve(DraftObject): "The area of this object") obj.addProperty("App::PropertyArea", "Area", "Draft", _tip) - obj.MakeFace = get_param("fillmode", True) + obj.MakeFace = utils.get_param("fillmode", True) obj.Closed = False obj.Degree = 3 obj.Continuity = [] @@ -193,4 +193,7 @@ class BezCurve(DraftObject): return pn + knot +# Alias for compatibility with v0.18 and earlier _BezCurve = BezCurve + +## @} diff --git a/src/Mod/Draft/draftobjects/block.py b/src/Mod/Draft/draftobjects/block.py index 23e63835c2..fbcfd17b67 100644 --- a/src/Mod/Draft/draftobjects/block.py +++ b/src/Mod/Draft/draftobjects/block.py @@ -20,12 +20,13 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Block. -""" +"""Provides the object code for the Block object.""" ## @package block -# \ingroup DRAFT -# \brief This module provides the object code for Draft Block. +# \ingroup draftobjects +# \brief Provides the object code for the Block object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP from draftobjects.base import DraftObject @@ -53,4 +54,8 @@ class Block(DraftObject): obj.Placement = plm obj.positionBySupport() + +# Alias for compatibility with v0.18 and earlier _Block = Block + +## @} diff --git a/src/Mod/Draft/draftobjects/bspline.py b/src/Mod/Draft/draftobjects/bspline.py index 223c5d8308..d16ffb4ec2 100644 --- a/src/Mod/Draft/draftobjects/bspline.py +++ b/src/Mod/Draft/draftobjects/bspline.py @@ -20,17 +20,17 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft BSpline. -""" +"""Provides the object code for the BSpline object.""" ## @package bspline -# \ingroup DRAFT -# \brief This module provides the object code for Draft BSpline. +# \ingroup draftobjects +# \brief Provides the object code for the BSpline object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App - -from draftutils.utils import get_param +import draftutils.utils as utils from draftobjects.base import DraftObject @@ -56,7 +56,7 @@ class BSpline(DraftObject): _tip = QT_TRANSLATE_NOOP("App::Property", "The area of this object") obj.addProperty("App::PropertyArea","Area", "Draft", _tip) - obj.MakeFace = get_param("fillmode",True) + obj.MakeFace = utils.get_param("fillmode",True) obj.Closed = False obj.Points = [] self.assureProperties(obj) @@ -133,4 +133,7 @@ class BSpline(DraftObject): obj.positionBySupport() +# Alias for compatibility with v0.18 and earlier _BSpline = BSpline + +## @} diff --git a/src/Mod/Draft/draftobjects/circle.py b/src/Mod/Draft/draftobjects/circle.py index df6f91dfe1..a3a520aa5b 100644 --- a/src/Mod/Draft/draftobjects/circle.py +++ b/src/Mod/Draft/draftobjects/circle.py @@ -20,17 +20,17 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Circle. -""" +"""Provides the object code for the Circle object.""" ## @package circle -# \ingroup DRAFT -# \brief This module provides the object code for Draft Circle. +# \ingroup draftobjects +# \brief Provides the object code for the Circle object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App - -from draftutils.utils import get_param +import draftutils.utils as utils from draftobjects.base import DraftObject @@ -62,7 +62,7 @@ class Circle(DraftObject): obj.addProperty("App::PropertyArea", "Area", "Draft", _tip) - obj.MakeFace = get_param("fillmode", True) + obj.MakeFace = utils.get_param("fillmode", True) def execute(self, obj): @@ -95,4 +95,7 @@ class Circle(DraftObject): obj.positionBySupport() +# Alias for compatibility with v0.18 and earlier _Circle = Circle + +## @} diff --git a/src/Mod/Draft/draftobjects/clone.py b/src/Mod/Draft/draftobjects/clone.py index c0026d7f14..2ea79952e4 100644 --- a/src/Mod/Draft/draftobjects/clone.py +++ b/src/Mod/Draft/draftobjects/clone.py @@ -20,16 +20,16 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Clone. -""" +"""Provides the object code for the Clone object.""" ## @package clone -# \ingroup DRAFT -# \brief This module provides the object code for Draft Clone. +# \ingroup draftobjects +# \brief Provides the object code for the Clone object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App - import DraftVecUtils from draftobjects.base import DraftObject @@ -131,4 +131,7 @@ class Clone(DraftObject): return None +# Alias for compatibility with v0.18 and earlier _Clone = Clone + +## @} diff --git a/src/Mod/Draft/draftobjects/dimension.py b/src/Mod/Draft/draftobjects/dimension.py index 10b6be95fd..a7143a655b 100644 --- a/src/Mod/Draft/draftobjects/dimension.py +++ b/src/Mod/Draft/draftobjects/dimension.py @@ -23,7 +23,7 @@ # * USA * # * * # *************************************************************************** -"""Provides the object code for the Draft Dimensions. +"""Provides the object code for the dimension objects. This includes the `LinearDimension` and `AgularDimension`. The first one measures a distance between two points or vertices @@ -95,9 +95,11 @@ a more generic base class, while at the same time improve the way the link properties are used. """ ## @package dimension -# \ingroup DRAFT -# \brief Provides the object code for the Draft Dimensions. +# \ingroup draftobjects +# \brief Provides the object code for the dimension objects. +## \addtogroup draftobjects +# @{ import math from PySide.QtCore import QT_TRANSLATE_NOOP @@ -659,3 +661,5 @@ def measure_two_obj_angles(link_sub_1, link_sub_2): # Alias for compatibility with v0.18 and earlier _AngularDimension = AngularDimension + +## @} diff --git a/src/Mod/Draft/draftobjects/draft_annotation.py b/src/Mod/Draft/draftobjects/draft_annotation.py index e243559331..c7c3d43d76 100644 --- a/src/Mod/Draft/draftobjects/draft_annotation.py +++ b/src/Mod/Draft/draftobjects/draft_annotation.py @@ -21,7 +21,7 @@ # * USA * # * * # *************************************************************************** -"""Provide the basic object code for all Draft annotation objects. +"""Provides the object code for all annotation type objects. This is used by many objects that show dimensions and text created on screen through Coin (pivy). @@ -32,9 +32,11 @@ through Coin (pivy). - Text """ ## @package draft_annotation -# \ingroup DRAFT -# \brief Provide the basic object code for all Draft annotation objects. +# \ingroup draftobjects +# \brief Provides the object code for all annotation type objects. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP from draftutils.messages import _wrn @@ -152,3 +154,5 @@ class DraftAnnotation(object): Does nothing. """ return + +## @} diff --git a/src/Mod/Draft/draftobjects/draftlink.py b/src/Mod/Draft/draftobjects/draftlink.py index e137b551cb..da039b6142 100644 --- a/src/Mod/Draft/draftobjects/draftlink.py +++ b/src/Mod/Draft/draftobjects/draftlink.py @@ -18,7 +18,7 @@ # * USA * # * * # *************************************************************************** -"""Provides the object code for the Draft Link object. +"""Provides the base class for Link objects used by other objects. This class was created by realthunder during the `LinkMerge` to demonstrate how to use the `App::Link` objects to create @@ -31,8 +31,8 @@ on how the properties are being set, and how the code interacts with the arrays that use it. """ ## @package draftlink -# \ingroup DRAFT -# \brief Provides the object code for the Draft Link object. +# \ingroup draftobjects +# \brief Provides the base class for Link objects used by other objects. import lazy_loader.lazy_loader as lz from PySide.QtCore import QT_TRANSLATE_NOOP @@ -46,6 +46,9 @@ from draftobjects.base import DraftObject Part = lz.LazyLoader("Part", globals(), "Part") DraftGeomUtils = lz.LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils") +## \addtogroup draftobjects +# @{ + class DraftLink(DraftObject): """New class to use the App::Link objects in arrays. @@ -224,3 +227,5 @@ class DraftLink(DraftObject): # Alias for compatibility with old versions of v0.19 _DraftLink = DraftLink + +## @} diff --git a/src/Mod/Draft/draftobjects/drawingview.py b/src/Mod/Draft/draftobjects/drawingview.py index 94b7840eb9..a46c553897 100644 --- a/src/Mod/Draft/draftobjects/drawingview.py +++ b/src/Mod/Draft/draftobjects/drawingview.py @@ -20,19 +20,29 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for the Draft DrawingView object. -This module is obsolete, since Drawing was substituted by TechDraw. +"""Provides the object code for the DrawingView object (OBSOLETE). + +This module is obsolete, since the Drawing Workbench stopped +being developed in v0.17. +The TechDraw Workbench replaces Drawing, and it no longer requires +a `DrawingView` object to display objects in a drawing sheet. + +This module is still provided in order to be able to open older files +that use this `DrawingView` object. However, a GUI tool to create +this object should no longer be available. """ ## @package drawingview -# \ingroup DRAFT -# \brief This module provides the object code for the Draft DrawingView object. +# \ingroup draftobjects +# \brief Provides the object code for the DrawingView object (OBSOLETE). +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import getSVG - import draftutils.utils as utils import draftutils.groups as groups + from draftobjects.base import DraftObject @@ -124,4 +134,7 @@ class DrawingView(DraftObject): return utils.getDXF(obj) +# Alias for compatibility with v0.18 and earlier _DrawingView = DrawingView + +## @} diff --git a/src/Mod/Draft/draftobjects/ellipse.py b/src/Mod/Draft/draftobjects/ellipse.py index 29c98bb3e2..fb6cdc8891 100644 --- a/src/Mod/Draft/draftobjects/ellipse.py +++ b/src/Mod/Draft/draftobjects/ellipse.py @@ -20,17 +20,17 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Ellipse. -""" +"""Provides the object code for the Ellipse object.""" ## @package ellipse -# \ingroup DRAFT -# \brief This module provides the object code for Draft Ellipse. +# \ingroup draftobjects +# \brief Provides the object code for the Ellipse object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App - -from draftutils.utils import get_param +import draftutils.utils as utils from draftobjects.base import DraftObject @@ -60,7 +60,7 @@ class Ellipse(DraftObject): _tip = QT_TRANSLATE_NOOP("App::Property","Area of this object") obj.addProperty("App::PropertyArea", "Area","Draft", _tip) - obj.MakeFace = get_param("fillmode",True) + obj.MakeFace = utils.get_param("fillmode",True) def execute(self, obj): import Part @@ -93,4 +93,7 @@ class Ellipse(DraftObject): obj.positionBySupport() +# Alias for compatibility with v0.18 and earlier _Ellipse = Ellipse + +## @} diff --git a/src/Mod/Draft/draftobjects/facebinder.py b/src/Mod/Draft/draftobjects/facebinder.py index de4609dc8e..7492a7ae62 100644 --- a/src/Mod/Draft/draftobjects/facebinder.py +++ b/src/Mod/Draft/draftobjects/facebinder.py @@ -20,16 +20,17 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Facebinder. -""" +"""Provides the object code for the Facebinder object.""" ## @package facebinder -# \ingroup DRAFT -# \brief This module provides the object code for Draft Facebinder. +# \ingroup draftobjects +# \brief Provides the object code for the Facebinder object. + +## \addtogroup draftobjects +# @{ +from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App -from PySide.QtCore import QT_TRANSLATE_NOOP - from draftobjects.base import DraftObject @@ -133,4 +134,7 @@ class Facebinder(DraftObject): self.execute(obj) +# Alias for compatibility with v0.18 and earlier _Facebinder = Facebinder + +## @} diff --git a/src/Mod/Draft/draftobjects/fillet.py b/src/Mod/Draft/draftobjects/fillet.py index b42f40c637..9452220bd4 100644 --- a/src/Mod/Draft/draftobjects/fillet.py +++ b/src/Mod/Draft/draftobjects/fillet.py @@ -20,13 +20,16 @@ # *************************************************************************** """Provides the object code for the Fillet object.""" ## @package fillet -# \ingroup DRAFT +# \ingroup draftobjects # \brief Provides the object code for the Fillet object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App import draftobjects.base as base + from draftutils.messages import _msg @@ -121,3 +124,5 @@ class Fillet(base.DraftObject): """ if prop in "FilletRadius": self._update_radius(obj, obj.FilletRadius) + +## @} diff --git a/src/Mod/Draft/draftobjects/label.py b/src/Mod/Draft/draftobjects/label.py index 036af75187..88f7c00b9a 100644 --- a/src/Mod/Draft/draftobjects/label.py +++ b/src/Mod/Draft/draftobjects/label.py @@ -23,11 +23,13 @@ # * USA * # * * # *************************************************************************** -"""Provide the object code for Draft Label objects.""" +"""Provides the object code for the Label object.""" ## @package label -# \ingroup DRAFT -# \brief Provide the object code for Draft Label objects. +# \ingroup draftobjects +# \brief Provides the object code for the Label object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App @@ -425,3 +427,6 @@ def _get_area(target, subelement): def _get_volume(target): volume = U.Quantity(target.Shape.Volume, U.Volume).UserString return [volume.replace("^3", "³")] + + +## @} diff --git a/src/Mod/Draft/draftobjects/patharray.py b/src/Mod/Draft/draftobjects/patharray.py index 135a6d6db8..c1bcbde9ee 100644 --- a/src/Mod/Draft/draftobjects/patharray.py +++ b/src/Mod/Draft/draftobjects/patharray.py @@ -25,7 +25,7 @@ # * USA * # * * # *************************************************************************** -"""Provides the object code for the Draft PathArray object. +"""Provides the object code for the PathArray object. The copies will be placed along a path like a polyline, spline, or bezier curve, and along the selected subelements. @@ -60,8 +60,8 @@ objects. Therefore, the first solution is simpler, that is, using a single property of type `App::PropertyLinkSub`. """ ## @package patharray -# \ingroup DRAFT -# \brief Provides the object code for the Draft PathArray object. +# \ingroup draftobjects +# \brief Provides the object code for the PathArray object. import FreeCAD as App import DraftVecUtils @@ -76,6 +76,9 @@ from draftobjects.draftlink import DraftLink Part = lz.LazyLoader("Part", globals(), "Part") DraftGeomUtils = lz.LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils") +## \addtogroup draftobjects +# @{ + class PathArray(DraftLink): """The Draft Path Array object. @@ -428,6 +431,7 @@ class PathArray(DraftLink): _wrn("v0.19, " + obj.Label + ", " + _tr(_info)) +# Alias for compatibility with v0.18 and earlier _PathArray = PathArray @@ -617,3 +621,5 @@ def get_parameter_from_v0(edge, offset): getParameterFromV0 = get_parameter_from_v0 + +## @} diff --git a/src/Mod/Draft/draftobjects/point.py b/src/Mod/Draft/draftobjects/point.py index f9eaa089c8..24bc6fab08 100644 --- a/src/Mod/Draft/draftobjects/point.py +++ b/src/Mod/Draft/draftobjects/point.py @@ -20,26 +20,24 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Point. -""" +"""Provides the object code for the Point object.""" ## @package point -# \ingroup DRAFT -# \brief This module provides the object code for Draft Point. +# \ingroup draftobjects +# \brief Provides the object code for the Point object. +## \addtogroup draftobjects +# @{ import math - -import FreeCAD as App - from PySide.QtCore import QT_TRANSLATE_NOOP -from draftutils.utils import get_param +import FreeCAD as App from draftobjects.base import DraftObject class Point(DraftObject): - """The Draft Point object. - """ + """The Draft Point object.""" + def __init__(self, obj, x=0, y=0, z=0): super(Point, self).__init__(obj, "Point") @@ -51,13 +49,12 @@ class Point(DraftObject): _tip = QT_TRANSLATE_NOOP("App::Property", "Z Location") obj.addProperty("App::PropertyDistance", "Z", "Draft", _tip) - + obj.X = x obj.Y = y obj.Z = z - mode = 2 - obj.setEditorMode('Placement',mode) + obj.setPropertyStatus('Placement', 'Hidden') def execute(self, obj): import Part @@ -68,4 +65,7 @@ class Point(DraftObject): obj.Z.Value) +# Alias for compatibility with v0.18 and earlier _Point = Point + +## @} diff --git a/src/Mod/Draft/draftobjects/pointarray.py b/src/Mod/Draft/draftobjects/pointarray.py index 232205e0f9..e01f6030a8 100644 --- a/src/Mod/Draft/draftobjects/pointarray.py +++ b/src/Mod/Draft/draftobjects/pointarray.py @@ -22,7 +22,7 @@ # * USA * # * * # *************************************************************************** -"""Provides the object code for the Draft PointArray object. +"""Provides the object code for the PointArray object. To Do ----- @@ -34,14 +34,14 @@ from the vertices of any object with a `Part::TopoShape` (2D or 3D). See the `get_point_list` function for more information. """ ## @package pointarray -# \ingroup DRAFT -# \brief Provides the object code for the Draft PointArray object. +# \ingroup draftobjects +# \brief Provides the object code for the PointArray object. +import lazy_loader.lazy_loader as lz from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App import draftutils.utils as utils -import lazy_loader.lazy_loader as lz from draftutils.messages import _wrn, _err from draftutils.translate import translate, _tr @@ -50,6 +50,9 @@ from draftobjects.base import DraftObject # Delay import of module until first use because it is heavy Part = lz.LazyLoader("Part", globals(), "Part") +## \addtogroup draftobjects +# @{ + class PointArray(DraftObject): """The Draft Point Array object.""" @@ -293,4 +296,7 @@ def build_copies(base_object, pt_list=None, placement=App.Placement()): return shape +# Alias for compatibility with v0.18 and earlier _PointArray = PointArray + +## @} diff --git a/src/Mod/Draft/draftobjects/polygon.py b/src/Mod/Draft/draftobjects/polygon.py index 6d1efa98e4..7ef39dfaa2 100644 --- a/src/Mod/Draft/draftobjects/polygon.py +++ b/src/Mod/Draft/draftobjects/polygon.py @@ -20,22 +20,20 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Polygon. -""" +"""Provides the object code for the Polygon object.""" ## @package polygon -# \ingroup DRAFT -# \brief This module provides the object code for Draft Polygon. +# \ingroup draftobjects +# \brief Provides the object code for the Polygon object. +## \addtogroup draftobjects +# @{ import math - from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App - import DraftGeomUtils from draftutils.utils import get_param - from draftobjects.base import DraftObject @@ -119,4 +117,7 @@ class Polygon(DraftObject): obj.positionBySupport() +# Alias for compatibility with v0.18 and earlier _Polygon = Polygon + +## @} diff --git a/src/Mod/Draft/draftobjects/rectangle.py b/src/Mod/Draft/draftobjects/rectangle.py index 0e78e4a316..27dac7cf49 100644 --- a/src/Mod/Draft/draftobjects/rectangle.py +++ b/src/Mod/Draft/draftobjects/rectangle.py @@ -20,20 +20,19 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Rectangle. -""" +"""Provides the object code for the Rectangle object.""" ## @package rectangle -# \ingroup DRAFT -# \brief This module provides the object code for Draft Rectangle. +# \ingroup draftobjects +# \brief Provides the object code for the Rectangle object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App - import DraftGeomUtils from draftutils.utils import get_param - from draftobjects.base import DraftObject @@ -169,4 +168,7 @@ class Rectangle(DraftObject): obj.positionBySupport() +# Alias for compatibility with v0.18 and earlier _Rectangle = Rectangle + +## @} diff --git a/src/Mod/Draft/draftobjects/shape2dview.py b/src/Mod/Draft/draftobjects/shape2dview.py index 8f85da166c..6cf5167ce8 100644 --- a/src/Mod/Draft/draftobjects/shape2dview.py +++ b/src/Mod/Draft/draftobjects/shape2dview.py @@ -1,4 +1,4 @@ -2# *************************************************************************** +# *************************************************************************** # * Copyright (c) 2009, 2010 Yorik van Havre * # * Copyright (c) 2009, 2010 Ken Cline * # * Copyright (c) 2020 FreeCAD Developers * @@ -20,22 +20,22 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Shape2dView. -""" +"""Provides the object code for the Shape2dView object.""" ## @package shape2dview -# \ingroup DRAFT -# \brief This module provides the object code for Draft Shape2dView. +# \ingroup draftobjects +# \brief Provides the object code for the Shape2dView object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App - import DraftVecUtils import draftutils.utils as utils -import draftutils.groups as u_groups import draftutils.gui_utils as gui_utils -from draftutils.translate import translate +import draftutils.groups as groups +from draftutils.translate import translate from draftobjects.base import DraftObject @@ -111,13 +111,13 @@ class Shape2DView(DraftObject): "returns projected edges from a shape and a direction" import Part, Drawing, DraftGeomUtils edges = [] - groups = Drawing.projectEx(shape, direction) - for g in groups[0:5]: + _groups = Drawing.projectEx(shape, direction) + for g in _groups[0:5]: if g: edges.append(g) if hasattr(obj,"HiddenLines"): if obj.HiddenLines: - for g in groups[5:]: + for g in _groups[5:]: edges.append(g) #return Part.makeCompound(edges) if hasattr(obj,"Tessellation") and obj.Tessellation: @@ -156,7 +156,7 @@ class Shape2DView(DraftObject): if hasattr(obj.Base,"OnlySolids"): onlysolids = obj.Base.OnlySolids import Arch, Part, Drawing - objs = u_groups.get_group_contents(objs, walls=True) + objs = groups.get_group_contents(objs, walls=True) objs = gui_utils.remove_hidden(objs) shapes = [] if hasattr(obj,"FuseArch") and obj.FuseArch: @@ -247,7 +247,7 @@ class Shape2DView(DraftObject): elif obj.Base.isDerivedFrom("App::DocumentObjectGroup"): shapes = [] - objs = u_groups.get_group_contents(obj.Base) + objs = groups.get_group_contents(obj.Base) for o in objs: if hasattr(o,'Shape'): if o.Shape: @@ -280,4 +280,7 @@ class Shape2DView(DraftObject): obj.Placement = pl +# Alias for compatibility with v0.18 and earlier _Shape2DView = Shape2DView + +## @} diff --git a/src/Mod/Draft/draftobjects/shapestring.py b/src/Mod/Draft/draftobjects/shapestring.py index ef627ccbea..022e055fe6 100644 --- a/src/Mod/Draft/draftobjects/shapestring.py +++ b/src/Mod/Draft/draftobjects/shapestring.py @@ -20,22 +20,20 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Shapestring. -""" +"""Provides the object code for the ShapeString object.""" ## @package shapestring -# \ingroup DRAFT -# \brief This module provides the object code for Draft Shapestring. +# \ingroup draftobjects +# \brief Provides the object code for the ShapeString object. +## \addtogroup draftobjects +# @{ import sys - -import FreeCAD as App - from PySide.QtCore import QT_TRANSLATE_NOOP -from draftutils.utils import epsilon +import FreeCAD as App +import draftutils.utils as utils from draftutils.translate import translate - from draftobjects.base import DraftObject @@ -174,7 +172,7 @@ class ShapeString(DraftObject): bcfA = biggest.common(face).Area fA = face.Area difA = abs(bcfA - fA) - eps = epsilon() + eps = utils.epsilon() # if biggest.common(face).Area == face.Area: if difA <= eps: # close enough to zero # biggest completely overlaps current face ==> cut @@ -196,4 +194,7 @@ class ShapeString(DraftObject): return ret +# Alias for compatibility with v0.18 and earlier _ShapeString = ShapeString + +## @} diff --git a/src/Mod/Draft/draftobjects/text.py b/src/Mod/Draft/draftobjects/text.py index 42c258c7cb..2996c7c417 100644 --- a/src/Mod/Draft/draftobjects/text.py +++ b/src/Mod/Draft/draftobjects/text.py @@ -21,11 +21,13 @@ # * USA * # * * # *************************************************************************** -"""Provide the object code for Draft Text objects.""" +"""Provides the object code for the Text object.""" ## @package text -# \ingroup DRAFT -# \brief Provide the object code for Draft Text objects. +# \ingroup draftobjects +# \brief Provides the object code for the Text object. +## \addtogroup draftobjects +# @{ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App @@ -77,3 +79,5 @@ class Text(DraftAnnotation): # Alias for compatibility with v0.18 and earlier DraftText = Text + +## @} diff --git a/src/Mod/Draft/draftobjects/wire.py b/src/Mod/Draft/draftobjects/wire.py index f36e93439f..d4a0731283 100644 --- a/src/Mod/Draft/draftobjects/wire.py +++ b/src/Mod/Draft/draftobjects/wire.py @@ -20,27 +20,24 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft Wire. -""" +"""Provides the object code for the Wire (Polyline) object.""" ## @package wire -# \ingroup DRAFT -# \brief This module provides the object code for Draft Wire. +# \ingroup draftobjects +# \brief Provides the object code for the Wire (Polyline) object. +## \addtogroup draftobjects +# @{ import math +from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCAD as App - import DraftGeomUtils import DraftVecUtils -from PySide.QtCore import QT_TRANSLATE_NOOP - from draftutils.utils import get_param - from draftobjects.base import DraftObject - class Wire(DraftObject): """The Wire object""" @@ -248,4 +245,7 @@ class Wire(DraftObject): obj.End = displayfpend +# Alias for compatibility with v0.18 and earlier _Wire = Wire + +## @} diff --git a/src/Mod/Draft/draftobjects/wpproxy.py b/src/Mod/Draft/draftobjects/wpproxy.py index 15ee3552c7..84b668cf91 100644 --- a/src/Mod/Draft/draftobjects/wpproxy.py +++ b/src/Mod/Draft/draftobjects/wpproxy.py @@ -20,12 +20,13 @@ # * USA * # * * # *************************************************************************** -"""This module provides the object code for Draft WorkingPlaneProxy. -""" +"""Provides the object code for the WorkingPlaneProxy object.""" ## @package wpproxy -# \ingroup DRAFT -# \brief This module provides the object code for Draft WorkingPlaneProxy. +# \ingroup draftobjects +# \brief Provides the object code for the WorkingPlaneProxy object. +## \addtogroup draftobjects +# @{ import FreeCAD as App from PySide.QtCore import QT_TRANSLATE_NOOP @@ -72,3 +73,5 @@ class WorkingPlaneProxy: def __setstate__(self,state): if state: self.Type = state + +## @}