Commit Graph

1763 Commits

Author SHA1 Message Date
wmayer
099cc2c59e Draft: only try to import FreeCADGui, coin and QtGui if FreeCAD.GuiUp is true 2020-01-15 12:24:18 +01:00
vocx-fc
d8fd4b2f9c Draft: move translate function to translate module
The translate mechanism in Draft depends on the `QtCore`
`translate` function. This is defined in its own module
so that `DraftGui.py` is not as big and hard to manage.

Other modules in Draft can import the translate function
without needing to import the entire interface, which
often causes errors and circular dependencies.

We can import `QtCore.QT_TRANSLATE_NOOP` at the top level
in `Draft.py` because it does not depend on the graphical
interface.
2020-01-15 10:05:52 +01:00
vocx-fc
abd31f0b2b Draft: move todo static class to the todo module
The todo class in `DraftGui.py` can be placed in its
own module so that `DraftGui.py` isn't as big
and hard to maintain.
2020-01-14 12:49:29 +01:00
Bernd Hahnebach
41cf28d1fb Draft: SVG import, encode fix 2020-01-10 12:39:33 +01:00
vocx-fc
60d81151d7 Draft: test_offset, test wire and closed shape (rectangle) 2020-01-10 10:09:22 +01:00
paullee0
0f38aad7ba [DraftGeomUtils] OffsetWire() to accept input as Face as previously did.
Forum Discussion -
https://forum.freecadweb.org/viewtopic.php?f=23&t=42282&p=359233#p359233
2020-01-10 10:08:00 +01:00
vocx-fc
4d956930f5 Draft: new module for GUI utility functions
Many auxiliary tools used by `Draft.py` can be defined
in another module. Many functions are moved to this module
so that `Draft.py` isn't as big and hard to maintain.

The following is a list o functions that were moved:
`get3DView`, `autogroup`, `dimSymbol`, `dimDash`,
`removeHidden`, `formatObject`, `getSelection`,
`getSelectionEx`, `select`, `loadTexture`.

Moreover, many of these functions were renamed
to comply better with PEP8 guidelines,
particularly the use of `snake_case`. For example,
`get3DView` is now `get_3d_view`.

Aliases are provided for the old names so that
other functions and classes that depend on these
won't break. The new names should be the official
programming interface, while the old names
should be deprecated at some point in the future.
2020-01-10 10:04:07 +01:00
paullee0
7acfb3b0f3 [ DraftGeomUtils ] - Fix Indent as commented on Github 2020-01-08 15:22:54 +01:00
paullee0
4818fc4ab4 [DraftGeomUtils] - Add per edge Align support
Per edge align feature
- OffsetWire() function is per-edge-aware of aligns information (alignList) for offsettg individual edge
- Instead of using dvec which universally offseting all edge consistently, it calculate vector per edge for offseting
- 2 modes of 'offsetting' to get 2 'offseted' wires from a basewire taking into per-each align info

It accept a normal info to make e.g. all wires in a Sketch gain consistent direction, instead of calculating from indiviual wires
2020-01-08 15:22:54 +01:00
carlopav
a4df2a1319 [Draft] Edit cleanup
[Draft] Edit further cleanup
2020-01-08 15:20:36 +01:00
carlopav
441a186ce4 [Draft] Edit: add support for arc editing in App::Part 2020-01-08 15:20:36 +01:00
carlopav
b6423863cb [Draft] Edit: improved context menu and fix for arc editing
[Draft] Edit small bugfix
2020-01-08 15:20:36 +01:00
carlopav
9870ec27b1 [Draft] Edit bugfix
Fixed contemporary editing of Draft and Part objects.
Implemented better showTrackers and hideTrackers functions.
2020-01-08 15:20:36 +01:00
carlopav
5a63ad51b1 [Draft] Edit cleanup
Cleaned up imports a suggested by @vocx.
Also cleaned up various things inside the tool.
[Draft] Edit small change in imports


[Draft] Edit updated documentation
2020-01-08 15:20:36 +01:00
carlopav
b189fd6450 [Draft] Edit: set shortcut to D,E
Changed subelement highlight to S,E
[Draft] Edit bugfix


bugfix
2020-01-08 15:20:36 +01:00
carlopav
7e50cc7c7a [Draft] Edit: context menu for Bezcurve editing 2020-01-08 15:20:36 +01:00
carlopav
d3b9aeb7f6 [Draft] Edit bugfix
traker was not updated if endEditing function was called by numericInput
2020-01-08 15:20:36 +01:00
carlopav
e238a4b9fc [Draft] Context menu for EditTrackers
Initial support for context menu.
Menu is triggered by Alt+Click or by pressin E Key.
Menu is customized on the clicked object.
Supported functions ATM: addPoint, deletePoint.
2020-01-08 15:20:36 +01:00
vocx-fc
7721ca0157 Draft: new module for utility functions
Many auxiliary tools used by `Draft.py` can be defined
in another module. Many functions are moved to this module
so that `Draft.py` isn't as big and hard to maintain.

The following is a list of functions and attributes that were moved:
`stringencodecoin`, `arrowtypes`, `typecheck`,
`getParamType`, `getParam`, `setParam`, `precision`,
`tolerance`, `epsilon`, `getRealName`, `getType`,
`getObjectsOfType`, `isClone`, `getGroupNames`,
`ungroup`, `shapify`, `getGroupContents`,
`printShape`, `compareObjects`, `loadSvgPatterns`,
`svgpatterns`, `getMovableChildren`, `getWindows`,
`utf8_decode`.

