Commit Graph

2034 Commits

Author SHA1 Message Date
carlopav
0cbdba0245 Draft: split Shapestring from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
511f095f5f Draft: split makeSketch from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
f43e026da1 Draft: split Facebinder from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
1335da71ae Draft: split WorkingPlaneProxy from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
e547bc34fa Draft: split Ellipse from Draft.py
.
2020-04-29 11:41:02 +02:00
carlopav
24d87ccdb3 Draft: split Point from Draft.py
.
2020-04-29 11:41:02 +02:00
carlopav
d711de1b4a Draft: split clone from Draft.py
.


.
2020-04-29 11:41:02 +02:00
carlopav
1a04f97d8f Draft: split wire related tools from Draft.py
Line Polyline BezCurve BSpline
.


.


.
2020-04-29 11:41:02 +02:00
carlopav
76e97c7062 Draft: split Polygon from Draft.py
.


.


.


.
2020-04-29 11:41:02 +02:00
carlopav
7b18ae746f Draft: split rectangle code from Draft.py
.


.
2020-04-29 11:41:02 +02:00
carlopav
52436ecb49 Draft: split circle from Draft.py
.


.
2020-04-29 11:41:02 +02:00
carlopav
f6cc26e263 Draft: compatible super for AngularDimension object 2020-04-29 11:41:02 +02:00
carlopav
0f3e0b0d0d Draft: parent classes of all Draft objects
Add DraftObject and ViewProviderDraft to serve as
the parent classes of all Draft objects
and all Draft view providers.

Inside `Draft.py` we need to import
`_DraftObject` from `draftobjects.base`;
and `_ViewProviderDraft`, `_ViewProviderDraftAlt`,
and `_ViewProviderDraftPart` from `draftviewproviders.view_base`.
.


.


.


.
2020-04-29 11:41:02 +02:00
Marcus Ding
6e18f7ec6e Add AxisReference property to Draft Array 2020-04-27 11:34:16 +02:00
luz.paz
cb9379225a [skip-ci] Fix typos
Found via codespell v1.17.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-04-27 11:29:32 +02:00
vocx-fc
20db141c3a Draft: change super() so it is compatible with Python 2
In Python 3 `super()` can be used without an argument
in order to get the parent class, `super()`.
In Python 2 the present class must be used as an argument,
`super(ThisClass, self)`.

This commit is done to support Python 2,
as without it all Gui Command tools will be broken
and will fail to launch, even if the unit tests pass.

Also, set the `__metaclass__` variable to `type`.
This is done to turn all classes into "new style" classes
in Python 2. This is required so `super()` works correctly
in this version of Pyton.

This commit can be reverted once Python 2 support
is completely dropped, and only Python 3 compatible code
is used.
2020-04-27 11:05:51 +02:00
vocx-fc
e87245aeef Draft: move Mirror GuiCommand to gui_mirror module 2020-04-24 13:49:13 +02:00
vocx-fc
bb4fbf62e9 Draft: move Draft_Clone GuiCommand to gui_clone module
Rename the Gui Command to `Clone`, and provide an alias
for the older name `Draft_Clone`, just in case.
2020-04-24 13:49:13 +02:00
vocx-fc
6d4ee479c0 Draft: small changes to the taskpanels for arrays 2020-04-24 13:49:13 +02:00
vocx-fc
4b5f7d5575 Draft: small changes to the view providers for arrays
These view providers are not currently in use, the files are just
there for reference, to show how they would be used in the future.

The `super()` instruction is not made compatible with Python 2
because this code won't run with Python 2 anyway.
2020-04-24 13:49:13 +02:00
vocx-fc
62b9183b5c Draft: rename Circular, Ortho, and Polar arrays
The internal GuiCommand classes are renamed to `CircularArray`,
`OrthoArray`, and `PolarArray`. This is a shorter name than the
previous `GuiCommandCircularArray`, `GuiCommandOrthoArray`,
and `GuiCommandPolarArray`.

