Commit Graph

141 Commits

Author SHA1 Message Date
Markus Reitböck
a72a0d6405 Gui: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:03 +02:00
xtemp09
887e7bd595 Simplify repr() function 2025-08-25 10:38:39 -05:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Kevin Martin
762c8e0ac5 Check for a null scene object
Under certain unusual circumstances getSceneGraph can be called when the scene is null, causing a native exception when the scene's reference count is incremented.
This changes the code to return python None in this condition, allowing the calling cod eto handle the no-scene case itself.
2025-04-05 18:45:19 +02:00
Benjamin Nauck
b625e81a3e Gui: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
Furgo
6864ac4e0d Start: set specific zoom level for new BIM projects (#20271)
* Gui: allow viewDefaultOrientation function to accept the None value, as per the docstring

* Start, BIM: set specific zoom level for new BIM projects
2025-03-25 09:36:43 +01:00
Chris Hennes
b18150e048 Merge pull request #19479 from tritao/base-cleanup-xml-generation
Base: Minor cleanups to base XML bindings generation
2025-02-10 09:34:50 -06:00
tritao
2145b742eb Base: Standardize on Py::Long type for Python bindings. 2025-02-08 13:14:22 +00:00
tritao
02ab2deac7 Gui: Reorganize the navigation files into a top Navigation folder. 2025-02-05 20:21:00 -06:00
Benjamin Nauck
6f535f19fb Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
tritao
f75263cd19 Gui: Rename View3DInventorPy::getView3DIventorPtr() due to typo. 2025-01-14 13:37:33 -06:00
kwahoo2
64b24cd27d Gui: add method to select objects with a 3D ray (#16789)
* Implementation of ray picking method for 3d picking

* Ray picking logic moved to C++

(cherry picked from commit ed23214c0bce7b70fd1003a7c4612e2d0d7da4cb)

* formatting, do not return unecessary dict keys, near plane clipping
2024-12-13 11:32:37 -06:00
Chris Hennes
889c5ea516 Merge pull request #15528 from ppphp/move_some_inventor
refactor: move some nodes to Inventor folder
2024-11-22 12:20:50 -05:00
wmayer
2d4049ef52 Core: Check returned pointer of convertSWIGPointerObj 2024-10-10 20:36:03 -05:00
wmayer
3b91fd33e0 Qt6: QColor::setNamedColor is deprecated since Qt 6.6 2024-09-11 15:41:04 +02:00
bgbsww
19e450a667 Refactor all element name pairs into clearer struct names - renames 2024-07-20 16:32:12 -04:00
liukaiwen
776ed8f2c1 refactor: move some nodes to Inventor folder 2024-07-20 01:07:04 +08:00
Chris Hennes
cfd41683a5 Core: Enable compiling with MSVC /permissive- (#11014)
* Base: Fixes for MSVC permissive-

* App: Fixes for MSVC permissive-

* Gui: Fixes for MSVC permissive-

* Main: Fixes for MSVC permissive-

* Fem: Fixes for MSVC permissive-

* Material: Fixes for MSVC permissive-

* Part: Fixes for MSVC permissive-

* Mesh: Fixes for MSVC permissive-

* Points: Fixes for MSVC permissive-

* Robot: Fixes for MSVC permissive-

* TechDraw: Fixes for MSVC permissive-

* Path: Fixes for MSVC permissive-

* Core; Changes per review comments

* TD: Revision from wandererfan

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-11-27 17:37:29 +01:00
Rexbas
56b60baeb2 Gui: Revert breaking Python interface change for viewPosition() 2023-10-25 11:17:55 +02:00
Rexbas
0441ea10fc 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
f1fb45960d Revert "Gui: Refactor navigation animations" 2023-09-26 19:44:16 +02:00
Rexbas
dc216cde2a 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
559fea0640 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
b35e83609a 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
f6c1c86cbd 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
3d7441c2a5 Gui: Wrap PyArg_ParseTupleAndKeywords 2023-08-25 15:34:26 -05:00
Pieter Hijma
2c5a4b71eb 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
e09d8aaba6 Gui: modernize C++: use range-based for loop 2023-08-14 19:42:18 +02:00
Pieter Hijma
c765d64891 Gui: Expose the upDirection vector to Python 2023-08-08 13:53:50 -04:00
Benjamin Bræstrup Sayoc
da2ae719f2 [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
e9a9413c71 Gui: rename getPointOnScreen() to getPointOnViewport() 2023-04-08 13:51:32 +02:00
wmayer
6509cc72e7 Gui: add method to convert between QPoint and SbVec2s considering device pixel ratio 2023-04-08 13:51:32 +02:00
wmayer
4d6b2c4a14 Gui: move class Camera to own source files 2023-03-22 16:13:38 +01:00
wmayer
184afd9761 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
6bff8ee833 Gui: Check Python types using Base::PyTypeCheck 2022-09-24 05:10:34 +02:00
marioalexis
ff1b4eff05 Gui: Replace C cast 2022-09-18 11:06:51 -05:00
berniev
ae53c9b0a4 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
2db561561e Gui: use empty 2022-08-06 16:35:45 +02:00
wmayer
25483b78be 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
ab6c75fad9 Core: replace PyObject_IsTrue with Base::asBoolean 2022-07-16 14:04:05 +02:00
wmayer
d5340a82ab Gui/Mod: replace several reinterpret_cast with static_cast 2022-06-25 11:36:55 +02:00
marioalexis
ae56fb62a7 Gui: Use PyObject_IsTrue in combination with conditional ternary operator 2022-06-22 19:50:03 -04:00
Zheng, Lei
8bec44934b Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
5df3dbae6f Gui: PR6497 move return statement to new line 2022-03-29 12:33:50 -05:00
wmayer
1178df06b4 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
713151df03 [Gui] only include the actually used inventor files 2022-03-17 21:12:19 +01:00
wmayer
5fd93b7d3b 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
08b77bff08 Core/Mod: modernize C++11
* use nullptr
2022-03-09 21:55:31 +01:00
wmayer
b626b7d719 Gui: Optimize includes to reduce compile time 2022-03-09 01:25:29 +01:00
wmayer
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00