Moreover, many of these functions were renamed
to comply better with PEP8 guidelines, particularly
the use of `snake_case`. For example, `getGroupNames`
is now `get_group_names`; `getMovableChildren`
is now `get_movable_children`.

Aliases are provided for the old names so that
other functions and classes that depend on these
won't break. The new names should be the official
programming interface, while the old names
should be deprecated at some point in the future.
2020-01-08 15:16:55 +01:00
vocx-fc
ab6976c5db Draft: add new command for Draft CircularArray
Added object, viewprovider, icon; gui command definition, task panel,
add command to InitGui; add callbacks, and delay system.
2020-01-08 15:16:07 +01:00
lorenz
51b5d81741 importDWG: remove comments 2020-01-07 07:35:14 -03:00
looooo
28ad3ea3cb importDWG: use subprocess.Popen instead of .call 2020-01-07 07:35:14 -03:00
looooo
ed5545c3ea importDWG: use libredwg's dwgtodxf converter if available 2020-01-07 07:35:14 -03:00
vocx-fc
1336381eec Draft: new command for Draft PolarArray
Added object, viewprovider, icon; gui command definition, task panel,
add command to InitGui; add callbacks, and delay system.
2020-01-07 07:18:39 -03:00
paullee0
52947e5adc [DraftGeomUtils] isReallyClosed(): Add back support to test if wire is Circle / Ellipse 2020-01-07 07:16:41 -03:00
Bernd Hahnebach
54c4341beb Draft: workaround for error on document loading 2020-01-05 22:16:15 +01:00
Grey Christoforo
5690909e49 fix brick01 file name 2019-12-29 21:25:14 +01:00
carlopav
100dd0bfcc [Draft] Edit, changed endEdit
Before behaviour when user click and when user input coordinates:
1- mousePressed -> endEditing -> numericInput -> update
2- numericInput -> update
Now:
1- mousePressed -> endEditing -> update
2- numericInput -> endEditing -> update
2019-12-28 15:59:26 -03:00
carlopav
af8671caa2 [Draft] Edit Documentation
Documented better the whole tool.
Changed the name of self.call to self. selection_callback for easier code reading.
[Draft] Edit small bugfix

Deleted a bunch of code I PR by error
2019-12-28 15:59:26 -03:00
vocx-fc
1b45c3da7e Draft: fix CMakeLists to install files in directories 2019-12-28 15:56:02 -03:00
vocx-fc
11f4fabf2f Draft: add GuiCommandBase class to serve as the parent class of all DraftTools
Prepare auxiliary directories to restructure all graphical tools
for objects, viewproviders, gui commands, and taskpanels.
2019-12-27 11:01:34 -03:00
luz.paz
8cfa85cf18 Draft: [skip ci] Fix header uniformity
This PR fixes header uniformity across all Draft files
2019-12-27 00:16:12 +01:00
Zheng, Lei
ad3167137d Draft: fix array restore 2019-12-26 15:56:31 -03:00
ageeye
2a5328b693 Use DraftVecUtils.tup only two times. 2019-12-26 15:54:10 -03:00
ageeye
0f81a0dd68 Fix the Draft Array polar type. Rotate first global and then object own rotation(spin) of placement. 2019-12-26 15:54:10 -03:00
Syres916
e96dcda79d [Draft] ImportDXF Bug upgrading from 0.16
See discussion https://forum.freecadweb.org/viewtopic.php?f=3&t=41879
2019-12-26 15:52:30 -03:00
carlopav
b14dca0918 [Draft] Edit further cleanup
[Draft] Edit fix minor bug
2019-12-26 13:31:06 -03:00
carlopav
6ab4a8a202 [Draft] Edit _ code cleanup
According to @vocx_fc suggestions, this commit is a first cleanup of the code.
2019-12-26 13:31:06 -03:00
carlopav
81862dd280 [Draft] Edit: improved Draft Circle editing
Now Draft circle editing works also with App::Part
2019-12-26 13:31:06 -03:00
carlopav
64314e557a [Draft] Edit _ improved rectangle editing
Improved rectangle editing to use 3 nodes. Now it works also inside App::Part
2019-12-26 13:31:06 -03:00
carlopav
7042446504 [Draft] Edit: general refactor
Changed names of several methods from set to get, changed the general set of nodes, improved placement calculation to use getGlobalPlacement instead of Placement.
2019-12-26 13:31:06 -03:00
Bernd Hahnebach
242d151323 Draft: Layer, more code formating 2019-12-23 09:46:05 +01:00
JeromeL63
c467651599 Draft: Layer, code formating 2019-12-23 09:46:05 +01:00
JeromeL63
df77b588c5 Draft: Layer, Separate Line color and shape color override 2019-12-23 09:46:05 +01:00
Bernd Hahnebach
66b853cff8 line endings, better handling in module directory 2019-12-19 22:26:15 +01:00
Bernd Hahnebach
8e09ea8a32 Draft: add gitattributes file to let git manage file endings and normalize them 2019-12-19 07:51:09 +01:00
Yorik van Havre
4e167f32bb Draft: Fixed regression in Rotate tool 2019-12-17 15:30:31 -03:00
vocx-fc
2a4fb552ec Draft: move the TestDraft unit tests to separate modules
This results in better organization of the tests,
avoiding extremely big files.
2019-12-17 15:06:36 -03:00
Yorik van Havre
bb5f17c7f7 Draft: fixed minor bug 2019-12-12 14:11:59 -03:00
Yorik van Havre
97804f851d Draft: fixed regression in rotations 2019-12-11 23:15:05 -03:00