Commit Graph

40 Commits

Author SHA1 Message Date
Roy-043
9bcb7cbc7e Draft: Gui.ActiveDocument.ActiveView.getActiveObject has changed
See #10405.
2023-11-24 12:08:28 +01:00
Roy-043
ceaf048277 Draft: Change get_3d_view to only return the active 3D view (#11050)
Related issue:
#10634

Also needed to avoid warnings from the PlaneGui class.
2023-10-15 14:28:32 +02:00
Roy-043
419bc52f10 Draft: Fix get_diffuse_color function (#9932) 2023-07-18 10:45:38 +02:00
Yorik van Havre
a5f7c74d0e Draft: allow autogroup to add an object to both a layer and an Arch/NativeIFC container 2023-06-13 12:24:14 +02:00
Yorik van Havre
55480c4c8d Draft: Provision for NativeIFC autogrouping 2023-06-07 13:02:49 +02:00
luzpaz
38a01939e0 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
luzpaz
5f487cadce Draft: [skip ci] fix typo in source comment (#8434)
Fixed typo in `draftutils/gui_utils.py`
2023-02-11 21:02:27 +01:00
Roy-043
9224946bec [Draft] fix Draft_Mirror diffuse color issue. (#8427) 2023-02-11 11:18:00 +01:00
Roy-043
b3189ccf2d Draft: Update gui_setstyle.py and gui_utils.py (#8195) 2023-01-14 20:07:59 +01:00
Roy-043
481995db81 Draft: Update gui_utils.py (#8191) 2023-01-14 13:53:38 +01:00
wmayer
0208608b9e Base: fix Matrix4D::hasScale
* If all column vectors of the 3x3 sub-matrix are equal the function incorrectly claims that it's uniform scaling.
* Detect also non-uniform scaling and if was applied from the left or right side
* Replace the int with an enum and expose it to Python
* Add several new unit tests
2022-02-15 21:05:11 +01:00
Roy-043
981ddd4699 Draft: Fix issues with translate and _tr (#5351) 2022-01-08 00:04:53 +01:00
Yorik van Havre
a6485ad191 Arch: BuildingParts autogrouping
Arch BuildingParts now gained a new set of View properties that allows
to define a "capture box". Subsequent Draft and Arch objects, or anything
else that uses Draft.autogroup(), will be automatically added to that
BuildingPart if they are inside the capture box.
2021-10-14 14:42:46 +02:00
Roy-043
dc988eb613 Draft: fix dim symbol issues 2021-09-23 10:45:21 +02:00
Syres916
8753271f61 [Draft] gui_utils Added FIXME comment to assist..
... revisiting in future
2021-08-02 15:19:22 +01:00
Syres916
b0c5f62672 [Draft] gui_utils Coin import addition 2021-07-18 19:52:31 +01:00
Syres916
39c450c909 [Draft] gui_utils Minor bugfix on change to...
...Draft Wb with grid enabled. Please backport to 0.19 branch, see discussion https://forum.freecadweb.org/viewtopic.php?f=3&t=60251
2021-07-17 21:52:30 +01:00
carlopav
45aa103dd4 Draft: Autogroup, insert guard to prevent cyclic references
ref. Forum discussion: Draft_OrthoArray: Crash when using active Std_Part. https://forum.freecadweb.org/viewtopic.php?f=23&t=59155&p=508132#p508132

Autogroup try to add new created Draft Objects into the active Part, but if the Part is used as a Base for the new object this could create a cyclic reference. 
This behaviour is prevented by adding a check for " obj in active_part.InListRecursive"
2021-06-06 11:21:21 +02:00
carlopav
e0a6c34dcc Draft: Autogroup, rename variables to more readable names 2021-06-05 17:07:32 +02:00
Yorik van Havre
8d7281e97b Draft: Fixed default color for new dimensions (now uses DefautTextColor instead of DefaultLineColor) 2021-04-23 15:46:39 +02:00
Benjamin Nauck
879532d852 Draft: Simplify load_texture after py3 requirement
This commit does the following things:
 * Remove python2 support
 * Using a bytearray instead of chr list to build up the binary data.
   this also removes the need of using char encoding.
2021-03-10 20:49:29 +01:00
Yorik van Havre
1cce61670c Draft: better checks for no active document 2020-11-16 13:25:12 +01:00
Yorik van Havre
583b59c29f Draft: Condensed the Draft toolbar style buttons into one with more options 2020-11-10 14:14:18 +01:00
Yorik van Havre
91f2608607 Draft: Fixed translation of construction group 2020-10-12 16:11:31 +02:00
vocx-fc
9227330fff Draft: get_bbox function to get the bounding box from RootNode
Normally the bounding box is taken from `Shape.BoundBox`.
Certain objects don't have a `Shape`, like `App::FeaturePythons`,
so the bounding box is calculated from `ViewObject.RootNode`.
2020-09-30 12:06:48 +02:00
vocx-fc
dd70caa723 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
96e3267f08 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
b1fade6f9e 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
f7e53eaab3 Draft: adjust the text size for Labels with format_object
This function, `draftutils.gui_utils.format_object`,
takes the value defined in the `DrafToolBar`, and uses it
to specify the `FontSize` for `Text` objects.

Now it specifies the `TextSize` for `Label` elements as well.
2020-06-15 09:59:57 +02:00
carlopav
89d4a6e00c Draft: Edit reordering 1
Started a general refactor to handle all the conversion between global and object coordinate system inside the main methods and just use object coordinates inside object functions.
Draft: Edit reordering 2

Fixed Editing of Part objects according to the new refactor
Draft: fix in autogroup function for dimensions


Draft: fixed Polygon editing when inscribed or circumscribed


Draft: Edit support for Ellipse object


.


Draft: Edit docstrings


Draft: Edit reordering 3


Draft: Fixed Edit for structure object

And also refactor Edit methods that control special object display during editing.
Draft: Fixed edit for arch wall object
2020-05-25 13:37:55 +02:00
carlopav
f90921ef03 [Draft] Improved Autogroup to handle Draft Annotations
Draft Dimension, Label and Text are now correctly auto-added to Part container
2020-04-16 11:37:10 +02:00
vocx-fc
a76a438fda Draft: gui_utils, add small stylistic changes
These changes are added by carlopav in pull request #3102.
We add them in this commit already so that this branch and
that branch are easier to rebase and merge.
2020-04-07 18:12:06 +02:00
vocx-fc
fea5dc667d Draft: gui_utils, autogroup return when GuiUp is False 2020-04-07 18:12:06 +02:00
vocx-fc
0714ab786f Draft: gui_utils.py clean up imports
Small spacing fixes like imports in separate lines
for more clarity, and the position of the license.
Also use the new `messages` module to provide the functions
to print text to the console.
2020-04-07 18:12:06 +02:00
carlopav
5e22086d71 [Draft] Autogroup bugfix 2020-01-27 10:12:02 +01:00
carlopav
78252e959a [Draft] Autogroup: better support for App::Link
https://forum.freecadweb.org/viewtopic.php?f=23&t=40400&start=30#p360248
Reference to forum topic.
small fix


small fix
2020-01-18 17:51:21 +01:00
carlopav
ec57ffd875 Merge remote-tracking branch 'upstream/master' into DraftModifiersAppPart 2020-01-16 14:30:10 +01:00
wmayer
099cc2c59e Draft: only try to import FreeCADGui, coin and QtGui if FreeCAD.GuiUp is true 2020-01-15 12:24:18 +01:00
carlopav
f21c387b04 [Draft] Autogroup changes to include App::Part
[Draft] merged with recent changes


[Draft] App part support small fix
2020-01-13 23:13:38 +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