Commit Graph

194 Commits

Author SHA1 Message Date
wmayer
3d227cf717 Gui: [skip ci] fix issue found with -fsanitize-address-use-after-scope 2021-02-21 13:53:23 +01:00
wmayer
4af6c5a13e Gui: [skip ci] update standard cursors of 3d view when device pixel ratio changes (e.g. by moving between standard and high DPI monitor) 2021-01-19 19:19:30 +01:00
wmayer
254ed951f9 Gui: [skip ci] must set device pixel ratio to QBitmaps on Windows when using for cursor as otherwise garbage is shown 2021-01-18 15:20:57 +01:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
99e9b4db1c Gui: [skip ci] Fix navigation styles
If a joystick is connected events of type Spaceball::MotionEvent might be emitted but the last saved mouse position is not passed to the SoMotion3Event and thus will lead to problems while panning.

See also: https://forum.freecadweb.org/viewtopic.php?f=3&t=50628 and https://github.com/FreeCAD/FreeCAD/pull/3902
2020-11-21 10:15:13 +01:00
wmayer
34f4b712d8 Qt5: fix deprecation warnings of QWheelEvent in Qt 5.15 2020-10-18 14:45:31 +02:00
wmayer
3a8a28ce92 Gui: [skip ci] Coverity: Uncaught exception 2020-09-14 17:21:50 +02:00
wmayer
dc65b055e5 LGTM: [skip ci] fix: Empty branch of conditional
An empty block after a conditional can be a sign of an omission and can decrease maintainability of the code.
Such blocks should contain an explanatory comment to aid future maintainers.
2020-07-26 15:49:14 +02:00
wmayer
43d9e82f97 Coverity: Uncaught exception 2020-07-20 17:34:26 +02:00
wmayer
9f890aa1a3 Gui: add comment 2020-07-09 19:59:24 +02:00
Zheng, Lei
4ce4177b2f Gui: disable COIN_AUTO_CACHING to work around coin3D bug 2020-07-09 19:57:48 +02:00
wmayer
419e8f7a99 [skip ci] fixes #0004309: The behavior of the Std_DrawStyle command is inconsistent when there are multiple 3D views for the active document. 2020-05-01 23:30:53 +02:00
wmayer
359d3a2b48 Gui: [skip ci] improve whitespaces 2020-04-06 19:50:08 +02:00
wmayer
d65d01b30d Gui: [skip ci] optimize View3DInventorViewer::containsViewProvider because it's sufficient to know if the root node of a view provider is part of the viewer or not 2020-04-02 16:08:47 +02:00
Zheng, Lei
0633abb70d Gui: refactor link property editor
PropertyLinkItem now support all major types of link property.
PropertyLinkListItem is no longer necessary, but kept for backward
compatible, which is now identical to PropertyLinkItem.

