Commit Graph

23649 Commits

Author SHA1 Message Date
Abdullah Tahiri
b054e16cf4 Sketcher: Fix detach observer 2021-01-07 12:37:48 +01:00
luz paz
5b058a9f13 Sketcher: App/Sketch.h minor documentation tweaks [skip ci] 2021-01-07 12:16:24 +01:00
Abdullah Tahiri
b01e189c63 Sketcher: Preferences - add 3D view scaling factor
==================================================

In addition to the font size in pixels, which controls the 3D View font size (and indirectly the constraint icons),
it is now possible to configure a scaling factor controlling the width of geometry, axes, information layer, and
constraint lines.
2021-01-07 12:11:01 +01:00
Abdullah Tahiri
3661ffe7fb Sketcher: Constraint icons and fonts in 3D View
===============================================

Based on PRs #4146 #4155.

PR #4155 proposes a scaling factor to be used to scale up constraint icons and the subindex font of icons. The
scaling factor is a parameter.

PR #4146 proposes to derive the constraint icon size from the system font size via function of the dpi. The
constraint icon subindex is a factor of the constraint size.

Observations:
- PR #4146 identifies the need for a scaling factor too, but this is a hardcoded 1.25 factor.
- PR #4146 appears to mix font points and font pixels when deriving the sizes.
- PR #4155 deals exclusively with icon size and subindex font, not with constraint label

Useful concepts:
- Font point is a physical distance. There are 72 points in one inch.
- Monitors have pixels with varying pixel densities. The number of pixels in one point varies
with pixel density. Hence the need for a correction based on the dpi of the monitor.

API constraints:
- While QT's configuration can be obtained in points or pixels, coin3D sets the font size in points.

Solution:
- Continue relying on the local font setting from preferences for coin3d font, albeit by converting from pixels to points.
- Introduce a sketcher wide 3D view scaling factor, as per #4155. This factor is however used for geometry, not for fonts.
- Geometry is scaled to compensate for the scaling factor and the monitor pixel density (the scaling factor is the product
of both scaling factors).
- Derive the 3D view icon size to be 80% (hardcoded) of the 3D view font size. Having constraint icons proportional to contraint label
font size gives consistency to the interface, as constraint icons also have subindices. I do not think it is worth to provide this 80%
as a configurable parameter
- The constraint icon subindex, being a special case of font relative to the accompanying icon, is set to be the 80% of the
icon size (hardcoded). I think it is not worth to provide this as a configurable parameter.

Bonus:
- ViewProviderSketch implements an observer of parameter group and tracks view scaling factor parameter and marker size.
- On change of parameter the inventor nodes are updated and the 3D view redrawn.
- Size information is moved to edit structure for consistency with Marker size.
2021-01-07 12:11:01 +01:00
Kisolre
1d970d5226 Sketcher: Add constraint icon scaling.
https://forum.freecadweb.org/viewtopic.php?f=3&t=4362&start=20#p458026
2021-01-07 12:11:01 +01:00
Ilia (Elyas) Sobolev
7a82f955ca Sketcher: Scalable constraint icons
Rendering scalable icons from .svg
The size of the icons is related to the font size of the constraints.
Calculations and access to settings are collected in one place.
Default based on system font size.
And also Symbol for diameter and radius.
2021-01-07 12:11:01 +01:00
Abdullah Tahiri
e29a394ce0 Sketcher: std::move improvement fixes 2021-01-07 12:03:26 +01:00
Yorik van Havre
f774c0ec5e Merge pull request #4244 from danreb25/BBLPatch_ArchComponentDiffuseColor
Arch: deal with missing DiffuseColor attributes on obj.CloneOf.ViewObject
2021-01-07 11:53:40 +01:00
Yorik van Havre
94767d4622 Merge pull request #4249 from donovaly/GUI-icon-fix
[GUI] fix missing Std_AxisCross icon
2021-01-07 11:49:43 +01:00
Yorik van Havre
eb2d512fc8 Merge pull request #4251 from fxjaeckel/patch-1
[OpenSCAD] fix parsing error for numbers with positive exponent >= 6
2021-01-07 11:48:58 +01:00
Zheng, Lei
12defb11b6 Part/Sketcher: improve list property update efficiency 2021-01-07 10:27:21 +01:00
wmayer
5d9db07ddd Part: [skip ci] in TopoShape::getMemSize() handle edges or faces with no attached geometry 2021-01-06 15:39:25 +01:00
Abdullah Tahiri
ec73869d1c Sketcher: Remove Internal Alignment constraint from toolbar
===========================================================

