Commit Graph

183 Commits

Author SHA1 Message Date
wmayer
bb55427ca2 [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
3c52ff6c7f Gui: [skip ci] improve whitespaces 2020-04-06 19:50:08 +02:00
wmayer
7b194bfe9f 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
12690fb566 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
7e4969f329 Gui: fix screentshot 2020-01-14 15:59:38 +01:00
Zheng, Lei
78ac86abd2 Gui: fix screenshot with opaque background 2020-01-12 18:50:37 +01:00
Zheng, Lei
12965165a6 Gui: fix screenshot 2020-01-12 18:50:37 +01:00
wmayer
a5630bc689 fix some const correctness 2019-12-29 17:13:18 +01:00
wmayer
c5c3b41c8f 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
7f720e9318 [skip ci] scale grabbed image to defined width 2019-12-27 21:00:34 +01:00
wmayer
4a373effb4 Gui: [skip ci] show navi cube also when rendering as framebuffer or GL image 2019-12-27 13:57:21 +01:00
wmayer
194fa49bfa Gui: [skip ci] add option to grab 3D view as is 2019-12-27 13:52:34 +01:00
luz.paz
04ba2872f0 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
11581294e5 add convenience method to 3d viewer to disable selection 2019-11-07 17:13:20 +01:00
wmayer
cea553c101 fix -Wimplicit-fall-through, -Wpedantic 2019-10-22 10:54:03 +02:00
wmayer
6d515aa60c fix build failure on Windows due to conflicting define of GDI API 2019-10-08 14:49:56 +02:00
Zheng, Lei
bb3baefdb5 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
11af8c8543 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
9fa56345cf 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
690df49618 fixes #0004103: Black screen when using rubberband selection 2019-09-17 15:55:05 +02:00
wmayer
4068df6483 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
63a577fe07 Fix typos in src/Gio 2019-08-17 15:32:49 +02:00
Zheng, Lei
d4ac072306 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
5214f5b7ce 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
c9ba972d26 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
2b02659010 Misc. typo and whitespace fixes
Found via `codespell`
2019-05-30 19:56:12 +02:00
Dion Moult
20795f1505 Actually highlight preselected objects upon the selectionchange event, otherwise it only triggers on mousemove event 2019-05-08 10:26:55 -03:00
wmayer
6c5a0cf125 fix build failure on Ubuntu Bionic 2019-02-13 10:46:55 +01:00
wmayer
2de2edb3ed fix build failures with newer compiler versions 2019-02-12 13:10:49 +01:00
Mateusz Skowroński
ac508516da 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
8fabcc8d75 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
47ae980fa2 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
f94445f9a9 add PS action to dumpToFile 2018-11-05 19:22:52 +01:00
luz.paz
7e221ab15d 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
8392914f50 allow to access NaviCube of 3d viewer 2018-10-23 12:47:11 +02:00
wmayer
2877face0c 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
644cfa06bb replace boolean to check for inside/outside cutting with enum values 2018-09-18 18:25:51 +02:00
wmayer
90258a47f0 move check for grabbed node and releasing it from ViewProviderDragger::unsetEditViewer to View3DInventorViewer::resetEditingViewProvider 2018-09-11 17:27:17 +02:00
wmayer
721e37d888 fix several reference counting bugs 2018-08-18 16:01:55 +02:00
wmayer
74ac2e76f1 clear selection node when destroying viewer 2018-08-18 11:32:32 +02:00
luz.paz
424cd49398 Typos and whitespace fixes 2018-08-07 11:13:31 -04:00
wmayer
9a3021818b implement option to change corner of navi cube 2018-05-26 18:51:53 +02:00
wmayer
3b4ab88844 + option to disable navi cube
+ handle destruction of GL context in 3d viewer class
+ fix for OpenGL error message: 'Texture is not valid in the current context. Texture has not been destroyed'
2018-05-26 15:33:45 +02:00
wmayer
68b979de5e fix Qt5 build failure 2018-05-26 15:33:45 +02:00
Kustaa Nyholm
e610965b5c First Qt5 compatible NaviCube attempt 2018-05-26 15:33:45 +02:00
wmayer
2264e8d484 further simplification when to use which rendering method when saving an image 2018-01-14 22:19:32 +01:00
wmayer
257ec15cff make workaround with transparent background more reliable 2018-01-12 15:47:40 +01:00
wmayer
9689717d34 workaround to create images with transparent background 2018-01-12 14:36:25 +01:00
wmayer
a9b1356bc7 code reduction w.r.t offscreen rendering 2018-01-07 17:12:50 +01:00
wmayer
292608e466 simplify to define when to use which offscreen rendering method 2018-01-07 15:00:40 +01:00