Compare commits

...

426 Commits

Author SHA1 Message Date
Chris Hennes 930dd9a762 Addon Manager: Fix bug in updater 2022-12-06 20:35:37 -06:00
Uwe fc12f15ee4 [Win installer] some uninstaller improvements
- remove two registry path deletions that were never performed since the paths do not exist
- remove registry key that stores the main window parameters (size and position) when the option to remove also the user settings is on (because this affects all FreeCAD installations)
- also change a name to uppercase (does not matter but Win 10 uses uppercase, so we should do the same to avoid confusions)
2022-12-05 02:06:46 +01:00
Uwe aaee1b5e39 this is FreeCAD 0.20.2 2022-12-05 00:02:59 +01:00
Uwe 4fef2ad448 [Win installer] improve file deletion script 2022-12-05 00:00:58 +01:00
Uwe 726ddc71f9 [Win installer] prepare for FC 0.20.2 2022-12-04 23:33:45 +01:00
Uwe 9415d2d0c4 [PD] Pad/pocket: fix wrong error message
- the error can also occur when the mode it not UpToFace (ToFirst or ToLast)
- also add note when Reversed checkbox is enabled since this is no obvious (as discussed in the forum)
- also some whitespace unification and include sorting
2022-12-04 05:38:49 +01:00
Uwe bbfe3aedce [PD] FeatureSketchBased: fix orthogonal check
- same fix as #7879
- also fix wording on an error message and improve a variable name
2022-12-04 05:33:40 +01:00
Roy-043 524bda9547 Arch: Fix missing Windows in Arch Reference of BuildingPart 2022-12-02 00:52:10 +01:00
Roy-043 ac182bf9d9 Arch: Fix Arch_Space text position 2022-12-01 12:35:19 +01:00
Roy-043 05789429cf Arch: fix cutplane color (#7859)
* Arch: fix cutplane color

* Update ArchCutPlane.py
2022-11-30 08:53:52 +01:00
Yorik van Havre 15482dcad6 Merge pull request #7885 from Roy-043/Draft-fix-clone-DiffuseColor
Draft: fix clone DiffuseColor
2022-11-30 08:51:53 +01:00
Yorik van Havre effe30ba69 Start: Set minimum height for notes panel 2022-11-30 01:24:14 +01:00
wandererfan 1bcb7275db [TD]backport fix for no Detail without BaseView 2022-11-29 02:17:14 +01:00
Chris Hennes 9bf0c5890f Addon Manager: Fix bad formatting in error handler 2022-11-27 19:41:17 -06:00
flachyjoe d17c9e35d5 [Spreadsheet] Fix alias setting for empty cells
Fix #7841
2022-11-27 19:36:42 -06:00
wmayer 2605b54d89 Sketch: use the focal distance to determine a correct scale factor for SoDatumLabel
This fixes #7860: Dimensions get unreadable (small) if a 2nd sketch is visible
and fixes #7082: Dimension size on perspective view scales "backwards"
2022-11-24 10:25:10 +01:00
Uwe 1621bd0deb [skip ci] [Part] TopoShapePyImp: fix formatting mistake
- introduced with c29228d7
2022-11-22 03:26:20 +01:00
Uwe fd6c8382ee [Part] manually backport PR #7824 2022-11-22 03:19:49 +01:00
Uwe f177aa6467 [skip ci] .clang-format: shorthand loops
- disallow as we did before we had this format file
2022-11-22 03:13:55 +01:00
Uwe c29228d785 [Part] manually backport 09dccb70 2022-11-22 03:08:25 +01:00
Yorik van Havre eec4a5975c Merge pull request #7821 from Roy-043/Draft-fix-arcFromSpline
Draft: fix arcFromSpline midpoint bug
2022-11-21 14:59:57 +01:00
Uwe 10902d7d4f Revert "Gui: ActionGroup also get its tooltip title updated"
This reverts commit fcaa312616.
2022-11-21 12:34:08 +01:00
0penBrain fcaa312616 Gui: ActionGroup also get its tooltip title updated 2022-11-21 04:09:58 +01:00
0penBrain a713eafc95 Gui: ActionGroup also get its tooltip title updated 2022-11-21 04:07:57 +01:00
Rexbas acc94f3baf Gui: Stop Revit rotation and zoom on scroll release
- Stops the rotation when scroll is released but SHIFT is still pressed
- Stops zooming when scroll is released but CTRL is still pressed
2022-11-21 04:02:58 +01:00
wmayer 710a470706 App: fix endless-loop in DocumentObject::getParents 2022-11-20 12:27:38 +01:00
wmayer 087cdd8169 Gui: fix endless-loop in View3DInventorSelection::checkGroupOnTop 2022-11-20 12:09:06 +01:00
Bernd Hahnebach fd544b4ba9 FEM: gmsh binary location on osx, add comment 2022-11-20 01:24:08 +01:00
Bernd Hahnebach 887fac2ab1 FEM: add standard path for gmsh on osx 2022-11-20 01:24:08 +01:00
wmayer 5223aff0fb Base: [skip ci] fix readability-identifier-length 2022-11-20 01:20:58 +01:00
luz paz 757af860be [Sketcher] fix header uniformity
Make uniform all Sketcher headers.
2022-11-20 01:19:31 +01:00
luz paz feec92c94a [Arch] fix header uniformity
Make uniforum all Arch headers
2022-11-20 01:17:03 +01:00
wmayer c5723f1f89 Arch: replace tabs with spaces 2022-11-20 01:15:45 +01:00
0penBrain 3e0bd9e34a [Typo]Sketcher: 'Clone' is the first command of CompCopy, match the tooltip 2022-11-20 01:03:39 +01:00
wmayer af4c8ffa82 App: fix memory leak and consistently use Py::asObject() in DocumentObserverPython 2022-11-20 00:58:52 +01:00
wmayer 866e20543d clang-tidy: disable 'readability-redundant-access-specifiers' because clang-tidy fails to distinguish between 'public' vs. 'public Q_SLOTS' 2022-11-20 00:55:38 +01:00
wmayer 7d9b3445a7 App: [skip ci] fix memory leak (copied from master) 2022-11-14 19:51:29 +01:00
vernzimm c63cb3d9dc Gui: Add default JPEG save quality (#7737)
* Update SoFCOffscreenRenderer.cpp

Set jpg screenshot capture to 100% quality vs qimage defaulting to -1

* Add default quality to JPG export

Fixed original version and use quality 90% as compromise between file size and fidelity.
2022-11-11 22:50:43 +01:00
Uwe ae653d1d5c backport .clang-format file from master 2022-11-11 05:19:58 +01:00
wmayer 3e981e0712 PD: fix crash in TaskRevolutionParameters::addAxisToCombo
and some warnings reported by GH actions
2022-11-10 14:10:32 +01:00
wmayer c849e9970e PD: [skip ci] improve the exception text 2022-11-10 14:10:32 +01:00
Uwe 31fe74b3a7 [PD] TaskDlgRevolutionParameters: fix some CI warnings
- reported here: https://github.com/FreeCAD/FreeCAD/pull/7667/commits/f0a0e563
- and here: https://github.com/FreeCAD/FreeCAD/pull/7719/commits/8f3f17f8
2022-11-10 14:10:32 +01:00
luz paz 56d29f212b Arch: remove trailing whitespace in importWebGL.py 2022-11-10 14:09:19 +01:00
wmayer 6f302d33fe Gui: backport class WrapperManager to fix possible crashes when using PySide 2022-11-10 09:32:25 +01:00
Roy-043 7d457f189d Draft: test_modification.py: modified test and added test (#7741)
The old test_offset_closed function was renamed to test_offset_rectangle_with_face.
It is now also a regression test for: #7670

The added test_offset_closed_with_reversed_edge function is a regression test for: #5496
2022-11-09 13:33:29 +01:00
Yorik van Havre b601ed911c Merge pull request #7670 from Roy-043/Draft-Fix-rectangle-with-face-offset-bug
Draft: Fix rectangle with face offset bug
2022-11-09 13:32:06 +01:00
Uwe 3aac13eacf Revert "Gui: fix possible crash when running the garbage collector after creating a shiboken wrapper"
This reverts commit a06533392b.
2022-11-09 13:23:47 +01:00
Uwe c8042bed16 Revert "Gui: [skip ci] fix build failure if shiboken support is disabled"
This reverts commit d60a737ae8.
2022-11-09 13:23:37 +01:00
wmayer d60a737ae8 Gui: [skip ci] fix build failure if shiboken support is disabled 2022-11-09 13:05:16 +01:00
wmayer a06533392b Gui: fix possible crash when running the garbage collector after creating a shiboken wrapper 2022-11-09 13:03:32 +01:00
Uwe 3569b135bb [Gui] CommandWindow.cpp: manually backport a change to fix compilation 2022-11-09 03:09:40 +01:00
Chris Hennes d1ad3b4926 Addon Manager: Add try/except to integer conversion 2022-11-08 10:30:38 -06:00
Uwe 59177020a6 Revert "Part: TestPartApp.py add tolerance to PartTestShapeRotate"
This reverts commit 31b3358291.
2022-11-07 02:31:17 +01:00
wmayer f238295c2d PD: unit test to check offset of sub-shape binder (PR #7445) 2022-11-06 14:15:56 +01:00
wmayer 68ac5c1c8c Gui: [skip ci] fix possible crash in FilterStatusBar::eventFilter() 2022-11-06 14:07:34 +01:00
wmayer 9647ac5fdd Gui: handle std::exception and Base::Exception inside DlgPreferencesImp::createPageInGroup to avoid that the preferences dialog won't be shown at all 2022-11-06 14:05:01 +01:00
wmayer a36c87c71d PD: use Base::StateLocker to simplify handling of blockUpdate and make it exception-safe 2022-11-06 14:03:01 +01:00
wmayer 9a053b860d PD: fixes #7629: Keep sketch visible during revolution tasks 2022-11-06 14:01:17 +01:00
Roy-043 31b3358291 Part: TestPartApp.py add tolerance to PartTestShapeRotate 2022-11-06 13:59:24 +01:00
Roy-043 459790624f Part: Fix typo in regression_tests.py 2022-11-06 13:58:18 +01:00
Uwe 664bc12c9a [PD] Helix: assure source Sketch is visible when in selection mode
- same as https://github.com/FreeCAD/FreeCAD/commit/18781bcf6 but for Helices (fixes #7629 also for helices)
- also modernize Qt connection
2022-11-06 13:51:03 +01:00
Uwe bc3a3d3c8c [Gui] SplashScreen: modernize Qt connection
- was reported as warning by our CI
2022-11-06 13:49:34 +01:00
Chris Hennes 83f4b2c293 Addon Manager: Catch unicode decode failures 2022-11-05 09:44:43 -05:00
Flachy Joe 0bd3f9d8a9 [PartDesign] Improve Helix calculation for straight shape (#7674) 2022-11-04 13:32:58 +01:00
wmayer a22a8a00a1 PD: [skip ci] disable undo/redo for the tmp. document created by the SubShapeBinder 2022-10-27 14:35:47 +02:00
wmayer 1833ae86de Gui: if an expression is set for Euler angles in the placement dialog then evaluate the expression instead of determining the angles from the rotation
See forum thread: https://forum.freecadweb.org/viewtopic.php?f=3&t=72522
2022-10-26 18:18:33 +02:00
Yorik van Havre 75c515691d Merge pull request #7616 from Roy-043/Draft-Make-Std_TransformManip-work-for-Draft_Point
Draft: Make Std_TransformManip work for Draft_Point
2022-10-26 18:17:40 +02:00
luz paz 4b191ff830 Spreadsheet: [skip ci] fix doxygen typo 2022-10-26 02:50:30 +02:00
wmayer dd35d0d035 App: fixes issue #7628: Crash after creating Sketch for Body
The problem is that inside Transaction::addObjectNew() a transaction object is deleted before removing it from the container. When deleting the corresponding transactional object (i.e. a DocumentObject or ViewProvider)
it can happen that it e.g. calls Transaction::addOrRemoveProperty() that now finds the dangling pointer in the container.

The safe way is to first remove the object from the container before deleting it.
2022-10-25 03:10:45 +02:00
wmayer d66b34050d Gui: cppcoreguidelines-pro-type-reinterpret-cast
Replace an unsafe reinterpret_cast with the safer static_cast
2022-10-25 01:18:54 +02:00
Roy-043 641fd1b287 Sketcher: Correct icon for Sketcher_CreatePointFillet 2022-10-25 01:15:01 +02:00
wmayer 3f48031cb4 CMake: [skip ci] fix deprecation warning about policy CMP0072 2022-10-25 01:14:27 +02:00
Uwe 142e796244 [skip CI] [FEM] equation.py: fix a tooltip
- the highest priority is computed first, the Wiki page is already correct
2022-10-25 01:13:22 +02:00
Bernd Hahnebach 9c5ff9164e FEM: get LGTM silent 2022-10-25 01:12:29 +02:00
luz paz 92b8d8a690 Fix source comment typo 2022-10-25 01:11:09 +02:00
Stefan Klug 293856b705 PartDesign: Remove duplicate comment 2022-10-25 01:10:33 +02:00
Stefan Klug 326ec081ce [Bugfix] PartDesign: Fix HoleCutDepth not being recalculated correctly
HoleCutDepth is reset to 0 to force a recalculation of te depth when
HoleCutType is set to a new value.
But the line
	pcHole->HoleCutCustomValues.setValue(false)
also forces a recalculation. So the depth was recalculated with the old
value in HoleCutType which was not expected behaviour.
2022-10-23 04:11:17 +02:00
0penBrain cf6e561e5a [Bugfix]Spreadsheet: fix multi-screen management of QtColorPicker
+ set parent when instantiating
2022-10-21 09:31:55 -05:00
wmayer f7f717db9e fix build failure 2022-10-16 11:46:48 +02:00
wmayer 1f08f07d38 Gui: depending on parameter settings open a transaction when changing visibility or selectability 2022-10-15 21:39:56 +02:00
wmayer b7f66680ab App: fixes #7277: Write to network drive fails on Windows 2022-10-14 02:26:50 +02:00
Roy-043 3473e5d424 Draft: Fix alignment of angular dimension arrows in svg.py 2022-10-14 01:49:18 +02:00
Yorik van Havre 00a8a784ec Merge pull request #7591 from Roy-043/Arch-Improve-handling-of-window-hosts
Arch: Improve handling of window hosts
2022-10-14 01:46:08 +02:00
Ajinkya Dahale 8443756ff5 [Sketcher] [planegcs] Add references for equations
Some equations were mentioned by just the number without telling the resource they were from. The book was found couple years ago but not mentioned here.
2022-10-14 01:45:28 +02:00
Yorik van Havre 35a61883e1 Merge pull request #7576 from Roy-043/releases/FreeCAD-0-20
Draft+Arch: Fix crash related to SoBrepEdgeSet
2022-10-11 14:22:34 +02:00
Roy-043 1fc9b07a2e Draft+Arch: Fix crash related to SoBrepEdgeSet 2022-10-07 21:16:11 +02:00
wandererfan a4f29eb509 [TD]encode Xml characters in spreadsheet 2022-10-06 03:02:39 +02:00
Uwe 570aac5399 [FEM] ViewProviderFemConstrain*: remove unused includes - part 2/2
- also sort includes
- also fix warnings about too long lines
2022-10-04 00:08:45 +02:00
Uwe cb8926155c [FEM] ViewProviderFemConstrain*: remove unused includes - part 1
- also sort includes
- also fix warnings about too long lines
2022-10-04 00:08:45 +02:00
Uwe c8f0338ae1 [FEM] ViewProviderFem*: remove unused includes
- also sort includes
2022-10-04 00:08:00 +02:00
Uwe 20a19b3245 [FEM] ViewProvider*: remove unused includes
- also sort includes
2022-10-04 00:06:14 +02:00
looooo 07900daa07 add_definitions(-DSALOME_USE_64BIT_IDS) for smesh via config 2022-10-03 23:11:21 +02:00
Uwe ae0ff4f405 [FEM] TaskFemConstrain*: remove unused includes
- also sort includes
2022-10-03 05:42:41 +02:00
Uwe 8f2e08758d [FEM] TaskPostBoxes.cpp: re-add an include
- (strange that it compiled on MSVC without even a warning)
2022-10-03 05:42:41 +02:00
Uwe a9d1b557ed [FEM] Task*: remove unused includes
- also sort includes
2022-10-03 05:42:41 +02:00
Uwe e81a31f638 [FEM] Dlg* etc.: remove unused includes
- also sort includes
2022-10-03 05:42:41 +02:00
Uwe a01202aaa7 [FEM] FemResult* to end: remove unused includes
- also sort includes
2022-10-03 05:42:40 +02:00
Uwe 81b94827ee [FEM] FemPost*: remove unused includes
- also sort includes
2022-10-03 05:42:12 +02:00
Uwe d8bc205b75 [FEM] FemMesh*: remove unused includes
- also sort includes
2022-10-03 05:42:12 +02:00
Uwe 77b5fd9a5d [skip CI] [Part] TaskFaceColors.cpp: whitespace 2022-10-03 05:25:31 +02:00
Uwe d64ba16bbf [Part] Task*: remove unused includes - part 2/2
- also some sorting
2022-10-03 05:25:31 +02:00
Uwe c6b3d2f688 [Part] Task*: remove unused includes - part 1
- also some sorting
2022-10-03 05:24:51 +02:00
Uwe 344f88cb05 [Part] So*: remove unused includes
- also some sorting
2022-10-03 05:23:08 +02:00
Uwe 1e2806095c [Part] Dlg*: remove unused includes - part 2/2
- also some sorting
2022-10-03 05:23:08 +02:00
Uwe 2db76146a7 [Part] Dlg*: remove unused includes - part 1
- also some sorting
2022-10-03 05:22:49 +02:00
Uwe 6b3fefa166 [FEM] App, FemConstraint*: remove unused includes - part 2/2
- also sort includes
2022-10-03 00:13:15 +02:00
Uwe f7111e00a4 [FEM] App, FemConstraint*: remove unused includes - part 1
- also sort includes
2022-10-03 00:13:15 +02:00
Stanislav 8fc35c5981 i18n: Manually update language files from Crowdin (#7540)
* Manual update from Crowdin
2022-10-02 18:21:46 +02:00
0penBrain 987ec6d705 [Bugfix]Gui: TinkerCAD mouse mode was always stopping RMB propagation 2022-10-01 04:39:22 +02:00
fandaL 1d80800838 FEM:fix remaining result object in memory in femmesh2mesh 2022-10-01 04:34:53 +02:00
wmayer d8d521150d Gui: change Selection.getCompleteSelection() to return a list of SelectionObject instead of DocumentObject (see 10e9e3b9b5) 2022-09-30 14:56:40 +02:00
0penBrain 766f787d84 Sketcher: fix misleading indentation 2022-09-24 16:06:24 +02:00
0penBrain e13e09b888 [Bugfix]Sketcher/Point-on-object: do not substitute constraint if conditions are not OK 2022-09-24 16:06:24 +02:00
Yorik van Havre a52eb0d4b9 Merge pull request #7359 from Roy-043/Draft-Improve-In-Command-shortcut-Undo-implementation
Draft: Improve In-Command-shortcut Undo implementation
2022-09-24 05:17:20 +02:00
marioalexis 8458569bda Gui: Allow None parameter again in drag and drop methods in Python ViewProviderPy class 2022-09-24 05:12:08 +02:00
wmayer 6e187c3b0e Spreadsheet: Handle language change event for context-menu 2022-09-19 02:41:55 +02:00
Uwe de8de44276 Revert "[PD] sync wedge code to master"
This reverts commit a019468c4a.
2022-09-19 02:17:46 +02:00
Uwe a019468c4a [PD] sync wedge code to master 2022-09-18 12:33:14 +02:00
Ethan Chappel 9b20f21792 Gui: Add format parameter for wedgeXmin 2022-09-18 12:08:23 +02:00
0penBrain dcb8738f55 Gui: when customizing shortcuts, warn user if command isn't in use with message box 2022-09-15 13:22:14 +02:00
Uwe 5c0cc8dc8a [Sketcher] rename a variable to please spellchecker
- also some code style improvements
2022-09-14 10:25:58 +02:00
Ajinkya Dahale 46cd5a3809 [Sketcher] Fix Typo in comment
threated -> treated
2022-09-14 09:17:35 +02:00
0penBrain bc5c7f80df [Bugfix]Sketcher: prevent dangling state of Shift key if key released out of Quarter 2022-09-14 09:13:41 +02:00
Roy-043 914520becb Draft: Fix flatten wire 2022-09-14 01:33:45 +02:00
Roy-043 ecce035d2d Draft: Fix alignment of angular dimension arrows 2022-09-13 02:36:23 +02:00
Roy-043 a00912ba77 Arch: Fix baseface generation for walls with a trace that self-intersects, has T-connections or that overlaps 2022-09-13 02:31:39 +02:00
Yorik van Havre 18952f7a4b Merge pull request #7354 from Roy-043/Draft-add-tolerance-to-boundbox-check-in-intersections.py
Draft: add tolerance to BoundBox check in intersections.py
2022-09-13 02:04:12 +02:00
Uwe c47bbd0cfe Revert "Mod: [skip ci] fix some MSVC warnings"
This reverts commit 0d5ec23d1f.
2022-09-12 03:34:42 +02:00
Markus Lampert 9364930948 Fixed handling of App::PropertyPercent in SetupSheet save/load 2022-09-12 03:08:23 +02:00
sliptonic 71d47a137d Merge pull request #7454 from sliptonic/PathFeedRateBug
Fix bug when testing verticallity during PathFeedRate generation
2022-09-12 03:06:39 +02:00
VM4Dim de1abd6719 [StartPage] Fix Wiki Link to Reverse_Engineering WB Page 2022-09-12 03:03:28 +02:00
wmayer 0d5ec23d1f Mod: [skip ci] fix some MSVC warnings 2022-09-12 03:01:20 +02:00
wmayer 506dc005f4 Mesh: [skip ci] add missing headers to PCH 2022-09-12 03:00:40 +02:00
0penBrain 754d82428f [Bugfix]Gui: ensure message boxes appear and stay on top of main window 2022-09-12 02:55:59 +02:00
Roy-043 81fcd18e8d Draft: Fix workingplane auto alignment to Front view 2022-09-12 02:42:19 +02:00
marioalexis 3a41e39de8 Gui: Prevent crash when trying to create ExpressionBinding without arguments 2022-09-12 02:29:11 +02:00
wmayer 1d074847b6 Base: implement default constructor and open() function for Base::ifstream and Base::ofstream 2022-09-12 02:27:05 +02:00
IFo Hancroft 83badab7c0 Update org.freecadweb.FreeCAD.xml 2022-09-11 22:27:13 +02:00
IFo Hancroft 2f49c0979f Fixes filetype icon not showing
Fixes the icon of .FCStd files not showing because the xml element was
called icon instead of generic-icon
2022-09-11 22:27:13 +02:00
wmayer c0d54e0a49 Gui: [skip ci] fix UTF-8 handling of icon resources 2022-09-11 22:19:09 +02:00
wmayer 5b9cfb2d32 App: fix possible dangling pointer in Document::removeObject() 2022-09-11 22:15:43 +02:00
luz paz 44783edf98 Follow-up typo fixes 2022-09-11 22:14:45 +02:00
0penBrain 09dd45aa7a [Bugfix]Sketcher: some user colors aren't taken into account 2022-09-11 22:08:33 +02:00
0penBrain fe085edd79 [Bugfix]Gui: allow set up expression even if property value is currently being edited 2022-09-11 22:08:32 +02:00
wmayer cba832d1e6 Mod: replace std::ifstream/std::ofstream with Base::ifstream/Base::ofstream 2022-09-11 21:58:43 +02:00
wandererfan 58d028b4ba [TD]fix misspelled preference key 2022-09-11 21:50:05 +02:00
wandererfan e6f9974235 [Part]fix makeWireString for Win & Py > 3.09 2022-09-11 21:44:56 +02:00
sliptonic 0793fcccca Merge pull request #7438 from Syres916/patch-54
[Path] Change Default Drilling Retraction from G99 to G98
2022-09-11 21:42:47 +02:00
wmayer 9d5b46196e PD: [skip ci] fix UTF-8 handling in Hole feature 2022-09-11 21:33:40 +02:00
wmayer 1ccdc547a9 TD: fix UTF-8 handling in LineGroup 2022-09-11 21:33:40 +02:00
0penBrain 5de0153a36 PartDesign: improve offset handling of SubShapeBinder 2022-09-11 21:19:27 +02:00
wmayer 639546574e Py: make FreeCAD 0.v20 to compile with Py3.11
As requested in this thread: https://forum.freecadweb.org/viewtopic.php?p=622230#p622230
2022-08-30 15:26:12 +02:00
Syres916 882ba47de7 [0.20] [AddonManager] Minor Bugfix with Mod folder
https://forum.freecadweb.org/viewtopic.php?p=617191#p617191
2022-08-24 23:39:02 -05:00
Chris Hennes ad6353995e Addon Manager: Fix bug in dependency resolver 2022-08-24 15:25:16 -05:00
Chris Hennes a95fa37d3e AddonManager: Fix bug in dependency resolver. 2022-08-24 10:23:38 -05:00
jbaehr 56d6a02b1b Fix MacOS-X build of FreeCAD-0.20.1 (#7389)
* Fix build on MacOS-X 10.14: missing cmath header
(This undoes a small part of commit 9ec0bcdcf2,
which seems a bit too agressive. Without the cmath header the build fails
using Apple clang version 11.0.0 (clang-1100.0.33.17) on Mojave)

* Fix build on MacOS-X 10.14: missing Xerces include dir
2022-08-24 00:47:35 +05:00
Uwe b14a90946b [FEM] Elmer: fix flux equation
- the Flux solver must be executed before Heat and Electrostatic
- the analysis can have multiple Flux equations -> write a unique solver name to case.sif
- the Flux equation can currently only take 2 possible values. Therefore provide them as enum
2022-08-16 03:53:09 +02:00
Uwe adf84d0ecf [FEM] potential constraint: change default value
- in practice one wants to apply potentials to faces via this constraint, therefore enable to set a potential by default, also assure that the initial unit is V
2022-08-15 02:43:33 +02:00
Uwe 64c79f51db [FEM] potential constraint: allow to set expression for value 2022-08-15 02:43:32 +02:00
Uwe 3bb9491fba [FEM] [skip CI] Elmer writer: fix indentation mistake
- found by Pylint checker
2022-08-14 20:53:11 +02:00
Uwe 046f0384f4 [Gui] revert setting unit factor for F/m
- see https://github.com/FreeCAD/FreeCAD/commit/9db5dff7#r81159352
2022-08-14 20:52:47 +02:00
Uwe 279a2c3fb2 [FEM] permittivity: improve code
- in commit 9db5dff7 I hard-coded the permittivity incorrectly
2022-08-14 19:21:43 +02:00
Uwe fa62b41622 [FEM] fix handling of vacuum permittivity
- fix message that permittivity object was not handled
- set an expression, otherwise the user gets only "0.000" for the default of 8.8e-12
- use as unit the common "F/m" (this is also more user-friendly than "s^4*A^2 / (m^3*kg)")
- fix a ToDo
2022-08-14 19:21:43 +02:00
Uwe dfac3dbe27 [FEM] Elmer example: remove wrong permittivity
- a permittivity of 1 F/m is not physical, also not for testing. In fact overwriting a constant is not good practice for an example
2022-08-14 18:48:11 +02:00
Uwe 3cdbd61e9c [FEM] Elmer: writer: get rid of unnecessary function
- fixes the ToDo
- also remove unnecessary comment
2022-08-14 18:47:44 +02:00
Uwe ee3e46d8d1 [FEM] Elmer: handle pressure for fluids
- Elmer allows external pressure on fluid boundaries as well as for solids
2022-08-14 18:47:16 +02:00
Uwe aeab707a92 [FEM] change default pressure
- a default of 1 GPa for a pressure onto a face is not suitable. use 1 bar (100 kPa) instead
2022-08-14 07:17:49 +02:00
Uwe 0cf4b544f0 [FEM] Elmer: fix initial flow velocity
- we must allow must be several velocities because there can be several fluid bodies
- don't output flow velocity for solid bodies
2022-08-14 06:51:50 +02:00
Uwe 5129e62ed2 [FEM] [skip CI] remove an obsolete comment
- since a while there is no green hook but a QuantitySpinBox
2022-08-14 06:51:07 +02:00
Uwe fe76983fd3 [FEM] [skip CI] Elmer: add copyright
-  heavily edited these files so I am to blame now too ;-)
2022-08-14 06:50:40 +02:00
grubertechnic 394f74cf9e [TechDraw] fix up button in TaskProjGroup 2022-08-14 06:49:54 +02:00
Uwe 6d621563aa [FEM] Elmer: sort solver methods for better overview 2022-08-14 06:41:55 +02:00
Uwe fbbe82ebfd [FEM] [skip CI] fix non-Unicode character
- made problems with text editors -> change file to UTF-8
2022-08-14 06:37:33 +02:00
Uwe fb98d8611a [FEM] Elmer: fix for the Idrs method
- while adding support for the IDRS method I forgot to implement its mandatory parameter
2022-08-14 01:52:39 +02:00
Uwe 74f63c8293 [FEM] Elmer: set constraints for solver systems
- set constraints according to the Elmer docs (no conversion necessary, existing properties just stay integers)
2022-08-14 01:52:39 +02:00
Uwe 5511405272 [FEM] Elmer: just sorting to keep the overview 2022-08-14 01:52:39 +02:00
Wanderer Fan 398076fdde [TD]hatch file default handling 2022-08-14 01:50:45 +02:00
luz paz 0974cab1a4 [FEM] Substitute underscore for whitespace in CalculiX solver output
Fixes #7360  
Forum thread: forum.freecadweb.org/viewtopic.php?p=617376#p617376
2022-08-13 16:43:08 +02:00
Uwe d615b466d7 [FEM] Elmer: only output a property if necessary 2022-08-13 14:39:46 +02:00
Uwe 3fa1f515ee [FEM] Elmer: fix heat flux handling
- the heat flux in the temperature constraint is not the heat flux from the heatflux constraint. The latter is in W/m² while the first one is W/mesh node
2022-08-13 05:57:48 +02:00
Uwe 7d9855c849 [FEM] Elmer: add support to turn off solvers
- with this property the linear solver is turned off. As consequence one can this way also disable the execution of an equation without the need to delete the equation object

- also add missing preconditioners
2022-08-13 05:56:33 +02:00
Uwe 51deef0dcd [FEM] Elmer: add tooltips 2022-08-13 04:10:21 +02:00
Uwe 2e068fe4a8 Revert "[TD]fix LineFormat ctor line color"
This reverts commit 497600f8d0.
2022-08-13 04:09:44 +02:00
Uwe 7fb4ac2634 [FEM] Flow constraints: fix wrong tooltips 2022-08-13 03:42:13 +02:00
Wanderer Fan 497600f8d0 [TD]fix LineFormat ctor line color 2022-08-13 03:40:44 +02:00
wmayer 6b1e7a3546 Gui: clear combo boxes before re-filling them, fix handling of icon size in preferences pack 2022-08-13 03:37:14 +02:00
Uwe 8af35dc211 [FEM] Elmer: fix handling if fluids + solid materials
- as already reported in the forum, it was not possible to make a flow simulation when there is also solid material.
2022-08-12 06:19:48 +02:00
Uwe 877e77c09d [FEM] Selection: fix error for 2D shapes
- 2D shapes have no "Shape" attribute. This attribute was accessed before checked it it exists
2022-08-12 06:19:48 +02:00
Uwe 5a179983a2 [FEM] Elmer: allow lower relaxation factor
- despite the Elmer docs say 0.01 is the lover limit, for fluids like water, one might need down to 1e-4
2022-08-12 06:19:48 +02:00
wmayer 41f7c5f6c5 Gui: don't show non-existing and unusual directories in file dialog 2022-08-12 01:53:40 +02:00
Tobias Frost 0a61c568a6 Replace edit-cut.svg
Replace 2 instances of edit-cut.svg with the version from the tango icon
library to reslove license issue. Closes #7347.

Tango Icon Library used: http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz
Location within the tarball:
./tango-icon-theme-0.8.90/scalable/actions/edit-cut.svg
2022-08-11 17:00:01 +02:00
wmayer a22a43b927 Draft: fix snapper icons
* Add convenience function to get 3D views from MDI area
* Use 'inherits' instead of 'QMetaObject.className()' to check more reliably for sub-classes
2022-08-11 16:58:44 +02:00
Wanderer Fan 3ee4ffc404 [TD]fix multiple dimension drag 2022-08-11 16:57:16 +02:00
Uwe f5d13554ec [FEM] [skip CI] remove unused import for potential 2022-08-10 13:44:09 +02:00
Uwe 57e0e6e769 [FEM] [skip CI] formatting fix for potential 2022-08-10 13:42:54 +02:00
Uwe 31376b12ad [FEM] electric Potential: add missing conversion
- add missing conversion of property change that was already done before FC 0.20
2022-08-10 13:33:39 +02:00
Uwe c96fe6b32e [FEM] Elmer: fix material bug and improve material handling
- for fluid material writing the elasticity solver failed with unknown Young Modulus
- fix regression with checking for fluid material. Checking the material of the bodies is not sufficient. One can e.g. have a solid without bodies defined, then it applied to all bodies and there might be a fluid defined for only one body. Checking the body's material would then deliver there is no fluid
2022-08-10 06:17:04 +02:00
Uwe c06f24122b [FEM] update a bimetal testfile 2022-08-10 04:26:37 +02:00
Uwe 88dc25d151 [FEM] Elmer: set constraints for relaxation factor
- the relaxation factor is crucial for nonlinear systems thus help the user by setting constraints and convenient steps.
Since the property stays a float no update is necessary, existing properties just stay a normal float
2022-08-10 04:11:07 +02:00
Uwe ad7e780a1f [FEM] Elmer: notify users about missing fluid material
- it was often unclear when no flow equation was written to the case.sif (was a regression FC0.20)
2022-08-10 03:29:51 +02:00
Uwe 4d5135ac4b [FEM] fix bimetall example
- add missing density
- set a second temperature to make the heat solver actually working
- adapt to new defaults
2022-08-10 02:28:13 +02:00
Uwe a00268b5ed [Material] add materials used by our examples
- add generic copper and invar
- also extend the generic aluminum card
2022-08-10 02:09:35 +02:00
Uwe c31af916bc [FEM] Elmer: automatic update for BiCGstablDegree
- up to last week we used the invalid BiCGstablDegree 0 thus update to the default of 2
2022-08-10 02:08:54 +02:00
Uwe 25b39419fd [FEM] fix selection issues with flow velocity constraint
- same fix as commit 7e071623 for flow velocity constraint
- the used selection widget did not highlight the selected faces. This made it very hard to work with when one has an existing document where e.g. 5 faces have a certain velocity and you cannot figure out which ones.
To fix this use another selection widget
2022-08-10 01:38:55 +02:00
Uwe 18bdc5c551 [Part] manually backport second part of today's override fixes 2022-08-10 01:30:59 +02:00
wmayer 3c8404fd09 Part: fix build failures with OCC >= 7.6 2022-08-10 00:59:45 +02:00
Uwe 7f8c5bcd85 [FEM] Elmer: fix broken example
- (a regression to FC 0.20.0), use new settings ("direct" is already the default, iterative solving takes here about 5 times longer, DisplaceMesh must be False)
2022-08-09 05:39:11 +02:00
Uwe b2fe784efd [Win installer] prepare for 0.20.1 release 2022-08-09 04:21:57 +02:00
Uwe ddbcc0b3d5 [Build] output point release version
- to Splashscreen, About, MainWindow and Console
2022-08-09 03:32:24 +02:00
Uwe 87953bf330 [FEM] increase size of generic solver task panel
- increase it to size of CCX panel to create more room for the log output
2022-08-09 03:23:52 +02:00
sliptonic 9e267241fe Merge pull request #7333 from mlampert/bugfix/external-thread-issues
PATH: Bugfix/external thread issues
2022-08-09 00:49:40 +02:00
Uwe 8fe6438ca8 [FEM] backport a variable renaming
- to avoid merge conflicts
2022-08-08 12:49:46 +02:00
Uwe 855634a670 [FEM] Elmer: scale EigenMode results
- for an not yet known reason the result from Elmer are only for eigen analyses a factor 1000 (we send the mesh scaled to Elmer and it seems the eigen solver does not notice this)
Therefore scale these results
2022-08-08 12:36:17 +02:00
Uwe 194902fb90 [FEM] fix warp filter factor
- since our mesh is in mm, we must multiply the set factor by 1000 to get the real factor. This applies also for pipelines from CCX results.
Now the factor fits with the factor one can set in the CCX results dialog
2022-08-08 12:35:21 +02:00
wmayer b221137067 Gui: set width of list box according to text length 2022-08-08 12:34:18 +02:00
Uwe 2be012c9c6 [FEM] backport some changes to resolve merge conflicts
- manually done
2022-08-08 11:39:13 +02:00
berniev 3e6f7cfc53 Gui: redundant void 2 2022-08-08 11:16:32 +02:00
berniev 8714208cfb App: redundant void 2 2022-08-08 11:14:47 +02:00
wmayer 0ddacad17a Mod: [skip ci] improve whitespace 2022-08-08 10:59:29 +02:00
wmayer 73af68afc5 Gui: [skip ci] include header with export macros 2022-08-08 10:58:22 +02:00
Uwe 365230d313 [FEM] update test files 2022-08-08 03:26:56 +02:00
Uwe 898a57ca29 [FEM] collected Elmer fixes
- manually merge the recent Elmer fixes and novelties
2022-08-08 02:39:14 +02:00
Uwe c2ae76dd77 [FEM] add generic Aluminum material
- with full thermal info
2022-08-08 02:24:09 +02:00
Roy-043 02d6b1dd51 Sketcher: Fix sWhatsThis for Sketcher_CompConstrainRadDia (#7324) 2022-08-08 02:14:04 +02:00
luz paz bcdc681755 FEM: remove trailing whitespace from various FEM files 2022-08-08 02:13:22 +02:00
Uwe d8ed961e35 [FEM] fix pipeline recompute issue
- after a simulation was run, the pipelines and its childs are recomputed but its shape coloring is not updated.

- also update XML documentation
- also remove comment in tasks.py for now
2022-08-08 02:08:05 +02:00
Uwe 73132b3743 [FEM] add framework to scale result mesh values
- it seems that we will need to scale result values (probably for the Elmer Eigen solver)
  This PR adds the framework to do this. It is meant for Elmer but designed versatile.
2022-08-08 02:06:32 +02:00
Uwe 6da987a91b [FEM] fix pipeline recompute bug
- on recomputing scalar or warp filters the information about the field was lost.
  This is because the validity of an array was tested before it is actually filled

- also fix MSVC warning of using a C++ keyword as variable
- also avoid an unnecessary recompute after Elmer solver was run
2022-08-08 00:09:37 +02:00
wmayer 7fd0a19ed7 Gui: improve integrated Python console:
* correctly handle the case that Py_BuildValue() can return a null pointer
* fix a latin1 <-> UTF-8 conversion problem
2022-08-07 19:36:08 +02:00
Uwe 5922dd75bf [FEM] pipeline fix when there is no field
- for the case that pipeline with a field is active, then another pipeline that does not display any field, we cannot just return because the pipeline cannot have the color bar range of the prevision pipeline
2022-08-07 15:27:29 +02:00
Uwe f99c270091 [FEM] [skip CI] set unit for potential loads 2022-08-07 15:18:47 +02:00
Uwe 7fcf092632 [FEM] update Elmer test files 2022-08-07 06:54:37 +02:00
Uwe 93db713b0e [Base] attempt to make a Path backport compiling 2022-08-07 06:49:58 +02:00
Uwe 1571a4817f [FEM] make point filter aware of electric flux
- make point filter aware of electric flux (manually backported)
2022-08-07 06:35:31 +02:00
Uwe 9fd20de4b8 [FEM] fix selection issues with electrostatic constraint
- the used selection widget did not highlight the selected faces. This made it very hard to work with when one has an existing document where e.g. 5 faces have a certain voltage and you cannot figure out which ones.
To fix this use another selection widget
2022-08-07 06:30:53 +02:00
Uwe a4d95722e2 [Fem] Elmer: writer: remove unused variable 2022-08-07 06:29:48 +02:00
Uwe 59da0af311 [FEM] make point filter aware of force density 2022-08-07 06:28:01 +02:00
Uwe 7fbae8a314 [FEM] Elmer: resale the mesh using Elmer
- according to Peter from the Elmer team, we can use Elmer for both, scaling in and scaling back just for consistency
2022-08-07 06:25:28 +02:00
Uwe 8913921f5b [FEM] Elmer: fix pipeline update issue
- the existing result pipeline can have several children. They must all be updated.
2022-08-07 06:24:16 +02:00
berniev da88c7a6d3 give success message normal prominence 2022-08-07 06:23:23 +02:00
sliptonic 002fcacd57 Merge pull request #7278 from mlampert/bugfix/vcarve-c++-exception
PATH: Bugfix/vcarve c++ exception
2022-08-06 03:58:33 +02:00
Uwe 0c14bcb0d9 [Fem] Elmer: update test files 2022-08-05 02:42:45 +02:00
Yorik van Havre bfe8b89da1 Draft: Enabled shortcut for undo segment - fixes #6181
That shortcut had apparently been left out last time the system was recoded..
I used the default shortcut '/' because Ctrl doesn't really work with the
current system, and Z is already taken
2022-08-05 02:30:03 +02:00
Uwe eb4a62f945 [FEM] Elmer: sync input scaling with master 2022-08-05 02:29:14 +02:00
Uwe 40c4f6585b [FEM] fix enable editing for all solvers
- currently for Z88 nothing happens when clicking the Edit button in the solver task dialog. The reason is that opening *.txt files was never implemented
- also do this for Elmer
- for Z88 we need to open several file for a proper editing because the solver info is distributed over these files
2022-08-04 04:25:36 +02:00
Uwe 75d970afda [FEM] Elmer: setup new pipelines like we do for CCX
and manually new created ones
2022-08-04 04:25:00 +02:00
Uwe 655508d68e [FEM] Elmer: use different default linear solver
- BiCGStabl is as robust as BiCGStab but in all tested cases it converges faster
2022-08-04 04:24:34 +02:00
Uwe c66e4b4772 [FEM] Elmer: use direct solving as default for stresses
- direct solving is sometimes even 10 times faster (as fast as CCX) and as accurate as CCX
2022-08-04 04:22:59 +02:00
Uwe 2e3d9dadda [FEM] pipeline: minor highlighting fix
- if a pipeline is invisible the highlighting must not be triggered
2022-08-04 04:21:59 +02:00
Günter Neiß bfe4c724b4 OpenSCAD: remove SCAD-Import error in importCSG.py
Signed-off-by: Günter Neiß <gneiss@web.de>
2022-08-04 01:20:45 +02:00
wmayer ff659b1352 Fem: [skip ci] fix possible crash in PropertyPostDataObject::getMemSize 2022-08-04 00:50:50 +02:00
Uwe b06edfcb97 [Gui] QSint: missing piece to fix QGroupBox visibility
- also the freecadscheme must be adapted (e.g. for PartDesign dialogs)
- fixes now #6102 completely
2022-08-04 00:49:51 +02:00
Chris Hennes d1d9a17a98 Addon Manager: fix thread termination bug 2022-08-03 01:21:45 +02:00
wmayer 67c24b5749 Fem: [skip ci] replace the SoAnnotation with an SoSeparator to fix rendering artifacts for non-convex objects 2022-08-03 01:15:58 +02:00
wmayer 426ff82c87 Fem: use SoAnnotation to highlight result pipeline objects 2022-08-03 01:15:14 +02:00
carlopav 22e8085394 [Draft] Fix Draft Edit AddPoint with BSpline
ref. https://forum.freecadweb.org/viewtopic.php?p=613622#p613622

Fix Bug when adding point to a BSpline.
2022-08-03 01:14:01 +02:00
luz paz b522212d71 AddonManager: Fix source comment typos
[skip ci]
2022-08-03 01:11:58 +02:00
Uwe 6146311a94 - fixes #6102
- the point is that we don't set any style for the group boxes, therefore the Windows style is applied as nothing was set yet. The default Windows style is the color #dddddd which is hardly visible on our blue default style.
as solution set an explicit color.
2022-08-02 05:22:30 +02:00
Yorik van Havre 68b5d8dbca Merge pull request #7259 from Roy-043/Draft-Fix-handling-of-groups-on-move-copy-and-rotate-copy
Draft: Fix handling of groups on move-copy and rotate-copy
2022-08-02 05:19:10 +02:00
wmayer 3a424136ff Spreadsheet: fixes #7285: [Bug] FreeCAD crashes if cell value ' is set in Spreadsheet 2022-08-01 11:51:53 +02:00
Uwe 67682e2bb3 [.github] [skip CI] checks.yml: disable a whitespace check
- todo whitespace is not important
2022-08-01 04:38:47 +02:00
Floriansimmer 65b1048463 Ci v2 (#7282)
* Github: Build and Test

Build and Test:
- ccache
- build
- Unittest
- install
- Unittest of install
- report

misc:
- use .clang-tidy file to configure Clang-tidy checks
- use use .pylintrc to configure Pylint checks
- Update changed-files Action
- better regex for file extension filter
- show enabled clang-tidy checks in Step Report
- show enabled Pylint Checks
- cpplint filter documentation
- modified cpplint filters recomended by https://github.com/sider/runners/blob/HEAD/images/cpplint/sider_recommended_CPPLINT.cfg
- fixed Branch filter for Clazy QT6 checks --> has only worked on pull requests
- fail the CI only on Build  errors, Unittest errors and misspellings

* Github: remove Codespell action as it is now integrated into the check workflow
2022-08-01 04:37:23 +02:00
Uwe 6975093d6e [FEM] Elmer: fixes for the point filter
- use correct names and support all possible outputs
2022-08-01 04:35:32 +02:00
Uwe 2893474ab2 [FEM] Elmer: update .sif files
- because of solver default settings change
2022-08-01 04:34:41 +02:00
Uwe 4430a1cce9 [FEM] Elmer: set sensible defaults for elasticity equation
- for BiCGstabl the minimal degree is 2, but 3 is recommended
- when adding the equation, it should do something, therefore enable the calculation of the principal stresses (as it was, nothing was calculated except of the displacement)
2022-08-01 04:34:41 +02:00
wmayer 75b912b173 Fem: implement a selection observer to notify a ViewProviderFemPostObject when its selection status has changed 2022-07-31 21:20:09 +02:00
Uwe 01ae4db181 [FEM] Constraint: BodeHeat: fix regression from commit 22c64ef8
- a simple indentation mistake
2022-07-31 21:19:00 +02:00
Uwe 8303a55092 [FEM] add missing eigenfrequcy calculation for Elmer
- while for CCX we output the eigenfrequency, for Elmer the user had to perform the calculation of a sqrt of the complex result.
This is inconvenient and error-prone and also requires the knowledge where the result is output by Elmer and in what format. (cast me more than an hour to find this out)
Therefore perform the calculation for the user and output the result.
2022-07-31 05:44:14 +02:00
Uwe 9c7f869e3b [FEM] Elmer: fix small number property handling
- use an expression as discussed: https://forum.freecadweb.org/viewtopic.php?p=613897#p613897
2022-07-31 05:43:01 +02:00
Uwe fdb3dd9de4 [FEM] Elmer: fix eigenmode results for point filter
Elmers' eigenmode results have a different result name
2022-07-31 05:42:06 +02:00
adrianinsaval 014ed4ccc5 Bump PACKAGE_VERSION_PATCH for next patch release 2022-07-31 05:39:28 +02:00
Chris Hennes e51acb490c Addon Manager: Add other_files download for wiki macros 2022-07-30 21:35:19 -05:00
Uwe 58c9ed6028 [FEM] Elmer: add missing direct variant MUMPS
- also use capitalized wording to Umfpack as Elmer does
2022-07-30 20:10:35 +02:00
Zheng, Lei bb55fe76db Gui: fix ViewProviderLink transform with scale
Fixes FreeCAD/FreeCAD#7113
2022-07-30 19:17:55 +02:00
Uwe 451d95d04a Revert "App: fixes #7277: Write to network drive fails on Windows"
This reverts commit c00740aa15.
2022-07-30 16:09:50 +02:00
wmayer c00740aa15 App: fixes #7277: Write to network drive fails on Windows 2022-07-30 14:04:33 +02:00
Adrian Insaurralde Avalos 25ea7e41a6 [python init] Prepend install prefix if libdir is not absolute
For python init script so it can work by default
2022-07-30 00:33:07 +02:00
wmayer 191c95c0ea Mod: [skip ci] fix warning: [-Wreturn-std-move] 2022-07-30 00:21:35 +02:00
wmayer f5096a17e2 Gui: [skip ci] mkae sure the tooltip in ActionGroup::onActivated() disappears again 2022-07-30 00:12:29 +02:00
wmayer 130da19292 App: fixes #7112: Addon manager does not work on windows with special characters in the username 2022-07-29 10:06:34 -05:00
Wanderer Fan 5df4501ccc [TD]fix redraw does not paint all views 2022-07-29 01:37:00 +02:00
Wanderer Fan 919e31ea27 [TD]fix Symbol update on property change 2022-07-29 01:35:59 +02:00
Uwe 60499ffcd4 [Sketcher] fix icon name
- fix a FIXME, Sketcher_CreateEllipse depicts already the right thing, it just has to be renamed
2022-07-29 01:34:51 +02:00
Chris Hennes 8811dc4a48 Addon Manager: Fix get_zip_url for non-github URLs 2022-07-28 02:11:24 +02:00
wmayer 86686ab7ed Part: [skip ci] add unit test for PR #7260 2022-07-27 17:02:48 +02:00
Uwe 55bcd7bf19 [FEM] fix PostObject hiding issue
- when a PostObject is hidden the FemPostDataAtPointFilter must not be taken into account
2022-07-27 16:59:14 +02:00
Uwe 264227ae7b [FEM] sync an icon with master 2022-07-27 16:45:05 +02:00
Uwe 67cafa1453 [FEM] PostDataAtPoint: remove unnecessary style setting
- PostDataAtPoint is a point therefore setting a filling style is not necessary

- also fix a typo in a comment
2022-07-27 16:16:18 +02:00
Uwe a181437a71 [FEM] skip CI] update a comment 2022-07-27 16:11:23 +02:00
Uwe 390461c581 [FEM] update ViewProvider selection code
as suggested in
https://github.com/FreeCAD/FreeCAD/commit/67e836b7e953cf5901a337a6f56df34a0446cd6a#r79459854
2022-07-27 16:11:23 +02:00
Uwe c1b350f117 [Sketcher] CommandCreateGeo: next attempt to fix compilation 2022-07-27 16:03:37 +02:00
Uwe d5404eed47 [Sketcher] CommandCreateGeo: fix compilation 2022-07-27 15:40:06 +02:00
tomate44 75186322eb [Part] BSplineSurface: fix KnotSequence for periodic BSpline surfaces 2022-07-27 15:03:31 +02:00
Uwe 93fe24201a [Sketcher] [skip CI] whitespace fix 2022-07-27 15:02:50 +02:00
0penBrain 9d729cf114 [BUGFIX] Sketcher: fix icon normal/construction toggling when commands used in custom toolbar
Fixes #7064
2022-07-27 14:51:12 +02:00
Chrismettal 0d10011b38 [Stylesheets] Remove whitespace and add "checked" icon style 2022-07-27 14:24:07 +02:00
Uwe f81f9e3bab [FEM] BodyHeat constraint: use unique icon
- it was not possible to distinguish the constraint from the heatFlux constraint
2022-07-27 14:04:40 +02:00
Uwe 4b092abdb0 [FEM] BodyHeat constraint: hide unused property
- the constraint does not take a references and when trying to set one as user because one thinks this empty property must be set, one gets a recompute error
2022-07-27 14:04:40 +02:00
wmayer 341e017960 Spreadsheet: fix several memory leaks 2022-07-27 14:02:45 +02:00
Uwe aae0a70bb6 [FEM] PostObject: improve color bar refreshing
- for data point filters the color bar must not be updated
2022-07-26 04:14:58 +02:00
Uwe ff1e67b44d [FEM] Elmer writer: fix errors on missing material properties
- we must in this case raise an error and stop the writer script
2022-07-26 04:13:55 +02:00
Uwe a3e00bd73e [FEM] update bodyHeatSource
- to the state of the other constraints

(this constraint is currently completely broken by the way)
2022-07-26 04:13:17 +02:00
adrianinsaval 28773a081c Improve grid maxNumberOfLines warning message 2022-07-25 21:03:31 +02:00
wmayer 632ac1521a Part: add instruction how to adjust the maximum number of grid lines 2022-07-25 21:01:28 +02:00
Uwe 53977e0220 Fem: [skip ci] Fix several clazy issues: * Maybe you meant to call base method instead [-Wclazy-skipped-base-method] * Using copy-ctor but class SbMatrix has a trivial copy-ctor but non trivial assign operator [-Wclazy-rule-of-two-soft] * Missing emit keyword on signal call FemGui::PointMarker::PointsChanged [-Wclazy-incorrect-emit] 2022-07-25 20:47:42 +02:00
Uwe 6ba6463107 [FEM] Elmer: fix python error when solver failed
we must then stop the execution of the script
2022-07-25 03:39:41 +02:00
Uwe 9cfbdbe96c [FEM] ViewProviderDocumentObject: fix parenthesis mistake
(I don't know how this happened)
2022-07-24 19:34:55 +02:00
Uwe 7a9a7544ea [FEM] fix color bar handling on hiding post objects
- fixed the remaining part of #7230: on hiding an object, refresh the color bar of the new visible object (if there is any)
2022-07-24 19:34:55 +02:00
Uwe a1d57f9877 [FEM] set default selection mode to BoundBox for post objects
- this fixes a long-standing annoyance that popped up also from time to time in the forum:
  the post objects deliver information via its coloring but a selection in the tree changed the shape color

Even experienced users like me did not know about the SelectionStyle property and always had to click into the model to see the real color, not the selection color.
Therefore SelectionStyle set to BoundBox is sensible as default settings for post objects since this assures that the users always see the right coloring.
2022-07-24 19:34:55 +02:00
Uwe 5bea268817 [.github] try to get the checks also for the 0-20 branch 2022-07-24 06:10:09 +02:00
Uwe add9dd377b Revert "a test for .github"
This reverts commit 25865955b1.
2022-07-24 06:09:11 +02:00
Uwe 6fd477d34b [.github] disable tidy checks for now
- as requested in https://github.com/FreeCAD/FreeCAD/pull/7152#issuecomment-1193176866
2022-07-24 06:07:39 +02:00
Uwe 3b6a83e1b4 [.github] disable clang checks for now
see https://github.com/FreeCAD/FreeCAD/pull/7152#issuecomment-1193167296
2022-07-24 06:07:39 +02:00
Floriansimmer 777bafbc1c Github: basic check CI Run (#7152)
* Github: basic check CI Run

- trailing Whitespace
- tab
- string based QT connections
- Cpplint
- pylint
- Black
- clang-format
- Codespell
- clang-tidy
- clazy (+QT6 Checks)
- Report
2022-07-24 06:07:39 +02:00
mosfet80 03ad5fd551 Git ignore hidden files with defined exceptions (#7108)
* git ignore all hidden files

* Removal file with non-existent link

* git Ignore all hidden files except .gitignore

* Set exceptions in gitignore
2022-07-24 06:07:39 +02:00
Uwe 25865955b1 a test for .github
ignore
2022-07-24 06:03:54 +02:00
Uwe a5860ad542 [FEM] fix regression of missing stress results
- fixes the regression that went in short as "last minute fix": commit 3af54a7dda -> fixes #7242

- also remove a doubled entry in an IF
2022-07-24 05:51:23 +02:00
Uwe ca013f6af7 [FEM] TaskBoxes: add missing info about transparency
The user had no info about the current transparency nor the value he will be selecting.
2022-07-24 05:50:28 +02:00
Uwe 85c8aeb40c [FEM] task_material_common: add a comment 2022-07-23 17:39:36 +02:00
Uwe 8c376a89f2 [FEM] fix material task dialog for fluids
- this fixes a mistake from commit ef088674
- it also consistently use the thermal expansion coefficient
- add code comments

now the material task dialog works with all fluid materials without errors or warnings
2022-07-23 17:39:36 +02:00
Syres916 39fd2593c1 [Part] Bugfix Primitives correction of decimal..
...places on creation
See https://forum.freecadweb.org/viewtopic.php?f=3&t=70339
2022-07-23 17:37:04 +02:00
wmayer fdeee21237 Part: fix TopoShape.isInside() for faces 2022-07-23 17:35:43 +02:00
Uwe 58a87e1ca4 [FEM] better fix for missing colorbar update for FemPostObject
- better fix for #7230 because we can call the direct paint method and because the bar is now also updated when the object is shown

- also add a ToDo note
2022-07-23 17:16:49 +02:00
Uwe 34e60c6731 [FEM] fix missing colorbar update for FemPostObject
- fixes issue #7230

- to update the color bar for post objects, the Field property has to be reset to trigger this. This PR does this.
2022-07-23 17:16:49 +02:00
Roy-043 fc33aed8c1 Arch: Housekeeping: import translate from correct file 2022-07-23 17:00:33 +02:00
Uwe 8ad3fc8ccc [FEM] [skip CI] fix UI file height entry
- was automatically done by QT designer
2022-07-23 16:59:55 +02:00
Uwe a64469320c [FEM] [skipCI] ViewProviderFemPostPipeline: remove unused include
- also sorting
2022-07-23 16:58:39 +02:00
Yorik van Havre 96ea0d266a Merge pull request #7215 from Roy-043/Draft-Remove-unnecessary-DisplayStatusbar-preference
Draft: Remove unnecessary DisplayStatusbar preference
2022-07-20 12:19:08 +02:00
Uwe 832100482c [PD] TaskExtrudeParameters: add missing simplification
forgot this change in commit 98dae1b2
2022-07-20 12:18:07 +02:00
Uwe f9f753e321 [PD] TaskExtrudeParameters: simplify code
to avoid several time the same translatable string
2022-07-20 03:22:44 +02:00
adrianinsaval fb223c2587 [PD Pad/Pocket] Fix bug with midplane usage in TwoLengths mode (#7216)
* [PD Pad/Pocket] Fix bug with midplane usage in TwoLengths mode
2022-07-20 03:22:03 +02:00
wmayer c98a03ecc6 Gui: fix crash in ViewProviderLink::currentDraggingPlacement() if there is no active dragger 2022-07-20 03:21:35 +02:00
wmayer 7f39542a73 Part: add instruction how to adjust the maximum number of grid lines 2022-07-20 03:21:01 +02:00
Yorik van Havre cc3d165ed8 Merge pull request #7181 from manuvarkey/bug_fix_1
Fix bug #6679, add new profiles
2022-07-19 03:16:29 +02:00
Roy-043 58d27e220f Arch: Fix getCutVolume in ArchCommands.py 2022-07-19 03:13:34 +02:00
Yorik van Havre 3b5dd5b852 Merge pull request #7200 from Roy-043/Draft-Fix-color-handling-in-make_point.py
Draft: Fix color handling in make_point.py
2022-07-19 03:12:37 +02:00
Yorik van Havre d385cbece7 Merge pull request #7174 from Roy-043/Draft-Fix-EditMode-for-hatch,-facebinder-and-shapestring
Draft: Fix EditMode for hatch, facebinder and shapestring
2022-07-19 03:11:24 +02:00
Yorik van Havre 98897fb356 Merge pull request #7176 from Roy-043/Draft_Add_resetEdit_to_gui_hatch.py
Draft: Add resetEdit to gui_hatch.py
2022-07-19 03:07:46 +02:00
Yorik van Havre 8b433990ad Merge pull request #7173 from Roy-043/Draft_Fix_setEdit_in_view_text.py
Draft: Fix setEdit in view_text.py
2022-07-19 03:06:52 +02:00
Yorik van Havre 0e7449aef1 Merge pull request #7141 from Roy-043/Draft-make_hatch.py-should-return-the-object
Draft: make_hatch.py should return the object
2022-07-19 03:04:37 +02:00
sliptonic feab004970 Merge pull request #6974 from agren/restore-path-drilling-retract-behaviour
Path: Restore drilling op retract value to user supplied Retract Height
2022-07-18 00:38:38 +02:00
Uwe 136eb1d17a [PD] add parameter enabling logic for pad/pocket
- currently all parameters are always enabled and thus can lead to errors like the one reported here:
https://forum.freecadweb.org/viewtopic.php?f=3&t=70266
2022-07-18 00:31:55 +02:00
Uwe 50f112eaff [PD] improve face selection for Pad/Pocket
- this PR extends PR #7191 as described in this forum thread: https://forum.freecadweb.org/viewtopic.php?f=3&t=70327
2022-07-18 00:29:09 +02:00
Uwe a7dbbd5f21 [FEM] fix Z88 binary handling
- when the binary was not found, the function called the non-existing binary
- also push error message for Elmer and Z88 to the status info so that user gets feedback also when report view console is not shown
- uniform wording to 'binary'
- avoid unnecessary console output
2022-07-17 03:39:21 +02:00
Uwe 89ecdae088 [PD] fix Pad/Pocket logic issue
- fixes the bug reported in https://forum.freecadweb.org/viewtopic.php?f=3&t=70266
  as Method #2
  -> When switching to two dimensions, symmetric must be unchecked if it is checked
2022-07-17 03:24:19 +02:00
Uwe 13c4de32f2 [FEM] check if solver executables exist
- currently one can enter any path for the solver executables, a check is missing

- moreover for Z88 the executable name is error-prone (just happened to me and cost me half an hour to find out what is wrong), therefore check also the correct filename. For Elmer this cannot be done since there are different executables one can choose of (e.g. for multi-threading etc.)
2022-07-17 03:21:42 +02:00
Uwe abc61d3e14 [FEM] check if Gmsh, CCX and Mystran solver binaries exist
- adds the check like we have already for Z88 and Elmer
- also remove an unnecessary return statement
2022-07-17 03:13:59 +02:00
Uwe 6be3aef0e2 [FEM] fix CCX (new framework) binary handling
- when the binary was not found, the function called the non-existing binary
- also push error message to the status info so that user gets feedback also when report view console is not shown
2022-07-17 03:07:50 +02:00
Uwe 8cd18ce93e [FEM] [skip CI] tell user when Elmer write succeeded
At the moment the user gets no feedback, while for Z88 and CCX he gets a result
2022-07-17 03:04:12 +02:00
Uwe 7979e8c639 [Gui] preferences: clarify Part/PD page
- users are confused that we have a preferences page named "Part design" that also defines things for the Part WB. The Wiki is clear that the preferences page is for both, Part and PD, however the UI is not.
This PR makes this clear.
2022-07-16 18:09:15 +02:00
wmayer e0a8a7f306 PD: fix ProfileBased::getSupportFace() to also handle the case where a support face is selected 2022-07-16 17:35:34 +02:00
wmayer 233685616d PD: rename getUpToFaceFromLinkSub to getFaceFromLinkSub 2022-07-16 17:35:34 +02:00
Roy-043 22c971499a Update view_facebinder.py
There is no need for `Gui.Control.closeDialog()` in `setEdit`
2022-07-16 17:33:29 +02:00
Roy-043 e2ed278874 Draft: Fix Hatch task panel title
Form -> Hatch
2022-07-16 17:32:47 +02:00
Marshal Horn c97f1afd72 Replaced python2 usage of next()
iterator.next() is deprecated in python3.
next(iterator) is the direct replacement.
In some cases a for() loop makes more sense
2022-07-16 17:29:23 +02:00
Wanderer Fan 8d5f274d03 [TD]fix crash on body with no shape 2022-07-14 01:59:41 +02:00
Bernd Hahnebach bd2a9b259d FEM: Python code formatting 2022-07-14 01:56:54 +02:00
Uwe c68d109db1 [FEM] femutils.py: style changes
- as requested
2022-07-14 01:55:10 +02:00
Uwe c1bea323d2 [FEM] fix solver console bugs
- for Elmer and Z88 on Windows several windows pop up (console windows). This is maybe annoying and the user is wondering what is going on, but the main problem is that when you close them, you break the solving process.
Therefore, on Windows only, hide the empty popup windows.
2022-07-14 01:55:10 +02:00
sliptonic 179329d1ba Merge pull request #7137 from Russ4262/fix/path_array_polar
Path: Fix Type=Polar regression in PathArray
2022-07-14 01:51:40 +02:00
Uwe b0e55b69ed Merge pull request #7178 from sliptonic/bug/misc
[Path]  Several small bug fixes
2022-07-14 01:47:26 +02:00
Bernd Hahnebach fc13b150d5 FEM: elmer solver writer, add some comment in the regard of units 2022-07-14 01:37:30 +02:00
wmayer 9e3618005e Part: [skip ci] fix possible build failure 2022-07-14 01:34:26 +02:00
Peter Marquardt fcba255925 Draft: fix spacing of ToolTip text 2022-07-14 01:32:17 +02:00
Bernd Hahnebach f6e1aeabe3 FEM: typos, found with:
codespell -q 2 -S *.ts -S *.dyn -S *.svg  -L childs,dof,dum,freez,methode,nd,normaly,programm,som,uint,vertexes,inout  src/Mod/Fem/
2022-07-14 01:30:54 +02:00
Uwe bbc5ca8a74 [FEM] fix CCX multi-threading bug
- in the preferences one could specify more CPU cores than available

- also correct a label sine the number of cores are since FC 0.20 used for all CCX solver runs

- also remove unnecessary (doubled) slots from the UI file
2022-07-10 17:34:48 +02:00
Uwe 0e304cd22b [FEM] remove doubled slots from preferences UI files 2022-07-10 17:34:48 +02:00
wehrle cc55bf7d83 correction 2022-07-10 13:44:24 +02:00
Roy-043 9833f3fd99 Draft: Fix join.py 2022-07-09 20:17:31 +02:00
Wanderer Fan 6cd575600c [TD]fix bad edge in face finder 2022-07-09 20:15:50 +02:00
Benjamin Bræstrup Sayoc 23f39ad2da [TechDraw] Use function overloadin and avoid code repeat 2022-07-09 20:14:45 +02:00
wmayer 3dadeab9e0 GuiPy: allow to call setupWithoutGUI more than once 2022-07-09 20:12:41 +02:00
Roy-043 1861868428 Draft: displayStatusbarScaleWidget should be checked in preferences-draftinterface.ui 2022-07-09 20:11:18 +02:00
Roy-043 3ce1ce70c9 Arch: Invert opening symbol Simple door 2022-07-09 20:08:01 +02:00
Wanderer Fan 6e77b5ae3f [TD]fix multiple open dialogs 2022-07-09 19:43:31 +02:00
wmayer ebed2d0b33 Test: [skip ci] unit test for fix of Vector2d::Rotate 2022-07-09 19:41:46 +02:00
Wanderer Fan 74bbc3e1db [TD]fix scaling of bitmap 2022-07-09 19:35:49 +02:00
Yorik van Havre 020375256c Merge pull request #7122 from donovaly/Arch-fix-typo
[Arch] fix typo in function name
2022-07-09 19:33:02 +02:00
wmayer 323acb01cf App: fix build failure on Windows caused by PR #7034 2022-07-09 19:31:01 +02:00
flachyjoe 8bb7cfe780 [App] Fix file not found error with canonical filename
boost::filesystem::canonical doesn't resolve non existent file where
boost::filesystem::weakly_canonical does.

Notice boost::filesystem::weakly_canonical only resolve absolute path.
2022-07-09 19:29:48 +02:00
flachyjoe d25478bb35 [App] Fix #5592 : Respect symbolic links
Use the real path to the file when saving the document.
2022-07-09 19:29:48 +02:00
Wanderer Fan ed94b600ca [TD]fix bitmap hatch 2022-07-03 17:55:17 +02:00
Uwe ee78a3c046 [Base] Tools2D.h: a simplification and code style unification 2022-07-03 16:22:28 +02:00
ChenOrange 6a44d1e8ff Vector2d:fix rotate bug 2022-07-03 16:22:28 +02:00
luz paz cc90163850 LGTM: omit src/Tools/wiki2qhelp.py from analysis
Per https://lgtm.com/projects/g/FreeCAD/FreeCAD

[skip ci]
2022-07-03 16:22:02 +02:00
Uwe da1e2c22de [FEM] fix wrong console outputs for fluid materials
- since a while ThermalExpansionCoefficient is used, VolumetricThermalExpansionCoefficient is only used for the material task panel
- as already stated in a code comment, the unit of VolumetricThermalExpansionCoefficient is ThermalExpansionCoefficient, therefore we must check for ThermalExpansionCoefficient
- we must also check if ThermalExpansionCoefficient exists

- Adapt the existing fluid material cards to use the ThermalExpansionCoefficient
2022-07-03 16:17:10 +02:00
Mihail ed7c650f48 FEM WB Elmer viscosity bug fix.
In Elmer there was errors "Viscosity not found" if used mixed solid and flow calculation.
This fix disables Stokes-Navier eruation for Solid objects.

	modified:      src/Mod/Fem/femsolver/elmer/writer.py
2022-07-03 16:15:44 +02:00
Yorik van Havre ad181ce993 Merge pull request #7071 from Roy-043/Draft-Fix-Placement-in-make_sketch
Draft: Fix Sketch Placement in make_sketch (issue #7058)
2022-07-01 03:27:13 +02:00
Wanderer Fan c91c096235 [TD]fix Dimension export to DXF 2022-07-01 02:46:13 +02:00
Wanderer Fan c06f0e9132 [TD]Include CosmeticLines in Dxf 2022-07-01 02:46:13 +02:00
wmayer 5930aac110 Test: ignore UnicodeEncodeError in TestMetadata.test_file_path 2022-07-01 02:21:05 +02:00
wmayer 1d55d10a51 Test: use codecs.open in TestMetadata.test_file_path 2022-07-01 02:12:40 +02:00
wmayer 9a51cd0e34 App: issue #7112: Addon manager does not work on windows with special characters in the username 2022-07-01 02:02:44 +02:00
Roy-043 a0e5012ed0 Draft: Fix default fillmode in DraftGui.py 2022-07-01 02:01:44 +02:00
wmayer ad2c36b351 Test: [skip ci] test file path with utf-8 <-> utf-16 conversion 2022-06-30 00:33:30 +02:00
wmayer 4c74687a6d Test: extend test for enumeration 2022-06-30 00:31:32 +02:00
Roy-043 0d510a837f Draft: Fix align working plane to DatumPlane bug 2022-06-30 00:30:10 +02:00
Roy-043 c219656919 Draft: Fix align working plane to DatumPlane bug 2022-06-30 00:29:48 +02:00
wmayer bb6ab2d7c2 Part: fix GeomBSplineCurve::toBiArcs
If tangent of start and end point are parallel then also check a tangent in between to make sure that it can be considered a straight line
See https://forum.freecadweb.org/viewtopic.php?f=8&t=69710
2022-06-30 00:27:09 +02:00
Uwe ebb5a2bdc6 [FEM] fix point filter initialization issue
- on opening the task dialog of existing point filter, the point value must be displayed
2022-06-27 02:14:45 +02:00
sliptonic 7547f6c79b Merge pull request #6760 from Russ4262/fix/dressup_leadinout
Path: Fixes #6693 - Add Z and K values to arc commands
2022-06-25 19:23:44 +02:00
Uwe f4bf59e000 [PD] Hole initialization bugfix
- by default there is no hole head cut and therefore its parameter must be initialized as read-only (will be enably when user sets a head cut)

- also fix a typo

- also fix a UI file issue (automatically done by Qt Designer)
2022-06-25 16:59:19 +02:00
Kuzemko Alexsandr 79df3ea2eb [Part] Fix display "labelfillet" name for Chamfer and Fillet (#7083)
* Fix display "labelfillet" name for Chamfer and Fillet
* Synchronize options name with PartDesign_Chamfer. Proposed by  @Roy-043
@Roy-043 https://github.com/FreeCAD/FreeCAD/pull/7074#issuecomment-1165303970
2022-06-25 15:06:18 +02:00
Uwe d0c9fec938 [PD] Hole dialog fixes
- when there is no profile the change of the hole cut type was not handled
- for the deprecated hole cut types it must also be possible to use custom values
2022-06-25 14:12:06 +02:00
ShuffleWire de5e7f35e1 Base: add Const attribute to many MatrixPy methods
multiply(), determinant(), isOrthogonal(),
submatrix(), analyze() also get the const attribute
2022-06-24 02:38:20 +02:00
wmayer a015548a88 Part: add Const attribute to several methods in TopoShapePy 2022-06-24 02:38:20 +02:00
wmayer 8a56db68e7 Base: add Const attribute to MatrixPy::inverse() 2022-06-24 02:38:20 +02:00
Adrian Insaurralde Avalos 3f2df77d3f Rename FindOpenCasCade.cmake to FindOCC.cmake
To fix a warning 'name passed to `find_package_handle_standard_args` (OCC) does not match'
2022-06-24 02:37:40 +02:00
luzpaz bb51742f33 Stylesheets: fix typos
[skip ci]
2022-06-24 02:34:58 +02:00
wmayer d07ca8c3b6 Test: [skip ci] test for fixed Rotation::inverse() 2022-06-20 13:14:43 +02:00
marioalexis 763ba9e149 Base: Fix wrong function name in RotationPy documentation. 2022-06-20 02:20:46 +02:00
Uwe c62f6a7e4c Merge branch 'releases/FreeCAD-0-20' of github.com:FreeCAD/FreeCAD into releases/FreeCAD-0-20 2022-06-20 01:00:24 +02:00
Uwe 3e375b6528 update version number and copyright year 2022-06-20 01:00:05 +02:00
Christoph Moench-Tegeder 0a5a1803a5 fix Expressions assignment for FreeBSD
Just like Apple, FreeBSD uses clang as it's main compiler, and thus
runs afoul of the same problem in src/App/PropertyExpressionEngine.cpp
like Apple (issue #5281): "error: no viable overloaded '='".
Extend the fix from #5281 for the BSDs (check macro FC_OS_BSD) -
at least OpenBSD uses clang, too (maybe this check should be reworked
to test for clang, but I can't test on Apple, so let's keep this fix
minimalistic).

References: #5281
2022-06-19 16:15:02 +02:00
marioalexis be9218a76a Base: Set angle in Rotation::inverse function 2022-06-19 15:45:08 +02:00
Wanderer Fan e3865d5121 [TD]fix ProjGroup view spacing 2022-06-19 15:13:42 +02:00
Wanderer Fan 66d6379f7e [TD]fix dimension update on scale change 2022-06-19 15:13:41 +02:00
wmayer c7c9f630b3 plugin: do not exclude widget plugins from tarball 2022-06-19 15:09:22 +02:00
wmayer 6f0e049638 Mesh: fixes #6902: Conda test errors 2022-06-19 15:08:22 +02:00
wmayer 28f730a81e Mesh: fixes #7018: 3mf created with FreeCAD cannot be loaded with PrusaSlicer 2022-06-19 15:06:19 +02:00
wmayer 637472f105 Part: [skip ci] add tests for ruled surfaces 2022-06-19 15:04:16 +02:00
wmayer bd3d6aa3ed Spreadsheet: add tests for merging cells and binding cells 2022-06-19 15:02:42 +02:00
Uwe bcd43070b3 update screenshot in Readme
update screenshot to FC 0.20
2022-06-19 15:01:40 +02:00
TotalCaesar659 c6ab0be18e Update URL to HTTPS 2022-06-19 15:01:40 +02:00
Uwe 668570fc85 [Win installer] update information
- also refine a script
2022-06-19 15:01:40 +02:00
Uwe 3c565e1307 Update Readme to FreeCAD 0.20 2022-06-19 14:59:23 +02:00
800 changed files with 13663 additions and 9029 deletions
+66
View File
@@ -0,0 +1,66 @@
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignOperands: DontAlign
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: MultiLine
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: Never
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 100
CompactNamespaces: false
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Left
ReflowComments: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
+491
View File
@@ -0,0 +1,491 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,boost-*,bugprone-*,
performance-*,readability-*,portability-*,modernize-*,cppcoreguidelines-*,
concurrency-*,-modernize-use-trailing-return-type, -modernize-use-nodiscard,
-readability-redundant-access-specifiers'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: file
User: florians
CheckOptions:
- key: readability-suspicious-call-argument.PrefixSimilarAbove
value: '30'
- key: cppcoreguidelines-no-malloc.Reallocations
value: '::realloc'
- key: cppcoreguidelines-owning-memory.LegacyResourceConsumers
value: '::free;::realloc;::freopen;::fclose'
- key: bugprone-reserved-identifier.Invert
value: 'false'
- key: bugprone-narrowing-conversions.PedanticMode
value: 'false'
- key: bugprone-unused-return-value.CheckedFunctions
value: '::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty;::std::back_inserter;::std::distance;::std::find;::std::find_if;::std::inserter;::std::lower_bound;::std::make_pair;::std::map::count;::std::map::find;::std::map::lower_bound;::std::multimap::equal_range;::std::multimap::upper_bound;::std::set::count;::std::set::find;::std::setfill;::std::setprecision;::std::setw;::std::upper_bound;::std::vector::at;::bsearch;::ferror;::feof;::isalnum;::isalpha;::isblank;::iscntrl;::isdigit;::isgraph;::islower;::isprint;::ispunct;::isspace;::isupper;::iswalnum;::iswprint;::iswspace;::isxdigit;::memchr;::memcmp;::strcmp;::strcoll;::strncmp;::strpbrk;::strrchr;::strspn;::strstr;::wcscmp;::access;::bind;::connect;::difftime;::dlsym;::fnmatch;::getaddrinfo;::getopt;::htonl;::htons;::iconv_open;::inet_addr;::isascii;::isatty;::mmap;::newlocale;::openat;::pathconf;::pthread_equal;::pthread_getspecific;::pthread_mutex_trylock;::readdir;::readlink;::recvmsg;::regexec;::scandir;::semget;::setjmp;::shm_open;::shmget;::sigismember;::strcasecmp;::strsignal;::ttyname'
- key: modernize-use-auto.MinTypeNameLength
value: '5'
- key: cppcoreguidelines-macro-usage.CheckCapsOnly
value: 'false'
- key: readability-inconsistent-declaration-parameter-name.Strict
value: 'false'
- key: readability-suspicious-call-argument.DiceDissimilarBelow
value: '60'
- key: bugprone-assert-side-effect.IgnoredFunctions
value: __builtin_expect
- key: readability-suspicious-call-argument.Equality
value: 'true'
- key: bugprone-easily-swappable-parameters.QualifiersMix
value: 'false'
- key: bugprone-suspicious-string-compare.WarnOnImplicitComparison
value: 'true'
- key: bugprone-argument-comment.CommentNullPtrs
value: '0'
- key: cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion
value: 'true'
- key: cppcoreguidelines-init-variables.IncludeStyle
value: llvm
- key: modernize-use-nodiscard.ReplacementString
value: '[[nodiscard]]'
- key: modernize-loop-convert.MakeReverseRangeHeader
value: ''
- key: readability-suspicious-call-argument.SuffixSimilarAbove
value: '30'
- key: cppcoreguidelines-narrowing-conversions.WarnOnIntegerNarrowingConversion
value: 'true'
- key: bugprone-easily-swappable-parameters.IgnoredParameterNames
value: '"";iterator;Iterator;begin;Begin;end;End;first;First;last;Last;lhs;LHS;rhs;RHS'
- key: modernize-loop-convert.UseCxx20ReverseRanges
value: 'true'
- key: cppcoreguidelines-prefer-member-initializer.UseAssignment
value: 'false'
- key: performance-type-promotion-in-math-fn.IncludeStyle
value: llvm
- key: readability-function-cognitive-complexity.DescribeBasicIncrements
value: 'true'
- key: bugprone-suspicious-include.ImplementationFileExtensions
value: 'c;cc;cpp;cxx'
- key: modernize-loop-convert.MakeReverseRangeFunction
value: ''
- key: readability-inconsistent-declaration-parameter-name.IgnoreMacros
value: 'true'
- key: bugprone-suspicious-missing-comma.SizeThreshold
value: '5'
- key: readability-identifier-naming.IgnoreFailedSplit
value: 'false'
- key: readability-qualified-auto.AddConstToQualified
value: 'true'
- key: bugprone-sizeof-expression.WarnOnSizeOfThis
value: 'true'
- key: bugprone-string-constructor.WarnOnLargeLength
value: 'true'
- key: cppcoreguidelines-explicit-virtual-functions.OverrideSpelling
value: override
- key: readability-uppercase-literal-suffix.IgnoreMacros
value: 'true'
- key: modernize-make-shared.IgnoreMacros
value: 'true'
- key: bugprone-dynamic-static-initializers.HeaderFileExtensions
value: ';h;hh;hpp;hxx'
- key: bugprone-suspicious-enum-usage.StrictMode
value: 'false'
- key: performance-unnecessary-copy-initialization.AllowedTypes
value: ''
- key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens
value: '5'
- key: modernize-use-transparent-functors.SafeMode
value: 'false'
- key: readability-suspicious-call-argument.Levenshtein
value: 'true'
- key: bugprone-not-null-terminated-result.WantToUseSafeFunctions
value: 'true'
- key: bugprone-string-constructor.LargeLengthThreshold
value: '8388608'
- key: readability-simplify-boolean-expr.ChainedConditionalAssignment
value: 'false'
- key: cppcoreguidelines-avoid-magic-numbers.IgnoreAllFloatingPointValues
value: 'false'
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: 'false'
- key: bugprone-exception-escape.FunctionsThatShouldNotThrow
value: ''
- key: performance-inefficient-vector-operation.EnableProto
value: 'false'
- key: modernize-make-shared.MakeSmartPtrFunction
value: 'std::make_shared'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: readability-suspicious-call-argument.PrefixDissimilarBelow
value: '25'
- key: readability-function-size.LineThreshold
value: '4294967295'
- key: bugprone-easily-swappable-parameters.MinimumLength
value: '2'
- key: portability-simd-intrinsics.Suggest
value: 'false'
- key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader
value: ''
- key: modernize-use-override.IgnoreDestructors
value: 'false'
- key: modernize-make-shared.MakeSmartPtrFunctionHeader
value: '<memory>'
- key: bugprone-sizeof-expression.WarnOnSizeOfConstant
value: 'true'
- key: readability-redundant-string-init.StringNames
value: '::std::basic_string_view;::std::basic_string'
- key: modernize-make-unique.IgnoreDefaultInitialization
value: 'true'
- key: modernize-use-emplace.ContainersWithPushBack
value: '::std::vector;::std::list;::std::deque'
- key: readability-magic-numbers.IgnoreBitFieldsWidths
value: 'true'
- key: modernize-make-unique.IncludeStyle
value: llvm
- key: modernize-use-override.OverrideSpelling
value: override
- key: readability-suspicious-call-argument.LevenshteinDissimilarBelow
value: '50'
- key: bugprone-argument-comment.CommentStringLiterals
value: '0'
- key: concurrency-mt-unsafe.FunctionSet
value: any
- key: readability-identifier-length.IgnoredExceptionVariableNames
value: '^[e]$'
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: bugprone-reserved-identifier.AllowedIdentifiers
value: ''
- key: cppcoreguidelines-pro-type-member-init.IgnoreArrays
value: 'false'
- key: readability-else-after-return.WarnOnUnfixable
value: 'true'
- key: cppcoreguidelines-avoid-magic-numbers.IgnoredFloatingPointValues
value: '1.0;100.0;'
- key: modernize-use-emplace.IgnoreImplicitConstructors
value: 'false'
- key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros
value: 'true'
- key: readability-suspicious-call-argument.Substring
value: 'true'
- key: modernize-use-equals-delete.IgnoreMacros
value: 'true'
- key: readability-identifier-length.IgnoredVariableNames
value: ''
- key: readability-magic-numbers.IgnoreAllFloatingPointValues
value: 'false'
- key: cppcoreguidelines-pro-bounds-constant-array-index.IncludeStyle
value: llvm
- key: readability-suspicious-call-argument.Abbreviations
value: 'arr=array;cnt=count;idx=index;src=source;stmt=statement;cpy=copy;dest=destination;dist=distancedst=distance;ptr=pointer;wdth=width;str=string;ln=line;srv=server;attr=attribute;ref=reference;buf=buffer;col=column;nr=number;vec=vector;len=length;elem=element;val=value;i=index;var=variable;hght=height;cl=client;num=number;pos=position;lst=list;addr=address'
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts
value: 'false'
- key: readability-uppercase-literal-suffix.NewSuffixes
value: ''
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: performance-unnecessary-value-param.AllowedTypes
value: ''
- key: readability-uniqueptr-delete-release.PreferResetCall
value: 'false'
- key: readability-identifier-length.MinimumExceptionNameLength
value: '2'
- key: cppcoreguidelines-avoid-magic-numbers.IgnorePowersOf2IntegerValues
value: 'false'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: cppcoreguidelines-avoid-magic-numbers.IgnoreBitFieldsWidths
value: 'true'
- key: cppcoreguidelines-avoid-magic-numbers.IgnoredIntegerValues
value: '1;2;3;4;'
- key: cppcoreguidelines-no-malloc.Allocations
value: '::malloc;::calloc'
- key: bugprone-narrowing-conversions.IgnoreConversionFromTypes
value: ''
- key: readability-function-size.BranchThreshold
value: '4294967295'
- key: bugprone-suspicious-missing-comma.RatioThreshold
value: '0.200000'
- key: readability-implicit-bool-conversion.AllowIntegerConditions
value: 'false'
- key: readability-identifier-length.IgnoredParameterNames
value: '^[n]$'
- key: readability-function-size.StatementThreshold
value: '800'
- key: readability-identifier-naming.IgnoreMainLikeFunctions
value: 'false'
- key: cppcoreguidelines-init-variables.MathHeader
value: '<math.h>'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: bugprone-reserved-identifier.AggressiveDependentMemberLookup
value: 'false'
- key: readability-suspicious-call-argument.DiceSimilarAbove
value: '70'
- key: modernize-use-equals-default.IgnoreMacros
value: 'true'
- key: readability-suspicious-call-argument.Abbreviation
value: 'true'
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: 'false'
- key: readability-identifier-length.MinimumLoopCounterNameLength
value: '2'
- key: modernize-use-emplace.SmartPointers
value: '::std::shared_ptr;::std::unique_ptr;::std::auto_ptr;::std::weak_ptr'
- key: cppcoreguidelines-no-malloc.Deallocations
value: '::free'
- key: bugprone-dangling-handle.HandleClasses
value: 'std::basic_string_view;std::experimental::basic_string_view'
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
value: 'false'
- key: readability-suspicious-call-argument.JaroWinklerSimilarAbove
value: '85'
- key: readability-simplify-subscript-expr.Types
value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array'
- key: performance-unnecessary-copy-initialization.ExcludedContainerTypes
value: ''
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: 'true'
- key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold
value: '3'
- key: readability-function-size.VariableThreshold
value: '4294967295'
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: bugprone-narrowing-conversions.WarnOnFloatingPointNarrowingConversion
value: 'true'
- key: readability-identifier-naming.GetConfigPerFile
value: 'true'
- key: modernize-use-default-member-init.UseAssignment
value: 'false'
- key: readability-function-size.NestingThreshold
value: '4294967295'
- key: modernize-use-override.AllowOverrideAndFinal
value: 'false'
- key: cppcoreguidelines-narrowing-conversions.IgnoreConversionFromTypes
value: ''
- key: readability-function-size.ParameterThreshold
value: '4294967295'
- key: modernize-pass-by-value.ValuesOnly
value: 'false'
- key: readability-function-cognitive-complexity.IgnoreMacros
value: 'false'
- key: modernize-loop-convert.IncludeStyle
value: llvm
- key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons
value: 'false'
- key: bugprone-narrowing-conversions.WarnWithinTemplateInstantiation
value: 'false'
- key: cert-err33-c.CheckedFunctions
value: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;'
- key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison
value: 'false'
- key: readability-redundant-smartptr-get.IgnoreMacros
value: 'true'
- key: cppcoreguidelines-explicit-virtual-functions.AllowOverrideAndFinal
value: 'false'
- key: readability-identifier-naming.AggressiveDependentMemberLookup
value: 'false'
- key: readability-identifier-length.MinimumParameterNameLength
value: '3'
- key: modernize-use-emplace.TupleTypes
value: '::std::pair;::std::tuple'
- key: modernize-use-emplace.TupleMakeFunctions
value: '::std::make_pair;::std::make_tuple'
- key: bugprone-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion
value: 'true'
- key: cppcoreguidelines-owning-memory.LegacyResourceProducers
value: '::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile'
- key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether
value: 'true'
- key: bugprone-argument-comment.StrictMode
value: '0'
- key: modernize-replace-random-shuffle.IncludeStyle
value: llvm
- key: modernize-use-bool-literals.IgnoreMacros
value: 'true'
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField
value: 'true'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: bugprone-suspicious-string-compare.StringCompareLikeFunctions
value: ''
- key: modernize-avoid-bind.PermissiveParameterList
value: 'false'
- key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold
value: '1'
- key: readability-suspicious-call-argument.Suffix
value: 'true'
- key: readability-suspicious-call-argument.JaroWinklerDissimilarBelow
value: '75'
- key: modernize-use-noexcept.ReplacementString
value: ''
- key: modernize-use-override.FinalSpelling
value: final
- key: modernize-use-using.IgnoreMacros
value: 'true'
- key: cppcoreguidelines-explicit-virtual-functions.FinalSpelling
value: final
- key: readability-suspicious-call-argument.MinimumIdentifierNameLength
value: '3'
- key: bugprone-narrowing-conversions.WarnOnIntegerNarrowingConversion
value: 'true'
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: cppcoreguidelines-pro-type-member-init.UseAssignment
value: 'false'
- key: bugprone-suspicious-include.HeaderFileExtensions
value: ';h;hh;hpp;hxx'
- key: performance-no-automatic-move.AllowedTypes
value: ''
- key: readability-suspicious-call-argument.SubstringDissimilarBelow
value: '40'
- key: bugprone-argument-comment.CommentIntegerLiterals
value: '0'
- key: bugprone-stringview-nullptr.IncludeStyle
value: llvm
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: 'false'
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: bugprone-argument-comment.CommentFloatLiterals
value: '0'
- key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit
value: '16'
- key: readability-simplify-boolean-expr.ChainedConditionalReturn
value: 'false'
- key: readability-else-after-return.WarnOnConditionVariables
value: 'true'
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: readability-suspicious-call-argument.SuffixDissimilarBelow
value: '25'
- key: bugprone-argument-comment.CommentCharacterLiterals
value: '0'
- key: cppcoreguidelines-macro-usage.AllowedRegexp
value: '^DEBUG_*'
- key: readability-suspicious-call-argument.LevenshteinSimilarAbove
value: '66'
- key: cppcoreguidelines-narrowing-conversions.PedanticMode
value: 'false'
- key: modernize-make-shared.IgnoreDefaultInitialization
value: 'true'
- key: readability-suspicious-call-argument.JaroWinkler
value: 'true'
- key: bugprone-implicit-widening-of-multiplication-result.UseCXXHeadersInCppSources
value: 'true'
- key: modernize-make-shared.IncludeStyle
value: llvm
- key: readability-suspicious-call-argument.Prefix
value: 'true'
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions
value: 'false'
- key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources
value: 'true'
- key: bugprone-signed-char-misuse.CharTypdefsToIgnore
value: ''
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
value: 'false'
- key: modernize-make-unique.IgnoreMacros
value: 'true'
- key: performance-for-range-copy.AllowedTypes
value: ''
- key: bugprone-argument-comment.CommentBoolLiterals
value: '0'
- key: readability-braces-around-statements.ShortStatementLines
value: '0'
- key: bugprone-argument-comment.CommentUserDefinedLiterals
value: '0'
- key: readability-magic-numbers.IgnoredFloatingPointValues
value: '1.0;100.0;'
- key: performance-inefficient-string-concatenation.StrictMode
value: 'false'
- key: readability-redundant-declaration.IgnoreMacros
value: 'true'
- key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes
value: 'bool;Bool;_Bool;it;It;iterator;Iterator;inputit;InputIt;forwardit;ForwardIt;bidirit;BidirIt;constiterator;const_iterator;Const_Iterator;Constiterator;ConstIterator;RandomIt;randomit;random_iterator;ReverseIt;reverse_iterator;reverse_const_iterator;ConstReverseIterator;Const_Reverse_Iterator;const_reverse_iterator;Constreverseiterator;constreverseiterator'
- key: modernize-make-unique.MakeSmartPtrFunction
value: 'std::make_unique'
- key: portability-restrict-system-includes.Includes
value: '*'
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: 'false'
- key: modernize-make-unique.MakeSmartPtrFunctionHeader
value: '<memory>'
- key: bugprone-signal-handler.AsyncSafeFunctionSet
value: POSIX
- key: bugprone-easily-swappable-parameters.ModelImplicitConversions
value: 'true'
- key: readability-suspicious-call-argument.SubstringSimilarAbove
value: '50'
- key: cppcoreguidelines-narrowing-conversions.WarnWithinTemplateInstantiation
value: 'false'
- key: readability-identifier-length.MinimumVariableNameLength
value: '3'
- key: cppcoreguidelines-narrowing-conversions.WarnOnEquivalentBitWidth
value: 'true'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnorePublicMemberVariables
value: 'false'
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted
value: 'false'
- key: modernize-use-noexcept.UseNoexceptFalse
value: 'true'
- key: readability-function-cognitive-complexity.Threshold
value: '25'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: 'true'
- key: bugprone-argument-comment.IgnoreSingleArgument
value: '0'
- key: bugprone-narrowing-conversions.WarnOnEquivalentBitWidth
value: 'true'
- key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression
value: 'false'
- key: performance-faster-string-find.StringLikeClasses
value: '::std::basic_string;::std::basic_string_view'
- key: cppcoreguidelines-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion
value: 'true'
- key: bugprone-assert-side-effect.CheckFunctionCalls
value: 'false'
- key: bugprone-string-constructor.StringNames
value: '::std::basic_string;::std::basic_string_view'
- key: bugprone-assert-side-effect.AssertMacros
value: assert,NSAssert,NSCAssert
- key: bugprone-exception-escape.IgnoredExceptions
value: ''
- key: bugprone-signed-char-misuse.DiagnoseSignedUnsignedCharComparisons
value: 'true'
- key: modernize-use-default-member-init.IgnoreMacros
value: 'true'
- key: llvm-qualified-auto.AddConstToQualified
value: 'false'
- key: llvm-else-after-return.WarnOnConditionVariables
value: 'false'
- key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant
value: 'true'
- key: modernize-raw-string-literal.DelimiterStem
value: lit
- key: readability-suspicious-call-argument.Dice
value: 'true'
- key: readability-identifier-length.IgnoredLoopCounterNames
value: '^[ijk_]$'
- key: modernize-raw-string-literal.ReplaceShorterLiterals
value: 'false'
- key: readability-magic-numbers.IgnoredIntegerValues
value: '1;2;3;4;'
- key: performance-inefficient-vector-operation.VectorLikeClasses
value: '::std::vector'
- key: modernize-use-auto.RemoveStars
value: 'false'
- key: bugprone-implicit-widening-of-multiplication-result.IncludeStyle
value: llvm
- key: portability-simd-intrinsics.Std
value: ''
- key: performance-unnecessary-value-param.IncludeStyle
value: llvm
- key: readability-redundant-member-init.IgnoreBaseInCopyConstructors
value: 'false'
- key: modernize-replace-disallow-copy-and-assign-macro.MacroName
value: DISALLOW_COPY_AND_ASSIGN
- key: llvm-else-after-return.WarnOnUnfixable
value: 'false'
...
+15
View File
@@ -0,0 +1,15 @@
{
"problemMatcher": [
{
"owner": "black-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(would reformat (.*))$",
"file": 2,
"message": 1
}
]
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "clang",
"pattern": [
{
"regexp": "^(.+):([0-9]+):([0-9]+): (error|warning|note): (.+)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}
+16
View File
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "codespell-matcher",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+):(\\d+):\\s+(.+)$",
"file": 1,
"line": 2,
"message": 3
}
]
}
]
}
+16
View File
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "cpplint",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+):([0-9]+): (.+)$",
"file": 1,
"line": 2,
"message": 3
}
]
}
]
}
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "grepMatcher-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+):([0-9]+):(.+)$",
"file": 1,
"line": 2,
"message": 3
}
]
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "pylint-error",
"severity": "error",
"pattern": [
{
"regexp": "^(.+?):([0-9]+):([0-9]+): ([([E|F][0-9]+): (.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
]
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "pylint-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+?):([0-9]+):([0-9]+): ([^E|F][0-9]+): (.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
]
}
]
}
File diff suppressed because it is too large Load Diff
-31
View File
@@ -1,31 +0,0 @@
# GitHub Action to automate the identification of common misspellings in text files.
# https://github.com/codespell-project/actions-codespell
# https://github.com/codespell-project/codespell
name: Codespell
on:
pull_request:
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v12.2
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
ignore_words_file: .github/codespellignore
skip: ./.git,*.po,*.ts,*.svg,./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,./build/
path: ${{ steps.changed-files.outputs.all_changed_files }}
+7 -4
View File
@@ -1,5 +1,11 @@
# file types to ignore
.*
!/.gitignore
!/.travis/
!/.travis.yml
!/.clang-format
!/.git-blame-ignore-revs
!/.gitattributes
*.DS_Store
*.pyc
*.obj
@@ -34,10 +40,7 @@ install_manifest.txt
/src/Tools/offlinedoc/localwiki/
/src/Tools/offlinedoc/*.txt
OpenSCAD_rc.py
/\.idea/
.tags
tags
/\.vscode/
# crowdin file
src/Tools/freecad.zip
+614
View File
@@ -0,0 +1,614 @@
[MAIN]
# Analyse import fallback blocks. This can be used to support both Python 2 and
# 3 compatible code, which means that the block might have code that exists
# only in one or another interpreter, leading to false positives when analysed.
analyse-fallback-blocks=no
# Load and enable all available extensions. Use --list-extensions to see a list
# all available extensions.
#enable-all-extensions=
# In error mode, messages with a category besides ERROR or FATAL are
# suppressed, and no reports are done by default. Error mode is compatible with
# disabling specific errors.
#errors-only=
# Always return a 0 (non-error) status code, even if lint errors are found.
# This is primarily useful in continuous integration scripts.
#exit-zero=
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-allow-list=
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
# for backward compatibility.)
extension-pkg-whitelist=
# Return non-zero exit code if any of these messages/categories are detected,
# even if score is above --fail-under value. Syntax same as enable. Messages
# specified are enabled, while categories only check already-enabled messages.
fail-on=
# Specify a score threshold to be exceeded before program exits with error.
fail-under=10
# Interpret the stdin as a python script, whose filename needs to be passed as
# the module_or_package argument.
#from-stdin=
# Files or directories to be skipped. They should be base names, not paths.
ignore=CVS
# Add files or directories matching the regex patterns to the ignore-list. The
# regex matches against paths and can be in Posix or Windows format.
ignore-paths=
# Files or directories matching the regex patterns are skipped. The regex
# matches against base names, not paths. The default value ignores Emacs file
# locks
ignore-patterns=^\.#
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis). It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use, and will cap the count on Windows to
# avoid hangs.
jobs=1
# Control the amount of potential inferred values when inferring a single
# object. This can help the performance when dealing with large functions or
# complex, nested conditions.
limit-inference-results=100
# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=
# Pickle collected data for later comparisons.
persistent=yes
# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.10
# Discover python modules and packages in the file system subtree.
recursive=no
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
# In verbose mode, extra non-checker-related info will be displayed.
#verbose=
[REPORTS]
# Python expression which should return a score less than or equal to 10. You
# have access to the variables 'fatal', 'error', 'warning', 'refactor',
# 'convention', and 'info' which contain the number of messages in each
# category, as well as 'statement' which is the total number of statements
# analyzed. This score is used by the global evaluation report (RP0004).
evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details.
msg-template=
# Set the output format. Available formats are text, parseable, colorized, json
# and msvs (visual studio). You can also give a reporter class, e.g.
# mypackage.mymodule.MyReporterClass.
#output-format=
# Tells whether to display a full report or only the messages.
reports=yes
# Activate the evaluation score.
score=yes
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
# UNDEFINED.
confidence=HIGH,
CONTROL_FLOW,
INFERENCE,
INFERENCE_FAILURE,
UNDEFINED
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once). You can also use "--disable=all" to
# disable everything first and then re-enable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
invalid-name,
wrong-import-order,
import-error,
undefined-variable
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
enable=c-extension-no-member
[BASIC]
# Naming style matching correct argument names.
argument-naming-style=snake_case
# Regular expression matching correct argument names. Overrides argument-
# naming-style. If left empty, argument names will be checked with the set
# naming style.
#argument-rgx=
# Naming style matching correct attribute names.
attr-naming-style=snake_case
# Regular expression matching correct attribute names. Overrides attr-naming-
# style. If left empty, attribute names will be checked with the set naming
# style.
#attr-rgx=
# Bad variable names which should always be refused, separated by a comma.
bad-names=foo,
bar,
baz,
toto,
tutu,
tata
# Bad variable names regexes, separated by a comma. If names match any regex,
# they will always be refused
bad-names-rgxs=
# Naming style matching correct class attribute names.
class-attribute-naming-style=any
# Regular expression matching correct class attribute names. Overrides class-
# attribute-naming-style. If left empty, class attribute names will be checked
# with the set naming style.
#class-attribute-rgx=
# Naming style matching correct class constant names.
class-const-naming-style=UPPER_CASE
# Regular expression matching correct class constant names. Overrides class-
# const-naming-style. If left empty, class constant names will be checked with
# the set naming style.
#class-const-rgx=
# Naming style matching correct class names.
class-naming-style=PascalCase
# Regular expression matching correct class names. Overrides class-naming-
# style. If left empty, class names will be checked with the set naming style.
#class-rgx=
# Naming style matching correct constant names.
const-naming-style=UPPER_CASE
# Regular expression matching correct constant names. Overrides const-naming-
# style. If left empty, constant names will be checked with the set naming
# style.
#const-rgx=
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
# Naming style matching correct function names.
function-naming-style=snake_case
# Regular expression matching correct function names. Overrides function-
# naming-style. If left empty, function names will be checked with the set
# naming style.
#function-rgx=
# Good variable names which should always be accepted, separated by a comma.
good-names=i,
j,
k,
ex,
Run,
_
# Good variable names regexes, separated by a comma. If names match any regex,
# they will always be accepted
good-names-rgxs=
# Include a hint for the correct naming format with invalid-name.
include-naming-hint=no
# Naming style matching correct inline iteration names.
inlinevar-naming-style=any
# Regular expression matching correct inline iteration names. Overrides
# inlinevar-naming-style. If left empty, inline iteration names will be checked
# with the set naming style.
#inlinevar-rgx=
# Naming style matching correct method names.
method-naming-style=snake_case
# Regular expression matching correct method names. Overrides method-naming-
# style. If left empty, method names will be checked with the set naming style.
#method-rgx=
# Naming style matching correct module names.
module-naming-style=snake_case
# Regular expression matching correct module names. Overrides module-naming-
# style. If left empty, module names will be checked with the set naming style.
#module-rgx=
# Colon-delimited sets of names that determine each other's naming style when
# the name regexes allow several styles.
name-group=
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
# List of decorators that produce properties, such as abc.abstractproperty. Add
# to this list to register other decorators that produce valid properties.
# These decorators are taken in consideration only for invalid-name.
property-classes=abc.abstractproperty
# Regular expression matching correct type variable names. If left empty, type
# variable names will be checked with the set naming style.
#typevar-rgx=
# Naming style matching correct variable names.
variable-naming-style=snake_case
# Regular expression matching correct variable names. Overrides variable-
# naming-style. If left empty, variable names will be checked with the set
# naming style.
#variable-rgx=
[CLASSES]
# Warn about protected attribute access inside special methods
check-protected-access-in-special-methods=no
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,
__new__,
setUp,
__post_init__
# List of member names, which should be excluded from the protected access
# warning.
exclude-protected=_asdict,
_fields,
_replace,
_source,
_make
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=cls
[REFACTORING]
# Maximum number of nested blocks for function / method body
max-nested-blocks=5
# Complete name of functions that never returns. When checking for
# inconsistent-return-statements if a never returning function is called then
# it will be considered as an explicit return statement and no message will be
# printed.
never-returning-functions=sys.exit,argparse.parse_error
[DESIGN]
# List of regular expressions of class ancestor names to ignore when counting
# public methods (see R0903)
exclude-too-few-public-methods=
# List of qualified class names to ignore when counting class parents (see
# R0901)
ignored-parents=
# Maximum number of arguments for function / method.
max-args=5
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr=5
# Maximum number of branch for function / method body.
max-branches=12
# Maximum number of locals for function / method body.
max-locals=15
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# Maximum number of return / yield for function / method body.
max-returns=6
# Maximum number of statements in function / method body.
max-statements=50
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
[EXCEPTIONS]
# Exceptions that will emit a warning when caught.
overgeneral-exceptions=BaseException,
Exception
[FORMAT]
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
# Maximum number of characters on a single line.
max-line-length=100
# Maximum number of lines in a module.
max-module-lines=1000
# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
[IMPORTS]
# List of modules that can be imported at any level, not just the top level
# one.
allow-any-import-level=
# Allow wildcard imports from modules that define __all__.
allow-wildcard-with-all=no
# Deprecated modules which should not be used, separated by a comma.
deprecated-modules=
# Output a graph (.gv or any supported image format) of external dependencies
# to the given file (report RP0402 must not be disabled).
ext-import-graph=
# Output a graph (.gv or any supported image format) of all (i.e. internal and
# external) dependencies to the given file (report RP0402 must not be
# disabled).
import-graph=
# Output a graph (.gv or any supported image format) of internal dependencies
# to the given file (report RP0402 must not be disabled).
int-import-graph=
# Force import order to recognize a module as part of the standard
# compatibility libraries.
known-standard-library=
# Force import order to recognize a module as part of a third party library.
known-third-party=enchant
# Couples of modules and preferred modules, separated by a comma.
preferred-modules=
[LOGGING]
# The type of string formatting that logging methods do. `old` means using %
# formatting, `new` is for `{}` formatting.
logging-format-style=old
# Logging modules to check that the string format arguments are in logging
# function parameter format.
logging-modules=logging
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,
XXX,
TODO
# Regular expression of note tags to take in consideration.
notes-rgx=
[SIMILARITIES]
# Comments are removed from the similarity computation
ignore-comments=yes
# Docstrings are removed from the similarity computation
ignore-docstrings=yes
# Imports are removed from the similarity computation
ignore-imports=yes
# Signatures are removed from the similarity computation
ignore-signatures=yes
# Minimum lines number of a similarity.
min-similarity-lines=4
[SPELLING]
# Limits count of emitted suggestions for spelling mistakes.
max-spelling-suggestions=4
# Spelling dictionary name. Available dictionaries: none. To make it work,
# install the 'python-enchant' package.
spelling-dict=
# List of comma separated words that should be considered directives if they
# appear at the beginning of a comment and should not be checked.
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
# List of comma separated words that should not be checked.
spelling-ignore-words=
# A path to a file that contains the private dictionary; one word per line.
spelling-private-dict-file=
# Tells whether to store unknown words to the private dictionary (see the
# --spelling-private-dict-file option) instead of raising a message.
spelling-store-unknown-words=no
[STRING]
# This flag controls whether inconsistent-quotes generates a warning when the
# character used as a quote delimiter is used inconsistently within a module.
check-quote-consistency=no
# This flag controls whether the implicit-str-concat should generate a warning
# on implicit string concatenation in sequences defined over several lines.
check-str-concat-over-line-jumps=no
[TYPECHECK]
# List of decorators that produce context managers, such as
# contextlib.contextmanager. Add to this list to register other decorators that
# produce valid context managers.
contextmanager-decorators=contextlib.contextmanager
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=
# Tells whether to warn about missing members when the owner of the attribute
# is inferred to be None.
ignore-none=yes
# This flag controls whether pylint should warn about no-member and similar
# checks whenever an opaque object is returned when inferring. The inference
# can return multiple potential results while evaluating a Python object, but
# some branches might not be evaluated, which results in partial inference. In
# that case, it might be useful to still emit no-member and other checks for
# the rest of the inferred objects.
ignore-on-opaque-inference=yes
# List of symbolic message names to ignore for Mixin members.
ignored-checks-for-mixins=no-member,
not-async-context-manager,
not-context-manager,
attribute-defined-outside-init
# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace
# Show a hint with possible names when a member name was not found. The aspect
# of finding the hint is based on edit distance.
missing-member-hint=yes
# The minimum edit distance a name should have in order to be considered a
# similar match for a missing member name.
missing-member-hint-distance=1
# The total number of similar names that should be taken in consideration when
# showing a hint for a missing member.
missing-member-max-choices=1
# Regex pattern to define which classes are considered mixins.
mixin-class-rgx=.*[Mm]ixin
# List of decorators that change the signature of a decorated function.
signature-mutators=
[VARIABLES]
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid defining new builtins when possible.
additional-builtins=
# Tells whether unused global variables should be treated as a violation.
allow-global-unused-variables=yes
# List of names allowed to shadow builtins
allowed-redefined-builtins=
# List of strings which can identify a callback function by name. A callback
# name must start or end with one of those strings.
callbacks=cb_,
_cb
# A regular expression matching the name of dummy variables (i.e. expected to
# not be used).
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
# Argument names that match this expression will be ignored. Default to name
# with leading underscore.
ignored-argument-names=_.*|^ignored_|^unused_
# Tells whether we should check for unused import in __init__ files.
init-import=no
# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
+4 -4
View File
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
# relates to FindOpenGL module
# and cache variables OPENGL_gl_LIBRARY, OPENGL_glu_LIBRARY
if (POLICY CMP0072)
cmake_policy(SET CMP0072 OLD)
set(OpenGL_GL_PREFERENCE LEGACY)
endif(POLICY CMP0072)
find_program(CCACHE_PROGRAM ccache) #This check should occur before project()
@@ -18,9 +18,9 @@ project(FreeCAD)
set(PACKAGE_VERSION_NAME "Vulcan")
set(PACKAGE_VERSION_MAJOR "0")
set(PACKAGE_VERSION_MINOR "20")
set(PACKAGE_VERSION_PATCH "0")
set(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string)
set(FREECAD_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release)
set(PACKAGE_VERSION_PATCH "2")
set(PACKAGE_VERSION_SUFFIX "") # either "dev" for development snapshot or "" (empty string)
set(FREECAD_VERSION_PATCH "2") # number of patch release (e.g. "4" for the 0.18.4 release)
set(FREECAD_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
+6 -6
View File
@@ -11,7 +11,7 @@
[![Release](https://img.shields.io/github/release/freecad/freecad.svg)](https://github.com/freecad/freecad/releases/latest) [![Master][freecad-master-status]][gitlab-branch-master] [![Crowdin](https://d322cqt584bo4o.cloudfront.net/freecad/localized.svg)](https://crowdin.com/project/freecad) [![Gitter](https://img.shields.io/gitter/room/freecad/freecad.svg)](https://gitter.im/freecad/freecad?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/FreeCAD/FreeCAD.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/FreeCAD/FreeCAD/context:python) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/FreeCAD/FreeCAD.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/FreeCAD/FreeCAD/context:cpp) [![Liberapay](https://img.shields.io/liberapay/receives/FreeCAD.svg?logo=liberapay)](https://liberapay.com/FreeCAD)
![screenshot](https://wiki.freecadweb.org/images/thumb/7/72/Freecad016_screenshot1.jpg/800px-Freecad016_screenshot1.jpg)
<img src="https://user-images.githubusercontent.com/1828501/174066870-1692005b-f8d7-43fb-a289-6d2f07f73d7f.png" width="800"/>
Overview
--------
@@ -55,13 +55,13 @@ Other options are described at the [wiki Download page](https://wiki.freecadweb.
Build Status
------------
| Master | 0.19 | Translation |
| Master | 0.20 | Translation |
|:------:|:----:|:-----------:|
|[![Master][freecad-master-status]][gitlab-branch-master]|[![0.19][freecad-0.19-status]][gitlab-branch-0.19]|[![Crowdin](https://d322cqt584bo4o.cloudfront.net/freecad/localized.svg)](https://crowdin.com/project/freecad)|
|[![Master][freecad-master-status]][gitlab-branch-master]|[![0.20][freecad-0.20-status]][gitlab-branch-0.20]|[![Crowdin](https://d322cqt584bo4o.cloudfront.net/freecad/localized.svg)](https://crowdin.com/project/freecad)|
[freecad-0.19-status]: https://gitlab.com/freecad/FreeCAD-CI/badges/releases/FreeCAD-0-19/pipeline.svg
[freecad-0.20-status]: https://gitlab.com/freecad/FreeCAD-CI/badges/releases/FreeCAD-0-20/pipeline.svg
[freecad-master-status]: https://gitlab.com/freecad/FreeCAD-CI/badges/master/pipeline.svg
[gitlab-branch-0.19]: https://gitlab.com/freecad/FreeCAD-CI/-/commits/releases/FreeCAD-0-19
[gitlab-branch-0.20]: https://gitlab.com/freecad/FreeCAD-CI/-/commits/releases/FreeCAD-0-20
[gitlab-branch-master]: https://gitlab.com/freecad/FreeCAD-CI/-/commits/master
[travis-builds]: https://travis-ci.org/FreeCAD/FreeCAD/builds
@@ -99,7 +99,7 @@ To report an issue please:
For more detail see:
- [Wiki Page about the Bug Tracker](https://wiki.freecadweb.org/Tracker)
- [Bug Tracker](https://tracker.freecadweb.org)
- [Help Forum](http://forum.freecadweb.org/viewforum.php?f=3)
- [Help Forum](https://forum.freecadweb.org/viewforum.php?f=3)
Usage & Getting help
+1 -1
View File
@@ -1,7 +1,7 @@
macro(SetupOpenCasCade)
# -------------------------------- OpenCasCade --------------------------------
find_package(OpenCasCade)
find_package(OCC)
if(NOT OCC_FOUND)
message(FATAL_ERROR "================================================================\n"
"Neither OpenCASCADE Community Edition nor OpenCASCADE was found!\n"
@@ -121,6 +121,10 @@ macro(SetupSalomeSMESH)
find_package(SMESH CONFIG)
set (SMESH_INCLUDE_DIR ${SMESH_INCLUDE_PATH})
set(EXTERNAL_SMESH_LIBS ${SMESH_LIBRARIES})
# If this definition is not set, linker errors will occur against SMESH on 64 bit machines.
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-DSALOME_USE_64BIT_IDS)
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
if(NOT SMESH_FOUND)
message(ERROR "================\n"
"SMESH not found.\n"
@@ -125,9 +125,7 @@ macro(SetupShibokenAndPyside)
"PySide2 Python module not found.\n"
"================================\n")
else()
message(STATUS "===============================================\n"
"PySide2 Python module found at ${PRINT_OUTPUT}.\n"
"===============================================\n")
message(STATUS "PySide2 Python module found at ${PRINT_OUTPUT}.\n")
endif()
endmacro(SetupShibokenAndPyside)
+1
View File
@@ -12,6 +12,7 @@ path_classifiers:
- "src/CXX/"
template:
- "src/Tools/examplePy2wiki.py"
- "src/Tools/wiki2qhelp.py"
- "src/Mode/TemplatePyMod/"
unmaintained:
- "src/Mod/Robot/"
+11 -3
View File
@@ -2441,10 +2441,14 @@ void Application::initConfig(int argc, char ** argv)
// We only set these keys if not yet defined. Therefore it suffices to search
// only for 'BuildVersionMajor'.
if (App::Application::Config().find("BuildVersionMajor") == App::Application::Config().end()) {
std::stringstream str; str << FCVersionMajor << "." << FCVersionMinor;
std::stringstream str;
str << FCVersionMajor
<< "." << FCVersionMinor
<< "." << FCVersionPoint;
App::Application::Config()["ExeVersion" ] = str.str();
App::Application::Config()["BuildVersionMajor" ] = FCVersionMajor;
App::Application::Config()["BuildVersionMinor" ] = FCVersionMinor;
App::Application::Config()["BuildVersionPoint" ] = FCVersionPoint;
App::Application::Config()["BuildRevision" ] = FCRevision;
App::Application::Config()["BuildRepositoryURL" ] = FCRepositoryURL;
App::Application::Config()["BuildRevisionDate" ] = FCRevisionDate;
@@ -2524,17 +2528,21 @@ void Application::initConfig(int argc, char ** argv)
// Remove banner if FreeCAD is invoked via the -c command as regular
// Python interpreter
if (!(mConfig["Verbose"] == "Strict"))
Console().Message("%s %s, Libs: %s.%sR%s\n%s",mConfig["ExeName"].c_str(),
Console().Message("%s %s, Libs: %s.%s.%sR%s\n%s",
mConfig["ExeName"].c_str(),
mConfig["ExeVersion"].c_str(),
mConfig["BuildVersionMajor"].c_str(),
mConfig["BuildVersionMinor"].c_str(),
mConfig["BuildVersionPoint"].c_str(),
mConfig["BuildRevision"].c_str(),
mConfig["CopyrightInfo"].c_str());
else
Console().Message("%s %s, Libs: %s.%sB%s\n",mConfig["ExeName"].c_str(),
Console().Message("%s %s, Libs: %s.%s.%sB%s\n",
mConfig["ExeName"].c_str(),
mConfig["ExeVersion"].c_str(),
mConfig["BuildVersionMajor"].c_str(),
mConfig["BuildVersionMinor"].c_str(),
mConfig["BuildVersionPoint"].c_str(),
mConfig["BuildRevision"].c_str());
}
LoadParameters();
+6 -3
View File
@@ -104,9 +104,9 @@ PyMethodDef Application::Methods[] = {
"* If no module is given it will be determined by the file extension.\n"
"* If more than one module can load a file the first one will be taken.\n"
"* If no module exists to load the file an exception will be raised."},
{"open", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) (void)>( Application::sOpenDocument )), METH_VARARGS|METH_KEYWORDS,
{"open", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) ()>( Application::sOpenDocument )), METH_VARARGS|METH_KEYWORDS,
"See openDocument(string)"},
{"openDocument", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) (void)>( Application::sOpenDocument )), METH_VARARGS|METH_KEYWORDS,
{"openDocument", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) ()>( Application::sOpenDocument )), METH_VARARGS|METH_KEYWORDS,
"openDocument(filepath,hidden=False) -> object\n"
"Create a document and load the project file into the document.\n\n"
"filepath: file path to an existing file. If the file doesn't exist\n"
@@ -116,7 +116,7 @@ PyMethodDef Application::Methods[] = {
// {"saveDocument", (PyCFunction) Application::sSaveDocument, METH_VARARGS,
// "saveDocument(string) -- Save the document to a file."},
// {"saveDocumentAs", (PyCFunction) Application::sSaveDocumentAs, METH_VARARGS},
{"newDocument", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) (void)>( Application::sNewDocument )), METH_VARARGS|METH_KEYWORDS,
{"newDocument", reinterpret_cast<PyCFunction>(reinterpret_cast<void (*) ()>( Application::sNewDocument )), METH_VARARGS|METH_KEYWORDS,
"newDocument(name, label=None, hidden=False, temp=False) -> object\n"
"Create a new document with a given name.\n\n"
"name: unique document name which is checked automatically.\n"
@@ -492,6 +492,9 @@ PyObject* Application::sGetVersion(PyObject * /*self*/, PyObject *args)
it = cfg.find("BuildVersionMinor");
list.append(Py::String(it != cfg.end() ? it->second : ""));
it = cfg.find("BuildVersionPoint");
list.append(Py::String(it != cfg.end() ? it->second : ""));
it = cfg.find("BuildRevision");
list.append(Py::String(it != cfg.end() ? it->second : ""));
+42 -13
View File
@@ -2614,24 +2614,49 @@ bool Document::saveToFile(const char* filename) const
bool policy = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetBool("BackupPolicy",true);
auto canonical_path = [](const char* filename) {
try {
#ifdef FC_OS_WIN32
QString utf8Name = QString::fromUtf8(filename);
auto realpath = fs::weakly_canonical(fs::absolute(fs::path(utf8Name.toStdWString())));
std::string nativePath = QString::fromStdWString(realpath.native()).toStdString();
#else
auto realpath = fs::weakly_canonical(fs::absolute(fs::path(filename)));
std::string nativePath = realpath.native();
#endif
// In case some folders in the path do not exist
auto parentPath = realpath.parent_path();
fs::create_directories(parentPath);
return nativePath;
}
catch (const std::exception&) {
#ifdef FC_OS_WIN32
QString utf8Name = QString::fromUtf8(filename);
auto parentPath = fs::absolute(fs::path(utf8Name.toStdWString())).parent_path();
#else
auto parentPath = fs::absolute(fs::path(filename)).parent_path();
#endif
fs::create_directories(parentPath);
return std::string(filename);
}
};
//realpath is canonical filename i.e. without symlink
std::string nativePath = canonical_path(filename);
// make a tmp. file where to save the project data first and then rename to
// the actual file name. This may be useful if overwriting an existing file
// fails so that the data of the work up to now isn't lost.
std::string uuid = Base::Uuid::createUuid();
std::string fn = filename;
std::string fn = nativePath;
if (policy) {
fn += ".";
fn += uuid;
}
Base::FileInfo tmp(fn);
// In case some folders in the path do not exist
#ifdef FC_OS_WIN32
QString utf8Name = QString::fromUtf8(filename);
auto parentPath = fs::absolute(fs::path(utf8Name.toStdWString())).parent_path();
#else
auto parentPath = fs::absolute(fs::path(filename)).parent_path();
#endif
fs::create_directories(parentPath);
// open extra scope to close ZipWriter properly
{
@@ -2677,9 +2702,9 @@ bool Document::saveToFile(const char* filename) const
count_bak = -1;
}
bool useFCBakExtension = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetBool("UseFCBakExtension",false);
std::string saveBackupDateFormat = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetASCII("SaveBackupDateFormat","%Y%m%d-%H%M%S");
("User parameter:BaseApp/Preferences/Document")->GetBool("UseFCBakExtension",false);
std::string saveBackupDateFormat = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetASCII("SaveBackupDateFormat","%Y%m%d-%H%M%S");
BackupPolicy policy;
if (useFCBakExtension) {
@@ -2691,7 +2716,7 @@ bool Document::saveToFile(const char* filename) const
policy.setPolicy(BackupPolicy::Standard);
}
policy.setNumberOfFiles(count_bak);
policy.apply(fn, filename);
policy.apply(fn, nativePath);
}
signalFinishSave(*this, filename);
@@ -4218,6 +4243,10 @@ void Document::removeObject(const char* sName)
}
}
// In case the object gets deleted the pointer must be nullified
if (tobedestroyed) {
tobedestroyed->pcNameInDocument = nullptr;
}
d->objectMap.erase(pos);
}
+53 -27
View File
@@ -96,11 +96,9 @@ DocumentObject::~DocumentObject(void)
}
}
App::DocumentObjectExecReturn *DocumentObject::recompute(void)
void DocumentObject::printInvalidLinks() const
{
//check if the links are valid before making the recompute
if(!GeoFeatureGroupExtension::areLinksValid(this)) {
#if 1
try {
// Get objects that have invalid link scope, and print their names.
// Truncate the invalid object list name strings for readability, if they happen to be very long.
std::vector<App::DocumentObject*> invalid_linkobjs;
@@ -114,28 +112,44 @@ App::DocumentObjectExecReturn *DocumentObject::recompute(void)
scopenames += "... ";
break;
}
scopenames += scope.first->getNameInDocument();
scopenames += " ";
}
if (objnames.length() > 80) {
objnames += "... ";
break;
}
}
if (objnames.empty()) {
objnames = "N/A";
} else {
}
else {
objnames.pop_back();
}
if (scopenames.empty()) {
scopenames = "N/A";
} else {
}
else {
scopenames.pop_back();
}
Base::Console().Warning("%s: Link(s) to object(s) '%s' go out of the allowed scope '%s'. Instead, the linked object(s) reside within '%s'.\n", getTypeId().getName(), objnames.c_str(), getNameInDocument(), scopenames.c_str());
#else
return new App::DocumentObjectExecReturn("Links go out of the allowed scope", this);
#endif
Base::Console().Warning("%s: Link(s) to object(s) '%s' go out of the allowed scope '%s'. Instead, the linked object(s) reside within '%s'.\n",
getTypeId().getName(), objnames.c_str(), getNameInDocument(), scopenames.c_str());
}
catch (const Base::Exception& e) {
e.ReportException();
}
}
App::DocumentObjectExecReturn *DocumentObject::recompute()
{
//check if the links are valid before making the recompute
if (!GeoFeatureGroupExtension::areLinksValid(this)) {
printInvalidLinks();
}
// set/unset the execution bit
@@ -887,31 +901,43 @@ std::vector<std::string> DocumentObject::getSubObjects(int reason) const {
return ret;
}
std::vector<std::pair<App::DocumentObject *,std::string> > DocumentObject::getParents(int depth) const {
std::vector<std::pair<App::DocumentObject *,std::string> > ret;
if(!getNameInDocument() || !GetApplication().checkLinkDepth(depth))
std::vector<std::pair<App::DocumentObject *,std::string>> DocumentObject::getParents(int depth) const {
std::vector<std::pair<App::DocumentObject *, std::string>> ret;
if (!getNameInDocument() || !GetApplication().checkLinkDepth(depth, false)) {
return ret;
}
std::string name(getNameInDocument());
name += ".";
for(auto parent : getInList()) {
if(!parent || !parent->getNameInDocument())
continue;
if(!parent->hasChildElement() &&
!parent->hasExtension(GeoFeatureGroupExtension::getExtensionClassTypeId()))
continue;
if(!parent->getSubObject(name.c_str()))
for (auto parent : getInList()) {
if (!parent || !parent->getNameInDocument()) {
continue;
}
auto links = GetApplication().getLinksTo(parent,App::GetLinkRecursive);
if (!parent->hasChildElement() &&
!parent->hasExtension(GeoFeatureGroupExtension::getExtensionClassTypeId())) {
continue;
}
if (!parent->getSubObject(name.c_str())) {
continue;
}
auto links = GetApplication().getLinksTo(parent, App::GetLinkRecursive);
links.insert(parent);
for(auto parent : links) {
auto parents = parent->getParents(depth+1);
if(parents.empty())
parents.emplace_back(parent,std::string());
for(auto &v : parents)
ret.emplace_back(v.first,v.second+name);
for (auto parent : links) {
auto parents = parent->getParents(depth + 1);
if (parents.empty()) {
parents.emplace_back(parent, std::string());
}
for (auto &v : parents) {
ret.emplace_back(v.first, v.second + name);
}
}
}
return ret;
}
+23 -20
View File
@@ -112,7 +112,7 @@ public:
boost::signals2::signal<void (const App::DocumentObject&, const App::Property&)> signalChanged;
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
virtual const char* getViewProviderName() const {
return "";
}
/**
@@ -129,11 +129,11 @@ public:
}
/// Constructor
DocumentObject(void);
DocumentObject();
virtual ~DocumentObject();
/// returns the name which is set in the document for this object (not the name property!)
const char *getNameInDocument(void) const;
const char *getNameInDocument() const;
/// Return the object ID that is unique within its owner document
long getID() const {return _Id;}
/// returns the name that is safe to be exported to other document
@@ -143,7 +143,7 @@ public:
virtual bool isAttachedToDocument() const override;
virtual const char* detachFromDocument() override;
/// gets the document in which this Object is handled
App::Document *getDocument(void) const;
App::Document *getDocument() const;
/** Set the property touched -> changed, cause recomputation in Update()
*/
@@ -151,22 +151,22 @@ public:
/// set this document object touched (cause recomputation on dependent features)
void touch(bool noRecompute=false);
/// test if this document object is touched
bool isTouched(void) const;
bool isTouched() const;
/// Enforce this document object to be recomputed
void enforceRecompute();
/// Test if this document object must be recomputed
bool mustRecompute(void) const;
bool mustRecompute() const;
/// reset this document object touched
void purgeTouched(void) {
void purgeTouched() {
StatusBits.reset(ObjectStatus::Touch);
StatusBits.reset(ObjectStatus::Enforce);
setPropertyStatus(0,false);
}
/// set this feature to error
bool isError(void) const {return StatusBits.test(ObjectStatus::Error);}
bool isValid(void) const {return !StatusBits.test(ObjectStatus::Error);}
bool isError() const {return StatusBits.test(ObjectStatus::Error);}
bool isValid() const {return !StatusBits.test(ObjectStatus::Error);}
/// remove the error from the object
void purgeError(void){StatusBits.reset(ObjectStatus::Error);}
void purgeError(){StatusBits.reset(ObjectStatus::Error);}
/// returns true if this objects is currently recomputing
bool isRecomputing() const {return StatusBits.test(ObjectStatus::Recompute);}
/// returns true if this objects is currently restoring from file
@@ -228,7 +228,7 @@ public:
/// returns a list of objects linked by the property
std::vector<App::DocumentObject*> getOutListOfProperty(App::Property*) const;
/// returns a list of objects this object is pointing to by Links and all further descended
std::vector<App::DocumentObject*> getOutListRecursive(void) const;
std::vector<App::DocumentObject*> getOutListRecursive() const;
/// clear internal out list cache
void clearOutListCache() const;
/// get all possible paths from this to another object following the OutList
@@ -237,10 +237,10 @@ public:
/// get all objects link to this object
std::vector<App::DocumentObject*> getInList(void) const
#else
const std::vector<App::DocumentObject*> &getInList(void) const;
const std::vector<App::DocumentObject*> &getInList() const;
#endif
/// get all objects link directly or indirectly to this object
std::vector<App::DocumentObject*> getInListRecursive(void) const;
std::vector<App::DocumentObject*> getInListRecursive() const;
/** Get a set of all objects linking to this object, including possible external parent objects
*
* @param inSet [out]: a set containing all objects linking to this object.
@@ -299,7 +299,7 @@ public:
* necessarily mean that it will be recomputed. It only means that all
* objects that link it (i.e. its InList) will be recomputed.
*/
virtual short mustExecute(void) const;
virtual short mustExecute() const;
/** Recompute only this feature
*
@@ -308,7 +308,7 @@ public:
bool recomputeFeature(bool recursive=false);
/// get the status Message
const char *getStatusString(void) const;
const char *getStatusString() const;
/** Called in case of losing a link
* Get called by the document when a object got deleted a link property of this
@@ -317,7 +317,7 @@ public:
* additional or different behavior.
*/
virtual void onLostLinkToObject(DocumentObject*);
virtual PyObject *getPyObject(void) override;
virtual PyObject *getPyObject() override;
/** Get the sub element/object by name
*
@@ -561,7 +561,7 @@ public:
protected:
/// recompute only this object
virtual App::DocumentObjectExecReturn *recompute(void);
virtual App::DocumentObjectExecReturn *recompute();
/** get called by the document to recompute this feature
* Normally this method get called in the processing of
* Document::recompute().
@@ -569,7 +569,7 @@ protected:
* with the data from linked objects and objects own
* properties.
*/
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute();
/**
* Executes the extensions of a document object.
@@ -592,8 +592,8 @@ protected:
*/
std::bitset<32> StatusBits;
void setError(void){StatusBits.set(ObjectStatus::Error);}
void resetError(void){StatusBits.reset(ObjectStatus::Error);}
void setError(){StatusBits.set(ObjectStatus::Error);}
void resetError(){StatusBits.reset(ObjectStatus::Error);}
void setDocument(App::Document* doc);
/// get called before the value is changed
@@ -614,6 +614,9 @@ protected:
/// get called when a property status has changed
virtual void onPropertyStatusChanged(const Property &prop, unsigned long oldStatus) override;
private:
void printInvalidLinks() const;
/// python object of this class and all descendent
protected: // attributes
Py::SmartPtr PythonObject;
+1 -1
View File
@@ -23,7 +23,7 @@
#include "PreCompiled.h"
// inclution of the generated files (generated out of PropertyContainerPy.xml)
// inclusion of the generated files (generated out of PropertyContainerPy.xml)
#include "DocumentObjectExtensionPy.h"
#include "DocumentObjectExtensionPy.cpp"
+25 -25
View File
@@ -123,7 +123,7 @@ void DocumentObserverPython::slotCreatedDocument(const App::Document& Doc)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
Base::pyCall(pyCreatedDocument.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -137,7 +137,7 @@ void DocumentObserverPython::slotDeletedDocument(const App::Document& Doc)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
Base::pyCall(pyDeletedDocument.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -151,7 +151,7 @@ void DocumentObserverPython::slotRelabelDocument(const App::Document& Doc)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
Base::pyCall(pyRelabelDocument.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -165,7 +165,7 @@ void DocumentObserverPython::slotActivateDocument(const App::Document& Doc)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
Base::pyCall(pyActivateDocument.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -179,7 +179,7 @@ void DocumentObserverPython::slotUndoDocument(const App::Document& Doc)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
Base::pyCall(pyUndoDocument.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -194,7 +194,7 @@ void DocumentObserverPython::slotRedoDocument(const App::Document& Doc)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
Base::pyCall(pyRedoDocument.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -260,7 +260,7 @@ void DocumentObserverPython::slotBeforeChangeDocument(const App::Document& Doc,
Base::PyGILStateLocker lock;
try {
Py::Tuple args(2);
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
// If a property is touched but not part of a document object then its name is null.
// In this case the slot function must not be called.
const char* prop_name = Doc.getPropertyName(&Prop);
@@ -280,7 +280,7 @@ void DocumentObserverPython::slotChangedDocument(const App::Document& Doc, const
Base::PyGILStateLocker lock;
try {
Py::Tuple args(2);
args.setItem(0, Py::Object(const_cast<App::Document&>(Doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
// If a property is touched but not part of a document object then its name is null.
// In this case the slot function must not be called.
const char* prop_name = Doc.getPropertyName(&Prop);
@@ -300,7 +300,7 @@ void DocumentObserverPython::slotCreatedObject(const App::DocumentObject& Obj)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::DocumentObject&>(Obj).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
Base::pyCall(pyCreatedObject.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -314,7 +314,7 @@ void DocumentObserverPython::slotDeletedObject(const App::DocumentObject& Obj)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::DocumentObject&>(Obj).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
Base::pyCall(pyDeletedObject.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -329,7 +329,7 @@ void DocumentObserverPython::slotBeforeChangeObject(const App::DocumentObject& O
Base::PyGILStateLocker lock;
try {
Py::Tuple args(2);
args.setItem(0, Py::Object(const_cast<App::DocumentObject&>(Obj).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
// If a property is touched but not part of a document object then its name is null.
// In this case the slot function must not be called.
const char* prop_name = Obj.getPropertyName(&Prop);
@@ -350,7 +350,7 @@ void DocumentObserverPython::slotChangedObject(const App::DocumentObject& Obj,
Base::PyGILStateLocker lock;
try {
Py::Tuple args(2);
args.setItem(0, Py::Object(const_cast<App::DocumentObject&>(Obj).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
// If a property is touched but not part of a document object then its name is null.
// In this case the slot function must not be called.
const char* prop_name = Obj.getPropertyName(&Prop);
@@ -370,7 +370,7 @@ void DocumentObserverPython::slotRecomputedObject(const App::DocumentObject& Obj
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::DocumentObject&>(Obj).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
Base::pyCall(pyRecomputedObject.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -384,7 +384,7 @@ void DocumentObserverPython::slotRecomputedDocument(const App::Document& doc)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
Base::pyCall(pyRecomputedDocument.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -398,7 +398,7 @@ void DocumentObserverPython::slotBeforeRecomputeDocument(const App::Document& do
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
Base::pyCall(pyBeforeRecomputeDocument.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -412,7 +412,7 @@ void DocumentObserverPython::slotOpenTransaction(const App::Document& doc, std::
Base::PyGILStateLocker lock;
try {
Py::Tuple args(2);
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
args.setItem(1, Py::String(str));
Base::pyCall(pyOpenTransaction.ptr(),args.ptr());
}
@@ -427,7 +427,7 @@ void DocumentObserverPython::slotCommitTransaction(const App::Document& doc)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
Base::pyCall(pyCommitTransaction.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -441,7 +441,7 @@ void DocumentObserverPython::slotAbortTransaction(const App::Document& doc)
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
Base::pyCall(pyAbortTransaction.ptr(),args.ptr());
}
catch (Py::Exception&) {
@@ -456,7 +456,7 @@ void DocumentObserverPython::slotAppendDynamicProperty(const App::Property& Prop
try {
auto container = Prop.getContainer();
Py::Tuple args(2);
args.setItem(0, Py::Object(container->getPyObject(), true));
args.setItem(0, Py::asObject(container->getPyObject()));
// If a property is touched but not part of a document object then its name is null.
// In this case the slot function must not be called.
const char* prop_name = container->getPropertyName(&Prop);
@@ -477,7 +477,7 @@ void DocumentObserverPython::slotRemoveDynamicProperty(const App::Property& Prop
try {
auto container = Prop.getContainer();
Py::Tuple args(2);
args.setItem(0, Py::Object(container->getPyObject(), true));
args.setItem(0, Py::asObject(container->getPyObject()));
// If a property is touched but not part of a document object then its name is null.
// In this case the slot function must not be called.
const char* prop_name = container->getPropertyName(&Prop);
@@ -498,7 +498,7 @@ void DocumentObserverPython::slotChangePropertyEditor(const App::Document &, con
try {
auto container = Prop.getContainer();
Py::Tuple args(2);
args.setItem(0, Py::Object(container->getPyObject(), true));
args.setItem(0, Py::asObject(container->getPyObject()));
// If a property is touched but not part of a document object then its name is null.
// In this case the slot function must not be called.
const char* prop_name = container->getPropertyName(&Prop);
@@ -518,7 +518,7 @@ void DocumentObserverPython::slotStartSaveDocument(const App::Document& doc, con
Base::PyGILStateLocker lock;
try {
Py::Tuple args(2);
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
args.setItem(1, Py::String(file));
Base::pyCall(pyStartSaveDocument.ptr(),args.ptr());
}
@@ -533,7 +533,7 @@ void DocumentObserverPython::slotFinishSaveDocument(const App::Document& doc, co
Base::PyGILStateLocker lock;
try {
Py::Tuple args(2);
args.setItem(0, Py::Object(const_cast<App::Document&>(doc).getPyObject(), true));
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
args.setItem(1, Py::String(file));
Base::pyCall(pyFinishSaveDocument.ptr(),args.ptr());
}
@@ -548,7 +548,7 @@ void DocumentObserverPython::slotBeforeAddingDynamicExtension(const App::Extensi
Base::PyGILStateLocker lock;
try {
Py::Tuple args(2);
args.setItem(0, Py::Object(const_cast<App::ExtensionContainer&>(extcont).getPyObject()));
args.setItem(0, Py::asObject(const_cast<App::ExtensionContainer&>(extcont).getPyObject()));
args.setItem(1, Py::String(extension));
Base::pyCall(pyBeforeAddingDynamicExtension.ptr(),args.ptr());
}
@@ -563,7 +563,7 @@ void DocumentObserverPython::slotAddedDynamicExtension(const App::ExtensionConta
Base::PyGILStateLocker lock;
try {
Py::Tuple args(2);
args.setItem(0, Py::Object(const_cast<App::ExtensionContainer&>(extcont).getPyObject()));
args.setItem(0, Py::asObject(const_cast<App::ExtensionContainer&>(extcont).getPyObject()));
args.setItem(1, Py::String(extension));
Base::pyCall(pyAddedDynamicExtension.ptr(),args.ptr());
}
+1 -1
View File
@@ -3193,7 +3193,7 @@ static int column;
// show the parser the lexer method
#define yylex ExpressionParserlex
int ExpressionParserlex(void);
int ExpressionParserlex();
// Parser, defined in ExpressionParser.y
# define YYTOKENTYPE
+1 -1
View File
@@ -25,7 +25,7 @@
#include "Application.h"
// inclution of the generated files (generated out of PropertyContainerPy.xml)
// inclusion of the generated files (generated out of PropertyContainerPy.xml)
#include <App/ExtensionPy.h>
#include <App/ExtensionPy.cpp>
+8 -8
View File
@@ -148,7 +148,7 @@ void LinkParams::removeCopyOnChangeApplyToAll() {
EXTENSION_PROPERTY_SOURCE(App::LinkBaseExtension, App::DocumentObjectExtension)
LinkBaseExtension::LinkBaseExtension(void)
LinkBaseExtension::LinkBaseExtension()
:enableLabelCache(false),hasOldSubElement(false),hasCopyOnChange(true)
{
initExtensionType(LinkBaseExtension::getExtensionClassTypeId());
@@ -166,7 +166,7 @@ LinkBaseExtension::~LinkBaseExtension()
{
}
PyObject* LinkBaseExtension::getExtensionPyObject(void) {
PyObject* LinkBaseExtension::getExtensionPyObject() {
if (ExtensionPythonObject.is(Py::_None())){
// ref counter is set to 1
ExtensionPythonObject = Py::Object(new LinkBaseExtensionPy(this),true);
@@ -293,7 +293,7 @@ void LinkBaseExtension::setProperty(int idx, Property *prop) {
static const char _GroupPrefix[] = "Configuration (";
App::DocumentObjectExecReturn *LinkBaseExtension::extensionExecute(void) {
App::DocumentObjectExecReturn *LinkBaseExtension::extensionExecute() {
// The actual value of LinkTouched is not important, just to notify view
// provider that the link (in fact, its dependents, i.e. linked ones) have
// recomputed.
@@ -398,7 +398,7 @@ App::DocumentObjectExecReturn *LinkBaseExtension::extensionExecute(void) {
return inherited::extensionExecute();
}
short LinkBaseExtension::extensionMustExecute(void) {
short LinkBaseExtension::extensionMustExecute() {
auto link = getLink();
if(!link)
return 0;
@@ -2226,7 +2226,7 @@ template class AppExport ExtensionPythonT<LinkBaseExtension>;
EXTENSION_PROPERTY_SOURCE(App::LinkExtension, App::LinkBaseExtension)
LinkExtension::LinkExtension(void)
LinkExtension::LinkExtension()
{
initExtensionType(LinkExtension::getExtensionClassTypeId());
@@ -2266,7 +2266,7 @@ bool Link::canLinkProperties() const {
namespace App {
PROPERTY_SOURCE_TEMPLATE(App::LinkPython, App::Link)
template<> const char* App::LinkPython::getViewProviderName(void) const {
template<> const char* App::LinkPython::getViewProviderName() const {
return "Gui::ViewProviderLinkPython";
}
template class AppExport FeaturePythonT<App::Link>;
@@ -2293,7 +2293,7 @@ bool LinkElement::canDelete() const {
namespace App {
PROPERTY_SOURCE_TEMPLATE(App::LinkElementPython, App::LinkElement)
template<> const char* App::LinkElementPython::getViewProviderName(void) const {
template<> const char* App::LinkElementPython::getViewProviderName() const {
return "Gui::ViewProviderLinkPython";
}
template class AppExport FeaturePythonT<App::LinkElement>;
@@ -2312,7 +2312,7 @@ LinkGroup::LinkGroup() {
namespace App {
PROPERTY_SOURCE_TEMPLATE(App::LinkGroupPython, App::LinkGroup)
template<> const char* App::LinkGroupPython::getViewProviderName(void) const {
template<> const char* App::LinkGroupPython::getViewProviderName() const {
return "Gui::ViewProviderLinkPython";
}
template class AppExport FeaturePythonT<App::LinkGroup>;
+7 -7
View File
@@ -286,8 +286,8 @@ public:
bool extensionGetLinkedObject(DocumentObject *&ret,
bool recurse, Base::Matrix4D *mat, bool transform, int depth) const override;
virtual App::DocumentObjectExecReturn *extensionExecute(void) override;
virtual short extensionMustExecute(void) override;
virtual App::DocumentObjectExecReturn *extensionExecute() override;
virtual short extensionMustExecute() override;
virtual void extensionOnChanged(const Property* p) override;
virtual void onExtendedUnsetupObject () override;
virtual void onExtendedDocumentRestored() override;
@@ -296,7 +296,7 @@ public:
virtual int extensionIsElementVisible(const char *) override;
virtual bool extensionHasChildElement() const override;
virtual PyObject* getExtensionPyObject(void) override;
virtual PyObject* getExtensionPyObject() override;
virtual Property *extensionGetPropertyByName(const char* name) const override;
@@ -536,9 +536,9 @@ public:
LINK_PROPS_DEFINE(LINK_PARAMS_LINK)
Link(void);
Link();
const char* getViewProviderName(void) const override{
const char* getViewProviderName() const override{
return "Gui::ViewProviderLink";
}
@@ -581,7 +581,7 @@ public:
LINK_PROPS_DEFINE(LINK_PARAMS_ELEMENT)
LinkElement();
const char* getViewProviderName(void) const override{
const char* getViewProviderName() const override{
return "Gui::ViewProviderLink";
}
@@ -620,7 +620,7 @@ public:
LinkGroup();
const char* getViewProviderName(void) const override{
const char* getViewProviderName() const override{
return "Gui::ViewProviderLink";
}
+9 -1
View File
@@ -98,7 +98,11 @@ Metadata::Metadata(const fs::path& metadataFile)
auto errHandler = std::make_unique<MetadataInternal::XMLErrorHandler>();
_parser->setErrorHandler(errHandler.get());
#if defined (FC_OS_WIN32)
_parser->parse(reinterpret_cast<const XMLCh*>(metadataFile.wstring().c_str()));
#else
_parser->parse(metadataFile.string().c_str());
#endif
auto doc = _parser->getDocument();
_dom = doc->getDocumentElement();
@@ -448,6 +452,7 @@ bool Metadata::satisfies(const Meta::Dependency& dep)
std::map<std::string, std::string>& config = App::Application::Config();
replacements.insert(std::make_pair("$BuildVersionMajor", config["BuildVersionMajor"]));
replacements.insert(std::make_pair("$BuildVersionMinor", config["BuildVersionMinor"]));
replacements.insert(std::make_pair("$BuildVersionMinor", config["BuildVersionPoint"]));
replacements.insert(std::make_pair("$BuildRevision", config["BuildRevision"]));
for (const auto& replacement : replacements) {
auto pos = injectedString.find(replacement.first);
@@ -492,7 +497,10 @@ bool App::Metadata::supportsCurrentFreeCAD() const
if (fcVersion == Meta::Version()) {
std::map<std::string, std::string>& config = App::Application::Config();
std::stringstream ss;
ss << config["BuildVersionMajor"] << "." << config["BuildVersionMinor"] << "." << (config["BuildRevision"].empty() ? "0" : config["BuildRevision"]);
ss << config["BuildVersionMajor"]
<< "." << config["BuildVersionMinor"]
<< "." << config["BuildVersionPoint"]
<< "." << (config["BuildRevision"].empty() ? "0" : config["BuildRevision"]);
fcVersion = Meta::Version(ss.str());
}
+7 -3
View File
@@ -23,6 +23,7 @@
#include "PreCompiled.h"
#include "Metadata.h"
#include <Base/FileInfo.h>
// inclusion of the generated files (generated out of MetadataPy.xml)
#include "MetadataPy.h"
@@ -64,10 +65,13 @@ int MetadataPy::PyInit(PyObject* args, PyObject* /*kwd*/)
// Main class constructor -- takes a file path, loads the metadata from it
PyErr_Clear();
const char* filename;
if (PyArg_ParseTuple(args, "s", &filename)) {
char* filename;
if (PyArg_ParseTuple(args, "et", "utf-8", &filename)) {
try {
auto md = new Metadata(filename);
std::string utf8Name = std::string(filename);
PyMem_Free(filename);
auto md = new Metadata(Base::FileInfo::stringToPath(utf8Name));
setTwinPointer(md);
return 0;
}
+1 -1
View File
@@ -34,7 +34,7 @@
#include <boost/iostreams/device/array.hpp>
#include <boost/iostreams/stream.hpp>
// inclution of the generated files (generated out of PropertyContainerPy.xml)
// inclusion of the generated files (generated out of PropertyContainerPy.xml)
#include "PropertyContainerPy.h"
#include "PropertyContainerPy.cpp"
+1 -1
View File
@@ -179,7 +179,7 @@ private:
typedef boost::adjacency_list< boost::listS, boost::vecS, boost::directedS > DiGraph;
typedef std::pair<int, int> Edge;
// Note: use std::map instead of unordered_map to keep the binding order stable
#ifdef FC_OS_MACOSX
#if defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
typedef std::map<App::ObjectIdentifier, ExpressionInfo> ExpressionMap;
#else
typedef std::map<const App::ObjectIdentifier, ExpressionInfo> ExpressionMap;
-1
View File
@@ -1034,7 +1034,6 @@ PyObject *PropertyLinkSub::getPyObject(void)
Py::Tuple tup(2);
Py::List list(static_cast<int>(_cSubList.size()));
if (_pcLinkSub) {
_pcLinkSub->getPyObject();
tup[0] = Py::asObject(_pcLinkSub->getPyObject());
for(unsigned int i = 0;i<_cSubList.size(); i++)
list[i] = Py::String(_cSubList[i]);
+5 -2
View File
@@ -194,9 +194,12 @@ void Transaction::addObjectNew(TransactionalObject *Obj)
auto pos = index.find(Obj);
if (pos != index.end()) {
if (pos->second->status == TransactionObject::Del) {
delete pos->second;
delete pos->first;
// first remove the item from the container before deleting it
auto second = pos->second;
auto first = pos->first;
index.erase(pos);
delete second;
delete first;
}
else {
pos->second->status = TransactionObject::New;
+4 -1
View File
@@ -32,7 +32,9 @@
#include "Builder3D.h"
#include "Console.h"
#include "Exception.h"
#include "FileInfo.h"
#include "Matrix.h"
#include "Stream.h"
#include "Tools.h"
@@ -320,7 +322,8 @@ void Builder3D::saveToLog()
void Builder3D::saveToFile(const char* FileName)
{
result << "} ";
std::ofstream file(FileName);
Base::FileInfo fi(FileName);
Base::ofstream file(fi);
if(!file)
throw FileException("Builder3D::saveToFile(): Can not open file...");
+6
View File
@@ -266,7 +266,13 @@ std::stringstream &LogLevel::prefix(std::stringstream &str, const char *src, int
PyFrameObject* frame = PyEval_GetFrame();
if (frame) {
line = PyFrame_GetLineNumber(frame);
#if PY_VERSION_HEX < 0x030b0000
src = PyUnicode_AsUTF8(frame->f_code->co_filename);
#else
PyCodeObject* code = PyFrame_GetCode(frame);
src = PyUnicode_AsUTF8(code->co_filename);
Py_DECREF(code);
#endif
}
}
if (print_src && src && src[0]) {
+56
View File
@@ -524,6 +524,7 @@ void InterpreterSingleton::addPythonPath(const char* Path)
list.append(Py::String(Path));
}
#if PY_VERSION_HEX < 0x030b0000
const char* InterpreterSingleton::init(int argc,char *argv[])
{
if (!Py_IsInitialized()) {
@@ -566,6 +567,61 @@ const char* InterpreterSingleton::init(int argc,char *argv[])
PyGILStateLocker lock;
return Py_EncodeLocale(Py_GetPath(),nullptr);
}
#else
namespace {
void initInterpreter(int argc,char *argv[])
{
PyStatus status;
PyConfig config;
PyConfig_InitPythonConfig(&config);
status = PyConfig_SetBytesArgv(&config, argc, argv);
if (PyStatus_Exception(status)) {
throw Base::RuntimeError("Failed to set config");
}
status = Py_InitializeFromConfig(&config);
if (PyStatus_Exception(status)) {
throw Base::RuntimeError("Failed to init from config");
}
PyConfig_Clear(&config);
Py_Initialize();
const char* virtualenv = getenv("VIRTUAL_ENV");
if (virtualenv) {
PyRun_SimpleString(
"# Check for virtualenv, and activate if present.\n"
"# See https://virtualenv.pypa.io/en/latest/userguide/#using-virtualenv-without-bin-python\n"
"import os\n"
"import sys\n"
"base_path = os.getenv(\"VIRTUAL_ENV\")\n"
"if not base_path is None:\n"
" activate_this = os.path.join(base_path, \"bin\", \"activate_this.py\")\n"
" exec(open(activate_this).read(), {'__file__':activate_this})\n"
);
}
}
}
const char* InterpreterSingleton::init(int argc,char *argv[])
{
try {
if (!Py_IsInitialized()) {
initInterpreter(argc, argv);
PythonStdOutput::init_type();
this->_global = PyEval_SaveThread();
}
PyGILStateLocker lock;
return Py_EncodeLocale(Py_GetPath(),nullptr);
}
catch (const Base::Exception& e) {
e.ReportException();
throw;
}
}
#endif
void InterpreterSingleton::replaceStdOutput()
{
+6 -6
View File
@@ -179,7 +179,7 @@ Rotate around Z axis.
angle : float\n Angle in radians.</UserDocu>
</Documentation>
</Methode>
<Methode Name="multiply">
<Methode Name="multiply" Const="true">
<Documentation>
<UserDocu>multiply(matrix) -> Base.Matrix
multiply(vector) -> Base.Vector\n
@@ -202,7 +202,7 @@ vector : Base.Vector</UserDocu>
Compute the inverse matrix in-place, if possible.</UserDocu>
</Documentation>
</Methode>
<Methode Name="inverse">
<Methode Name="inverse" Const="true">
<Documentation><UserDocu>inverse() -> Base.Matrix\n
Compute the inverse matrix, if possible.</UserDocu>
</Documentation>
@@ -219,13 +219,13 @@ Transpose the matrix in-place.</UserDocu>
Returns a transposed copy of this matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="determinant">
<Methode Name="determinant" Const="true">
<Documentation>
<UserDocu>determinant() -> float\n
Compute the determinant of the matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isOrthogonal">
<Methode Name="isOrthogonal" Const="true">
<Documentation>
<UserDocu>isOrthogonal(tol=1e-6) -> float\n
Checks if the matrix is orthogonal, i.e. M * M^T = k*I and returns
@@ -233,7 +233,7 @@ the multiple of the identity matrix. If it's not orthogonal 0 is returned.\n
tol : float\n Tolerance used to check orthogonality.</UserDocu>
</Documentation>
</Methode>
<Methode Name="submatrix">
<Methode Name="submatrix" Const="true">
<Documentation>
<UserDocu>submatrix(dim) -> Base.Matrix\n
Get the leading principal submatrix of the given dimension.
@@ -242,7 +242,7 @@ corresponding identity matrix.\n
dim : int\n Dimension parameter must be in the range [1,4].</UserDocu>
</Documentation>
</Methode>
<Methode Name="analyze">
<Methode Name="analyze" Const="true">
<Documentation>
<UserDocu>analyze() -> str\n
Analyzes the type of transformation.</UserDocu>
+1 -1
View File
@@ -28,7 +28,7 @@
#include "Persistence.h"
#include "Writer.h"
// inclution of the generated files (generated By PersitancePy.xml)
// inclusion of the generated files (generated By PersitancePy.xml)
#include "PersistencePy.h"
#include "PersistencePy.cpp"
+8 -4
View File
@@ -60,7 +60,11 @@ PyObjectBase::PyObjectBase(void* p,PyTypeObject *T)
, baseProxy(nullptr)
, attrDict(nullptr)
{
#if PY_VERSION_HEX < 0x030b0000
Py_TYPE(this) = T;
#else
this->ob_type = T;
#endif
_Py_NewReference(this);
#ifdef FC_LOGPYOBJECTS
Base::Console().Log("PyO+: %s (%p)\n",T->tp_name, this);
@@ -103,7 +107,7 @@ static void
PyBaseProxy_dealloc(PyObject* self)
{
/* Clear weakrefs first before calling any destructors */
if (reinterpret_cast<PyBaseProxy*>(self)->weakreflist != nullptr)
if (reinterpret_cast<PyBaseProxy*>(self)->weakreflist)
PyObject_ClearWeakRefs(self);
Py_TYPE(self)->tp_free(self);
}
@@ -349,7 +353,7 @@ int PyObjectBase::__setattro(PyObject *obj, PyObject *attro, PyObject *value)
//Hint: In general we don't allow to delete attributes (i.e. value=0). However, if we want to allow
//we must check then in _setattr() of all subclasses whether value is 0.
if ( value==nullptr ) {
if (!value) {
PyErr_Format(PyExc_AttributeError, "Cannot delete attribute: '%s'", attr);
return -1;
}
@@ -409,7 +413,7 @@ PyObject *PyObjectBase::_getattr(const char *attr)
// As fallback solution use Python's default method to get generic attributes
PyObject *w, *res;
w = PyUnicode_InternFromString(attr);
if (w != nullptr) {
if (w) {
res = PyObject_GenericGetAttr(this, w);
Py_XDECREF(w);
return res;
@@ -429,7 +433,7 @@ int PyObjectBase::_setattr(const char *attr, PyObject *value)
PyObject *w;
// As fallback solution use Python's default method to get generic attributes
w = PyUnicode_InternFromString(attr); // new reference
if (w != nullptr) {
if (w) {
// call methods from tp_getset if defined
int res = PyObject_GenericSetAttr(this, w, value);
Py_DECREF(w);
+5
View File
@@ -47,6 +47,7 @@
#endif
#define slots
#include <bitset>
#include <cstring>
#include "Exception.h"
#ifndef PYCXX_PYTHON_2TO3
@@ -122,6 +123,10 @@ inline void Assert(int expr, char *msg) // C++ assert
};
}
inline bool asBoolean(PyObject *obj) {
return PyObject_IsTrue(obj) != 0;
}
}
/*------------------------------
+9 -1
View File
@@ -15,8 +15,10 @@ is provided on an as is basis, without warranties of any kind.
#include <string.h>
#include <assert.h>
#include <compile.h>
#include <eval.h>
#include <frameobject.h>
#if PY_VERSION_HEX < 0x030b0000
#include <eval.h>
#endif
/*****************************************************************************
@@ -310,7 +312,13 @@ void PP_Fetch_Error_Text()
if(!frame)
return;
int line = PyFrame_GetLineNumber(frame);
#if PY_VERSION_HEX < 0x030b0000
const char *file = PyUnicode_AsUTF8(frame->f_code->co_filename);
#else
PyCodeObject* code = PyFrame_GetCode(frame);
const char *file = PyUnicode_AsUTF8(code->co_filename);
Py_DECREF(code);
#endif
#ifdef FC_OS_WIN32
const char *_f = strstr(file, "\\src\\");
#else
+1
View File
@@ -341,6 +341,7 @@ Rotation Rotation::inverse() const
rot._axis[0] = -this->_axis[0];
rot._axis[1] = -this->_axis[1];
rot._axis[2] = -this->_axis[2];
rot._angle = this->_angle;
return rot;
}
+1 -1
View File
@@ -40,7 +40,7 @@ angle2 : float
angle3 : float\n
Rotation(seq, angle1, angle2, angle3)
Define from one string and three floats (Euler angles) as Euler rotation
of a given type. Call toEulerSequence() for supported sequence types.
of a given type. Call toEulerAngles() for supported sequence types.
seq : str
angle1 : float
angle2 : float
+22 -12
View File
@@ -339,17 +339,22 @@ class FileInfo;
class ofstream : public std::ofstream
{
public:
ofstream() = default;
ofstream(const FileInfo& fi, ios_base::openmode mode =
std::ios::out | std::ios::trunc)
#ifdef _MSC_VER
: std::ofstream(fi.toStdWString().c_str(), mode)
: std::ofstream(fi.toStdWString().c_str(), mode) {}
#else
: std::ofstream(fi.filePath().c_str(), mode)
: std::ofstream(fi.filePath().c_str(), mode) {}
#endif
~ofstream() override = default;
void open(const FileInfo& fi, ios_base::openmode mode =
std::ios::out | std::ios::trunc) {
#ifdef _MSC_VER
std::ofstream::open(fi.toStdWString().c_str(), mode);
#else
std::ofstream::open(fi.filePath().c_str(), mode);
#endif
{
}
virtual ~ofstream()
{
}
};
@@ -362,17 +367,22 @@ public:
class ifstream : public std::ifstream
{
public:
ifstream() = default;
ifstream(const FileInfo& fi, ios_base::openmode mode =
std::ios::in)
#ifdef _MSC_VER
: std::ifstream(fi.toStdWString().c_str(), mode)
: std::ifstream(fi.toStdWString().c_str(), mode) {}
#else
: std::ifstream(fi.filePath().c_str(), mode)
: std::ifstream(fi.filePath().c_str(), mode) {}
#endif
~ifstream() override = default;
void open(const FileInfo& fi, ios_base::openmode mode =
std::ios::in) {
#ifdef _MSC_VER
std::ifstream::open(fi.toStdWString().c_str(), mode);
#else
std::ifstream::open(fi.filePath().c_str(), mode);
#endif
{
}
virtual ~ifstream()
{
}
};
+20 -21
View File
@@ -264,7 +264,7 @@ inline Vector2d& Vector2d::operator-= (const Vector2d &v)
inline Vector2d Vector2d::operator* (double c) const
{
return Vector2d(c*x, c*y);
return Vector2d(c * x, c * y);
}
inline Vector2d& Vector2d::operator*= (double c)
@@ -276,17 +276,17 @@ inline Vector2d& Vector2d::operator*= (double c)
inline double Vector2d::operator* (const Vector2d &v) const
{
return x*v.x + y*v.y;
return x * v.x + y * v.y;
}
inline Vector2d operator* (double c, const Vector2d &v)
{
return Vector2d(c*v.x, c*v.y);
return Vector2d(c * v.x, c * v.y);
}
inline Vector2d Vector2d::operator/ (double c) const
{
return Vector2d(x/c, y/c);
return Vector2d(x / c, y / c);
}
inline Vector2d& Vector2d::operator/= (double c)
@@ -298,12 +298,12 @@ inline Vector2d& Vector2d::operator/= (double c)
inline bool Vector2d::IsNull(double tolerance) const
{
return x*x + y*y <= tolerance*tolerance;
return x * x + y * y <= tolerance * tolerance;
}
inline double Vector2d::Length() const
{
return sqrt(x*x + y*y);
return sqrt(x * x + y * y);
}
inline double Vector2d::Angle() const
@@ -313,7 +313,7 @@ inline double Vector2d::Angle() const
inline double Vector2d::Sqr() const
{
return x*x + y*y;
return x * x + y * y;
}
inline Vector2d& Vector2d::Set(double x, double y)
@@ -339,8 +339,9 @@ inline Vector2d& Vector2d::Scale(double factor)
inline Vector2d& Vector2d::Rotate(double angle)
{
x = x*cos(angle) - y*sin(angle);
y = x*sin(angle) + y*cos(angle);
auto tmp_x = x;
x = x * cos(angle) - y * sin(angle);
y = tmp_x * sin(angle) + y * cos(angle);
return *this;
}
@@ -363,7 +364,7 @@ inline Vector2d Vector2d::Perpendicular(bool clockwise) const
inline Vector2d Vector2d::FromPolar(double r, double fi)
{
return Vector2d(r*cos(fi), r*sin(fi));
return Vector2d(r * cos(fi), r * sin(fi));
}
inline double Vector2d::Distance(const Vector2d& v) const
@@ -371,7 +372,7 @@ inline double Vector2d::Distance(const Vector2d& v) const
double dx = (x - v.x);
double dy = (y - v.y);
return sqrt(dx*dx + dy*dy);
return sqrt(dx * dx + dy * dy);
}
inline bool Vector2d::IsEqual(const Vector2d& v, double tolerance) const
@@ -414,7 +415,7 @@ inline bool Polygon2d::Delete (size_t ulNdx)
{
std::vector<Vector2d>::iterator it = _aclVct.begin();
std::advance(it, ulNdx);
_aclVct.erase ( it );
_aclVct.erase(it);
return true;
}
@@ -491,10 +492,10 @@ inline BoundBox2d::BoundBox2d (const BoundBox2d &rclBB)
inline BoundBox2d::BoundBox2d (double fX1, double fY1, double fX2, double fY2)
{
MinX = std::min<double>( fX1, fX2 );
MaxX = std::max<double>( fX1, fX2 );
MinY = std::min<double>( fY1, fY2 );
MaxY = std::max<double>( fY1, fY2 );
MinX = std::min<double>(fX1, fX2);
MaxX = std::max<double>(fX1, fX2);
MinY = std::min<double>(fY1, fY2);
MaxY = std::max<double>(fY1, fY2);
}
inline bool BoundBox2d::IsValid ()
@@ -504,8 +505,8 @@ inline bool BoundBox2d::IsValid ()
inline bool BoundBox2d::IsEqual(const BoundBox2d& b, double tolerance) const
{
return Vector2d(MinX,MinY).IsEqual(Vector2d(b.MinX,b.MinY), tolerance) &&
Vector2d(MaxX,MaxY).IsEqual(Vector2d(b.MaxX,b.MaxY), tolerance);
return Vector2d(MinX, MinY).IsEqual(Vector2d(b.MinX, b.MinY), tolerance) &&
Vector2d(MaxX, MaxY).IsEqual(Vector2d(b.MaxX, b.MaxY), tolerance);
}
inline BoundBox2d& BoundBox2d::operator= (const BoundBox2d& rclBB)
@@ -549,7 +550,7 @@ inline bool BoundBox2d::Contains(const Vector2d &v, double tolerance) const
inline Vector2d BoundBox2d::GetCenter() const
{
return Vector2d((MinX + MaxX)*0.5, (MinY + MaxY)*0.5);
return Vector2d((MinX + MaxX) * 0.5, (MinY + MaxY) * 0.5);
}
inline void BoundBox2d::SetVoid()
@@ -569,5 +570,3 @@ inline void BoundBox2d::Add(const Vector2d &v)
} // namespace Base
#endif // BASE_TOOLS2D_H
+12 -12
View File
@@ -87,9 +87,9 @@ const char* UnitsApi::getDescription(UnitSystem system)
}
}
UnitsSchemaPtr UnitsApi::createSchema(UnitSystem s)
UnitsSchemaPtr UnitsApi::createSchema(UnitSystem system)
{
switch (s) {
switch (system) {
case UnitSystem::SI1:
return std::make_unique<UnitsSchemaInternal>();
case UnitSystem::SI2:
@@ -115,14 +115,14 @@ UnitsSchemaPtr UnitsApi::createSchema(UnitSystem s)
return nullptr;
}
void UnitsApi::setSchema(UnitSystem s)
void UnitsApi::setSchema(UnitSystem system)
{
if (UserPrefSystem) {
UserPrefSystem->resetSchemaUnits(); // for schemas changed the Quantity constants
}
UserPrefSystem = createSchema(s);
currentSystem = s;
UserPrefSystem = createSchema(system);
currentSystem = system;
// for wrong value fall back to standard schema
if (!UserPrefSystem) {
@@ -133,21 +133,21 @@ void UnitsApi::setSchema(UnitSystem s)
UserPrefSystem->setSchemaUnits(); // if necessary a unit schema can change the constants in Quantity (e.g. mi=1.8km rather then 1.6km).
}
QString UnitsApi::toString(const Base::Quantity& q, const QuantityFormat& f)
QString UnitsApi::toString(const Base::Quantity& quantity, const QuantityFormat& format)
{
QString value = QString::fromLatin1("'%1 %2'").arg(q.getValue(), 0, f.toFormat(), f.precision)
.arg(q.getUnit().getString());
QString value = QString::fromLatin1("'%1 %2'").arg(quantity.getValue(), 0, format.toFormat(), format.precision)
.arg(quantity.getUnit().getString());
return value;
}
QString UnitsApi::toNumber(const Base::Quantity& q, const QuantityFormat& f)
QString UnitsApi::toNumber(const Base::Quantity& quantity, const QuantityFormat& format)
{
return toNumber(q.getValue(), f);
return toNumber(quantity.getValue(), format);
}
QString UnitsApi::toNumber(double d, const QuantityFormat& f)
QString UnitsApi::toNumber(double value, const QuantityFormat& format)
{
QString number = QString::fromLatin1("%1").arg(d, 0, f.toFormat(), f.precision);
QString number = QString::fromLatin1("%1").arg(value, 0, format.toFormat(), format.precision);
return number;
}
+1
View File
@@ -29,6 +29,7 @@
#include <QString>
#include "UnitsSchemaInternal.h"
#include <cmath>
using namespace Base;
+1
View File
@@ -29,6 +29,7 @@
#include <QString>
#include "UnitsSchemaMKS.h"
#include <cmath>
using namespace Base;
+1
View File
@@ -2,6 +2,7 @@
// Version Number
#define FCVersionMajor "${PACKAGE_VERSION_MAJOR}"
#define FCVersionMinor "${PACKAGE_VERSION_MINOR}"
#define FCVersionPoint "${FREECAD_VERSION_PATCH}"
#define FCVersionName "${PACKAGE_VERSION_NAME}"
// test: $Format:Hash (%H), Date: %ci$
#define FCRevision "${PACKAGE_WCREF}" //Highest committed revision number
+2 -1
View File
@@ -10,7 +10,8 @@ if (WIN32)
REALPATH BASE_DIR "${CMAKE_INSTALL_PREFIX}")
set( ${CMAKE_INSTALL_BINDIR})
else()
set(FREECAD_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
get_filename_component(FREECAD_LIBRARY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}"
REALPATH BASE_DIR "${CMAKE_INSTALL_PREFIX}")
endif()
configure_file(__init__.py.template ${NAMESPACE_INIT})
+2 -1
View File
@@ -33,6 +33,7 @@
# include <QTimer>
# include <QToolBar>
# include <QToolButton>
# include <QToolTip>
#endif
#include <Base/Exception.h>
@@ -381,7 +382,7 @@ void ActionGroup::onActivated (QAction* a)
void ActionGroup::onHovered (QAction *a)
{
Gui::ToolTip::showText(QCursor::pos(), a->toolTip());
QToolTip::showText(QCursor::pos(), a->toolTip());
}
+17 -16
View File
@@ -1017,7 +1017,7 @@ bool Application::sendHasMsgToFocusView(const char* pMsg)
return false;
}
Gui::MDIView* Application::activeView(void) const
Gui::MDIView* Application::activeView() const
{
if (activeDocument())
return activeDocument()->getActiveView();
@@ -1049,12 +1049,12 @@ void Application::activateView(const Base::Type& type, bool create)
}
/// Getter for the active view
Gui::Document* Application::activeDocument(void) const
Gui::Document* Application::activeDocument() const
{
return d->activeDocument;
}
Gui::Document* Application::editDocument(void) const
Gui::Document* Application::editDocument() const
{
return d->editDocument;
}
@@ -1188,7 +1188,7 @@ void Application::detachView(Gui::BaseView* pcView)
d->passive.remove(pcView);
}
void Application::onUpdate(void)
void Application::onUpdate()
{
// update all documents
std::map<const App::Document*, Gui::Document*>::iterator It;
@@ -1218,7 +1218,7 @@ void Application::viewActivated(MDIView* pcView)
}
void Application::updateActive(void)
void Application::updateActive()
{
activeDocument()->onUpdate();
}
@@ -1569,7 +1569,7 @@ QString Application::workbenchMenuText(const QString& wb) const
return QString();
}
QStringList Application::workbenches(void) const
QStringList Application::workbenches() const
{
// If neither 'HiddenWorkbench' nor 'ExtraWorkbench' is set then all workbenches are returned.
const std::map<std::string,std::string>& config = App::Application::Config();
@@ -1659,22 +1659,22 @@ void Application::setupContextMenu(const char* recipient, MenuItem* items) const
}
}
bool Application::isClosing(void)
bool Application::isClosing()
{
return d->isClosing;
}
MacroManager *Application::macroManager(void)
MacroManager *Application::macroManager()
{
return d->macroMngr;
}
CommandManager &Application::commandManager(void)
CommandManager &Application::commandManager()
{
return d->commandManager;
}
Gui::PreferencePackManager* Application::prefPackManager(void)
Gui::PreferencePackManager* Application::prefPackManager()
{
return d->prefPackManager;
}
@@ -1756,7 +1756,7 @@ static void init_resources()
Q_INIT_RESOURCE(translation);
}
void Application::initApplication(void)
void Application::initApplication()
{
static bool init = false;
if (init) {
@@ -1778,7 +1778,7 @@ void Application::initApplication(void)
}
}
void Application::initTypes(void)
void Application::initTypes()
{
// views
Gui::BaseView ::init();
@@ -1848,7 +1848,7 @@ void Application::initTypes(void)
(ViewProviderDocumentObject::getClassTypeId());
}
void Application::initOpenInventor(void)
void Application::initOpenInventor()
{
// init the Inventor subsystem
SoDB::init();
@@ -1856,12 +1856,12 @@ void Application::initOpenInventor(void)
SoFCDB::init();
}
void Application::runInitGuiScript(void)
void Application::runInitGuiScript()
{
Base::Interpreter().runString(Base::ScriptFactory().ProduceScript("FreeCADGuiInit"));
}
void Application::runApplication(void)
void Application::runApplication()
{
const std::map<std::string,std::string>& cfg = App::Application::Config();
std::map<std::string,std::string>::const_iterator it;
@@ -2038,7 +2038,8 @@ void Application::runApplication(void)
std::map<std::string, std::string>& config = App::Application::Config();
QString major = QString::fromLatin1(config["BuildVersionMajor"].c_str());
QString minor = QString::fromLatin1(config["BuildVersionMinor"].c_str());
QString title = QString::fromLatin1("%1 %2.%3").arg(mainApp.applicationName(), major, minor);
QString point = QString::fromLatin1(config["BuildVersionPoint"].c_str());
QString title = QString::fromLatin1("%1 %2.%3.%4").arg(mainApp.applicationName(), major, minor, point);
mw.setWindowTitle(title);
} else {
mw.setWindowTitle(mainApp.applicationName());
+15 -15
View File
@@ -89,9 +89,9 @@ public:
/// get called if a view gets activated, this manage the whole activation scheme
void viewActivated(Gui::MDIView* pcView);
/// call update to all documents and all views (costly!)
void onUpdate(void);
void onUpdate();
/// call update to all views of the active document
void updateActive(void);
void updateActive();
/// call update to all command actions
void updateActions(bool delay = false);
//@}
@@ -160,11 +160,11 @@ public:
/// message when a GuiDocument is about to vanish
void onLastWindowClosed(Gui::Document* pcDoc);
/// Getter for the active document
Gui::Document* activeDocument(void) const;
Gui::Document* activeDocument() const;
/// Set the active document
void setActiveDocument(Gui::Document* pcDocument);
/// Getter for the editing document
Gui::Document* editDocument(void) const;
Gui::Document* editDocument() const;
Gui::MDIView* editViewOfNode(SoNode *node) const;
/// Set editing document, which will reset editing of all other document
void setEditDocument(Gui::Document* pcDocument);
@@ -177,7 +177,7 @@ public:
*/
Gui::Document* getDocument(const App::Document* pDoc) const;
/// Getter for the active view of the active document or null
Gui::MDIView* activeView(void) const;
Gui::MDIView* activeView() const;
/// Activate a view of the given type of the active document
void activateView(const Base::Type&, bool create=false);
/// Shows the associated view provider of the given object
@@ -189,7 +189,7 @@ public:
//@}
/// true when the application shutting down
bool isClosing(void);
bool isClosing();
void checkForPreviousCrashes();
/** @name workbench handling */
@@ -199,7 +199,7 @@ public:
QPixmap workbenchIcon(const QString&) const;
QString workbenchToolTip(const QString&) const;
QString workbenchMenuText(const QString&) const;
QStringList workbenches(void) const;
QStringList workbenches() const;
void setupContextMenu(const char* recipient, MenuItem*) const;
//@}
@@ -212,24 +212,24 @@ public:
/** @name User Commands */
//@{
/// Get macro manager
Gui::MacroManager *macroManager(void);
Gui::MacroManager *macroManager();
/// Reference to the command manager
Gui::CommandManager &commandManager(void);
Gui::CommandManager &commandManager();
/// helper which create the commands
void createStandardOperations();
//@}
Gui::PreferencePackManager* prefPackManager(void);
Gui::PreferencePackManager* prefPackManager();
/** @name Init, Destruct an Access methods */
//@{
/// some kind of singleton
static Application* Instance;
static void initApplication(void);
static void initTypes(void);
static void initOpenInventor(void);
static void runInitGuiScript(void);
static void runApplication(void);
static void initApplication();
static void initTypes();
static void initOpenInventor();
static void runInitGuiScript();
static void runApplication();
void tryClose( QCloseEvent * e );
//@}
+1 -1
View File
@@ -360,7 +360,7 @@ private:
}
void RecoveryWriter::writeFiles(void)
void RecoveryWriter::writeFiles()
{
#if 0
FileWriter::writeFiles();
+1 -1
View File
@@ -110,7 +110,7 @@ public:
always returns true.
*/
virtual bool shouldWrite(const std::string&, const Base::Persistence *) const;
virtual void writeFiles(void);
virtual void writeFiles();
private:
AutoSaveProperty& saver;
+2 -2
View File
@@ -45,7 +45,7 @@ int AxisOriginPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
// returns a string which represent the object e.g. when printed in python
std::string AxisOriginPy::representation(void) const
std::string AxisOriginPy::representation() const
{
return "<AxisOrigin>";
}
@@ -175,7 +175,7 @@ void AxisOriginPy::setLabels(Py::Dict dict)
getAxisOriginPtr()->setLabels(labels);
}
Py::Object AxisOriginPy::getNode(void) const
Py::Object AxisOriginPy::getNode() const
{
SoGroup* node = getAxisOriginPtr()->getNode();
PyObject* Ptr = Base::Interpreter().createSWIGPointerObj("pivy.coin","SoGroup *", node, 1);
+3 -3
View File
@@ -88,7 +88,7 @@ public:
BitmapFactoryInst* BitmapFactoryInst::_pcSingleton = nullptr;
BitmapFactoryInst& BitmapFactoryInst::instance(void)
BitmapFactoryInst& BitmapFactoryInst::instance()
{
if (_pcSingleton == nullptr)
{
@@ -112,7 +112,7 @@ BitmapFactoryInst& BitmapFactoryInst::instance(void)
return *_pcSingleton;
}
void BitmapFactoryInst::destruct (void)
void BitmapFactoryInst::destruct ()
{
if (_pcSingleton != nullptr)
delete _pcSingleton;
@@ -203,7 +203,7 @@ bool BitmapFactoryInst::findPixmapInCache(const char* name, QPixmap& px) const
QIcon BitmapFactoryInst::iconFromTheme(const char* name, const QIcon& fallback)
{
QString iconName = QString::fromLatin1(name);
QString iconName = QString::fromUtf8(name);
QIcon icon = QIcon::fromTheme(iconName, fallback);
if (icon.isNull()) {
QPixmap px = pixmap(name);
+3 -3
View File
@@ -52,8 +52,8 @@ public:
BottomRight /**< Place to the bottom right corner */
};
static BitmapFactoryInst& instance(void);
static void destruct (void);
static BitmapFactoryInst& instance();
static void destruct ();
/// Adds a path where pixmaps can be found
void addPath(const QString& path);
@@ -149,7 +149,7 @@ private:
};
/// Get the global instance
inline BitmapFactoryInst& BitmapFactory(void)
inline BitmapFactoryInst& BitmapFactory()
{
return BitmapFactoryInst::instance();
}
+1 -1
View File
@@ -76,7 +76,7 @@ public:
*/
virtual ~ComboView();
Gui::TaskView::TaskView *getTaskPanel(void){return taskPanel;}
Gui::TaskView::TaskView *getTaskPanel(){return taskPanel;}
QTabWidget* getTabPanel() const { return tabs;}
+30 -23
View File
@@ -264,12 +264,12 @@ void Command::addToGroup(ActionGroup* group)
group->addAction(_pcAction->findChild<QAction*>());
}
Application *Command::getGuiApplication(void)
Application *Command::getGuiApplication()
{
return Application::Instance;
}
Gui::Document* Command::getActiveGuiDocument(void) const
Gui::Document* Command::getActiveGuiDocument() const
{
return getGuiApplication()->activeDocument();
}
@@ -474,7 +474,7 @@ void Command::_invoke(int id, bool disablelog)
#endif
}
void Command::testActive(void)
void Command::testActive()
{
if (!_pcAction)
return;
@@ -523,7 +523,7 @@ void Command::setEnabled(bool on)
// Helper methods
//--------------------------------------------------------------------------
bool Command::hasActiveDocument(void) const
bool Command::hasActiveDocument() const
{
return getActiveGuiDocument() != nullptr;
}
@@ -533,7 +533,7 @@ bool Command::hasObject(const char* Name)
return getDocument() != nullptr && getDocument()->getObject(Name) != nullptr;
}
Gui::SelectionSingleton& Command::getSelection(void)
Gui::SelectionSingleton& Command::getSelection()
{
return Gui::Selection();
}
@@ -605,17 +605,17 @@ void Command::openCommand(const char* sCmdName)
App::GetApplication().setActiveTransaction(sCmdName);
}
void Command::commitCommand(void)
void Command::commitCommand()
{
App::GetApplication().closeActiveTransaction();
}
void Command::abortCommand(void)
void Command::abortCommand()
{
App::GetApplication().closeActiveTransaction(true);
}
bool Command::hasPendingCommand(void)
bool Command::hasPendingCommand()
{
return !!App::GetApplication().getActiveTransaction();
}
@@ -657,8 +657,15 @@ void Command::printPyCaller() {
if(!frame)
return;
int line = PyFrame_GetLineNumber(frame);
#if PY_VERSION_HEX < 0x030b0000
const char *file = PyUnicode_AsUTF8(frame->f_code->co_filename);
printCaller(file?file:"<no file>",line);
#else
PyCodeObject* code = PyFrame_GetCode(frame);
const char* file = PyUnicode_AsUTF8(code->co_filename);
printCaller(file?file:"<no file>",line);
Py_DECREF(code);
#endif
}
void Command::printCaller(const char *file, int line) {
@@ -810,13 +817,13 @@ const std::string Command::strToPython(const char* Str)
}
/// Updates the (active) document (propagate changes)
void Command::updateActive(void)
void Command::updateActive()
{
WaitCursor wc;
doCommand(App,"App.ActiveDocument.recompute()");
}
bool Command::isActiveObjectValid(void)
bool Command::isActiveObjectValid()
{
Gui::Document* active = Gui::Application::Instance->activeDocument();
assert(active);
@@ -843,7 +850,7 @@ void Command::updateAll(std::list<Gui::Document*> cList)
//--------------------------------------------------------------------------
/// returns the begin of a online help page
const char * Command::beginCmdHelp(void)
const char * Command::beginCmdHelp()
{
return "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
"<html>\n"
@@ -855,7 +862,7 @@ const char * Command::beginCmdHelp(void)
}
/// returns the end of a online help page
const char * Command::endCmdHelp(void)
const char * Command::endCmdHelp()
{
return "</body></html>\n\n";
}
@@ -974,7 +981,7 @@ void Command::printConflictingAccelerators() const
Base::Console().Warning("Accelerator conflict between %s (%s) and %s (%s)\n", sName, sAccel, cmd->sName, cmd->sAccel);
}
Action * Command::createAction(void)
Action * Command::createAction()
{
Action *pcAction;
pcAction = new Action(this,getMainWindow());
@@ -1021,7 +1028,7 @@ Command *GroupCommand::addCommand(const char *name) {
return cmd;
}
Action * GroupCommand::createAction(void) {
Action * GroupCommand::createAction() {
ActionGroup* pcAction = new ActionGroup(this, getMainWindow());
pcAction->setMenuRole(QAction::NoRole);
pcAction->setDropDownMenu(true);
@@ -1136,7 +1143,7 @@ void MacroCommand::activated(int iMsg)
}
}
Action * MacroCommand::createAction(void)
Action * MacroCommand::createAction()
{
Action *pcAction;
pcAction = new Action(this,getMainWindow());
@@ -1306,7 +1313,7 @@ void PythonCommand::activated(int iMsg)
}
}
bool PythonCommand::isActive(void)
bool PythonCommand::isActive()
{
try {
Base::PyGILStateLocker lock;
@@ -1336,7 +1343,7 @@ void PythonCommand::languageChange()
}
}
const char* PythonCommand::getHelpUrl(void) const
const char* PythonCommand::getHelpUrl() const
{
PyObject* pcTemp;
pcTemp = Interpreter().runMethodObject(_pcPyCommand, "CmdHelpURL");
@@ -1347,7 +1354,7 @@ const char* PythonCommand::getHelpUrl(void) const
return PyUnicode_AsUTF8(pcTemp);
}
Action * PythonCommand::createAction(void)
Action * PythonCommand::createAction()
{
QAction* qtAction = new QAction(nullptr);
Action *pcAction;
@@ -1522,7 +1529,7 @@ void PythonGroupCommand::activated(int iMsg)
}
}
bool PythonGroupCommand::isActive(void)
bool PythonGroupCommand::isActive()
{
try {
Base::PyGILStateLocker lock;
@@ -1546,7 +1553,7 @@ bool PythonGroupCommand::isActive(void)
return true;
}
Action * PythonGroupCommand::createAction(void)
Action * PythonGroupCommand::createAction()
{
Gui::ActionGroup* pcAction = new Gui::ActionGroup(this, Gui::getMainWindow());
pcAction->setDropDownMenu(hasDropDownMenu());
@@ -1656,7 +1663,7 @@ void PythonGroupCommand::languageChange()
}
}
const char* PythonGroupCommand::getHelpUrl(void) const
const char* PythonGroupCommand::getHelpUrl() const
{
return "";
}
@@ -1833,7 +1840,7 @@ std::vector <Command*> CommandManager::getModuleCommands(const char *sModName) c
return vCmds;
}
std::vector <Command*> CommandManager::getAllCommands(void) const
std::vector <Command*> CommandManager::getAllCommands() const
{
std::vector <Command*> vCmds;
@@ -1870,7 +1877,7 @@ void CommandManager::runCommandByName (const char* sName) const
pCmd->invoke(0);
}
void CommandManager::testActive(void)
void CommandManager::testActive()
{
for ( std::map<std::string, Command*>::iterator It= _sCommands.begin();It!=_sCommands.end();++It) {
It->second->testActive();
+36 -36
View File
@@ -213,15 +213,15 @@ class SelectionSingleton;
class MDIView;
void CreateStdCommands(void);
void CreateDocCommands(void);
void CreateFeatCommands(void);
void CreateMacroCommands(void);
void CreateViewStdCommands(void);
void CreateWindowStdCommands(void);
void CreateStructureCommands(void);
void CreateTestCommands(void);
void CreateLinkCommands(void);
void CreateStdCommands();
void CreateDocCommands();
void CreateFeatCommands();
void CreateMacroCommands();
void CreateViewStdCommands();
void CreateWindowStdCommands();
void CreateStructureCommands();
void CreateTestCommands();
void CreateLinkCommands();
/** The CommandBase class
@@ -246,7 +246,7 @@ public:
//@{
protected:
/// Creates the used Action when adding to a widget. The default implementation does nothing.
virtual Action * createAction(void);
virtual Action * createAction();
public:
/// Reassigns QAction stuff after the language has changed.
@@ -323,7 +323,7 @@ protected:
/// Methods which gets called when activated, needs to be reimplemented!
virtual void activated(int iMsg)=0;
/// Creates the used Action
virtual Action * createAction(void);
virtual Action * createAction();
/// Applies the menu text, tool and status tip to the passed action object
void applyCommandData(const char* context, Action* );
const char* keySequenceToAccel(int) const;
@@ -336,9 +336,9 @@ public:
/// CommandManager is a friend
friend class CommandManager;
/// Override this method if your Cmd is not always active
virtual bool isActive(void){return true;}
virtual bool isActive(){return true;}
/// Get somtile called to check the state of the command
void testActive(void);
void testActive();
/// Enables or disables the command
void setEnabled(bool);
/// (Re)Create the text for the tooltip (for example, when the shortcut is changed)
@@ -372,11 +372,11 @@ public:
/** @name Helper methods to get important classes */
//@{
/// Get pointer to the Application Window
static Application* getGuiApplication(void);
static Application* getGuiApplication();
/// Get a reference to the selection
static Gui::SelectionSingleton& getSelection(void);
static Gui::SelectionSingleton& getSelection();
/// Get pointer to the active gui document
Gui::Document* getActiveGuiDocument(void) const;
Gui::Document* getActiveGuiDocument() const;
/** Get pointer to the named or active App document
* Returns a pointer to the named document or the active
* document when no name is given. NULL is returned
@@ -407,17 +407,17 @@ public:
/// Open a new Undo transaction on the active document
static void openCommand(const char* sName=nullptr);
/// Commit the Undo transaction on the active document
static void commitCommand(void);
static void commitCommand();
/// Abort the Undo transaction on the active document
static void abortCommand(void);
static void abortCommand();
/// Check if an Undo transaction is open on the active document
static bool hasPendingCommand(void);
static bool hasPendingCommand();
/// Updates the (active) document (propagate changes)
static void updateActive(void);
static void updateActive();
/// Updates the (all or listed) documents (propagate changes)
static void updateAll(std::list<Gui::Document*> cList);
/// Checks if the active object of the active document is valid
static bool isActiveObjectValid(void);
static bool isActiveObjectValid();
/// Translate command
void languageChange();
/// Updates the QAction with respect to the passed mode.
@@ -539,17 +539,17 @@ public:
/** @name Helper methods to generate help pages */
//@{
/// returns the begin of a online help page
const char * beginCmdHelp(void);
const char * beginCmdHelp();
/// returns the end of a online help page
const char * endCmdHelp(void);
const char * endCmdHelp();
/// Get the help URL
virtual const char* getHelpUrl(void) const { return sHelpUrl; }
virtual const char* getHelpUrl() const { return sHelpUrl; }
//@}
/** @name Helper methods for the Active tests */
//@{
/// true when there is a document
bool hasActiveDocument(void) const;
bool hasActiveDocument() const;
/// true when there is a document and a Feature with Name
bool hasObject(const char* Name);
//@}
@@ -557,7 +557,7 @@ public:
/** @name checking of internal state */
//@{
/// returns the name to which the command belongs
const char* getAppModuleName(void) const {return sAppModule;}
const char* getAppModuleName() const {return sAppModule;}
void setAppModuleName(const char*);
/// Get the command name
const char* getName() const { return sName; }
@@ -643,7 +643,7 @@ public:
protected:
virtual void activated(int iMsg);
virtual Gui::Action * createAction(void);
virtual Gui::Action * createAction();
virtual void languageChange();
void setup(Action *);
@@ -673,11 +673,11 @@ protected:
/// Method which gets called when activated
virtual void activated(int iMsg);
/// if the command is not always active
virtual bool isActive(void);
virtual bool isActive();
/// Get the help URL
const char* getHelpUrl(void) const;
const char* getHelpUrl() const;
/// Creates the used Action
virtual Action * createAction(void);
virtual Action * createAction();
//@}
public:
@@ -724,11 +724,11 @@ protected:
/// Method which gets called when activated
virtual void activated(int iMsg);
/// if the command is not always active
virtual bool isActive(void);
virtual bool isActive();
/// Get the help URL
const char* getHelpUrl(void) const;
const char* getHelpUrl() const;
/// Creates the used Action
virtual Action * createAction(void);
virtual Action * createAction();
//@}
public:
@@ -779,7 +779,7 @@ protected:
/// Method which get called when activated
void activated(int iMsg);
/// Creates the used Action
Action * createAction(void);
Action * createAction();
//@}
public:
@@ -845,7 +845,7 @@ public:
* of a special app module use GetModuleCommands()
* @see Command
*/
std::vector <Command*> getAllCommands(void) const;
std::vector <Command*> getAllCommands() const;
/** Returns all commands of a group
* delivers a vector of all commands in the given group.
@@ -866,7 +866,7 @@ public:
/// method is OBSOLETE use GetModuleCommands() or GetAllCommands()
const std::map<std::string, Command*>& getCommands() const { return _sCommands; }
/// get frequently called by the AppWnd to check the commands are active.
void testActive(void);
void testActive();
void addCommandMode(const char* sContext, const char* sName);
void updateCommands(const char* sContext, int mode);
+32 -32
View File
@@ -242,7 +242,7 @@ void StdCmdImport::activated(int iMsg)
}
}
bool StdCmdImport::isActive(void)
bool StdCmdImport::isActive()
{
return (getActiveGuiDocument() ? true : false);
}
@@ -490,7 +490,7 @@ void StdCmdExport::activated(int iMsg)
}
}
bool StdCmdExport::isActive(void)
bool StdCmdExport::isActive()
{
return (getActiveGuiDocument() ? true : false);
}
@@ -543,7 +543,7 @@ void StdCmdMergeProjects::activated(int iMsg)
}
}
bool StdCmdMergeProjects::isActive(void)
bool StdCmdMergeProjects::isActive()
{
return this->hasActiveDocument();
}
@@ -576,7 +576,7 @@ void StdCmdDependencyGraph::activated(int iMsg)
getMainWindow()->addWindow(view);
}
bool StdCmdDependencyGraph::isActive(void)
bool StdCmdDependencyGraph::isActive()
{
return (getActiveGuiDocument() ? true : false);
}
@@ -643,7 +643,7 @@ void StdCmdSave::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"Save\")");
}
bool StdCmdSave::isActive(void)
bool StdCmdSave::isActive()
{
#if 0
if( getActiveGuiDocument() )
@@ -683,7 +683,7 @@ void StdCmdSaveAs::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"SaveAs\")");
}
bool StdCmdSaveAs::isActive(void)
bool StdCmdSaveAs::isActive()
{
#if 0
if( getActiveGuiDocument() )
@@ -721,7 +721,7 @@ void StdCmdSaveCopy::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"SaveCopy\")");
}
bool StdCmdSaveCopy::isActive(void)
bool StdCmdSaveCopy::isActive()
{
return ( getActiveGuiDocument() ? true : false );
}
@@ -748,7 +748,7 @@ void StdCmdSaveAll::activated(int iMsg)
Gui::Document::saveAll();
}
bool StdCmdSaveAll::isActive(void)
bool StdCmdSaveAll::isActive()
{
return ( getActiveGuiDocument() ? true : false );
}
@@ -786,7 +786,7 @@ void StdCmdRevert::activated(int iMsg)
doCommand(Command::App,"App.ActiveDocument.restore()");
}
bool StdCmdRevert::isActive(void)
bool StdCmdRevert::isActive()
{
return ( getActiveGuiDocument() ? true : false );
}
@@ -816,7 +816,7 @@ void StdCmdProjectInfo::activated(int iMsg)
dlg.exec();
}
bool StdCmdProjectInfo::isActive(void)
bool StdCmdProjectInfo::isActive()
{
return ( getActiveGuiDocument() ? true : false );
}
@@ -846,7 +846,7 @@ void StdCmdProjectUtil::activated(int iMsg)
dlg.exec();
}
bool StdCmdProjectUtil::isActive(void)
bool StdCmdProjectUtil::isActive()
{
return true;
}
@@ -878,7 +878,7 @@ void StdCmdPrint::activated(int iMsg)
}
}
bool StdCmdPrint::isActive(void)
bool StdCmdPrint::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("Print");
}
@@ -908,7 +908,7 @@ void StdCmdPrintPreview::activated(int iMsg)
}
}
bool StdCmdPrintPreview::isActive(void)
bool StdCmdPrintPreview::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("PrintPreview");
}
@@ -939,7 +939,7 @@ void StdCmdPrintPdf::activated(int iMsg)
}
}
bool StdCmdPrintPdf::isActive(void)
bool StdCmdPrintPdf::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("PrintPdf");
}
@@ -996,12 +996,12 @@ void StdCmdUndo::activated(int iMsg)
getGuiApplication()->sendMsgToActiveView("Undo");
}
bool StdCmdUndo::isActive(void)
bool StdCmdUndo::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("Undo");
}
Action * StdCmdUndo::createAction(void)
Action * StdCmdUndo::createAction()
{
Action *pcAction;
@@ -1040,12 +1040,12 @@ void StdCmdRedo::activated(int iMsg)
getGuiApplication()->sendMsgToActiveView("Redo");
}
bool StdCmdRedo::isActive(void)
bool StdCmdRedo::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("Redo");
}
Action * StdCmdRedo::createAction(void)
Action * StdCmdRedo::createAction()
{
Action *pcAction;
@@ -1081,7 +1081,7 @@ void StdCmdCut::activated(int iMsg)
getGuiApplication()->sendMsgToActiveView("Cut");
}
bool StdCmdCut::isActive(void)
bool StdCmdCut::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("Cut");
}
@@ -1114,7 +1114,7 @@ void StdCmdCopy::activated(int iMsg)
}
}
bool StdCmdCopy::isActive(void)
bool StdCmdCopy::isActive()
{
if (getGuiApplication()->sendHasMsgToFocusView("Copy"))
return true;
@@ -1152,7 +1152,7 @@ void StdCmdPaste::activated(int iMsg)
}
}
bool StdCmdPaste::isActive(void)
bool StdCmdPaste::isActive()
{
if (getGuiApplication()->sendHasMsgToFocusView("Paste"))
return true;
@@ -1243,7 +1243,7 @@ void StdCmdDuplicateSelection::activated(int iMsg)
fi.deleteFile();
}
bool StdCmdDuplicateSelection::isActive(void)
bool StdCmdDuplicateSelection::isActive()
{
return Gui::Selection().hasSelection();
}
@@ -1275,7 +1275,7 @@ void StdCmdSelectAll::activated(int iMsg)
rSel.setSelection(doc->getName(), objs);
}
bool StdCmdSelectAll::isActive(void)
bool StdCmdSelectAll::isActive()
{
return App::GetApplication().getActiveDocument() != nullptr;
}
@@ -1448,7 +1448,7 @@ void StdCmdDelete::activated(int iMsg)
Gui::getMainWindow()->update();
}
bool StdCmdDelete::isActive(void)
bool StdCmdDelete::isActive()
{
return Selection().getCompleteSelection().size() > 0;
}
@@ -1502,7 +1502,7 @@ void StdCmdRefresh::activated(int iMsg)
}
}
bool StdCmdRefresh::isActive(void)
bool StdCmdRefresh::isActive()
{
return this->getDocument() && this->getDocument()->mustExecute();
}
@@ -1528,7 +1528,7 @@ void StdCmdTransform::activated(int iMsg)
Gui::Control().showDialog(new Gui::Dialog::TaskTransform());
}
bool StdCmdTransform::isActive(void)
bool StdCmdTransform::isActive()
{
return (Gui::Control().activeDialog()==nullptr);
}
@@ -1562,7 +1562,7 @@ void StdCmdPlacement::activated(int iMsg)
Gui::Control().showDialog(plm);
}
bool StdCmdPlacement::isActive(void)
bool StdCmdPlacement::isActive()
{
return Gui::Selection().countObjectsOfType(App::GeoFeature::getClassTypeId()) >= 1;
}
@@ -1596,7 +1596,7 @@ void StdCmdTransformManip::activated(int iMsg)
getActiveGuiDocument()->setEdit(vp, Gui::ViewProvider::Transform);
}
bool StdCmdTransformManip::isActive(void)
bool StdCmdTransformManip::isActive()
{
return Gui::Selection().countObjectsOfType(App::GeoFeature::getClassTypeId()) == 1;
}
@@ -1664,7 +1664,7 @@ void StdCmdAlignment::activated(int iMsg)
Gui::Selection().clearSelection();
}
bool StdCmdAlignment::isActive(void)
bool StdCmdAlignment::isActive()
{
if (ManualAlignment::hasInstance())
return false;
@@ -1706,7 +1706,7 @@ void StdCmdEdit::activated(int iMsg)
}
}
bool StdCmdEdit::isActive(void)
bool StdCmdEdit::isActive()
{
return (Selection().getCompleteSelection().size() > 0) || (Gui::Control().activeDialog() != nullptr);
}
@@ -1763,7 +1763,7 @@ protected:
copyExpressions(objs);
}
virtual Gui::Action * createAction(void) {
virtual Gui::Action * createAction() {
ActionGroup* pcAction = new ActionGroup(this, getMainWindow());
pcAction->setDropDownMenu(true);
applyCommandData(this->className(), pcAction);
@@ -1932,7 +1932,7 @@ protected:
namespace Gui {
void CreateDocCommands(void)
void CreateDocCommands()
{
CommandManager &rcCmdMgr = Application::Instance->commandManager();
+3 -3
View File
@@ -110,7 +110,7 @@ void StdCmdRandomColor::activated(int iMsg)
}
}
bool StdCmdRandomColor::isActive(void)
bool StdCmdRandomColor::isActive()
{
return (Gui::Selection().size() != 0);
}
@@ -135,7 +135,7 @@ StdCmdSendToPythonConsole::StdCmdSendToPythonConsole()
sAccel = "Ctrl+Shift+P";
}
bool StdCmdSendToPythonConsole::isActive(void)
bool StdCmdSendToPythonConsole::isActive()
{
//active only if either 1 object is selected or multiple subobjects from the same object
return Gui::Selection().getSelectionEx().size() == 1;
@@ -211,7 +211,7 @@ void StdCmdSendToPythonConsole::activated(int iMsg)
namespace Gui {
void CreateFeatCommands(void)
void CreateFeatCommands()
{
CommandManager &rcCmdMgr = Application::Instance->commandManager();
+4 -4
View File
@@ -65,8 +65,8 @@ public:
protected:
virtual void activated(int iMsg);
virtual bool isActive(void);
virtual Action * createAction(void);
virtual bool isActive();
virtual Action * createAction();
virtual void languageChange();
};
@@ -86,7 +86,7 @@ bool StdCmdLinkMakeGroup::isActive() {
return !!App::GetApplication().getActiveDocument();
}
Action * StdCmdLinkMakeGroup::createAction(void)
Action * StdCmdLinkMakeGroup::createAction()
{
ActionGroup* pcAction = new ActionGroup(this, getMainWindow());
pcAction->setDropDownMenu(true);
@@ -892,7 +892,7 @@ public:
namespace Gui {
void CreateLinkCommands(void)
void CreateLinkCommands()
{
CommandManager &rcCmdMgr = Application::Instance->commandManager();
rcCmdMgr.addCommand(new StdCmdLinkMake());
+11 -11
View File
@@ -58,7 +58,7 @@ void StdCmdDlgMacroRecord::activated(int iMsg)
cDlg.exec();
}
bool StdCmdDlgMacroRecord::isActive(void)
bool StdCmdDlgMacroRecord::isActive()
{
return ! (getGuiApplication()->macroManager()->isOpen());
}
@@ -86,7 +86,7 @@ void StdCmdMacroStopRecord::activated(int iMsg)
getGuiApplication()->macroManager()->commit();
}
bool StdCmdMacroStopRecord::isActive(void)
bool StdCmdMacroStopRecord::isActive()
{
return getGuiApplication()->macroManager()->isOpen();
}
@@ -115,7 +115,7 @@ void StdCmdDlgMacroExecute::activated(int iMsg)
cDlg.exec();
}
bool StdCmdDlgMacroExecute::isActive(void)
bool StdCmdDlgMacroExecute::isActive()
{
return ! (getGuiApplication()->macroManager()->isOpen());
}
@@ -144,7 +144,7 @@ void StdCmdDlgMacroExecuteDirect::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"Run\")");
}
bool StdCmdDlgMacroExecuteDirect::isActive(void)
bool StdCmdDlgMacroExecuteDirect::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("Run");
}
@@ -169,7 +169,7 @@ void StdCmdMacroAttachDebugger::activated(int iMsg)
"RemoteDebugger.attachToRemoteDebugger()");
}
bool StdCmdMacroAttachDebugger::isActive(void)
bool StdCmdMacroAttachDebugger::isActive()
{
return true;
}
@@ -199,7 +199,7 @@ void StdCmdMacroStartDebug::activated(int iMsg)
dbg->stepRun();
}
bool StdCmdMacroStartDebug::isActive(void)
bool StdCmdMacroStartDebug::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("StartDebug");
}
@@ -225,7 +225,7 @@ void StdCmdMacroStopDebug::activated(int iMsg)
Application::Instance->macroManager()->debugger()->tryStop();
}
bool StdCmdMacroStopDebug::isActive(void)
bool StdCmdMacroStopDebug::isActive()
{
static PythonDebugger* dbg = Application::Instance->macroManager()->debugger();
return dbg->isRunning();
@@ -252,7 +252,7 @@ void StdCmdMacroStepOver::activated(int iMsg)
Application::Instance->macroManager()->debugger()->stepOver();
}
bool StdCmdMacroStepOver::isActive(void)
bool StdCmdMacroStepOver::isActive()
{
static PythonDebugger* dbg = Application::Instance->macroManager()->debugger();
return dbg->isRunning();
@@ -279,7 +279,7 @@ void StdCmdMacroStepInto::activated(int iMsg)
Application::Instance->macroManager()->debugger()->stepInto();
}
bool StdCmdMacroStepInto::isActive(void)
bool StdCmdMacroStepInto::isActive()
{
static PythonDebugger* dbg = Application::Instance->macroManager()->debugger();
return dbg->isRunning();
@@ -306,14 +306,14 @@ void StdCmdToggleBreakpoint::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"ToggleBreakpoint\")");
}
bool StdCmdToggleBreakpoint::isActive(void)
bool StdCmdToggleBreakpoint::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("ToggleBreakpoint");
}
namespace Gui {
void CreateMacroCommands(void)
void CreateMacroCommands()
{
CommandManager &rcCmdMgr = Application::Instance->commandManager();
rcCmdMgr.addCommand(new StdCmdDlgMacroRecord());
+1 -1
View File
@@ -39,7 +39,7 @@
// returns a string which represents the object e.g. when printed in python
std::string CommandPy::representation(void) const
std::string CommandPy::representation() const
{
return std::string("<Command object>");
}
+12 -12
View File
@@ -102,12 +102,12 @@ void StdCmdWorkbench::activated(int i)
}
}
bool StdCmdWorkbench::isActive(void)
bool StdCmdWorkbench::isActive()
{
return true;
}
Action * StdCmdWorkbench::createAction(void)
Action * StdCmdWorkbench::createAction()
{
Action *pcAction;
@@ -152,7 +152,7 @@ void StdCmdRecentFiles::activated(int iMsg)
/**
* Creates the QAction object containing the recent files.
*/
Action * StdCmdRecentFiles::createAction(void)
Action * StdCmdRecentFiles::createAction()
{
RecentFilesAction* pcAction = new RecentFilesAction(this, getMainWindow());
pcAction->setObjectName(QLatin1String("recentFiles"));
@@ -192,7 +192,7 @@ void StdCmdRecentMacros::activated(int iMsg)
/**
* Creates the QAction object containing the recent macros.
*/
Action * StdCmdRecentMacros::createAction(void)
Action * StdCmdRecentMacros::createAction()
{
RecentMacrosAction* pcAction = new RecentMacrosAction(this, getMainWindow());
pcAction->setObjectName(QLatin1String("recentMacros"));
@@ -218,7 +218,7 @@ StdCmdAbout::StdCmdAbout()
eType = 0;
}
Action * StdCmdAbout::createAction(void)
Action * StdCmdAbout::createAction()
{
Action *pcAction;
@@ -356,7 +356,7 @@ StdCmdDlgPreferences::StdCmdDlgPreferences()
eType = 0;
}
Action * StdCmdDlgPreferences::createAction(void)
Action * StdCmdDlgPreferences::createAction()
{
Action *pcAction = Command::createAction();
pcAction->setMenuRole(QAction::PreferencesRole);
@@ -803,7 +803,7 @@ void StdCmdTextDocument::activated(int iMsg)
commitCommand();
}
bool StdCmdTextDocument::isActive(void)
bool StdCmdTextDocument::isActive()
{
return hasActiveDocument();
}
@@ -845,8 +845,8 @@ public:
void updateIcon(int mode);
protected:
virtual void activated(int iMsg);
virtual bool isActive(void);
virtual Gui::Action * createAction(void);
virtual bool isActive();
virtual Gui::Action * createAction();
};
StdCmdUserEditMode::StdCmdUserEditMode()
@@ -863,7 +863,7 @@ StdCmdUserEditMode::StdCmdUserEditMode()
this->getGuiApplication()->signalUserEditModeChanged.connect(boost::bind(&StdCmdUserEditMode::updateIcon, this, bp::_1));
}
Gui::Action * StdCmdUserEditMode::createAction(void)
Gui::Action * StdCmdUserEditMode::createAction()
{
Gui::ActionGroup* pcAction = new Gui::ActionGroup(this, Gui::getMainWindow());
pcAction->setDropDownMenu(true);
@@ -928,14 +928,14 @@ void StdCmdUserEditMode::activated(int iMsg)
Gui::Application::Instance->setUserEditMode(iMsg);
}
bool StdCmdUserEditMode::isActive(void)
bool StdCmdUserEditMode::isActive()
{
return true;
}
namespace Gui {
void CreateStdCommands(void)
void CreateStdCommands()
{
CommandManager &rcCmdMgr = Application::Instance->commandManager();
+3 -3
View File
@@ -75,7 +75,7 @@ void StdCmdPart::activated(int iMsg)
updateActive();
}
bool StdCmdPart::isActive(void)
bool StdCmdPart::isActive()
{
return hasActiveDocument();
}
@@ -117,14 +117,14 @@ void StdCmdGroup::activated(int iMsg)
gui->signalScrollToObject(*static_cast<ViewProviderDocumentObject*>(vp));
}
bool StdCmdGroup::isActive(void)
bool StdCmdGroup::isActive()
{
return hasActiveDocument();
}
namespace Gui {
void CreateStructureCommands(void)
void CreateStructureCommands()
{
CommandManager &rcCmdMgr = Application::Instance->commandManager();
+16 -16
View File
@@ -132,7 +132,7 @@ void FCCmdTest1::activated(int iMsg)
Q_UNUSED(iMsg);
}
bool FCCmdTest1::isActive(void)
bool FCCmdTest1::isActive()
{
//return (GetActiveOCCDocument()!=NULL);
return true;
@@ -160,7 +160,7 @@ void FCCmdTest2::activated(int iMsg)
Q_UNUSED(iMsg);
}
bool FCCmdTest2::isActive(void)
bool FCCmdTest2::isActive()
{
return (getDocument()!=nullptr);
}
@@ -190,7 +190,7 @@ void FCCmdTest3::activated(int iMsg)
}
bool FCCmdTest3::isActive(void)
bool FCCmdTest3::isActive()
{
return (getDocument()!=nullptr);
}
@@ -221,7 +221,7 @@ void FCCmdTest4::activated(int iMsg)
}
bool FCCmdTest4::isActive(void)
bool FCCmdTest4::isActive()
{
return (getDocument()!=nullptr);
}
@@ -250,7 +250,7 @@ void FCCmdTest5::activated(int iMsg)
return;
}
bool FCCmdTest5::isActive(void)
bool FCCmdTest5::isActive()
{
return (getDocument()!=nullptr);
}
@@ -280,7 +280,7 @@ void FCCmdTest6::activated(int iMsg)
return;
}
bool FCCmdTest6::isActive(void)
bool FCCmdTest6::isActive()
{
return (getDocument()!=nullptr);
}
@@ -330,7 +330,7 @@ void CmdTestCmdFuncs::activated(int iMsg)
Gui::copyVisualT(objName.c_str(), "DisplayMode", objName.c_str());
}
bool CmdTestCmdFuncs::isActive(void)
bool CmdTestCmdFuncs::isActive()
{
return (getDocument()!=nullptr);
}
@@ -372,7 +372,7 @@ void CmdTestProgress1::activated(int iMsg)
}
}
bool CmdTestProgress1::isActive(void)
bool CmdTestProgress1::isActive()
{
return (!Base::Sequencer().isRunning());
}
@@ -415,7 +415,7 @@ void CmdTestProgress2::activated(int iMsg)
}
}
bool CmdTestProgress2::isActive(void)
bool CmdTestProgress2::isActive()
{
return ( !Base::Sequencer().isRunning() );
}
@@ -485,7 +485,7 @@ void CmdTestProgress3::activated(int iMsg)
}
}
bool CmdTestProgress3::isActive(void)
bool CmdTestProgress3::isActive()
{
return ( !Base::Sequencer().isRunning() );
}
@@ -540,7 +540,7 @@ void CmdTestProgress4::activated(int iMsg)
}
}
bool CmdTestProgress4::isActive(void)
bool CmdTestProgress4::isActive()
{
return (!Base::Sequencer().isRunning());
}
@@ -620,7 +620,7 @@ void CmdTestProgress5::activated(int iMsg)
thr3->start();
}
bool CmdTestProgress5::isActive(void)
bool CmdTestProgress5::isActive()
{
return (!Base::Sequencer().isRunning());
}
@@ -647,7 +647,7 @@ void CmdTestMDI1::activated(int iMsg)
getMainWindow()->removeWindow(mdi);
}
bool CmdTestMDI1::isActive(void)
bool CmdTestMDI1::isActive()
{
return getMainWindow()->activeWindow();
}
@@ -675,7 +675,7 @@ void CmdTestMDI2::activated(int iMsg)
}
}
bool CmdTestMDI2::isActive(void)
bool CmdTestMDI2::isActive()
{
return getMainWindow()->activeWindow();
}
@@ -703,7 +703,7 @@ void CmdTestMDI3::activated(int iMsg)
mdi->show();
}
bool CmdTestMDI3::isActive(void)
bool CmdTestMDI3::isActive()
{
return getMainWindow()->activeWindow();
}
@@ -811,7 +811,7 @@ void CmdTestConsoleOutput::activated(int iMsg)
namespace Gui {
void CreateTestCommands(void)
void CreateTestCommands()
{
CommandManager &rcCmdMgr = Application::Instance->commandManager();
+96 -59
View File
@@ -87,6 +87,37 @@ using namespace Gui;
using Gui::Dialog::DlgSettingsImageImp;
namespace bp = boost::placeholders;
namespace {
// A helper class to open a transaction when changing properties of view providers.
// It uses the same parameter key as the PropertyView to control the behaviour.
class TransactionView {
Gui::Document* document;
public:
static bool getDefault() {
auto hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/PropertyView");
return hGrp->GetBool("AutoTransactionView", false);
}
TransactionView(Gui::Document* doc, const char* name, bool enable = getDefault())
: document(doc)
{
if (document && enable) {
document->openCommand(name);
}
else {
document = nullptr;
}
}
~TransactionView() {
if (document) {
document->commitCommand();
}
}
};
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DEF_STD_CMD_AC(StdOrthographicCamera)
@@ -115,7 +146,7 @@ void StdOrthographicCamera::activated(int iMsg)
}
}
bool StdOrthographicCamera::isActive(void)
bool StdOrthographicCamera::isActive()
{
View3DInventor* view = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
if (view) {
@@ -132,7 +163,7 @@ bool StdOrthographicCamera::isActive(void)
return false;
}
Action * StdOrthographicCamera::createAction(void)
Action * StdOrthographicCamera::createAction()
{
Action *pcAction = Command::createAction();
pcAction->setCheckable(true);
@@ -165,7 +196,7 @@ void StdPerspectiveCamera::activated(int iMsg)
}
}
bool StdPerspectiveCamera::isActive(void)
bool StdPerspectiveCamera::isActive()
{
View3DInventor* view = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
if (view) {
@@ -183,7 +214,7 @@ bool StdPerspectiveCamera::isActive(void)
return false;
}
Action * StdPerspectiveCamera::createAction(void)
Action * StdPerspectiveCamera::createAction()
{
Action *pcAction = Command::createAction();
pcAction->setCheckable(true);
@@ -261,8 +292,8 @@ public:
protected:
virtual void activated(int iMsg);
virtual bool isActive(void);
virtual Action * createAction(void);
virtual bool isActive();
virtual Action * createAction();
virtual void languageChange();
private:
@@ -298,7 +329,7 @@ StdCmdFreezeViews::StdCmdFreezeViews()
eType = Alter3DView;
}
Action * StdCmdFreezeViews::createAction(void)
Action * StdCmdFreezeViews::createAction()
{
ActionGroup* pcAction = new ActionGroup(this, getMainWindow());
pcAction->setDropDownMenu(true);
@@ -500,7 +531,7 @@ void StdCmdFreezeViews::onRestoreViews()
}
}
bool StdCmdFreezeViews::isActive(void)
bool StdCmdFreezeViews::isActive()
{
View3DInventor* view = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
if (view) {
@@ -557,7 +588,7 @@ StdCmdToggleClipPlane::StdCmdToggleClipPlane()
eType = Alter3DView;
}
Action * StdCmdToggleClipPlane::createAction(void)
Action * StdCmdToggleClipPlane::createAction()
{
Action *pcAction = (Action*)Command::createAction();
#if 0
@@ -588,7 +619,7 @@ void StdCmdToggleClipPlane::activated(int iMsg)
#endif
}
bool StdCmdToggleClipPlane::isActive(void)
bool StdCmdToggleClipPlane::isActive()
{
#if 0
View3DInventor* view = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
@@ -623,8 +654,8 @@ public:
void updateIcon(const Gui::MDIView* view);
protected:
virtual void activated(int iMsg);
virtual bool isActive(void);
virtual Gui::Action * createAction(void);
virtual bool isActive();
virtual Gui::Action * createAction();
};
StdCmdDrawStyle::StdCmdDrawStyle()
@@ -641,7 +672,7 @@ StdCmdDrawStyle::StdCmdDrawStyle()
this->getGuiApplication()->signalActivateView.connect(boost::bind(&StdCmdDrawStyle::updateIcon, this, bp::_1));
}
Gui::Action * StdCmdDrawStyle::createAction(void)
Gui::Action * StdCmdDrawStyle::createAction()
{
Gui::ActionGroup* pcAction = new Gui::ActionGroup(this, Gui::getMainWindow());
pcAction->setDropDownMenu(true);
@@ -836,7 +867,7 @@ void StdCmdDrawStyle::activated(int iMsg)
}
}
bool StdCmdDrawStyle::isActive(void)
bool StdCmdDrawStyle::isActive()
{
return Gui::Application::Instance->activeDocument();
}
@@ -863,10 +894,11 @@ StdCmdToggleVisibility::StdCmdToggleVisibility()
void StdCmdToggleVisibility::activated(int iMsg)
{
Q_UNUSED(iMsg);
TransactionView transaction(getActiveGuiDocument(), QT_TRANSLATE_NOOP("Command", "Toggle visibility"));
Selection().setVisible(SelectionSingleton::VisToggle);
}
bool StdCmdToggleVisibility::isActive(void)
bool StdCmdToggleVisibility::isActive()
{
return (Gui::Selection().size() != 0);
}
@@ -898,22 +930,27 @@ void StdCmdToggleSelectability::activated(int iMsg)
std::vector<App::DocumentObject*> sel = Selection().getObjectsOfType
(App::DocumentObject::getClassTypeId(), (*it)->getName());
if (sel.empty()) {
continue;
}
for (std::vector<App::DocumentObject*>::const_iterator ft=sel.begin();ft!=sel.end();++ft) {
ViewProvider *pr = pcDoc->getViewProviderByName((*ft)->getNameInDocument());
TransactionView transaction(pcDoc, QT_TRANSLATE_NOOP("Command", "Toggle selectability"));
for (const auto & ft : sel) {
ViewProvider *pr = pcDoc->getViewProviderByName(ft->getNameInDocument());
if (pr && pr->isDerivedFrom(ViewProviderGeometryObject::getClassTypeId())){
if (static_cast<ViewProviderGeometryObject*>(pr)->Selectable.getValue())
doCommand(Gui,"Gui.getDocument(\"%s\").getObject(\"%s\").Selectable=False"
, (*it)->getName(), (*ft)->getNameInDocument());
, (*it)->getName(), ft->getNameInDocument());
else
doCommand(Gui,"Gui.getDocument(\"%s\").getObject(\"%s\").Selectable=True"
, (*it)->getName(), (*ft)->getNameInDocument());
, (*it)->getName(), ft->getNameInDocument());
}
}
}
}
bool StdCmdToggleSelectability::isActive(void)
bool StdCmdToggleSelectability::isActive()
{
return (Gui::Selection().size() != 0);
}
@@ -941,7 +978,7 @@ void StdCmdShowSelection::activated(int iMsg)
Selection().setVisible(SelectionSingleton::VisShow);
}
bool StdCmdShowSelection::isActive(void)
bool StdCmdShowSelection::isActive()
{
return (Gui::Selection().size() != 0);
}
@@ -969,7 +1006,7 @@ void StdCmdHideSelection::activated(int iMsg)
Selection().setVisible(SelectionSingleton::VisHide);
}
bool StdCmdHideSelection::isActive(void)
bool StdCmdHideSelection::isActive()
{
return (Gui::Selection().size() != 0);
}
@@ -1011,7 +1048,7 @@ void StdCmdSelectVisibleObjects::activated(int iMsg)
rSel.setSelection(app->getName(), visible);
}
bool StdCmdSelectVisibleObjects::isActive(void)
bool StdCmdSelectVisibleObjects::isActive()
{
return App::GetApplication().getActiveDocument();
}
@@ -1052,7 +1089,7 @@ void StdCmdToggleObjects::activated(int iMsg)
}
}
bool StdCmdToggleObjects::isActive(void)
bool StdCmdToggleObjects::isActive()
{
return App::GetApplication().getActiveDocument();
}
@@ -1089,7 +1126,7 @@ void StdCmdShowObjects::activated(int iMsg)
}
}
bool StdCmdShowObjects::isActive(void)
bool StdCmdShowObjects::isActive()
{
return App::GetApplication().getActiveDocument();
}
@@ -1126,7 +1163,7 @@ void StdCmdHideObjects::activated(int iMsg)
}
}
bool StdCmdHideObjects::isActive(void)
bool StdCmdHideObjects::isActive()
{
return App::GetApplication().getActiveDocument();
}
@@ -1164,7 +1201,7 @@ void StdCmdSetAppearance::activated(int iMsg)
#endif
}
bool StdCmdSetAppearance::isActive(void)
bool StdCmdSetAppearance::isActive()
{
#if 0
return Gui::Selection().size() != 0;
@@ -1491,7 +1528,7 @@ void StdCmdViewFitAll::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"ViewFit\")");
}
bool StdCmdViewFitAll::isActive(void)
bool StdCmdViewFitAll::isActive()
{
//return isViewOfType(Gui::View3DInventor::getClassTypeId());
return getGuiApplication()->sendHasMsgToActiveView("ViewFit");
@@ -1522,7 +1559,7 @@ void StdCmdViewFitSelection::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"ViewSelection\")");
}
bool StdCmdViewFitSelection::isActive(void)
bool StdCmdViewFitSelection::isActive()
{
//return isViewOfType(Gui::View3DInventor::getClassTypeId());
return getGuiApplication()->sendHasMsgToActiveView("ViewSelection");
@@ -1551,7 +1588,7 @@ void StdViewDock::activated(int iMsg)
Q_UNUSED(iMsg);
}
bool StdViewDock::isActive(void)
bool StdViewDock::isActive()
{
MDIView* view = getMainWindow()->activeWindow();
return (qobject_cast<View3DInventor*>(view) ? true : false);
@@ -1580,7 +1617,7 @@ void StdViewUndock::activated(int iMsg)
Q_UNUSED(iMsg);
}
bool StdViewUndock::isActive(void)
bool StdViewUndock::isActive()
{
MDIView* view = getMainWindow()->activeWindow();
return (qobject_cast<View3DInventor*>(view) ? true : false);
@@ -1642,7 +1679,7 @@ void StdViewFullscreen::activated(int iMsg)
Q_UNUSED(iMsg);
}
bool StdViewFullscreen::isActive(void)
bool StdViewFullscreen::isActive()
{
MDIView* view = getMainWindow()->activeWindow();
return (qobject_cast<View3DInventor*>(view) ? true : false);
@@ -1669,7 +1706,7 @@ StdViewDockUndockFullscreen::StdViewDockUndockFullscreen()
rcCmdMgr.addCommand(new StdViewFullscreen());
}
Action * StdViewDockUndockFullscreen::createAction(void)
Action * StdViewDockUndockFullscreen::createAction()
{
ActionGroup* pcAction = new ActionGroup(this, getMainWindow());
pcAction->setDropDownMenu(true);
@@ -1740,7 +1777,7 @@ void StdViewDockUndockFullscreen::activated(int iMsg)
}
}
bool StdViewDockUndockFullscreen::isActive(void)
bool StdViewDockUndockFullscreen::isActive()
{
MDIView* view = getMainWindow()->activeWindow();
if (qobject_cast<View3DInventor*>(view)) {
@@ -1785,7 +1822,7 @@ void StdCmdViewVR::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"ViewVR\")");
}
bool StdCmdViewVR::isActive(void)
bool StdCmdViewVR::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("ViewVR");
}
@@ -1958,7 +1995,7 @@ void StdViewScreenShot::activated(int iMsg)
}
}
bool StdViewScreenShot::isActive(void)
bool StdViewScreenShot::isActive()
{
return isViewOfType(Gui::View3DInventor::getClassTypeId());
}
@@ -1988,7 +2025,7 @@ void StdCmdViewCreate::activated(int iMsg)
getActiveGuiDocument()->getActiveView()->viewAll();
}
bool StdCmdViewCreate::isActive(void)
bool StdCmdViewCreate::isActive()
{
return (getActiveGuiDocument()!=nullptr);
}
@@ -2023,7 +2060,7 @@ void StdCmdToggleNavigation::activated(int iMsg)
}
}
bool StdCmdToggleNavigation::isActive(void)
bool StdCmdToggleNavigation::isActive()
{
//#0001087: Inventor Navigation continues with released Mouse Button
//This happens because 'Esc' is also used to close the task dialog.
@@ -2159,7 +2196,7 @@ void StdCmdAxisCross::activated(int iMsg)
}
}
bool StdCmdAxisCross::isActive(void)
bool StdCmdAxisCross::isActive()
{
Gui::View3DInventor* view = qobject_cast<View3DInventor*>(Gui::getMainWindow()->activeWindow());
if (view && view->getViewer()->hasAxisCross()) {
@@ -2201,7 +2238,7 @@ void StdCmdViewExample1::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"Example1\")");
}
bool StdCmdViewExample1::isActive(void)
bool StdCmdViewExample1::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("Example1");
}
@@ -2229,7 +2266,7 @@ void StdCmdViewExample2::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"Example2\")");
}
bool StdCmdViewExample2::isActive(void)
bool StdCmdViewExample2::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("Example2");
}
@@ -2257,7 +2294,7 @@ void StdCmdViewExample3::activated(int iMsg)
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"Example3\")");
}
bool StdCmdViewExample3::isActive(void)
bool StdCmdViewExample3::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("Example3");
}
@@ -2286,7 +2323,7 @@ void StdCmdViewIvStereoOff::activated(int iMsg)
doCommand(Command::Gui,"Gui.activeDocument().activeView().setStereoType(\"Mono\")");
}
bool StdCmdViewIvStereoOff::isActive(void)
bool StdCmdViewIvStereoOff::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("SetStereoOff");
}
@@ -2315,7 +2352,7 @@ void StdCmdViewIvStereoRedGreen::activated(int iMsg)
doCommand(Command::Gui,"Gui.activeDocument().activeView().setStereoType(\"Anaglyph\")");
}
bool StdCmdViewIvStereoRedGreen::isActive(void)
bool StdCmdViewIvStereoRedGreen::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("SetStereoRedGreen");
}
@@ -2343,7 +2380,7 @@ void StdCmdViewIvStereoQuadBuff::activated(int iMsg)
doCommand(Command::Gui,"Gui.activeDocument().activeView().setStereoType(\"QuadBuffer\")");
}
bool StdCmdViewIvStereoQuadBuff::isActive(void)
bool StdCmdViewIvStereoQuadBuff::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("SetStereoQuadBuff");
}
@@ -2371,7 +2408,7 @@ void StdCmdViewIvStereoInterleavedRows::activated(int iMsg)
doCommand(Command::Gui,"Gui.activeDocument().activeView().setStereoType(\"InterleavedRows\")");
}
bool StdCmdViewIvStereoInterleavedRows::isActive(void)
bool StdCmdViewIvStereoInterleavedRows::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("SetStereoInterleavedRows");
}
@@ -2399,7 +2436,7 @@ void StdCmdViewIvStereoInterleavedColumns::activated(int iMsg)
doCommand(Command::Gui,"Gui.activeDocument().activeView().setStereoType(\"InterleavedColumns\")");
}
bool StdCmdViewIvStereoInterleavedColumns::isActive(void)
bool StdCmdViewIvStereoInterleavedColumns::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("SetStereoInterleavedColumns");
}
@@ -2449,7 +2486,7 @@ void StdCmdViewIvIssueCamPos::activated(int iMsg)
getGuiApplication()->macroManager()->addLine(MacroManager::Gui,Temp.c_str());
}
bool StdCmdViewIvIssueCamPos::isActive(void)
bool StdCmdViewIvIssueCamPos::isActive()
{
return getGuiApplication()->sendHasMsgToActiveView("GetCamera");
}
@@ -2483,7 +2520,7 @@ void StdViewZoomIn::activated(int iMsg)
}
}
bool StdViewZoomIn::isActive(void)
bool StdViewZoomIn::isActive()
{
return (qobject_cast<View3DInventor*>(getMainWindow()->activeWindow()));
}
@@ -2516,7 +2553,7 @@ void StdViewZoomOut::activated(int iMsg)
}
}
bool StdViewZoomOut::isActive(void)
bool StdViewZoomOut::isActive()
{
return (qobject_cast<View3DInventor*>(getMainWindow()->activeWindow()));
}
@@ -3124,7 +3161,7 @@ StdCmdTreeSelectAllInstances::StdCmdTreeSelectAllInstances()
eType = AlterSelection;
}
bool StdCmdTreeSelectAllInstances::isActive(void)
bool StdCmdTreeSelectAllInstances::isActive()
{
const auto &sels = Selection().getSelectionEx("*",App::DocumentObject::getClassTypeId(), ResolveMode::OldStyleElement, true);
if(sels.empty())
@@ -3231,7 +3268,7 @@ void StdCmdMeasureDistance::activated(int iMsg)
}
}
bool StdCmdMeasureDistance::isActive(void)
bool StdCmdMeasureDistance::isActive()
{
App::Document* doc = App::GetApplication().getActiveDocument();
if (!doc || doc->countObjectsOfType(App::GeoFeature::getClassTypeId()) == 0)
@@ -3304,7 +3341,7 @@ void StdCmdTextureMapping::activated(int iMsg)
Gui::Control().showDialog(new Gui::Dialog::TaskTextureMapping);
}
bool StdCmdTextureMapping::isActive(void)
bool StdCmdTextureMapping::isActive()
{
Gui::MDIView* view = getMainWindow()->activeWindow();
return view && view->isDerivedFrom(Gui::View3DInventor::getClassTypeId())
@@ -3419,7 +3456,7 @@ void StdCmdSelBack::activated(int iMsg)
Selection().selStackGoBack();
}
bool StdCmdSelBack::isActive(void)
bool StdCmdSelBack::isActive()
{
return Selection().selStackBackSize()>1;
}
@@ -3449,7 +3486,7 @@ void StdCmdSelForward::activated(int iMsg)
Selection().selStackGoForward();
}
bool StdCmdSelForward::isActive(void)
bool StdCmdSelForward::isActive()
{
return !!Selection().selStackForwardSize();
}
@@ -3702,7 +3739,7 @@ public:
addCommand(new StdTreeDrag(),cmds.size());
addCommand(new StdTreeSelection(),cmds.size());
};
}
virtual const char* className() const {return "StdCmdTreeViewActions";}
};
@@ -3734,7 +3771,7 @@ void StdCmdSelBoundingBox::activated(int iMsg)
}
}
bool StdCmdSelBoundingBox::isActive(void)
bool StdCmdSelBoundingBox::isActive()
{
if(_pcAction) {
bool checked = _pcAction->isChecked();
@@ -3744,7 +3781,7 @@ bool StdCmdSelBoundingBox::isActive(void)
return true;
}
Action * StdCmdSelBoundingBox::createAction(void)
Action * StdCmdSelBoundingBox::createAction()
{
Action *pcAction = Command::createAction();
pcAction->setCheckable(true);
@@ -3758,7 +3795,7 @@ Action * StdCmdSelBoundingBox::createAction(void)
namespace Gui {
void CreateViewStdCommands(void)
void CreateViewStdCommands()
{
CommandManager &rcCmdMgr = Application::Instance->commandManager();
+22 -21
View File
@@ -65,7 +65,7 @@ void StdCmdArrangeIcons::activated(int iMsg)
getMainWindow()->arrangeIcons ();
}
bool StdCmdArrangeIcons::isActive(void)
bool StdCmdArrangeIcons::isActive()
{
return !(getMainWindow()->windows().isEmpty());
}
@@ -93,7 +93,7 @@ void StdCmdTileWindows::activated(int iMsg)
getMainWindow()->tile();
}
bool StdCmdTileWindows::isActive(void)
bool StdCmdTileWindows::isActive()
{
return !(getMainWindow()->windows().isEmpty());
}
@@ -121,7 +121,7 @@ void StdCmdCascadeWindows::activated(int iMsg)
getMainWindow()->cascade();
}
bool StdCmdCascadeWindows::isActive(void)
bool StdCmdCascadeWindows::isActive()
{
return !(getMainWindow()->windows().isEmpty());
}
@@ -153,7 +153,7 @@ void StdCmdCloseActiveWindow::activated(int iMsg)
getMainWindow()->closeActiveWindow();
}
bool StdCmdCloseActiveWindow::isActive(void)
bool StdCmdCloseActiveWindow::isActive()
{
return !(getMainWindow()->windows().isEmpty());
}
@@ -181,7 +181,7 @@ void StdCmdCloseAllWindows::activated(int iMsg)
getMainWindow()->closeAllDocuments();
}
bool StdCmdCloseAllWindows::isActive(void)
bool StdCmdCloseAllWindows::isActive()
{
return !(getMainWindow()->windows().isEmpty()) || App::GetApplication().getDocuments().size();
}
@@ -210,7 +210,7 @@ void StdCmdActivateNextWindow::activated(int iMsg)
getMainWindow()->activateNextWindow();
}
bool StdCmdActivateNextWindow::isActive(void)
bool StdCmdActivateNextWindow::isActive()
{
return !(getMainWindow()->windows().isEmpty());
}
@@ -239,7 +239,7 @@ void StdCmdActivatePrevWindow::activated(int iMsg)
getMainWindow()->activatePreviousWindow();
}
bool StdCmdActivatePrevWindow::isActive(void)
bool StdCmdActivatePrevWindow::isActive()
{
return !(getMainWindow()->windows().isEmpty());
}
@@ -312,12 +312,12 @@ void StdCmdDockViewMenu::activated(int iMsg)
Q_UNUSED(iMsg);
}
bool StdCmdDockViewMenu::isActive(void)
bool StdCmdDockViewMenu::isActive()
{
return true;
}
Action * StdCmdDockViewMenu::createAction(void)
Action * StdCmdDockViewMenu::createAction()
{
Action *pcAction;
pcAction = new DockWidgetAction(this, getMainWindow());
@@ -348,12 +348,12 @@ void StdCmdToolBarMenu::activated(int iMsg)
Q_UNUSED(iMsg);
}
bool StdCmdToolBarMenu::isActive(void)
bool StdCmdToolBarMenu::isActive()
{
return true;
}
Action * StdCmdToolBarMenu::createAction(void)
Action * StdCmdToolBarMenu::createAction()
{
Action *pcAction;
pcAction = new ToolBarAction(this, getMainWindow());
@@ -367,16 +367,17 @@ Action * StdCmdToolBarMenu::createAction(void)
class FilterStatusBar : public QObject
{
// Q_OBJECT
// Q_OBJECT
public:
FilterStatusBar(Action * action):QObject(action) {this->action = action;}
// virtual ~FilterStatusBar() {}
FilterStatusBar(Action* action) :QObject(action) { this->action = action; }
// virtual ~FilterStatusBar() {}
protected:
Action * action;
bool eventFilter(QObject *obj, QEvent *event)
Action* action;
bool eventFilter(QObject* obj, QEvent* event) override
{
if (getMainWindow()->findChild<QStatusBar *>() != nullptr && obj == getMainWindow()->statusBar() && ((event->type() == QEvent::Hide) || (event->type() == QEvent::Show))) {
if (getMainWindow() && getMainWindow()->findChild<QStatusBar*>() && obj == getMainWindow()->statusBar() &&
((event->type() == QEvent::Hide) || (event->type() == QEvent::Show))) {
this->action->setChecked(getMainWindow()->statusBar()->isVisible());
}
return false;
@@ -396,7 +397,7 @@ StdCmdStatusBar::StdCmdStatusBar()
eType = 0;
}
Action * StdCmdStatusBar::createAction(void)
Action * StdCmdStatusBar::createAction()
{
Action *pcAction = Command::createAction();
pcAction->setCheckable(true);
@@ -448,12 +449,12 @@ void StdCmdWindowsMenu::activated(int iMsg)
Q_UNUSED(iMsg);
}
bool StdCmdWindowsMenu::isActive(void)
bool StdCmdWindowsMenu::isActive()
{
return true;
}
Action * StdCmdWindowsMenu::createAction(void)
Action * StdCmdWindowsMenu::createAction()
{
// Allow to show 10 menu items in the 'Window' menu and one separator.
// If we have more windows then the user can use the 'Windows...' item.
@@ -483,7 +484,7 @@ Action * StdCmdWindowsMenu::createAction(void)
namespace Gui {
void CreateWindowStdCommands(void)
void CreateWindowStdCommands()
{
CommandManager &rcCmdMgr = Application::Instance->commandManager();
+5 -5
View File
@@ -230,7 +230,7 @@ void ControlSingleton::closedDialog()
| QDockWidget::DockWidgetFloatable);
}
bool ControlSingleton::isAllowedAlterDocument(void) const
bool ControlSingleton::isAllowedAlterDocument() const
{
if (ActiveDialog)
return ActiveDialog->isAllowedAlterDocument();
@@ -238,14 +238,14 @@ bool ControlSingleton::isAllowedAlterDocument(void) const
}
bool ControlSingleton::isAllowedAlterView(void) const
bool ControlSingleton::isAllowedAlterView() const
{
if (ActiveDialog)
return ActiveDialog->isAllowedAlterView();
return true;
}
bool ControlSingleton::isAllowedAlterSelection(void) const
bool ControlSingleton::isAllowedAlterSelection() const
{
if (ActiveDialog)
return ActiveDialog->isAllowedAlterSelection();
@@ -254,14 +254,14 @@ bool ControlSingleton::isAllowedAlterSelection(void) const
// -------------------------------------------
ControlSingleton& ControlSingleton::instance(void)
ControlSingleton& ControlSingleton::instance()
{
if (_pcSingleton == nullptr)
_pcSingleton = new ControlSingleton;
return *_pcSingleton;
}
void ControlSingleton::destruct (void)
void ControlSingleton::destruct ()
{
if (_pcSingleton != nullptr)
delete _pcSingleton;
+1 -1
View File
@@ -128,7 +128,7 @@ private:
};
/// Get the global instance
inline ControlSingleton& Control(void)
inline ControlSingleton& Control()
{
return ControlSingleton::instance();
}
+3 -3
View File
@@ -110,11 +110,11 @@ public:
public:
bool reject();
bool isAllowedAlterDocument(void) const
bool isAllowedAlterDocument() const
{ return true; }
bool isAllowedAlterView(void) const
bool isAllowedAlterView() const
{ return true; }
bool isAllowedAlterSelection(void) const
bool isAllowedAlterSelection() const
{ return true; }
QDialogButtonBox::StandardButtons getStandardButtons() const;
@@ -55,7 +55,7 @@ DlgEditFileIncludePropertyExternal::~DlgEditFileIncludePropertyExternal()
}
int DlgEditFileIncludePropertyExternal::Do(void)
int DlgEditFileIncludePropertyExternal::Do()
{
QFileInfo file = QString::fromUtf8(Prop.getValue());
assert(file.exists());
+1 -1
View File
@@ -42,7 +42,7 @@ public:
DlgEditFileIncludePropertyExternal( App::PropertyFileIncluded& Prop, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() );
virtual ~DlgEditFileIncludePropertyExternal();
int Do(void);
int Do();
protected Q_SLOTS:
protected:
+6 -1
View File
@@ -259,6 +259,8 @@ void DlgGeneralImp::loadSettings()
model->sort(0);
int current = getMainWindow()->iconSize().width();
current = hGrp->GetInt("ToolbarIconSize", current);
ui->toolbarIconSize->clear();
ui->toolbarIconSize->addItem(tr("Small (%1px)").arg(16), QVariant((int)16));
ui->toolbarIconSize->addItem(tr("Medium (%1px)").arg(24), QVariant((int)24));
ui->toolbarIconSize->addItem(tr("Large (%1px)").arg(32), QVariant((int)32));
@@ -270,6 +272,7 @@ void DlgGeneralImp::loadSettings()
}
ui->toolbarIconSize->setCurrentIndex(index);
ui->treeMode->clear();
ui->treeMode->addItem(tr("Combo View"));
ui->treeMode->addItem(tr("TreeView and PropertyView"));
ui->treeMode->addItem(tr("Both"));
@@ -308,6 +311,7 @@ void DlgGeneralImp::loadSettings()
}
// now add all unique items
ui->StyleSheets->clear();
ui->StyleSheets->addItem(tr("No style sheet"), QString::fromLatin1(""));
for (QMap<QString, QString>::iterator it = cssFiles.begin(); it != cssFiles.end(); ++it) {
ui->StyleSheets->addItem(it.key(), it.value());
@@ -333,7 +337,8 @@ void DlgGeneralImp::loadSettings()
}
}
if (index > -1) ui->StyleSheets->setCurrentIndex(index);
if (index > -1)
ui->StyleSheets->setCurrentIndex(index);
}
void DlgGeneralImp::changeEvent(QEvent *e)
+5
View File
@@ -328,6 +328,11 @@ void DlgCustomKeyboardImp::on_editShortcut_textChanged(const QString& sc)
Command* cmd = cCmdMgr.getCommandByName(name.constData());
if (cmd && !cmd->getAction()) {
Base::Console().Warning("Command %s not in use yet\n", cmd->getName());
QMessageBox::warning(this,
tr("Command not in use yet"),
tr("The command '%1' is loaded but not in use yet, so it can't be assigned a new shortcut.\n"
"To enable assignment, please make '%2' the active workbench").arg(data.toString(),ui->categoryBox->currentText()),
QMessageBox::Ok);
ui->buttonAssign->setEnabled(false); // command not in use
return;
}
+2 -2
View File
@@ -110,7 +110,7 @@ DlgMacroExecuteImp::~DlgMacroExecuteImp()
/**
* Fills up the list with all macro files found in the specified location.
*/
void DlgMacroExecuteImp::fillUpList(void)
void DlgMacroExecuteImp::fillUpList()
{
// lists all files in macro path
QDir dir(this->macroPath, QLatin1String("*.FCMacro *.py"));
@@ -409,7 +409,7 @@ void DlgMacroExecuteImp::on_deleteButton_clicked()
MacroItem * mitem = static_cast<MacroItem *>(item);
if (mitem->systemWide) {
QMessageBox::critical(qApp->activeWindow(), QObject::tr("Delete macro"),
QMessageBox::critical(Gui::getMainWindow(), QObject::tr("Delete macro"),
QObject::tr("Not allowed to delete system-wide macros"));
return;
}
+1 -1
View File
@@ -65,7 +65,7 @@ protected Q_SLOTS:
void on_tabMacroWidget_currentChanged(int index);
protected:
void fillUpList(void);
void fillUpList();
protected:
QString macroPath;
+1 -1
View File
@@ -937,7 +937,7 @@ ParameterGroupItem::~ParameterGroupItem()
_hcGrp->ClearObserver();
}
void ParameterGroupItem::fillUp(void)
void ParameterGroupItem::fillUp()
{
// filling up groups
std::vector<Base::Reference<ParameterGrp> > vhcParamGrp = _hcGrp->GetGroups();
+1 -1
View File
@@ -220,7 +220,7 @@ public:
void setData ( int column, int role, const QVariant & value );
QVariant data ( int column, int role ) const;
void fillUp(void);
void fillUp();
Base::Reference<ParameterGrp> _hcGrp;
};
+46 -13
View File
@@ -36,11 +36,13 @@
#include <App/Application.h>
#include <Base/Console.h>
#include <Base/Exception.h>
#include <Base/Tools.h>
#include "DlgPreferencesImp.h"
#include "ui_DlgPreferences.h"
#include "BitmapFactory.h"
#include "MainWindow.h"
#include "Tools.h"
#include "WidgetFactory.h"
@@ -65,7 +67,9 @@ DlgPreferencesImp::DlgPreferencesImp(QWidget* parent, Qt::WindowFlags fl)
invalidParameter(false), canEmbedScrollArea(true)
{
ui->setupUi(this);
ui->listBox->setFixedWidth(108);
QFontMetrics fm(font());
int length = QtTools::horizontalAdvance(fm, longestGroupName());
ui->listBox->setFixedWidth(Base::clamp<int>(length + 20, 108, 120));
ui->listBox->setGridSize(QSize(108, 75));
connect(ui->buttonBox, SIGNAL (helpRequested()),
@@ -106,6 +110,17 @@ void DlgPreferencesImp::setupPages()
ui->listBox->setCurrentRow(0);
}
QString DlgPreferencesImp::longestGroupName() const
{
std::string name;
for (const auto &group : _pages) {
if (group.first.size() > name.size())
name = group.first;
}
return QString::fromStdString(name);
}
/**
* Create the necessary widgets for a new group named \a groupName. Returns a
* pointer to the group's QTabWidget: that widget's lifetime is managed by the
@@ -122,11 +137,20 @@ QTabWidget* DlgPreferencesImp::createTabForGroup(const std::string &groupName)
QListWidgetItem* item = new QListWidgetItem(ui->listBox);
item->setData(GroupNameRole, QVariant(groupNameQString));
item->setText(QObject::tr(groupNameQString.toLatin1()));
item->setToolTip(QObject::tr(groupNameQString.toLatin1()));
// for Part/PD we need another tooltip since this group is for 2 WBs
if (groupName.compare("Part/Part Design") == 0)
item->setToolTip(QObject::tr(QString::fromStdString("Part and Part Design workbench").toLatin1()));
else
item->setToolTip(QObject::tr(groupNameQString.toLatin1()));
std::string fileName = groupName;
for (auto & ch : fileName) {
if (ch == ' ') ch = '_';
else ch = tolower(ch);
// for Part/PD the filename cannot be groupName since this group is for 2 WBs
if (groupName.compare("Part/Part Design") == 0)
fileName = "Part design";
for (auto &ch : fileName) {
if (ch == ' ')
ch = '_';
else
ch = tolower(ch);
}
fileName = std::string("preferences-") + fileName;
QPixmap icon = Gui::BitmapFactory().pixmapFromSvg(fileName.c_str(), QSize(48, 48));
@@ -152,15 +176,24 @@ QTabWidget* DlgPreferencesImp::createTabForGroup(const std::string &groupName)
*/
void DlgPreferencesImp::createPageInGroup(QTabWidget *tabWidget, const std::string &pageName)
{
PreferencePage* page = WidgetFactory().createPreferencePage(pageName.c_str());
if (page) {
tabWidget->addTab(page, page->windowTitle());
page->loadSettings();
page->setProperty("GroupName", tabWidget->property("GroupName"));
page->setProperty("PageName", QVariant(QString::fromStdString(pageName)));
try {
PreferencePage* page = WidgetFactory().createPreferencePage(pageName.c_str());
if (page) {
tabWidget->addTab(page, page->windowTitle());
page->loadSettings();
page->setProperty("GroupName", tabWidget->property("GroupName"));
page->setProperty("PageName", QVariant(QString::fromStdString(pageName)));
}
else {
Base::Console().Warning("%s is not a preference page\n", pageName.c_str());
}
}
else {
Base::Console().Warning("%s is not a preference page\n", pageName.c_str());
catch (const Base::Exception& e) {
Base::Console().Error("Base exception thrown for '%s'\n", pageName.c_str());
e.ReportException();
}
catch (const std::exception& e) {
Base::Console().Error("C++ exception thrown for '%s' (%s)\n", pageName.c_str(), e.what());
}
}
+1
View File
@@ -143,6 +143,7 @@ private:
void createPageInGroup(QTabWidget* tabWidget, const std::string& pageName);
void applyChanges();
void restoreDefaults();
QString longestGroupName() const;
//@}
private:
+5 -5
View File
@@ -66,7 +66,7 @@ DlgRunExternal::~DlgRunExternal()
delete ui;
}
int DlgRunExternal::Do(void)
int DlgRunExternal::Do()
{
QFileInfo ifo (ProcName);
@@ -79,23 +79,23 @@ int DlgRunExternal::Do(void)
return exec();
}
void DlgRunExternal::reject (void)
void DlgRunExternal::reject ()
{
QDialog::reject();
}
void DlgRunExternal::accept (void)
void DlgRunExternal::accept ()
{
QDialog::accept();
}
void DlgRunExternal::abort (void)
void DlgRunExternal::abort ()
{
process.terminate();
DlgRunExternal::reject();
}
void DlgRunExternal::advanced (void)
void DlgRunExternal::advanced ()
{
if (advancedHidden){
ui->extensionWidget->show();
+1
View File
@@ -25,6 +25,7 @@
#include <QDialog>
#include <QProcess>
#include <FCGlobal.h>
namespace Gui {
namespace Dialog {
+2 -2
View File
@@ -180,13 +180,13 @@ void DlgUnitsCalculator::parseError(const QString& errorText)
ui->ValueOutput->setText(errorText);
}
void DlgUnitsCalculator::copy(void)
void DlgUnitsCalculator::copy()
{
QClipboard *cb = QApplication::clipboard();
cb->setText(ui->ValueOutput->text());
}
void DlgUnitsCalculator::returnPressed(void)
void DlgUnitsCalculator::returnPressed()
{
if (ui->pushButton_Copy->isEnabled()) {
ui->textEdit->append(ui->ValueInput->text() + QString::fromLatin1(" = ") + ui->ValueOutput->text());
+2 -2
View File
@@ -56,8 +56,8 @@ protected Q_SLOTS:
void on_comboBoxScheme_activated(int);
void on_spinBoxDecimals_valueChanged(int);
void copy(void);
void returnPressed(void);
void copy();
void returnPressed();
void parseError(const QString& errorText);
+3 -3
View File
@@ -63,15 +63,15 @@ public:
*/
//@{
/// get called when the document is updated
virtual void onUpdate(void){}
virtual void onUpdate(){}
/// returns the name of the view (important for messages)
virtual const char *getName(void) const { return "DockWindow"; }
virtual const char *getName() const { return "DockWindow"; }
/// Message handler
virtual bool onMsg(const char* ,const char** ){ return false; }
/// Message handler test
virtual bool onHasMsg(const char*) const { return false; }
/// overwrite when checking on close state
virtual bool canClose(void){return true;}
virtual bool canClose(){return true;}
//@}
Q_SIGNALS:
+17 -17
View File
@@ -457,11 +457,11 @@ void Document::setEditingTransform(const Base::Matrix4D &mat) {
activeView->getViewer()->setEditingTransform(mat);
}
void Document::resetEdit(void) {
void Document::resetEdit() {
Application::Instance->setEditDocument(nullptr);
}
void Document::_resetEdit(void)
void Document::_resetEdit()
{
std::list<Gui::BaseView*>::iterator it;
if (d->_editViewProvider) {
@@ -1036,7 +1036,7 @@ std::vector<std::pair<ViewProviderDocumentObject*,int> > Document::getViewProvid
return ret;
}
App::Document* Document::getDocument(void) const
App::Document* Document::getDocument() const
{
return d->_pcDocument;
}
@@ -1130,7 +1130,7 @@ bool Document::askIfSavingFailed(const QString& error)
}
/// Save the document
bool Document::save(void)
bool Document::save()
{
if (d->_pcDocument->isSaved()) {
try {
@@ -1213,7 +1213,7 @@ bool Document::save(void)
}
/// Save the document under a new file name
bool Document::saveAs(void)
bool Document::saveAs()
{
getMainWindow()->showMessage(QObject::tr("Save document under new filename..."));
@@ -1314,7 +1314,7 @@ void Document::saveAll()
}
/// Save a copy of the document under a new file name
bool Document::saveCopy(void)
bool Document::saveCopy()
{
getMainWindow()->showMessage(QObject::tr("Save a copy of the document under new filename..."));
@@ -1339,7 +1339,7 @@ bool Document::saveCopy(void)
}
}
unsigned int Document::getMemSize (void) const
unsigned int Document::getMemSize () const
{
unsigned int size = 0;
@@ -1918,7 +1918,7 @@ void Document::detachView(Gui::BaseView* pcView, bool bPassiv)
}
}
void Document::onUpdate(void)
void Document::onUpdate()
{
#ifdef FC_LOGUPDATECHAIN
Base::Console().Log("Acti: Gui::Document::onUpdate()");
@@ -1935,7 +1935,7 @@ void Document::onUpdate(void)
}
}
void Document::onRelabel(void)
void Document::onRelabel()
{
#ifdef FC_LOGUPDATECHAIN
Base::Console().Log("Acti: Gui::Document::onRelabel()");
@@ -1954,7 +1954,7 @@ void Document::onRelabel(void)
d->connectChangeDocumentBlocker.unblock();
}
bool Document::isLastView(void)
bool Document::isLastView()
{
if (d->baseViews.size() <= 1)
return true;
@@ -2113,7 +2113,7 @@ bool Document::sendMsgToFirstView(const Base::Type& typeId, const char* pMsg, co
}
/// Getter for the active view
MDIView* Document::getActiveView(void) const
MDIView* Document::getActiveView() const
{
// get the main window's active view
MDIView* active = getMainWindow()->activeWindow();
@@ -2276,29 +2276,29 @@ void Document::openCommand(const char* sName)
getDocument()->openTransaction(sName);
}
void Document::commitCommand(void)
void Document::commitCommand()
{
getDocument()->commitTransaction();
}
void Document::abortCommand(void)
void Document::abortCommand()
{
getDocument()->abortTransaction();
}
bool Document::hasPendingCommand(void) const
bool Document::hasPendingCommand() const
{
return getDocument()->hasPendingTransaction();
}
/// Get a string vector with the 'Undo' actions
std::vector<std::string> Document::getUndoVector(void) const
std::vector<std::string> Document::getUndoVector() const
{
return getDocument()->getAvailableUndoNames();
}
/// Get a string vector with the 'Redo' actions
std::vector<std::string> Document::getRedoVector(void) const
std::vector<std::string> Document::getRedoVector() const
{
return getDocument()->getAvailableRedoNames();
}
@@ -2401,7 +2401,7 @@ void Document::redo(int iSteps)
d->_redoViewProviders.clear();
}
PyObject* Document::getPyObject(void)
PyObject* Document::getPyObject()
{
_pcDocPy->IncRef();
return _pcDocPy;
+17 -17
View File
@@ -141,13 +141,13 @@ public:
/** @name I/O of the document */
//@{
unsigned int getMemSize (void) const;
unsigned int getMemSize () const;
/// Save the document
bool save(void);
bool save();
/// Save the document under a new file name
bool saveAs(void);
bool saveAs();
/// Save a copy of the document under a new file name
bool saveCopy(void);
bool saveCopy();
/// Save all open document
static void saveAll();
/// This method is used to save properties or very small amounts of data to an XML document.
@@ -170,12 +170,12 @@ public:
bool isModified() const;
/// Getter for the App Document
App::Document* getDocument(void) const;
App::Document* getDocument() const;
/** @name methods for View handling */
//@{
/// Getter for the active view
Gui::MDIView* getActiveView(void) const;
Gui::MDIView* getActiveView() const;
void setActiveWindow(Gui::MDIView* view);
Gui::MDIView* getEditingViewOfViewProvider(Gui::ViewProvider*) const;
Gui::MDIView* getViewOfViewProvider(const Gui::ViewProvider*) const;
@@ -207,9 +207,9 @@ public:
/// Get all view providers along the path and the corresponding node index in the path
std::vector<std::pair<ViewProviderDocumentObject*,int> > getViewProvidersByPath(SoPath * path) const;
/// call update on all attached views
void onUpdate(void);
void onUpdate();
/// call relabel to all attached views
void onRelabel(void);
void onRelabel();
/// returns a list of all attached MDI views
std::list<MDIView*> getMDIViews() const;
/// returns a list of all MDI views of a certain type
@@ -244,9 +244,9 @@ public:
const Base::Matrix4D &getEditingTransform() const;
void setEditingTransform(const Base::Matrix4D &mat);
/// reset from edit mode, this cause all document to reset edit
void resetEdit(void);
void resetEdit();
/// reset edit of this document
void _resetEdit(void);
void _resetEdit();
/// get the in edit ViewProvider or NULL
ViewProvider *getInEdit(ViewProviderDocumentObject **parentVp=nullptr,
std::string *subname=nullptr, int *mode=nullptr, std::string *subElement=nullptr) const;
@@ -265,15 +265,15 @@ public:
/// Open a new Undo transaction on the document
void openCommand(const char* sName=nullptr);
/// Commit the Undo transaction on the document
void commitCommand(void);
void commitCommand();
/// Abort the Undo transaction on the document
void abortCommand(void);
void abortCommand();
/// Check if an Undo transaction is open
bool hasPendingCommand(void) const;
bool hasPendingCommand() const;
/// Get an Undo string vector with the Undo names
std::vector<std::string> getUndoVector(void) const;
std::vector<std::string> getUndoVector() const;
/// Get an Redo string vector with the Redo names
std::vector<std::string> getRedoVector(void) const;
std::vector<std::string> getRedoVector() const;
/// Will UNDO one or more steps
void undo(int iSteps);
/// Will REDO one or more steps
@@ -288,12 +288,12 @@ public:
/// handles the application close event
bool canClose(bool checkModify=true, bool checkLink=false);
bool isLastView(void);
bool isLastView();
/// called by Application before being deleted
void beforeDelete();
virtual PyObject *getPyObject(void);
virtual PyObject *getPyObject();
const char *getCameraSettings() const;
bool saveCameraSettings(const char *) const;
+8 -8
View File
@@ -50,7 +50,7 @@
using namespace Gui;
// returns a string which represent the object e.g. when printed in python
std::string DocumentPy::representation(void) const
std::string DocumentPy::representation() const
{
std::stringstream str;
str << "<GUI Document object at " << getDocumentPtr() << ">";
@@ -377,7 +377,7 @@ PyObject* DocumentPy::toggleInSceneGraph(PyObject *args) {
Py_Return;
}
Py::Object DocumentPy::getActiveObject(void) const
Py::Object DocumentPy::getActiveObject() const
{
App::DocumentObject *object = getDocumentPtr()->getDocument()->getActiveObject();
if (object) {
@@ -394,7 +394,7 @@ void DocumentPy::setActiveObject(Py::Object /*arg*/)
throw Py::AttributeError("'Document' object attribute 'ActiveObject' is read-only");
}
Py::Object DocumentPy::getActiveView(void) const
Py::Object DocumentPy::getActiveView() const
{
Gui::MDIView *view = getDocumentPtr()->getActiveView();
if (view) {
@@ -411,7 +411,7 @@ void DocumentPy::setActiveView(Py::Object /*arg*/)
throw Py::AttributeError("'Document' object attribute 'ActiveView' is read-only");
}
Py::Object DocumentPy::getDocument(void) const
Py::Object DocumentPy::getDocument() const
{
App::Document *doc = getDocumentPtr()->getDocument();
if (doc) {
@@ -423,7 +423,7 @@ Py::Object DocumentPy::getDocument(void) const
}
}
Py::Object DocumentPy::getEditingTransform(void) const
Py::Object DocumentPy::getEditingTransform() const
{
return Py::asObject(new Base::MatrixPy(new Base::Matrix4D(
getDocumentPtr()->getEditingTransform())));
@@ -438,7 +438,7 @@ void DocumentPy::setEditingTransform(Py::Object arg)
*static_cast<Base::MatrixPy*>(arg.ptr())->getMatrixPtr());
}
Py::Object DocumentPy::getInEditInfo(void) const {
Py::Object DocumentPy::getInEditInfo() const {
ViewProviderDocumentObject *vp = nullptr;
std::string subname,subelement;
int mode = 0;
@@ -462,7 +462,7 @@ void DocumentPy::setInEditInfo(Py::Object arg)
pyobj)->getViewProviderDocumentObjectPtr(),subname);
}
Py::Int DocumentPy::getEditMode(void) const
Py::Int DocumentPy::getEditMode() const
{
int mode = -1;
getDocumentPtr()->getInEdit(nullptr,nullptr,&mode);
@@ -475,7 +475,7 @@ Py::Boolean DocumentPy::getTransacting() const
return Py::Boolean(getDocumentPtr()->isPerformingTransaction());
}
Py::Boolean DocumentPy::getModified(void) const
Py::Boolean DocumentPy::getModified() const
{
return Py::Boolean(getDocumentPtr()->isModified());
}
+7 -7
View File
@@ -311,7 +311,7 @@ bool EditorView::onHasMsg(const char* pMsg) const
}
/** Checking on close state. */
bool EditorView::canClose(void)
bool EditorView::canClose()
{
if ( !d->textEdit->document()->isModified() )
return true;
@@ -341,7 +341,7 @@ void EditorView::setDisplayName(EditorView::DisplayName type)
/**
* Saves the content of the editor to a file specified by the appearing file dialog.
*/
bool EditorView::saveAs(void)
bool EditorView::saveAs()
{
QString fn = FileDialog::getSaveFileName(this, QObject::tr("Save Macro"),
QString(), QString::fromLatin1("%1 (*.FCMacro);;Python (*.py)").arg(tr("FreeCAD macro")));
@@ -382,7 +382,7 @@ bool EditorView::open(const QString& fileName)
* Copies the selected text to the clipboard and deletes it from the text edit.
* If there is no selected text nothing happens.
*/
void EditorView::cut(void)
void EditorView::cut()
{
d->textEdit->cut();
}
@@ -390,7 +390,7 @@ void EditorView::cut(void)
/**
* Copies any selected text to the clipboard.
*/
void EditorView::copy(void)
void EditorView::copy()
{
d->textEdit->copy();
}
@@ -399,7 +399,7 @@ void EditorView::copy(void)
* Pastes the text from the clipboard into the text edit at the current cursor position.
* If there is no text in the clipboard nothing happens.
*/
void EditorView::paste(void)
void EditorView::paste()
{
d->textEdit->paste();
}
@@ -408,7 +408,7 @@ void EditorView::paste(void)
* Undoes the last operation.
* If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.
*/
void EditorView::undo(void)
void EditorView::undo()
{
d->lock = true;
if (!d->undos.isEmpty()) {
@@ -423,7 +423,7 @@ void EditorView::undo(void)
* Redoes the last operation.
* If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.
*/
void EditorView::redo(void)
void EditorView::redo()
{
d->lock = true;
if (!d->redos.isEmpty()) {
+3 -3
View File
@@ -66,13 +66,13 @@ public:
void setDisplayName(DisplayName);
void OnChange(Base::Subject<const char*> &rCaller,const char* rcReason);
const char *getName(void) const {return "EditorView";}
void onUpdate(void){}
const char *getName() const {return "EditorView";}
void onUpdate(){}
bool onMsg(const char* pMsg,const char** ppReturn);
bool onHasMsg(const char* pMsg) const;
bool canClose(void);
bool canClose();
/** @name Standard actions of the editor */
//@{
+4 -2
View File
@@ -53,13 +53,15 @@ void ExpressionBindingPy::init_type()
PyObject *ExpressionBindingPy::PyMake(struct _typeobject *, PyObject * args, PyObject *)
{
Py::Tuple tuple(args);
PyObject* pyObj;
if (!PyArg_ParseTuple(args,"O", &pyObj))
return nullptr;
ExpressionBinding* expr = nullptr;
PythonWrapper wrap;
wrap.loadWidgetsModule();
QWidget* obj = dynamic_cast<QWidget*>(wrap.toQObject(tuple.getItem(0)));
QWidget* obj = dynamic_cast<QWidget*>(wrap.toQObject(Py::Object(pyObj)));
if (obj) {
do {
QuantitySpinBox* sb = qobject_cast<QuantitySpinBox*>(obj);
+1 -1
View File
@@ -31,7 +31,7 @@ class ExpressionBinding;
class ExpressionBindingPy : public Py::PythonExtension<ExpressionBindingPy>
{
public:
static void init_type(void); // announce properties and methods
static void init_type(); // announce properties and methods
ExpressionBindingPy(ExpressionBinding*);
~ExpressionBindingPy();

Some files were not shown because too many files have changed in this diff Show More