Commit Graph

115 Commits

Author SHA1 Message Date
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
Uwe
d6b7b91ab4 [Gui] View3D*: remove unused includes 2022-03-05 23:16:28 +01:00
Uwe
6a0a6e006c [Gui] more work to remove unused includes 2022-02-21 00:03:13 +01:00
Uwe
83d5c787da [Gui] View3DPy and View3DInventorViewer: remove unused headers 2022-02-19 02:35:54 +01:00
wmayer
d883850f90 + code refactoring of View3DInventorPy::viewDefaultOrientation 2021-12-27 16:32:31 +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
abba933757 [Gui] Expose API for corner axis cross visibility/size to Python 2021-11-23 00:05:10 +01:00
wmayer
5746a486df Gui: make View3DInventorPy acting as sub-class of MDIViewPy 2021-11-21 19:44:38 +01:00
wmayer
67cc5c9047 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
61ecfd3639 Gui: [skip ci] expose function to Python to enable/disable context-menu of 3d view 2021-11-02 12:57:54 +01:00
wmayer
370a120f75 Gui: [skip ci] improve whitespaces 2021-10-20 22:21:52 +02:00
wmayer
21ba35adab Gui: move PythonWrapper class to its own source file 2021-09-22 23:30:03 +02:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
abcaef8601 Gui: [skip ci] add method to access the Inventor viewer as QGraphicsView 2020-10-01 13:54:12 +02:00
DeepSOIC
1cb10c078f Gui: implement SoMouseWheelEvent
and sythesize it instead of fake buttons 4 and 5
2020-08-22 17:15:02 +02:00
Adrian
b25a2f4d3a 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
efa4cb66a2 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
674952d0aa Gui: [skip ci] allow to pass multi-sampling in Python wrapper 2019-12-27 15:19:19 +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
DeepSOIC
30bd6345f5 Gui: add preference to set 3d view scale for new documents
+ change default view orientation to Trimetric.
2019-09-11 21:39:08 +02:00
luz.paz
5807e0b531 Fix typos, grammar, and some whitespace issues
Found via `codespell -q 2 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml`
2019-09-07 11:58:38 -04:00
Zheng, Lei
0bc6722943 Gui: add View3DPy.hasClippingPlane() 2019-08-30 15:00:42 +02:00
luz.paz
63a577fe07 Fix typos in src/Gio 2019-08-17 15:32:49 +02:00
Zheng, Lei
fdf7adb6e1 Gui: ActiveObjectList API changes
Support sub-object in ActiveObjectList. This means that it can now
distinguish the same object being activated under different parent,
which may be in a different document through external linking.
2019-08-17 15:08:34 +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
Yorik van Havre
89ce5416b6 Gui: Added viewer.setName() python method 2019-08-15 00:20:59 -03:00