when adding GD&T statements as described in https://wiki.freecadweb.org/TechDraw_Geometric_dimensioning_and_tolerancing
You will quickly get a lot of balloons and it is then very tiring to be forced to first select a balloon with a single-click in the drawing, then go to the model tree and there double-click to get the dialog.
This PR also removes unused includes from the dialog code.
==============================================================
A previous commit assumed values for lineWidths and pointSizes were integers. This commit fixes this.
=========================================================================================
- Long overdue refactor to avoid repetition during save/restore and copy.
- New interface to notify an extension when it is attached. It also enables the extension to gain
a pointer to the geometry container. This is intended to extend the functionality already existing
in Part::Geometry.
the common rule is that if a dimension has equal over- and undertolerance, they are output on the same line as the dimension concatenated using the ± character.
This PR does this.
Note that this is not just cosmetics, it is even standardized in the GD&T norms.
also:
* use one format specifier for tolerances since the norms don't allow a different format for the over- and the undertolerance
* some code optimizations like a self-explaining function name, remove unnecessary/outdated comments
==================================================
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.
===============================================
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.
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.
===========================================================
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.
==========================================================
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.
================================
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.
=========================================================================
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.
=======================================================
ViewProviderSketch relies on new property SketchObject::FullyConstraint to show status via overlay icon
===============================================
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.
========================================================
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.
==================================================
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.
the arrow heads are much too large so that the feature use quite useless
The PR fixes this to make the arrow heads as large as for linear dimensions
It also slightly increase the arrow head size since.