DlgPropertyLink, the link selection dialog, is now made modeless, so
that that user can select geometry sub-element directory from 3D view.
2020-02-11 15:40:27 -05:00
Zheng, Lei
5afd6a9641 Gui: fix screentshot 2020-01-14 15:59:38 +01:00
Zheng, Lei
7484738044 Gui: fix screenshot with opaque background 2020-01-12 18:50:37 +01:00
Zheng, Lei
20c85d9cc4 Gui: fix screenshot 2020-01-12 18:50:37 +01:00
wmayer
a9f820470b fix some const correctness 2019-12-29 17:13:18 +01:00
wmayer
eb4e2d2c56 Gui: add virtual method containsViewProvider to MDIView and re-implement it in some sub-classes
Improve Document::setActiveView to not always switch to the first 3D view but check the currently active view before
2019-12-29 15:00:35 +01:00
wmayer
bd36bcb22b [skip ci] scale grabbed image to defined width 2019-12-27 21:00:34 +01:00
wmayer
a7a11341fc Gui: [skip ci] show navi cube also when rendering as framebuffer or GL image 2019-12-27 13:57:21 +01:00
wmayer
e7796c0497 Gui: [skip ci] add option to grab 3D view as is 2019-12-27 13:52:34 +01:00
luz.paz
f11783a498 src/Gui: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Gui` files
2019-12-25 11:39:17 +01:00
wmayer
dd120ef507 add convenience method to 3d viewer to disable selection 2019-11-07 17:13:20 +01:00
wmayer
8e17c8c4ba fix -Wimplicit-fall-through, -Wpedantic 2019-10-22 10:54:03 +02:00
wmayer
07975595ba fix build failure on Windows due to conflicting define of GDI API 2019-10-08 14:49:56 +02:00
Zheng, Lei
45fd865fc0 Gui: refactor bounding box selection style
Previously, box style selection is rendered using customized
SoBoxSelectionRenderAction, which does not support selection context,
i.e. it does not work with Link.

This patch implements context aware bound box rendering inside
SoFCSelectionRoot, SoFCSelection and SoFCPathAnnotation (for always on
top rendering). The box rendering in SoBoxSelectionRenderAction is
disabled on construction. Box style selection can be enabled for
individual object through property SelectionStyle (moved from
ViewProviderGeometryObject to ViewProviderDocumentObject), or globally
through Parameter BaseApp/Preferences/View/ShowSelectionBoundingBox.

In addition, the parameter BaseApp/Preferences/View/UseNewSelection is
used to override selection model reported from
ViewProvider::useNewSelectionModel(). The reason being that, the same
parameter is already used to toggle selection model inside
SoFCSelection. This avoids inconsistency of selection model choice
between view provider and the SoFCSelection node inside. Note that if
the parameter 'UseNewSelection' is set to false, those view providers
that choose old selection model will not work with Link.
2019-10-08 09:56:09 +02:00
wmayer
28a915d821 when closing a 3d view check if itÄs in edit mode to avoid to leave a view provider in a broken state 2019-10-01 16:34:51 +02:00
wmayer
b50b21576e core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00
wmayer
f4bc889b4d fixes #0004103: Black screen when using rubberband selection 2019-09-17 15:55:05 +02:00
wmayer
5172c3bc08 Fix clang compiler warnings:
+ fix -Winconsistent-missing-override
+ fix -Wunused-variable
+ fix -Wbraced-scalar-init
+ fix -Wparentheses (View3DInventorViewer::checkGroupOnTop: operator '?:' has lower precedence than '+'; '+' will be evaluated first)
+ fix -Wundefined-bool-conversion (MainWindow::updateActions)
+ suppress -Woverloaded-virtual but fix later
2019-08-17 19:52:12 +02:00
luz.paz
0f67e8ddfa Fix typos in src/Gio 2019-08-17 15:32:49 +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
c744157e9a Gui: add support of selection context
The patch implements context-aware selection and rendering in 3D view.

Please check [here](https://git.io/fjiY5) for more details, including
the following 'Render Caching' section.

The patch also includes modification of View3DInventorViewer to support
always-on-top selection rendering using the secondary selection context
and the new coin node SoFCPathAnnotation.

Another small change in SoQtQuarterAdaptor for more responsive frame
rate display. The original implementation reports skewed frame rate
in the presence of long idle period.
2019-08-17 14:52:10 +02:00
luz.paz
7c1490c046 Misc. typo and whitespace fixes
Found via `codespell`
2019-05-30 19:56:12 +02:00
Dion Moult
7da48b3307 Actually highlight preselected objects upon the selectionchange event, otherwise it only triggers on mousemove event 2019-05-08 10:26:55 -03:00
wmayer
b4d2b9def5 fix build failure on Ubuntu Bionic 2019-02-13 10:46:55 +01:00
wmayer
fb37201299 fix build failures with newer compiler versions 2019-02-12 13:10:49 +01:00
Mateusz Skowroński
317bcd59c9 Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] Thanks Clazy! 2019-02-11 15:39:14 +01:00
Abdullah Tahiri
167b0d6d99 Thumbnail generation
====================

Dynamically check whether to apply the fix for thumbnail generation.

Some QT5 version seem to be affected. This problem appears in some linux distributions with some window managers.

You may check/activate this fix:

>>> hgrp = App.ParamGet("User parameter:BaseApp/Preferences/Document")
>>> hgrp.GetBool("SaveThumbnailFix")
False
>>> hgrp.SetBool("SaveThumbnailFix",True)
>>> hgrp.GetBool("SaveThumbnailFix")
True
2018-12-10 09:14:36 -03:00
DeepSOIC
82fd0a8db6 Gui: Gesture: add option to disable tilt
On Qt5, using pinch will inevitably cause tilt. It's annoying, so it is disabled by default.

In the future, it's best to introduce some kind of threshold to overcome for the tilt to be triggered.
2018-11-29 15:29:27 -03:00
wmayer
36124965d1 add PS action to dumpToFile 2018-11-05 19:22:52 +01:00
luz.paz
f976a4f734 Misc. typos and whitespace fixes
Found via `codespell -q 3 --skip="*.po,*.ts,./.git,./src/3rdParty,./src/CXX,./src/zipios++,./src/Mod/Assembly/App/opendcm" -I ../fc-word-whitelist.txt` and `grep`
2018-10-25 11:06:28 -03:00
wmayer
8678f74dc6 allow to access NaviCube of 3d viewer 2018-10-23 12:47:11 +02:00
wmayer
e79a19828e avoid to degenerate the view frustum if there is only a single point in the scene 2018-10-15 14:08:46 +02:00
wmayer
ff6ed27ba9 replace boolean to check for inside/outside cutting with enum values 2018-09-18 18:25:51 +02:00
wmayer
8f3a53c24c move check for grabbed node and releasing it from ViewProviderDragger::unsetEditViewer to View3DInventorViewer::resetEditingViewProvider 2018-09-11 17:27:17 +02:00
wmayer
3c999f563e fix several reference counting bugs 2018-08-18 16:01:55 +02:00