Skip to content

Commit

Permalink
Draft: migrate Layer object and function to the new structure
Browse files Browse the repository at this point in the history
Move `make_layer` to `draftmake`; `Layer` and `LayerContainer`
to `draftobjects`; `ViewProviderLayer` and `ViewProviderLayerContainer`
to `draftviewproviders`.

The make function and the classes are imported in `Draft.py`
to support the usage of the older `VisGroup`.
  • Loading branch information
vocx-fc authored and yorikvanhavre committed Jul 20, 2020
1 parent cdc6c5f commit 831e517
Show file tree
Hide file tree
Showing 8 changed files with 893 additions and 430 deletions.
3 changes: 3 additions & 0 deletions src/Mod/Draft/CMakeLists.txt
Expand Up @@ -117,6 +117,7 @@ SET(Draft_make_functions
draftmake/make_facebinder.py
draftmake/make_fillet.py
draftmake/make_label.py
draftmake/make_layer.py
draftmake/make_line.py
draftmake/make_orthoarray.py
draftmake/make_patharray.py
Expand Down Expand Up @@ -150,6 +151,7 @@ SET(Draft_objects
draftobjects/fillet.py
draftobjects/draftlink.py
draftobjects/label.py
draftobjects/layer.py
draftobjects/dimension.py
draftobjects/patharray.py
draftobjects/point.py
Expand Down Expand Up @@ -179,6 +181,7 @@ SET(Draft_view_providers
draftviewproviders/view_fillet.py
draftviewproviders/view_draftlink.py
draftviewproviders/view_label.py
draftviewproviders/view_layer.py
draftviewproviders/view_dimension.py
draftviewproviders/view_point.py
draftviewproviders/view_rectangle.py
Expand Down
13 changes: 9 additions & 4 deletions src/Mod/Draft/Draft.py
Expand Up @@ -368,10 +368,15 @@
if App.GuiUp:
from draftviewproviders.view_fillet import ViewProviderFillet

# Layers
from DraftLayer import Layer as _VisGroup
from DraftLayer import ViewProviderLayer as _ViewProviderVisGroup
from DraftLayer import makeLayer
from draftobjects.layer import (Layer,
_VisGroup)

from draftmake.make_layer import (make_layer,
makeLayer)

if App.GuiUp:
from draftviewproviders.view_layer import (ViewProviderLayer,
_ViewProviderVisGroup)

# Annotation objects
from draftobjects.dimension import (LinearDimension,
Expand Down
8 changes: 5 additions & 3 deletions src/Mod/Draft/DraftFillet.py
Expand Up @@ -45,16 +45,18 @@
with the 0.19 development version.
Since this module is only used to migrate older objects, it is only temporary,
and will be removed after one year of the original introduction of the tool,
that is, in August 2020.
and will be removed after one year, that is, in January 2021.
The explanation of the migration methods is in the wiki page:
https://wiki.freecadweb.org/Scripted_objects_migration
"""
## @package DraftFillet
# \ingroup DRAFT
# \brief Provides Fillet class for objects created with a prototype version.
#
# This module is only required to migrate old objects created
# from August 2019 to February 2020. It will be removed definitely
# in August 2020, as the new Fillet object should be available.
# in January 2021, as the new Fillet object should be available.

import FreeCAD as App
import draftobjects.fillet
Expand Down

0 comments on commit 831e517

Please sign in to comment.