Commit Graph

151 Commits

Author SHA1 Message Date
Roy-043
db12b31b76 Draft: Fix handling of coin nodes
Fixes #18523.
2024-12-16 18:24:36 +01:00
Roy-043
298e6921a7 Draft: fix color of arrays
If `get_diffuse_color` returned a list with a single color, the list was wrongly multiplied. Regression introduced in V0.21, but in that version the error was masked by how Core handled the diffuse color.

Fixes #17052.
2024-11-25 17:43:56 +01:00
Yorik van Havre
8f9718ebc6 Draft: minor fixes (#17793)
- more tolerance on faultly solids in shape2Dview
- fixed display of dimensions in arch override unit
2024-11-16 17:52:55 +01:00
Chris Mayo
7183de92a4 Draft: Make startup and tests independent of BIM (#17390) 2024-11-16 17:43:46 +01:00
Roy-043
6c8c263297 Draft: Improve layer drag-drop fix.
The fix in #16212 only checks the LayerContainer for layers. Since we do not stop users from moving layers out of that container, we should search the whole document instead.

Fixes: #16201.
2024-10-17 12:29:42 +02:00
Kevin Martin
c9887d9400 DXF: Place objects in layer all at once rather than one at a time to improve DXF import speed dramatically. (#16596)
* Place objects in layer all at once rather than one at a time.
This reduces (by a factor of the number of objects in the layer) the number of times that the layer contents are traversed to set the properties of the contained objects.
This means the layer insertion of O(n) rather then O(n^2) on the number of objects.
Also remove a loop invariant in view_layer so the chidren are not traversed if colours or appearnces are not inherited from the layer.
Fixes #15732

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-23 11:39:02 +02:00
Roy-043
77539c1091 Draft: Fix regression with layer drag-and-drop behavior
Fixes: #16201

Changing the Group property type of layers to `App::PropertyLinkListHidden` also means that they longer occur in the InList of nested objects. This side-effect was missed in #14506.
2024-09-02 18:40:23 +02:00
Roy-043
1be41b68a2 Draft: Fix regression with display of SVG patterns
In V0.22 SVG patterns are not displayed when a file is reopend.

Forum topic:
https://forum.freecad.org/viewtopic.php?t=90128
2024-09-02 10:51:55 +02:00
wmayer
3e33f184b4 Core: Rename ViewProviderPythonFeature to ViewProviderFeaturePython
Fixes #15888
2024-08-26 18:14:22 +02:00
Roy-043
8f1e415eac Draft: Fix onChanged in view_point.py
Fixes #14804

Added (also don't make sense for a point object):
* AngularDeflection
* DrawStyle
* Pattern
* PatternSize

Removed:
* DiffuseColor (property no longer exists)
* LineMaterial (already hidden by default)
2024-06-20 13:46:00 +02:00
Roy-043
8bcbeae68b Draft: Draft_Layer new Material handling (#13949)
Discussion: #13657.

This PR adds  the ShapeAppearance view property to Draft Layers.

The DefaultShapeColor is used for the DiffuseColor of the ShapeAppearance material. Other material properties are not based on the preferences when a layer is created.

The old ShapeColor and Transparency properties remain (ShapeColor as a hidden property) and are kept in synch with the ShapeAppearance. This is consistent with how ShapeAppearance is implemented in Core.

The gui_layers.py and make_layer.py files do not have to be changed. They manipulate the vobj via the mentioned old properties.
2024-05-28 09:45:05 +02:00
Roy-043
107964c2c1 Draft: update Draft Point viewprovider to account for ShapeAppearance
Without this mod there is an error when opening a V0.21 file with a Draft Point. As well as when creating a Draft Point in V0.22.
2024-05-02 10:09:28 +02:00
Roy-043
7407eee427 Draft: revert Draft WB changes from #13294
Revert the Draft WB related changes of #13294.
2024-04-24 21:27:04 +02:00
David Carter
495a96a0f5 Material: Material appearance
Uses new material system for appearance

Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.

The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.

A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
2024-04-04 07:39:58 -05:00
Yorik van Havre
4e3467ae5e Draft: Allow to prevent layers to claim children 2024-03-11 12:29:13 -05:00
Kevin Martin
02ebb17558 Eliminate many "doing what you told me to" messages
These messages were perhaps originally intended as a debuggin aid but now add clutter to the output panes. Remaining messges are mostly the result of methods to display attributes of an object (which one could call from the Python console) or actually provide some information which would not be obvious from the circumstances
2024-02-02 08:58:45 -05:00
Roy-043
5b98a762d1 Draft: Improve layer functions
The current make_layer function has a `None` default for the shape color and the line color. With that value the current preference is used. This, and how the function is called, results in some confusing behaviors:
* Newly created layers will only use 2 values from the preferences when they might use 5. The latter makes more sense for the end-user IMO.
* Layers created during DXF import (for example) will have a different shape color depending on the current preferences.
* The make_layer function may reapply colors that have already been set by the view provider.

To solve this all view property related function parameter have been changed to a not None value. If a None value is supplied the view property as set by the view provider is not changed. The Layer Manager has been updated accordingly.
I realize that calling a function with 6 None values is not very convenient, but think it is the solution that is least likely to break other exiting code.

Additionally:
* Removed the makeLayer function. Layers were introduced in V0.19 when the naming scheme was changed to "make_*". Maybe it was created by mistake, or before the actual renaming operation started, but it is safe to remove it now.
* Removed overly verbose messages.
* gui_layers.py had a missing import (result of a previous V0.22 PR): `from draftutils import utils`.
2024-01-22 11:29:13 -06:00
Roy-043
12444a1d6b Draft: implement new get_param functions (step 3)
See #11677
2023-12-12 20:20:03 +01:00
Roy-043
56b8f76cfb Draft: Introduce DefaultAnnoScaleMultiplier parameter
This parameter replaces DraftAnnotationScale.

The parameter can be changed in the preferences and with the Draft_SetStyle command.
2023-12-09 19:17:36 +01:00
Roy-043
6c015072eb Draft: implement DefaultAnnoLineWidth and DefaultAnnoLineColor prefs
The format_object function in gui_utils.py still requires some work (in connection with the Draft_SetStyle command). This will be done later.
2023-11-29 23:06:17 +01:00
Roy-043
484bbf3807 Draft: improve handling of anno DisplayMode and LineSpacing
* DisplayMode controlled by new pref DefaultAnnoDisplayMode. This replaces the old dimstyle pref.
* LineSpacing pref is now used when creating annotations. Will be added to prefs ui later.
* format_object no longer changes FontSize as this conflicted with the height parameter in the make_text function.
* make_text function updated.
2023-11-27 15:45:56 +01:00
Roy-043
b5adfff293 Draft: make default anno style non-global
Additionally:
* Added the DimShowLine preference. Layout of the tab will be updated later.
* Improved handling of DraftAnnotationScale preference: catch division by zero and use it for the default anno style.
2023-11-23 09:45:12 +01:00
Roy-043
ca06e87a38 Draft: Updates related to the PlaneGui class (step 2)
Related issue:
#5603.

Additionally:
Fixed the issue where the texts of Arch_Space objects were not exported to DXF.
2023-10-23 16:25:12 +02:00
wmayer
83d4080fe8 App: fixes #10460: App::PropertyPythonObject is not saving data
Since Py3.11 the methods names __setstate__ and __getstate__ conflict with the method names added to the object class.
Thus rename them to 'loads' and 'dumps'
2023-09-24 10:56:35 -05:00
Roy-043
3e789dfc85 Draft: Fix for PR10673 (#10699)
Fixes an issue that was missed in #10673.
2023-09-16 17:10:02 +02:00
Roy-043
23c386dfee Draft: V0.21 version of getPlaneRotation caused a dimension bug (#10673)
`DraftVecUtils.getPlaneRotation` can now return None. The `view_dimension.py` code did not handle that.
2023-09-13 17:00:35 +02:00
CalligaroV
163c30700f [Feature Request] [Draft] [UI/UX] Remove the center arrow on radial dimensions (#10655)
Related to issue #7573

Forum discussion

https://forum.freecadweb.org/viewtopic.php?p=631252#p631252

These modifications don't add the new properties suggested on the issue mentioned above and suggested on the forum discussion but just remove the center arrow

Other info and discussion can be found at https://gitlab.com/calligarov/FreeCAD/-/merge_requests/1
2023-09-13 15:27:51 +02:00
Yorik van Havre
36353ffb7c Draft: Allow to set a custom feet separator for dimensions (#10481) 2023-09-11 14:05:26 +02:00
Roy-043
beb996e6a1 Draft: Avoid dictionary.keys() where possible (#10160) 2023-08-13 11:46:25 +02:00
Roy-043
bd3f71b478 Draft: Std_TransformManip should not be called from setEdit (#9375)
The object then seems to be put into edit mode twice (?) and Esc will not cancel the command.
2023-05-07 09:57:10 +02:00
luzpaz
129d5882a7 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
Jolbas
649857b58f return pure rotation from getPlaneRotation() 2023-02-28 01:07:56 +01:00
Roy-043
7f2f5e9414 [Draft] fix diffuse color issue when creating arrays (#8436) 2023-02-11 18:57:28 +01:00
Roy-043
c437b79ada [Draft] update of Draft_Clone related to gui_utils.get_diffuse_color (#8430) 2023-02-11 16:21:18 +01:00
Roy-043
e7d757de3d [Draft] fix ang dim arrows alignment issue related to asin (#8368) 2023-02-06 14:01:08 +01:00
Roy-043
4c4972339f Draft: V0.18 VisGroups were not handled (#8234) 2023-01-23 11:27:52 +01:00
Roy-043
6cf6299254 Draft: improve color handling in gui_setstyle.py (#8219)
Alhpa values of colors were not correct.
2023-01-22 11:18:17 +01:00
Roy-043
e6eb208639 Draft: Fix and improve Draft_AnnotationStyleEditor (#8207)
* Draft: Fix and improve Draft_AnnotationStyleEditor

* Draft: Fix and improve Draft_AnnotationStyleEditor 2
2023-01-21 10:28:47 +01:00
Yorik van Havre
ca4d093f4c Merge pull request #8122 from Roy-043/Arch-improve-context-menus
Arch: improve context menus
2023-01-13 11:48:57 +01:00
Roy-043
42a74daa19 Arch: improve context menus (rebase) 2023-01-12 22:54:09 +01:00
Roy-043
34f43a245c Draft: Fix inconsistent properties of Draft annotations 2022-12-23 16:49:56 +01:00
Roy-043
0fdb4949c3 Draft: improve context menus 2022-12-07 11:21:06 +01:00
Roy-043
cc8d6afee7 Draft: fix clone DiffuseColor 2022-11-27 11:11:24 +01:00
Roy-043
093368a6ad Draft+Arch: Fix crash related to SoBrepEdgeSet 2022-09-28 17:32:12 +02:00
Yorik van Havre
028517323c Merge pull request #7462 from Roy-043/Draft-Improve-drag-and-drop-behavior-for-Layers
Draft: Improve drag-and-drop behavior for Layers
2022-09-09 11:25:25 +02:00
Roy-043
333fc6448c Draft: Improve drag-and-drop behavior for Layers 2022-09-08 11:38:45 +02:00
Roy-043
a71a06291b Update view_dimension.py
The FlipArrows property for angular dimensions is handled differently.
2022-09-07 19:20:49 +02:00
Roy-043
c5a79d3909 Draft: Fix alignment of angular dimension arrows 2022-09-06 15:37:15 +02:00
Roy-043
39c2ff4e45 Draft: Fix flatten wire 2022-09-04 09:45:39 +02:00
Yorik van Havre
4555878c10 Merge pull request #7173 from Roy-043/Draft_Fix_setEdit_in_view_text.py
Draft: Fix setEdit in view_text.py
2022-07-18 10:44:31 +02:00