Commit Graph

2272 Commits

Author SHA1 Message Date
paul lee
102cfb4a71 [Draft - geotuils.offsets] Fix To Work with Sketch
Forum Discussion - https://forum.freecadweb.org/viewtopic.php?f=23&t=48852&p=419209#p419209
2020-08-11 11:10:42 +02:00
paul lee
7a41078624 [Draft - geoutils.offsets] Fix Circle and Arc Offset Direction
Forum Discussion - https://forum.freecadweb.org/viewtopic.php?f=23&t=48852#p418903
2020-08-11 11:10:42 +02:00
vocx-fc
d51955f658 Draft: makeLayer, small adjustments to keep compatibility
This follows from the migration of the Layer code
done in 831e517717.

In the older `makeLayer` function, the parameters `drawstyle`
and `transparency` could be `None`; in the new `make_layer` function,
`drawstyle` must be an explicit string, and `transparency`
must be a number. If not provided, they use default values.
2020-08-11 11:08:48 +02:00
luz paz
59e3ea096e Crowdin: Merge new translations [skip-ci] 2020-08-07 17:17:35 +02:00
wmayer
47d570716c LGTM: [skip ci] fix: Non-virtual destructor in base class 2020-07-24 19:30:12 +02:00
wmayer
1a16cde1f5 Coverity: Structurally/Logically dead code 2020-07-20 17:34:28 +02:00
wmayer
433ec2d6e4 Coverity: Copied into fixed size buffer 2020-07-20 17:34:25 +02:00
vocx-fc
d106be0b9b Draft: add Draft Layer unit tests
Also create a test `Layer` in the `draft_test_objects` script.
2020-07-20 14:21:15 +02:00
vocx-fc
831e517717 Draft: migrate Layer object and function to the new structure
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`.
2020-07-20 14:21:15 +02:00
vocx-fc
cdc6c5f541 Draft: move GuiCommand for Draft Layer to its own module 2020-07-20 14:21:15 +02:00
vocx-fc
7566bd1343 Draft: add module getSVG to the proper Doxygen group
Only one module `getSVG` added to the `getSVG` Doxygen group.

Probably at some point the module will be broken into smaller
modules to organize the code better.
2020-07-17 13:01:45 +02:00
vocx-fc
08069a89eb Draft: add modules of draftviewproviders to the proper Doxygen group
This includes `view_array`, `view_base`, `view_bezcurve`,
`view_bspline`, `view_circulararray`, `view_clone`, `view_dimension`,
`view_draft_annotation`, `view_draftlink`, `view_facebinder`,
`view_fillet`, `view_label`, `view_orthoarray`, `view_point`,
`view_polararray`, `view_rectangle`, `view_text`, `view_wire`,
`view_wpproxy`.

These are added to the `draftviewproviders` Doxygen group
so that the functions and classes contained in each module
are listed appropriately in the automatically generated
documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
6a3de864e7 Draft: add modules of draftutils to the proper Doxygen group
This includes `gui_utils`, `init_draft_statusbar`, `init_tools`,
`messages`, `todo`, `translate`, `utils`.

These are added to the `draftutils` Doxygen group
so that the functions contained in each module are listed
appropriately in the automatically generated documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
f9d92f3f93 Draft: add modules of drafttests to the proper Doxygen group
This includes `auxiliary`, `draft_test_objects`, `test_airfoildat`,
`test_creation`, `test_dwg`, `test_dxf`, `test_import`,
`test_import_gui`, `test_import_tools`, `test_modification`,
`test_oca`, `test_pivy`, `test_svg`.

These are added to the `drafttests` Doxygen group
so that the functions and classes contained in each module
are listed appropriately in the automatically generated
documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
d70a194dc7 Draft: add modules of drafttaskpanels to the proper Doxygen group
This includes `task_circulararray`, `task_orthoarray`,
`task_polararray`, `task_scale`, `task_selectplane`,
`task_shapestring`.

These are added to the `drafttaskpanels` Doxygen group
so that the functions and classes contained in each module
are listed appropriately in the automatically generated
documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
42599838f4 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.
2020-07-17 13:01:45 +02:00
vocx-fc
4fb2eb663e Draft: add modules of draftmake to the proper Doxygen group
This includes `make_arc_3points`, `make_array`, `make_bezcurve`,
`make_block`, `make_bspline`, `make_circle`, `make_circulararray`,
`make_clone`, `make_copy`, `make_dimension`, `make_drawingview`,
`make_ellipse`, `make_facebinder`, `make_fillet`, `make_label`,
`make_line`, `make_orthoarray`, `make_patharray`, `make_point`,
`make_pointarray`, `make_polararray`, `make_polygon`,
`make_rectangle`, `make_shape2dview`, `make_shapestring`,
`make_sketch`, `make_text`, `make_wire`, `make_wpproxy`.

These are added to the `draftmake` Doxygen group
so that the functions contained in each module are listed
appropriately in the automatically generated documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
e3da572072 Draft: add modules of draftguitools to the proper Doxygen group
This includes `gui_annotationstyleeditor`, `gui_arcs`, `gui_array_simple`,
`gui_arrays`, `gui_base`, `gui_base_original`, `gui_beziers`,
`gui_circles`, `gui_circulararray`, `gui_clone`, `gui_circulararray`,
`gui_clone`, `gui_dimension_ops`, `gui_dimensions`, `gui_downgrade`,
`gui_draft2sketch`, `gui_drawing`, `gui_edit`, `gui_edit_arch_objects`,
`gui_edit_draft_objects`, `gui_edit_part_objects`, `gui_edit_sketcher_objects`,
`gui_ellipses`, `gui_facebinders`, `gui_fillets`, `gui_grid`,
`gui_groups`, `gui_heal`, `gui_join`, `gui_labels`, `gui_line_add_delete`,
`gui_lineops`, `gui_lines`, `gui_lineslope`, `gui_mirror`,
`gui_move`, `gui_offset`, `gui_orthoarray`, `gui_patharray`,
`gui_planeproxy`, `gui_pointarray`, `gui_points`, `gui_polararray`,
`gui_polygons`, `gui_rectangles`, `gui_rotate`, `gui_scale`,
`gui_selectplane`, `gui_shape2dview`, `gui_shapestrings`, `gui_snapper`,
`gui_snaps`, `gui_splines`, `gui_split`, `gui_stretch`, `gui_styles`,
`gui_subeleemnts`, `gui_texts`, `gui_togglemodes`, `gui_tools_utils`,
`gui_trackers`, `gui_trimex`, `gui_upgrade`, `gui_wire2spline`.

These are added to the `draftguitools` Doxygen group
so that the functions and classes contained in each module
are listed appropriately in the automatically generated
documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
b434761e35 Draft: add modules of draftgeoutils to the proper Doxygen group
This includes `arcs`, `circle_inversion`, `circles`, `circles_apollonius`,
`circles_incomplete`, `cuboids`, `edges`, `faces`, `fillets`,
`general`, `geometry`, `intersections`, `linear_geometry`,
`offsets`, `sort_edges`, `wires`.

These are added to the `draftgeoutils` Doxygen group so that
the functions contained in each module are listed appropriately
in the automatically generated documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
a1ce2389d3 Draft: add modules of draftfunctions to the proper Doxygen group
This includes `array`, `cut`, `downgrade`, `draftiffy`, `extrude`,
`fuse`, `heal`, `join`, `mirror`, `move`, `offset`, `rotate`,
`scale`, `split` and `upgrade`.

These are added to the `draftfunction` Doxygen group
so that the functions contained in each module are listed
appropriately in the automatically generated documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
223e627900 Draft: remove documentation in Draft.py
The Doxygen documentation paragraphs in `Draft.py` are no longer necessary,
as this information is already added to the `draft.dox` file
which can be used to consolidate the general documentation of the workbench.
2020-07-17 13:01:45 +02:00
vocx-fc
9761d6af12 Draft: add Doxygen information to draft.dox
More information is added to the main `draft.dox` Doxygen file
so that this information appears when creating
the HTML documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
91a23e4a40 Draft: add Doxygen strings to the packages' __init__ files
The packages are `draftfunctions`, `draftgeoutils`, `draftguitools`,
`draftmake`, `draftobjects`, `drafttaskpanels`, `drafttests`,
`draftutils`, `draftviewproviders`.
2020-07-17 13:01:45 +02:00
Yorik van Havre
a5fe35413a Merge branch 'master' of github.com:FreeCAD/FreeCAD 2020-07-13 14:50:36 +02:00
luz paz
3dfae3ba46 Merged crowdin translations 2020-07-13 14:49:45 +02:00
vocx-fc
6b72865680 Draft: clean up the main Draft.py module
Remove imported modules that are no longer necessary.

Reorganize the import of functions from the separate modules.
It's possible that some functions will be further moved another time.
2020-07-13 14:35:38 +02:00
vocx-fc
6503d9351d Draft: move grouping functions to draftutils.groups module
These functions were previously in `draftutils.utils`,
and are related to grouping objects and finding objects
inside groups. These include `get_group_names`, `ungroup`,
`get_windows`, `get_group_contents`, `get_movable_children`.
These are imported in the main `Draft.py` module, so compatibility
is retained.

Modules which use these functions are updated; these include
Gui Commands like `Move`, `Rotate`, `Scale`, `AddToGroup`,
as well as objects like `DrawingView` and `Shape2DView`,
and `ViewProviderClone`.
The code inside the `importDXF` module is also updated.

The Arch Workbench uses many of these functions
but it does so from the `Draft` namespace, so these edits
don't change the situation for these commands.
2020-07-13 14:35:38 +02:00
vocx-fc
ec1a720bfb Draft: move the convertDraftTexts function to make_text
The old `convertDraftTexts` function was moved from the `Draft.py`
module to the `draftutils.utils` module; however, here it is
not possible to use because the `makeText` function
is not accessible. Therefore, the function is moved to
`draftmake.make_text`.
2020-07-13 14:35:38 +02:00
Yorik van Havre
fbfe821e8c Updated master ts files 2020-07-13 13:20:21 +02:00
luz paz
83f34a1e5b Fix Crowdin typos and various other typos/grammar [skip ci]
Found via codespell v2.0.dev0  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-07-12 11:42:27 +02:00
Yorik van Havre
593831e056 Draft: Add human figure to the grid if the BIM WB is installed 2020-07-10 14:44:24 +02:00
vocx-fc
7da1adc605 Draft: remove touch status in viewproviders of the Dimension objects
Remove the `touch` status, as the modifications only affect
the viewproviders, not the real properties.
2020-07-10 12:29:30 +02:00
vocx-fc
b51339b3fb Draft: clean up ViewProviderAngularDimension class
This class is also derived on `ViewProviderDimensionBase`.
It is used to measure the angle between two straight lines.

Various improvements in style, PEP8, spacing, docstrings.
In particular use more readable variable names.

The `updateData` method is modified to return immediately
if the `arc` attribute does not exist. This is better
to reduce the level of indentation of the code.
2020-07-10 12:29:30 +02:00
vocx-fc
a89eda2428 Draft: clean up ViewProviderLinearDimension class
This class handles linear dimensions of edges, or radial
dimensions of arcs and circles.

Various improvements in style, PEP8, spacing, docstrings.
In particular use more readable variable names.

The modules `Part` and `DraftGeomUtils` have been delayed
in import.

The `updataData` method is modified to return immediately
if the Proxy property modified is different from `Start`,
`End`, `Dimline` or `Direction`.
2020-07-10 12:29:30 +02:00
vocx-fc
bbf05f50e6 Draft: clean up ViewProviderDimensionBase class
Use methods to set up the properties. As the dimension object has
16 properties, these properties are assigned using three methods
corresponding to text, units, and graphics properties.
2020-07-10 12:29:30 +02:00
vocx-fc
aaeab8bc5d Draft: move units functions outside DraftGui.py
The functions `getDefaultUnit`, `makeFormatSpec`, `displayExternal`
are used to get the default unit schema for lengths and angles,
and display a string with a particular format.

They aren't used in `DraftGui.py`, but are used by the
viewprovider of the Dimension objects. Therefore, they are moved
into a separate module, so that they can be imported without
using the entire `DraftGui` module.
2020-07-10 12:29:30 +02:00
vocx-fc
94b0fe1599 Draft: clean up ViewProviderLabel class
Various improvements in style, PEP8, spacing, docstrings.

Improve the methods to update the text, the arrow, and the frame
of the label.

Options to handle `Justification` and `LineSpacing` are added.
These can be handled just like with the `ViewProviderText` object,
as the internal text node is the same, a `SoAsciiText`.

Nevertheless, currently the leader line and the frame that are
drawn for the label don't consider the correction in position
for the `Justification` or `Linespacing` so the graphics
may be overlapped in certain situations.
2020-07-10 12:23:43 +02:00
vocx-fc
22e9cf8921 Draft: clean up ViewProviderText class
Various improvements in style, PEP8, spacing, docstrings.

The list of strings is set to empty before being assigned again.
This solves a problem of the text not being updated correctly.

In the past some `try-except` blocks were there to catch and
ignore certain exceptions that apparently were caused by a
race condition, where certain properties are not assigned
to the object before they are used. These errors
don't seem to occur in v0.19, so we removed the exception
handling. We leave comments mentioning the issue
in case it re-appears.

The `DisplayMode` is swapped, so now `'2D text'` means that the
text always faces the camera, and `'3D text'` means that the
text can be positioned in different orientations in the 3D space.
This is consistent with the `Draft Label` behavior.

A function `draftutils.gui_utils.migrate_text_display_mode`
is provided to help migrate older objects of type `Text`
or `DraftText` to the new display mode.
2020-07-10 12:23:43 +02:00
vocx-fc
de6f251f75 Draft: migrate DraftText type to Text 2020-07-10 12:23:43 +02:00
vocx-fc
f2750cbe72 Draft: set a space before the Link group
For some reason all `App::Link` properties are in a group that
starts with a space, so `' Link'`, not just `'Link'`.

This was changed in 927379c175.
2020-07-07 10:15:14 +02:00
vocx-fc
cc4e00a2fe Draft: add warning message in case the radius is negative 2020-07-07 10:14:04 +02:00
carlopav
d5efc04857 Draft: cleanup of selectWP and support for objects getGlobalPlacement 2020-07-07 10:13:23 +02:00
carlopav
fd79e3e3a9 Draft: possibility to set the working plane to an App::Part placement 2020-07-07 10:13:23 +02:00
carlopav
f97d18ca09 Draft: makeCopy support to reparent App::Part grouped objs 2020-07-07 10:12:49 +02:00
carlopav
9542e1b508 Draft: Draft.move() support new objects (fix #3754)
and small refactor consequent to the introduction of App.ActiveDocument.copyObject support in Draft.makeCopy()
2020-07-07 10:12:49 +02:00
carlopav
e366a3a961 Draft: cleaned imports of Draft.makeCopy 2020-07-07 10:12:49 +02:00
carlopav
fa1a77f21f Draft: support for Document.copyObject() API
Now Draft can copy every FreeCAD object that have a shape.
2020-07-07 10:12:49 +02:00
luz.paz
1da81df756 Fix typos [skip-ci]
Found via codespell v1.18.0.dev0  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-06-29 20:52:23 +02:00
paul lee
81dd47b039 [ArchWall] ArchWall Offset should now works with Base as Sketch 2020-06-24 11:29:07 +02:00
vocx-fc
4e106902f1 Draft: add onChanged method in the derived annotation classes
The classes `ViewProviderDimensionBase`, `ViewProviderLinearDimension`,
`ViewProviderAngularDimension`, `ViewProviderText`, and
`ViewProviderLabel` use `super()` to call the `onChanged` method
of the parent class `ViewProviderDraftAnnotation`.

In this way the `AnnotationStyle` property correctly modifies
the properties of every annotation object.
2020-06-19 12:15:25 +02:00