Commit Graph

123 Commits

Author SHA1 Message Date
Rexbas
a2c2bf5a4b Gui: Revert breaking Python interface change for viewPosition() 2023-10-25 11:17:55 +02:00
Rexbas
37e600e766 Gui: Refactor navigation animations
- Animations are played through an Animator
- Standard animations have a fixed duration and inherit from QVariantAnimation
- The animation duration can be changed in the preferences
- Fix animations when using the two arrows above the NaviCube
- Start an animation or start and wait for an animation
- Replaces standard camera animations (e.g. by selecting standard views or NaviCube) with FixedTimeAnimation
- Replace View3DInventorViewer's CameraAnimation with FixedTimeAnimation
- Replace OpenInventor navigation style infinite spin animation with SpinningAnimation
- Stops an active animation when a new animation is started
- Stops an active animation when the user starts dragging, panning or zooming
- Refactor reorientCamera so it can be used in animations
- Enable animations by default
2023-10-25 11:17:55 +02:00
Yorik van Havre
ffd66cf826 Revert "Gui: Refactor navigation animations" 2023-09-26 19:44:16 +02:00
Rexbas
9fed764368 Gui: Refactor navigation animations
- Animations are played through an Animator
- Standard animations have a fixed duration and inherit from QVariantAnimation
- The animation duration can be changed in the preferences
- Fix animations when using the two arrows above the NaviCube
- Start an animation or start and wait for an animation
- Replaces standard camera animations (e.g. by selecting standard views or NaviCube) with FixedTimeAnimation
- Replace View3DInventorViewer's CameraAnimation with FixedTimeAnimation
- Replace OpenInventor navigation style infinite spin animation with SpinningAnimation
- Stops an active animation when a new animation is started
- Stops an active animation when the user starts dragging, panning or zooming
- Refactor reorientCamera so it can be used in animations
- Enable animations by default
2023-09-04 21:43:41 +02:00
sliptonic
59995204e0 Merge pull request #10405 from wwmayer/fix_activeobject_of_activeview
Gui: improve accessing active object of an MDI view
2023-08-28 10:34:57 -05:00
wmayer
2d35da4519 Gui: improve accessing active object of an MDI view
* if 2nd argument of getActiveObject() is False and the requested object doesn't exist then return (None, None, "")
* remove the exact same implementations from View3DInventorPy
2023-08-28 13:34:48 +02:00
wmayer
c05e7f7670 Gui: use '%Y-%m-%d %H:%M:%S' as format string for date
For more details see: https://forum.freecad.org/viewtopic.php?p=702475#p702475
2023-08-28 08:25:52 +02:00
Chris Hennes
86a44c9824 Gui: Wrap PyArg_ParseTupleAndKeywords 2023-08-25 15:34:26 -05:00
Pieter Hijma
d07dd67ba1 Gui: Cleanup Python varargs
Various function existed that had no arguments but were still treated as
if they were vararg functions.  This has no been changed to
add_noargs_method declarations, cleaning up the code.
2023-08-16 15:07:09 +02:00
wmayer
2725c3a54f Gui: modernize C++: use range-based for loop 2023-08-14 19:42:18 +02:00
Pieter Hijma
292196a606 Gui: Expose the upDirection vector to Python 2023-08-08 13:53:50 -04:00
Benjamin Bræstrup Sayoc
33384cff9c [Everywhere] FileInfo::hasExtension for multiple values (#9774)
* [Base] Add hasExtension for multiple values

* [Gui] Use hasExtension for multiple values

* [Drawing] Use hasExtension for multiple values

* [Fem] Use hasExtension for multiple values

* [Import] Use hasExtension for multiple values

* [Mesh] Use hasExtension for multiple values

* [Part] Use hasExtension for multiple values

* [TechDraw] Use hasExtension for multiple values
2023-08-07 09:55:19 -06:00
wmayer
6237a0e67b Gui: rename getPointOnScreen() to getPointOnViewport() 2023-04-08 13:51:32 +02:00
wmayer
7bf0e2e703 Gui: add method to convert between QPoint and SbVec2s considering device pixel ratio 2023-04-08 13:51:32 +02:00
wmayer
2aef0cfa61 Gui: move class Camera to own source files 2023-03-22 16:13:38 +01:00
wmayer
787a37be82 Gui: fix View3DInventorViewer's getViewProviderByPath, getViewProviderByPathFromTail, getViewProvidersOfType
The View3DInventorViewer only contains the top-level view providers which caused unexpected behaviour when using the three methods above. Thus, in client code they haven't been used any more.
Now the methods internally invoke the corresponding methods of the document. This allows it in client code to directly call the appropriate methods again (LoD).
2022-12-12 16:41:58 +01:00
marioalexis
fa6cf56020 Gui: Check Python types using Base::PyTypeCheck 2022-09-24 05:10:34 +02:00
marioalexis
0382f276a2 Gui: Replace C cast 2022-09-18 11:06:51 -05:00
berniev
75acacd1b7 Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
2022-09-14 13:25:13 -05:00
berniev
d88729d2c4 Gui: use empty 2022-08-06 16:35:45 +02:00
wmayer
0bef4e82f2 Fix several clazy issue:
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
2022-07-24 22:29:06 +02:00
wmayer
201f4c9a5a Core: replace PyObject_IsTrue with Base::asBoolean 2022-07-16 14:04:05 +02:00
wmayer
e9890c0798 Gui/Mod: replace several reinterpret_cast with static_cast 2022-06-25 11:36:55 +02:00
marioalexis
f78412c75b Gui: Use PyObject_IsTrue in combination with conditional ternary operator 2022-06-22 19:50:03 -04:00
Zheng, Lei
3ef438eaf0 Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
bedf920702 Gui: PR6497 move return statement to new line 2022-03-29 12:33:50 -05:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
fe5f5bdda5 [Gui] only include the actually used inventor files 2022-03-17 21:12:19 +01:00
wmayer
68b92c504f Fix several coverity issues:
* CID 350617: Dereference after null check
* CID 350585: Out-of-bounds read
* CID 350624: Resource leak
* CID 332701: Uncaught exception
* CID 350642: Uninitialized scalar field
* CID 350590: Uninitialized scalar field
* CID 350629: Uninitialized scalar variable
* CID 350602: Uninitialized scalar variable
* CID 350564: Uninitialized scalar variable
* CID 350548: Uninitialized scalar variable
2022-03-13 12:12:49 +01:00
wmayer
8d3c66cf18 Core/Mod: modernize C++11
* use nullptr
2022-03-09 21:55:31 +01:00
wmayer
9e91a8991e Gui: Optimize includes to reduce compile time 2022-03-09 01:25:29 +01:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
Uwe
14288f9725 [Gui] View3D*: remove unused includes 2022-03-05 23:16:28 +01:00
Uwe
6bf4cf7b41 [Gui] more work to remove unused includes 2022-02-21 00:03:13 +01:00
Uwe
3b1280c587 [Gui] View3DPy and View3DInventorViewer: remove unused headers 2022-02-19 02:35:54 +01:00
wmayer
0bc96dfedd + code refactoring of View3DInventorPy::viewDefaultOrientation 2021-12-27 16:32:31 +01:00
wmayer
b6527a7098 Gui: add function View3DInventorViewer::projectPointToLine and expose to Python 2021-12-12 12:49:53 +01:00
wmayer
4dae213b45 Gui: harmonize classes View3DInventorViewer and View3DInventorPy 2021-12-12 11:33:04 +01:00
0penBrain
9d15df29d9 [Gui] Expose API for corner axis cross visibility/size to Python 2021-11-23 00:05:10 +01:00
wmayer
fad2fd9568 Gui: make View3DInventorPy acting as sub-class of MDIViewPy 2021-11-21 19:44:38 +01:00
wmayer
8eb099d4e1 Gui: add MDIViewPy.cast_to_base and implement in Python wrappers for sub-classes of MDIView 2021-11-19 15:44:23 +01:00
wmayer
9def811a3a Gui: [skip ci] expose function to Python to enable/disable context-menu of 3d view 2021-11-02 12:57:54 +01:00
wmayer
5da633d59f Gui: [skip ci] improve whitespaces 2021-10-20 22:21:52 +02:00
wmayer
00759f9c96 Gui: move PythonWrapper class to its own source file 2021-09-22 23:30:03 +02:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
f98a4bbc47 Gui: [skip ci] add method to access the Inventor viewer as QGraphicsView 2020-10-01 13:54:12 +02:00
DeepSOIC
68848ea9f8 Gui: implement SoMouseWheelEvent
and sythesize it instead of fake buttons 4 and 5
2020-08-22 17:15:02 +02:00
Adrian
9e116801ed Change Std Bottom orientation (x ->right; y ->down)
Camera::rotation(Camera::Bottom) was upside-down compared to industry standards and other FreeCAD bottom views
2020-05-06 11:04:08 +02:00
wmayer
e6b3fad6e1 Gui: allow to dump only the visible part of the scene graph
Gui.ActiveDocument.ActiveView.dump("scene.iv", True)
The second parameter is optional and by default False
2020-01-16 13:28:01 +01:00
wmayer
9e4710d679 Gui: [skip ci] allow to pass multi-sampling in Python wrapper 2019-12-27 15:19:19 +01:00