Make `Cell::setContent` use `unique_ptr` and
`make_unique` for expressions to avoid potential memory
leaks.
Also renames `expo` to `newExpr` to avoid mixup with the
member variable `expression`.
Both changes was made at the request of @chennes.
This commit only changes the user interaction with spreadsheet and does
not affect backwards compatibility (as valid cell expressions are
prefixed with '=' when serialized).
This fixes [#4156](https://tracker.freecadweb.org/view.php?id=4156),
which is discussed in the forum thread:
https://forum.freecadweb.org/viewtopic.php?f=3&t=39665
There has been additional logic added to handle numbers and simple
fractions without using '='.
The behaviour is what is expected by the spreadsheet test cases
and in line with how other spreadsheet software works.
The '-prefix can still be used to force the input to be handled as
as string instead.
Example of numbers and fractions handled are:
3
2mm
1/8
1mm/2
1/2mm
2/m
1mm/2s
More complex expressions are not handled without '=' and will be stored
as strings instead, for example:
2 / 3 / 2
1 + 1/3
- Previously a subtractive pipe on a body with no solids would create a solid. Now Pipe will generate an error.
- Fix incorrect property header. Previously Pipe was identifying itself as Pad (copy paste error)
==================================================================================================
Coin documentation indicates the size of a font is:
SoSFFloat SoFont::size Size of font. Defaults to 10.0.
For 2D rendered bitmap fonts (like for SoText2), this value is the height of a character in screen pixels. For 3D text, this value is the world-space coordinates height of a character in the current units setting (see documentation for SoUnits node).
However, with hdpi monitors, the coin font labels do not respect the size passed in pixels:
https://forum.freecadweb.org/viewtopic.php?f=3&t=54347&p=467610#p467610https://forum.freecadweb.org/viewtopic.php?f=10&t=49972&start=40#p467471
Because I (abdullah) have 96 dpi logical, 82 dpi physical, and I see a 35px font setting for a "1" in a datum label as 34px,
and I see kilsore and Elyas screenshots showing 41px and 61px in higher resolution monitors for the same configuration, I think
that coin pixel size has to be corrected by the logical dpi of the monitor. The rationale is that: a) it obviously needs dpi
correction, b) with physical dpi, the ratio of representation between kilsore and me is too far away.
This means that the following correction does not have a documented basis, but appears necessary so that the Sketcher is usable in
HDPI monitors.
also fix issue that tolerance could be set despite theoretically exact is true under some circumstances
also some wording improvements
also a minor fix to use 0.0 instead of DBL_MIN
========================================================
With the possibility to increase icon sizes via font configuration, the
default hardcoded 2.5 step for seeking the constraint position becomes too
small, causing constraints, specially when multi-icon, to superimpose geometry points,
removing the ability to pick them.
Changing the default gives some increased room for icon size.
as discussed here: https://forum.freecadweb.org/viewtopic.php?f=35&t=54218
when a value is theoretically exact it must not have a tolerance
This PR
* fixes this
* also fixes the bug that OverTolerance must not be negative if the tolerances are equal
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.
- the setting "Standard and Style" only affects new dimensions, thus it must be italic
- fix bug that the Property 'LockPosition' appears for dimensions -> this is an option for views and thus must be hidden for dimensions
- since tolerances are in the vast majority fractions of a millimeter/inch, set its stepsize to 0.1
(I hope I did it right in handleChangedPropertyType.)
- fix inconsistent newlines in TaskBalloon.h
- improve wording for a heading
=========================================================================================
- 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.