This constraint command is basically never used by users and almost never by power users.

If it is not removed is because it may be useful for debugging... and maybe we should think about
removing the command althogether, as debugging can be done via Python console.
2021-01-06 13:54:00 +01:00
Abdullah Tahiri
4ffb6c5e2a Sketcher: VP - Fix error messages while deleting geometry
==========================================================

When selecting a list of geometry, where at least one element has internal geometry, together with the internal geometry
produced an error in the report view.

Solution:
Use newly exposed deleteGeometries to delete all geometries at once.

Note:
The list is not reverse sorted (as opposed as with the deleteGeometry method), as the list will be sorted
by SketchObject in the normal order. Reverse sorting would lead to the worst case for that normal order sort.
2021-01-06 13:54:00 +01:00
Abdullah Tahiri
a3b9edc6d8 Sketcher: Expose delGeometries function to Python 2021-01-06 13:54:00 +01:00
Abdullah Tahiri
41c91574cf Sketcher: deleteGeometries split
================================

New deleteGeometries function, according to the comment should the same
as deleteGeometry but at a time. However, this is not accurate, as deleteGeometry
deletes any internal geometry associated to the provided GeoIds, whereas
deleteGeometries does not delete that internal geometry.

Solution:
Split deleteGeometries into two different functions:
1) delGeometriesExclusiveList
2) delGeometry

The former will not delete associated internal geometry. It is more efficient, but
it is the resposibility of the caller not to leave internal geometry undeleted.

The latter, implemented in terms of the former, will delete associated internal
geometry too.

As a bonus, the latter will also remove any GeoId duplicates.
2021-01-06 13:54:00 +01:00
Abdullah Tahiri
b91bba28b3 Sketcher: VPSketch override correctness 2021-01-06 13:54:00 +01:00
Abdullah Tahiri
dbb08f0bfe Sketcher : Correct XPM icon
===========================

Added yellowish inside for better visualisation
2021-01-06 13:54:00 +01:00
Abdullah Tahiri
a388a0d980 Sketcher: ViewProvider - Show malformed constraints in solver messages 2021-01-06 13:54:00 +01:00
Abdullah Tahiri
3d5ab8a67e Sketcher: add command to select malformed constraints 2021-01-06 13:54:00 +01:00
Abdullah Tahiri
2bd2041bfe Sketcher: Retrieve 1-based list of malformed constraints from solver 2021-01-06 13:54:00 +01:00
Abdullah Tahiri
150e50c700 Sketcher: Treat malformed solver constraints as an error during recompute
=========================================================================

Sometimes it happens that malformed constraints are arrived to.

Example:
https://forum.freecadweb.org/viewtopic.php?f=3&t=53780#p463271

It is not the first time. They usually go under the radar and when they are
detected is too late to know what caused them. The user is desperate too.

This commit makes malformed constraints to prevent the recompute of the project.

This is in the best interest of the user.
2021-01-06 13:54:00 +01:00
Abdullah Tahiri
83d039101c Sketcher: VP show overlay icon fully constrained status
=======================================================

ViewProviderSketch relies on new property SketchObject::FullyConstraint to show status via overlay icon
2021-01-06 13:54:00 +01:00
Abdullah Tahiri
87c9f83bd6 Gui: Colorful/Greyable overlay status in icons
===============================================

Before this implementation, specific status via former mergeOverlayIcon() was greyed out
with the visibility.

With this commit, the developer has two options:

a) override mergeGreyableOverlayIcons, in which case the overlay will
be greyed out when the item is greyed out as per former mergeOverlayIcon()

b) override mergeColorfulOverlayIcons, in which case the overlay will
be superimposed after the icon is greyed out as it is the case for stardard
error and recompute flags.
2021-01-06 13:54:00 +01:00
Abdullah Tahiri
035bea5082 Sketcher: Add FullyConstrained read-only output property
========================================================

This property stores whether a Sketch has 0 DoF or not upon solve.

It is serialised to disk, enabling a recently loaded project to have an accurate
populated property even before the first solve() call.
2021-01-06 13:54:00 +01:00
Abdullah Tahiri
f9143750ab Sketcher: Show attachment overlay icon information
==================================================

ViewProviderSketch now derives from the ViewProviderAttachExtension and gets the overlay icon when not attached.

