Commit Graph

682 Commits

Author SHA1 Message Date
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
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
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
Yorik van Havre
4d90327a97 Draft: Fixed further regressions 2020-04-21 12:46:08 +02:00
carlopav
a4f7bc43f6 [Draft] Cleanup of Annotation style branch
Further cleanup and guarded imports of Gui in modules.

.
2020-04-16 11:37:10 +02:00
carlopav
cb4295fd8a [Draft] Splitted object Text and Label from Draft.py
And based them on Draft Annotation object
2020-04-16 11:37:10 +02:00
carlopav
749f614313 [Draft] Group object for dimension styles 2020-04-16 11:37:10 +02:00
carlopav
9f1405df0e [Draft] Annotation refactor and Cleanup
.


.
2020-04-16 11:37:10 +02:00
carlopav
637c45733e [Draft] Split Dimension object and reorganize of annotation objects
part 1
2020-04-16 11:37:10 +02:00
carlopav
5bbf3ad6cf [Draft] Dimension style object
still have to split viewprovider from object.
[Draft] Dimension Style code cleanup

thx @vocx-fc for reviewing
further cleanup


[Draft] Dimension Style improvements

Added a property to the dimension object to link the dimension style.
Improved the update of dimensions when style changes. This can be done in 2 different ways: by setting AutoUpdate property to True or by activating Update function from the viewprovider context menu.
2020-04-16 11:37:10 +02:00
carlopav
9e7fb35761 [Draft] Rearrange annotation properties groups
ref. https://forum.freecadweb.org/viewtopic.php?f=23&t=43795&p=373731#p373731
bugfix
2020-04-16 11:37:10 +02:00
carlopav
7d8847a2a2 [Draft] Annotation Scale bugfix
Now property ScaleMultiplier is checked for existence before the use.
2020-04-16 11:37:10 +02:00
carlopav
ba71f3de75 [Draft] First implementation of annotation scale
The changes are minimal, mainly is just cleanup of existing code and documentation.
[Draft] Annotation scale for ViewProviderDraftText

Adding support for scale factor according to changes in dimensions.
[Draft] Annotation scale for ViewProviderDraftLabel

completed annotations scale
[Draft] Annotation scale for ViewProviderAngularDimension
2020-04-16 11:37:10 +02:00
carlopav
9fcb4f94a0 [Draft] Annotation scale support and statusbar widget
Initial commit
Preliminary support for Draft Dimensions


[Draft] Statusbar Widget code cleanup
2020-04-16 11:37:10 +02:00
vocx-fc
587781221c Draft: new ShapeString icon for the tree view 2020-04-13 11:36:47 +02:00
vocx-fc
65acf43391 Draft: circulararray, clean up imports, docstrings, and checks 2020-04-08 11:08:29 +02:00
vocx-fc
1fcd4ac556 Draft: Draft.py improve imports of utility functions 2020-04-07 18:12:06 +02:00
vocx-fc
2ef52b3909 Draft: Draft.py clean up header and imports 2020-04-07 18:12:06 +02:00
carlopav
d9dd618230 [Draft] Fix to mirror tool
the normal is not computed with the view, but with the working plane if active.
ref. https://forum.freecadweb.org/viewtopic.php?f=23&t=44301&p=380632#p380370
2020-03-31 12:03:02 +02:00
vocx-fc
81d7267e72 Draft: add new viewprovider icon for radius dimension
If it is a linear dimension show the older icon;
if it is a radius or diameter dimension show a new icon.

These three modes use the same Proxy class
and the same viewprovider class. Depending on the linked geometry
one icon or the other will be shown.
2020-03-12 09:12:11 -03:00
vocx-fc
dce7f63c02 Draft: add new viewprovider icons for specific objects
When there are many Draft objects in the tree view
the icon can be used to tell different objects apart quickly.
One icon is used for objects that are "straight lines",
whose Proxy is of type `Line`, `Wire` or `Polyline`; another icon
for "regular geometrical" shapes of type `Rectangle` or `Polygon`;
and another icon for "curved" objects of type `Circle`,
`Ellipse`, `BSpline`, `BezCurve`, or `Fillet`.

Other objects use the older default icon.
2020-03-12 09:12:11 -03:00
vocx-fc
b25ca7194c Draft: lowercase use_link option for arrays
Inside the class `_DraftLink` the `onDocumentRestored` function
tests for the existence of the old attribute `useLink`. If it is
present, it uses it to define the new variable name `use_link`.
This is done use Python naming conventions.
The old `useLink` is deleted so it is not longer saved
together with the object when the document is saved.
2020-03-04 09:58:56 -03:00
Syres916
3ae13a012a [Draft] Change boolean If statement 2020-03-02 12:08:53 -03:00
Syres916
e26f306895 [Draft] WireToBSpline Fix makeWire Placement
See discussion https://forum.freecadweb.org/viewtopic.php?f=23&t=43184
2020-03-02 12:08:53 -03:00
vocx-fc
4c8bef7c91 Draft: new view provider icon for the angle dimension
The linear and radial dimensions use the same Proxy class,
but the angular dimension uses a different Proxy class.
To recognize quickly in the tree view the different
types of dimensions, we provide a new icon.

The icon is inspired on the `Draft_Dimension.svg` and
`TechDraw_AngleDimensions.svg` icons.
2020-02-15 13:07:38 +01:00
carlopav
b44031df60 [Draft] Move and rotate bugfix to handle App::DocumentGroup
Bugfix, ref https://forum.freecadweb.org/viewtopic.php?f=23&t=43061
2020-02-10 11:16:34 +01:00
vocx-fc
6a66044c21 Draft: override text in dimension only when GUI is up 2020-02-10 11:14:01 +01:00
M G Berberich
15bef3283f [Draft]fix circular array python2
There was semantic change of the division operator ‘/’
from python2 to python3. This fix makes the circular array
work with python2 correctly.
See PEP 238
2020-01-29 09:33:24 +01:00
vocx-fc
8eb56228cf Draft: plane proxy by default saves the state and view 2020-01-28 11:59:36 +01:00
Yorik van Havre
3f30f8b345 Merge branch 'master' into DraftModifiersAppPart 2020-01-16 14:26:45 +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
carlopav
6e70467335 Merge remote-tracking branch 'upstream/master' into DraftModifiersAppPart 2020-01-10 10:36:34 +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
carlopav
0ab2826123 Merge branch 'master' into DraftModifiersAppPart
merged upstream master and resolved conflicts
2020-01-09 14:42:58 +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
carlopav
a3d650b386 [Draft] Auto add new object to App::Part
Auto add object to part container if active and if no other autogroup object is selected by the user.
Note that object placement is automatically corrected to not jump over space.
[Draft] App::Part autogroup point object
2019-12-29 20:25:50 +01:00
carlopav
d4e32c1607 [Draft] getGroupContents and App::Part
App::Part contained objects should not be moved if also App::Part is moved
2019-12-29 15:24:14 +01:00
carlopav
f0d21a8755 [Draft] Move and Rotate documentation of recent changes
[Draft] Edit: small typo fix
2019-12-29 11:46:02 +01:00
carlopav
36340068ec [Draft] Draft.rotate() add support for App::Part 2019-12-27 22:44:07 +01:00
carlopav
f2792f9fc6 [Draft] Draft.move() add support for App::Part
Added getGlobalPlacement to vector calculation.
[Draft] Move bug fix
2019-12-27 20:41:04 +01: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