Commit Graph

683 Commits

Author SHA1 Message Date
carlopav
00ec299e06 Draft: split Facebinder from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
b94ba1bf4c Draft: split WorkingPlaneProxy from Draft.py 2020-04-29 11:41:02 +02:00
carlopav
d450c20f06 Draft: split Ellipse from Draft.py
.
2020-04-29 11:41:02 +02:00
carlopav
2d99a2f343 Draft: split Point from Draft.py
.
2020-04-29 11:41:02 +02:00
carlopav
e4bfb0b21d Draft: split clone from Draft.py
.


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


.


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


.


.


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


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


.
2020-04-29 11:41:02 +02:00
carlopav
43f6721c6e 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
3509f1a720 Add AxisReference property to Draft Array 2020-04-27 11:34:16 +02:00
vocx-fc
cb5aa765fb 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
6f2fd04518 Draft: Fixed further regressions 2020-04-21 12:46:08 +02:00
carlopav
164bbabbd8 [Draft] Cleanup of Annotation style branch
Further cleanup and guarded imports of Gui in modules.

.
2020-04-16 11:37:10 +02:00
carlopav
85bf45937e [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
4855564bb8 [Draft] Group object for dimension styles 2020-04-16 11:37:10 +02:00
carlopav
6d8fe07312 [Draft] Annotation refactor and Cleanup
.


.
2020-04-16 11:37:10 +02:00
carlopav
530e8b6c58 [Draft] Split Dimension object and reorganize of annotation objects
part 1
2020-04-16 11:37:10 +02:00
carlopav
34cf98102c [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
08d949b088 [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
116052cff0 [Draft] Annotation Scale bugfix
Now property ScaleMultiplier is checked for existence before the use.
2020-04-16 11:37:10 +02:00
carlopav
1d7b62e6ee [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
e65c61036b [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
75623131fa Draft: new ShapeString icon for the tree view 2020-04-13 11:36:47 +02:00
vocx-fc
8141096344 Draft: circulararray, clean up imports, docstrings, and checks 2020-04-08 11:08:29 +02:00
vocx-fc
d45321f7ff Draft: Draft.py improve imports of utility functions 2020-04-07 18:12:06 +02:00
vocx-fc
4018a47885 Draft: Draft.py clean up header and imports 2020-04-07 18:12:06 +02:00
carlopav
f018dbf159 [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
e41915e638 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
3e3ed47367 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
b38ba6e11d 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
b73cc1ac30 [Draft] Change boolean If statement 2020-03-02 12:08:53 -03:00
Syres916
edc7e3ed8c [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
802ca4e0cb 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
136c7c32de [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
3ed0df5a54 Draft: override text in dimension only when GUI is up 2020-02-10 11:14:01 +01:00
M G Berberich
380340623b [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
cacd3d9c6a Draft: plane proxy by default saves the state and view 2020-01-28 11:59:36 +01:00
Yorik van Havre
9d0c0685c8 Merge branch 'master' into DraftModifiersAppPart 2020-01-16 14:26:45 +01:00
vocx-fc
b52ac5fc6a 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
d69c93764e Merge remote-tracking branch 'upstream/master' into DraftModifiersAppPart 2020-01-10 10:36:34 +01:00
vocx-fc
ce2441c0b2 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
140c2ea17c Merge branch 'master' into DraftModifiersAppPart
merged upstream master and resolved conflicts
2020-01-09 14:42:58 +01:00
vocx-fc
692fa7e702 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
5ad41e27c2 [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
87970248a5 [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
646a480eb2 [Draft] Move and Rotate documentation of recent changes
[Draft] Edit: small typo fix
2019-12-29 11:46:02 +01:00
carlopav
1f59ee3b7e [Draft] Draft.rotate() add support for App::Part 2019-12-27 22:44:07 +01:00
carlopav
f0a18565be [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
ae7cb9e300 Draft: [skip ci] Fix header uniformity
This PR fixes header uniformity across all Draft files
2019-12-27 00:16:12 +01:00