ViewProvider2DObject does not implement a ViewProviderAttachExtension although Part2DObject (on which SketchObject derives)
does derive from AttachExtension. It is understood that this is because this functionality is unwanted for other
ViewProviders.
2021-01-06 13:54:00 +01:00
fxjaeckel
ed04ff7fda Update tokrules.py
[OpenSCAD] fix parser error for numbers with positive exponent >= 6
see forum: https://forum.freecadweb.org/viewtopic.php?f=3&t=54044
2021-01-05 20:26:42 -06:00
donovaly
5eaa4f04c3 [GUI] fix missing Std_AxisCross icon
in commit 7587658ae3 the icon was not also added to the used Std_AxisCross menu entry
2021-01-06 01:41:01 +01:00
danreb25
3b2e3a730f Merge branch 'master' into BBLPatch_ArchComponentDiffuseColor 2021-01-05 20:01:16 +01:00
Yorik van Havre
55219f85d4 Start: Added tooltip to preferences button 2021-01-05 16:54:23 +01:00
Yorik van Havre
eb549a99d3 Draft: Added import/export buttons to Annotation styles editor dialog 2021-01-05 16:54:06 +01:00
Yorik van Havre
d7692e359e Arch: Fixed wrong section fill when using archvrm module 2021-01-05 16:52:56 +01:00
bitacovir
58cf466b39 Add SVG icons for eight Std View commands 2021-01-05 16:14:57 +01:00
wmayer
bb1e4ed7c4 Path: [skip ci] fix build failure when using boost 1.75 2021-01-05 15:12:46 +01:00
wmayer
2a0b688114 cmake_ [skip ci] print major, minor and build number of boost 2021-01-05 15:11:53 +01:00
danrenb
a89e4dfbeb deal with missing DiffuseColor attributes on obj.CloneOf.ViewObject 2021-01-05 12:27:05 +01:00
sliptonic
d5092d78f0 Merge pull request #4213 from mlampert/feature/job-tool-group
[Path]: Feature/job tool group
2021-01-04 14:10:50 -06:00
sliptonic
deaee2292e Merge pull request #4226 from sliptonic/bug/adaptiveclip
[Path] fix bug with adaptive path gouging at start of movement
2021-01-04 09:53:27 -06:00
Mateusz Skowroński
294a2ebc9d Fix Qt deprecation warnings. QPrinter::paperSize() and QPrinter::setPaperSize() are obsolete. 2021-01-04 13:40:58 +01:00
wmayer
65b4271d53 FEM: fix also typos in inp files to avoid to break unit tests
See also: 22ed94e118
2021-01-04 13:38:43 +01:00
Yorik van Havre
9324b0aa56 Merge pull request #4216 from marioalexis84/draft-draftify
Draft: Replace Part.getSortedClusters by Part.sortEdges in draftify function
2021-01-04 12:33:55 +01:00
Yorik van Havre
5fca0232d7 Merge pull request #4236 from bitacovir/New_Std_View_Icons1
Add SVG icons of eight Std View menu commands
2021-01-04 12:31:46 +01:00
Yorik van Havre
f1b644d176 Merge pull request #4235 from marioalexis84/draft-facebinder
Draft: Fix multiple crashes when using modification functions - fixes #0004243, #0003971
2021-01-04 12:30:56 +01:00
Yorik van Havre
914e10c627 Merge pull request #4239 from carlopav/fix_draft_move_with_copy
Draft: change in default Draft.makeCopy
2021-01-04 12:18:54 +01:00
Yorik van Havre
5803784377 Merge pull request #4242 from realthunder/HelpDonate
Gui: add 'Donate' to Help menu
2021-01-04 12:05:16 +01:00
Zheng, Lei
3ea1486071 Gui: fix external edit reset crash
By making sure to signal from the owner document of the editing object.
The owner document of the editing object may be different from the
editing document in case of editing external linked object.
2021-01-04 12:01:00 +01:00
Zheng, Lei
d45122f45f Gui: add 'Donate' to Help menu 2021-01-04 10:43:37 +08:00
mlampert
254505e83c Merge branch 'master' into feature/job-tool-group 2021-01-03 18:12:41 -08:00
Bernd Hahnebach
22ed94e118 FEM: calculix solver, typos, thanks to UR_ 2021-01-04 00:52:33 +01:00
sliptonic
19ea3d28f5 Merge pull request #4234 from mlampert/bugfix/drilling-op-tool-attributes
[Path]: Check for CuttingEdgeAngle existance before using it for drill tip calculation
2021-01-03 16:42:04 -06:00