Commit Graph

1482 Commits

Author SHA1 Message Date
wmayer
a731566661 Fix clang compiler warnings:
+ fix -Winconsistent-missing-override
2019-08-17 19:53:07 +02:00
Zheng, Lei
022e6c6fb2 Sketcher: auto undo when canceling constraint editing 2019-08-17 15:32:50 +02:00
Zheng, Lei
f78f05adee Sketcher: fix external editing 2019-08-17 15:32:50 +02:00
Zheng, Lei
00bcef0619 Gui: support in-place editing
The link support means that an object can now appear in more than one
places, and even inside a document different from its own. This patch
adds support for in-place editing, meaning that the object can be edited
at correct place regardless where it is.

See [here](https://git.io/fjPIk) for more info about the relavent APIs.

This patch includes two example of modifications to support in-place
editing. One is the ViewProviderDragger, which simply adds the dragger
node to editing root node by calling
View3DInventorViewer::setupEditingRoot(dragger). The other much more
complex one is ViewProviderSketch which calls setupEditingRoot(0) to
transfer all its children node into editing root. ViewProviderSketch
also includes various modifications to command invocation, because we
can no longer assume the active document is the owner of the editing
object.

This patch also includes necessary modification of the 'Show' module to
support in-place editing.
2019-08-17 15:08:32 +02:00
Zheng, Lei
c8891be856 Gui: add coinRemoveAllChildren to work around Coin3D bug
See bug description:
https://bitbucket.org/Coin3D/coin/pull-requests/119/fix-sochildlist-auditing/diff

Because of path based rendering (SoFCPathAnnotation) in mouse over
highlight, this bug causes crash more frequently here comparing to
upstream.

All C++ calling of SoGroup::removeAllChildren() is replaced by
Gui::coinRemoveAllChildren(), and python code is fixed by monkey
patching SoGroup.removeAllChildren() in FreeCADGuiInit.py.
2019-08-17 14:52:11 +02:00
Zheng, Lei
93e60caa35 PropertyExpressionEngine: convert to link type property
PropertyExpressionEngine is changed to derived from a new class
PropertyExpressionContainer, which is in turn derives from
PropertyXLinkContainer. This makes PropertyExpressionEngine a link type
property that is capable of external linking. It now uses the unified
link property APIs for dependency management and tracking of object
life time, re-labeling, etc.

ObjectIdentifier is modified to support sub-object reference, but is
not exposed to end-user, because expression syntax is kept mostly
unchanged, which will be submitted in future PR. There is, however,
one small change in expression syntax (ExpressionParser.y) to introduce
local property reference to avoid ambiguity mentioned in
FreeCAD/FreeCAD#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
2019-08-17 14:52:09 +02:00
donovaly
c1ab62af64 TaskSketcherGeneral.ui: save horizontal space
The renderingOrder ListWidget consumes too much vertical space. In 99% of the cases it has only 3 entries but currently there is always space consumed for 10 entries.
Therefore use a size policy with 12 px for one entry and expanded if necessary to contain more entries
2019-08-02 17:28:02 +02:00
luz.paz
ff1a7fd0a8 Fix typos
Found via `codespell -q 3 -I ../fc-word-whitelist.txt -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller`
2019-07-16 11:21:52 -03:00
donovaly
f6e04f1829 uniforms option names and add tooltips for sketcher 2019-07-16 13:30:18 +02:00
Abdullah Tahiri
0091dd27bc MSVC complains about missing header 2019-07-14 12:37:39 +02:00
Abdullah Tahiri
614a031814 GeometryExtensions: Add override when overriding virtual functions (EMCPP Item 12) 2019-07-14 12:37:37 +02:00
Abdullah Tahiri
143f697310 GCC 4.8 brace initializer requires double braces
================================================

GCC 7 and clang work fine without the extra set of braces.

std::array<T, N> is an aggregate that contains a C array. To initialize it, you need outer braces for the class itself and inner braces for the C array:

https://stackoverflow.com/questions/12844475/why-cant-simple-initialize-with-braces-2d-stdarray
2019-07-14 12:37:37 +02:00
Abdullah Tahiri
a41de781cc Sketcher: GeometryExtension and ExternalGeometryExtension 2019-07-14 12:37:35 +02:00
Abdullah Tahiri
9b65a4885d Sketcher: Excise SketchGeometryExtension outside of SketchObject 2019-07-14 12:37:29 +02:00
Abdullah Tahiri
8688dbceb9 Sketcher: Python implementation of Sketcher geometry extension 2019-07-14 12:37:29 +02:00
Abdullah Tahiri
ef30cc2527 Part: Geometry Python interface to get/set an extension 2019-07-14 12:37:29 +02:00
Abdullah Tahiri
b778e21b45 Sketcher Geometry Extension 2019-07-14 12:37:28 +02:00
Abdullah Tahiri
26d3d906c8 Sketcher: Add Sketcher Geometry Extension 2019-07-14 12:37:28 +02:00
Abdullah Tahiri
e9f3551f8f Sketcher: Mode filter of Elements Widget
========================================

A combobox type filter to filter out on Normal geometry, Construction geometry, External geometry.

Useful, for example, to select and or delete only construction geometry.

It also fixes a bug, that external geometry was wrongly indexed in non-extended naming mode.
2019-07-01 13:49:06 +02:00
Abdullah Tahiri
b9417938c4 Sketcher: Fix Carbon copy leads to unsolvable sketch
====================================================

fixes #3973

https://forum.freecadweb.org/viewtopic.php?p=316251#p316198

This commit disables an old "axis orientation correction mode", which tried to
solve a problem with orientation of the axis. It never worked fine and it should
have never been introduced, as everything it intends to do should be done by
setting the appropriate placement offset.
2019-06-23 15:15:46 +02:00
Abdullah Tahiri
e632e9feb8 Sketcher: Fix carbon copy construction points
=============================================

fixes #3926

Points made of construction type are special non-constrainable points, such as (current) bspline knots.

This was not intended in Carbon Copy.
2019-06-22 23:15:07 +02:00
Abdullah Tahiri
0635822415 Sketcher: Polyline snap arc to 45 degrees bug fix
=================================================

fixes #3974

Snapping to 45 degrees during arc creation (hold ctrl during an arc within a polyline), resulted in
reduced precision, because Gui::Command::doCommand %f defaults only to six decimal positions, which is
a poor representation in radians of, for example, 90 degrees.

A work-around could have been to hardcode a higher number of decimals, as in %0.Xf. However, I do not like
such magic numbers.

The solution chosen is to use an App.Quantity object using as units degrees, which leads to no loss of precision.
2019-06-22 17:22:40 +02:00
Abdullah Tahiri
3810381d92 Sketcher: fixes no horizontal/vertical on segment after horizontal/vertical alignment
=====================================================================================

Selecting first the horizontal/vertical constraint and applying to a line segment with
a previous horizontal/vertical alignment constraint caused FreeCAD to refuse applying it.

fixes #4013
2019-06-22 09:58:42 +02:00
Abdullah Tahiri
f22d1393c7 Sketcher: Toolbar - add toggle deactivated state command 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
2822381d44 Sketcher: ViewProvider representation of deactivated constraints 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
8b5ee49db8 Sketcher: Settings - Deactivated constraints color selection 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
70081d739b Sketcher: Constraints' widget deactivated constraints commands and representation 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
4de857a471 Sketcher: GUI command to activate/deactivate constraints 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
7e3fd1a343 Sketcher: Update icon resources 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
76097838db Sketcher: Art - Toggle Active Constraint icon 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
f45d0e54c0 Sketcher: Python interface to SketchObject constraint state 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
e06e03dccb Sketcher: Extend SketchObject to handle constraint state 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
20a83b82f6 Sketcher: Solver interface of activated state 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
7fad315613 Sketcher: Python interface to contraints' activated state 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
7cd3dd7dc4 Sketcher: Extend Constraints to have an activated boolean state 2019-06-22 08:26:31 +02:00
Yorik van Havre
236f890864 Merged translations from crowdin 2019-06-17 20:06:59 -03:00
Abdullah Tahiri
87b46e3fb3 GCS: Refactor and additional debug information
==============================================

In maximum verbose debug mode, information is given about the groups of Sketcher Constraints that the solver is considering for redundancy or conflict.

This is before the popularity contest selects the constraint shown in the solver messages.

The main reason for showing this is to enable to diagnose problems with sketches in which the constraint indicated as the redundant one appears not to
be the right one. Intended for power users with "iteration level" debug mode.
2019-06-17 14:05:24 +02:00
SmallSharky
41c828a3b5 [Sketcher] Fix initial autoconstraints behavior 2019-05-18 11:54:37 +02:00
wmayer
4c63bd49e3 fix Sketcher build failure 2019-05-16 12:46:02 +02:00
Abdullah Tahiri
bb38abd6dd PCH: Sketcher GUI PCH Enable 2019-05-16 12:46:02 +02:00
Yorik van Havre
ed386410bc Merged latest translations from crowdin 2019-05-10 19:19:37 -03:00
Yorik van Havre
c65bf365a1 Updated master translation files 2019-05-10 19:15:33 -03:00
luz.paz
25c3310fbd Crowdin: fix grammatical error + whitespace
https://crowdin.com/translate/freecad/569/en-fi#6498705
2019-05-02 13:34:39 -03:00
Abdullah Tahiri
dc32a0685b Sketcher: GUI PCH 2019-05-02 07:12:51 +02:00
Abdullah Tahiri
95788dde71 Sketcher: PCH 2019-05-02 07:12:27 +02:00
Abdullah Tahiri
e80af8b4f2 PCH for Sketcher/PartDesign 2019-05-01 09:05:55 +02:00
luz.paz
0238906d38 Misc. typo and whitespace fixes
Found via `codespell`
2019-04-30 10:15:59 -03:00
Abdullah Tahiri
d21cf68b8a GCS: Partial refactoring of diagnose() and debug improvements 2019-04-24 17:56:37 +02:00
Abdullah Tahiri
5f42b8216f Sketch: Verbose to console output malformed constraints that are ignored by the solver 2019-04-24 17:56:37 +02:00
Abdullah Tahiri
a1c83e7150 Sketcher: Comment out very specific debug code 2019-04-24 17:56:37 +02:00