Commit Graph

206 Commits

Author SHA1 Message Date
Uwe
8a0e6dd587 [Gui] compilation fixes for non-PCH
the recent commits were done with PCH, this is the final commit of today's header work for PCH
2022-02-19 06:22:08 +01:00
Uwe
83d5c787da [Gui] View3DPy and View3DInventorViewer: remove unused headers 2022-02-19 02:35:54 +01:00
wmayer
a87e33258d Gui: remove support of using deprecated Qt OpenGL API 2022-01-26 14:46:41 +01:00
wmayer
c111009ea6 Gui: add function View3DInventorViewer::projectPointToLine and expose to Python 2021-12-12 12:49:53 +01:00
wmayer
94a881f829 Gui: harmonize classes View3DInventorViewer and View3DInventorPy 2021-12-12 11:33:04 +01:00
0penBrain
e998f61d2c [Gui] Render corner cross lines with thin polygons so it can be scaled 2021-11-23 00:06:38 +01:00
0penBrain
f6337f6e79 [Gui] Improve corner cross labels rendering by using larger antialiased pixmaps 2021-11-23 00:06:14 +01:00
0penBrain
8890b59f09 [Gui] Render corner cross labels as pixel maps so they are scalable 2021-11-23 00:05:50 +01:00
Yorik van Havre
b84c2c7f09 Merge pull request #4178 from uLeonis/master
[v0.20][Gui] Consolidate Std view modes
2021-09-09 12:22:27 +02:00
wmayer
37eb08380a Gui: remove WinNativeGestureRecognizers because this was a workaround for Qt4 under Windows 2021-04-02 11:47:12 +02:00
Chris Hennes
098d7b9aee [GUI] Remove code for Qt < 5.9 2021-04-02 10:10:37 +02:00
wmayer
786955e022 Gui: [skip ci] fix issue found with -fsanitize-address-use-after-scope 2021-02-21 13:53:23 +01:00
wmayer
73f10fab47 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
8924bd4734 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
uLeonis
cbe1050441 MeasureDistance
- Abort mode via ESCAPE added

BoxZoom, BoxSelection and BoxElementSelection
- Change the cursor to give the user feedback about active mode.
- Abort mode via ESCAPE
2020-12-21 17:32:33 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
4608e9bc0a 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
2647987157 Qt5: fix deprecation warnings of QWheelEvent in Qt 5.15 2020-10-18 14:45:31 +02:00
wmayer
d16c35a17d Gui: [skip ci] Coverity: Uncaught exception 2020-09-14 17:21:50 +02:00
wmayer
e9ce75d544 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
1a34d3da1f Coverity: Uncaught exception 2020-07-20 17:34:26 +02:00
wmayer
901c24fec3 Gui: add comment 2020-07-09 19:59:24 +02:00
Zheng, Lei
f00a15b0ea Gui: disable COIN_AUTO_CACHING to work around coin3D bug 2020-07-09 19:57:48 +02:00
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