These classes are not part of the scripting interface of Draft
so we don't risk breaking previous files.
2020-04-24 13:49:13 +02:00
vocx-fc
589693f66c Draft: small changes to the loading of the array modules 2020-04-24 13:49:13 +02:00
vocx-fc
b434347dbd Draft: move PointArray GuiCommand to gui_pointarray module 2020-04-24 13:49:13 +02:00
vocx-fc
539e36dd72 Draft: move PathLinkArray GuiCommand to gui_patharray module 2020-04-24 13:49:13 +02:00
vocx-fc
23a975250f Draft: move PathArray GuiCommand to gui_patharray module 2020-04-24 13:49:13 +02:00
vocx-fc
ae3089d780 Draft: move LinkArray GuiCommand to gui_array_simple module
The code is kept for historical reasons, but the tool
is no longer accessible from the toolbars or menus,
as it was superseded by the three commands `Draft_OrthoArray`,
`Draft_PolarArray` and `Draft_CircularArray`.
2020-04-24 13:49:13 +02:00
vocx-fc
a34ce0acf3 Draft: move Array GuiCommand to gui_array_simple module
The code is kept for historical reasons, but the tool
is no longer accessible from the toolbars or menus,
as it was superseded by the three commands `Draft_OrthoArray`,
`Draft_PolarArray` and `Draft_CircularArray`.
2020-04-24 13:49:13 +02:00
vocx-fc
8fad38bc8a Draft: move Draft2Sketch GuiCommand to gui_draft2sketch module 2020-04-24 13:49:13 +02:00
vocx-fc
e31b02f3e2 Draft: move Shape2DView GuiCommand to gui_shape2dview module 2020-04-24 13:49:13 +02:00
vocx-fc
276998d749 Draft: move WireToBSpline GuiCommand to gui_wire2spline module 2020-04-24 13:49:13 +02:00
vocx-fc
7b89b302cb Draft: move Drawing GuiCommand to gui_drawing module
Also, finally the command is removed from the toolbar
as the Drawing Workbench is obsolete since v0.17.

The command is still loaded and defined by the workbench
but it is no longer presented to the user interface in the menu
or toolbar.
2020-04-24 13:49:13 +02:00
vocx-fc
47c9d83862 Draft: move Scale GuiCommand to gui_scale module
The scale operation can be used with subelements, vertices
and edges, but in this case this only works with polylines
(wires) because internally the functions `scaleVertex`
and `scaleEdges` only work with polylines that have a `Points`
property.

When doing a copy and scale, it also calls `copyScaledEdges`
which calls `joinWires`, so problems with joining wires
may also be present when performing this operation.
2020-04-24 13:49:13 +02:00
vocx-fc
0a14ecf6da Draft: move Trimex GuiCommand to gui_trimex module 2020-04-24 13:49:13 +02:00
vocx-fc
cf5c6da659 Draft: move Downgrade GuiCommand to gui_downgrade module 2020-04-24 13:49:13 +02:00
vocx-fc
f9ff602cf2 Draft: move Upgrade GuiCommand to gui_upgrade module 2020-04-24 13:49:13 +02:00
vocx-fc
5f182e471c Draft: move Split GuiCommand to gui_split module 2020-04-24 13:49:13 +02:00
vocx-fc
56f2885cb3 Draft: move Join GuiCommand to gui_join module
Occasionally it fails to join lines even if the lines
visually share a point.

This is a rounding error in the comparison of the shared point;
a small distance will result in the points being considered
different and thus the lines not joining.

The solution is to test properly the two points using
`DraftVecUtils.equals` which considers the value of
the `precision` set in the Draft preferences.
2020-04-24 13:49:13 +02:00
vocx-fc
58812ebbbf Draft: move Stretch GuiCommand to gui_stretch module 2020-04-24 13:49:13 +02:00
vocx-fc
c7ca282e85 Draft: move Offset GuiCommand to gui_offset module
Include Yorik's commit e8b216dd42.
2020-04-24 13:49:13 +02:00
vocx-fc
98f9db5053 Draft: move Rotate GuiCommand to gui_rotate module 2020-04-24 13:49:13 +02:00
vocx-fc
73e1027445 Draft: move ApplyStyle GuiCommand to gui_styles module
Also fix an error in determining the objects of type group.

Also call `finish` to properly terminate the command,
otherwise it stays active and behaves incorrectly.
2020-04-24 13:49:13 +02:00
vocx-fc
a2a3cd18c2 Draft: move Move GuiCommand to gui_move module 2020-04-24 13:49:13 +02:00
vocx-fc
3348b91717 Draft: move SubelementHighlight to its own module 2020-04-24 13:49:13 +02:00
Yorik van Havre
e496f356f2 Draft: fixed regression in snapper 2020-04-23 12:05:59 +02:00
Yorik van Havre
9343223525 Draft: Annotation editor 2020-04-22 13:38:17 +02:00
luz.paz
1319bfe11c LGTM: Fix 'testing equality to None'
Testing whether an object is `None` using the `==` operator is inefficient and potentially incorrect.
2020-04-22 12:18:33 +02:00
carlopav
ff4ac3a3b4 Draft: reintroduced grid button in snap toolbar 2020-04-22 12:14:23 +02:00
carlopav
707550158d [Draft] Correct Draft Edit Tooltip in preferences
correction thx to Kunda1
2020-04-22 12:08:29 +02:00
vocx-fc
572d7f5757 Draft: move Label GuiCommand to gui_labels module
Also include carlopav's commit 225404c648 for the Draft_Label tool,
which runs the autogroup function on the created label.
2020-04-22 12:07:25 +02:00
vocx-fc
ea894c3f60 Draft: move Facebinder GuiCommand to gui_facebinders module 2020-04-22 12:07:25 +02:00