Compare commits

...

667 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
wmayer 68e337670e Fem: remove string from translation 2022-06-14 01:43:45 +02:00
wmayer 3158be46ad Fem: added signals and slots to notify when first function is added 2022-06-14 01:38:55 +02:00
Uwe 02b66ca461 [Win installer] refine deletion script
- remove more unnecessary files for the installer
2022-06-14 01:22:20 +02:00
Uwe 74c2ad4bf0 [FEM] point filter: use a LineEdit to output value
- that one copy the result to the clipboard
- also fix a typo
2022-06-14 01:21:17 +02:00
Uwe 522c91ce79 [FEM] next try to proper revert 2022-06-14 00:58:08 +02:00
Uwe e8d65c22d6 Revert "Fixing principal stress plots part 2"
This reverts commit 166eee5eed.
2022-06-14 00:40:51 +02:00
FEA-eng 166eee5eed Fixing principal stress plots part 2
https://forum.freecadweb.org/viewtopic.php?f=18&t=69385
2022-06-13 19:52:16 +02:00
FEA-eng 3af54a7dda Fixing principal stress plots part 1
https://forum.freecadweb.org/viewtopic.php?f=18&t=69385
2022-06-13 19:51:53 +02:00
wmayer 7fa294fd7a Fem: for PointMarker and DataMarker use the internal name instead of label, in customEvent() do not expect a fix name 2022-06-13 17:37:26 +02:00
wmayer 7400b11870 Fem: in FEM_PostFilterLinearizedStresses command do not use a hard-coded object name but that of the selected FemPostDataAlongLineFilter 2022-06-13 17:08:58 +02:00
wmayer 915371aa70 Fem: do not use the Label property but the internal name to access an FEM post object via Python 2022-06-13 17:01:38 +02:00
wmayer 7b225789da Fem: do not access the active document but the document the FEM post object is part of 2022-06-13 16:46:15 +02:00
wmayer c0cccf7f7e Gui: add overloaded version of cmdAppDocument and cmdGuiDocument() that has a string as first parameter 2022-06-13 15:21:55 +02:00
Chris Hennes 5219718eb0 GUI: Preliminary support for HiDPI splashscreen 2022-06-13 15:19:40 +02:00
marioalexis 4b1004b33a Base: Improve docstrings in BoundBoxPy.xml 2022-06-13 08:42:40 -04:00
wmayer 9aa14b36a3 Fem: use WeakPtrT classes instead of raw pointers to avoid possible dangling pointers and to avoid undefined behaviour if a wrong static_cast is performed 2022-06-13 14:21:18 +02:00
wmayer 876ef07480 Gui: implement '*' operator for weak pointer classes 2022-06-13 13:52:34 +02:00
wmayer 9e68e5f290 App: implement '*' operator for weak pointer classes 2022-06-13 13:52:21 +02:00
wmayer 27a36156f6 Fem: improve TaskPostDataAtPoint:
* refactor TaskPostDataAtPoint::on_Field_activated()
* show results in a label instead of message box to reduce clicks
* in output window also print field and position as the pure values are useless
2022-06-13 12:31:37 +02:00
wmayer 09f1b14cc9 Fem: remove several superfluous casts 2022-06-13 11:14:29 +02:00
wmayer e0487b62a6 Gui: [skip ci] set Std_LinkMakeRelative as WhatsThis name 2022-06-13 11:01:36 +02:00
wmayer 741fdc53c7 Base: unset flag to skip leading whitespaces when copying a file 2022-06-13 08:43:58 +02:00
Uwe 832f181ec0 [Gui] make What's This? work for sublinks 2022-06-13 02:42:37 +02:00
Uwe 2a8f85d95c [FEM] make post filter Ui std::unique_ptr 2022-06-13 01:59:46 +02:00
Uwe 227e568b4f [FEM] cut and clip filter: handle new functions
- on adding a new function, it should be used
- there is still a bug, see the added FIXME
2022-06-13 01:42:58 +02:00
Uwe f0e735ed33 [FEM] line filter resolution fix
a resolution of zero is senseless, thus set minimum to 1
2022-06-12 23:09:33 +02:00
Uwe ebd1afc5d9 [FEM] fix 2 crashes with line and scalar filter
- same crash origin like the crash fixed earlier today: https://github.com/FreeCAD/FreeCAD/commit/7b0b83a2e4
2022-06-12 22:18:59 +02:00
wmayer 9065058265 plugin: [skip ci] copy sizeHint handling to QuantitySpinBox implementation in QtDesigner plugin 2022-06-12 21:56:08 +02:00
wmayer 0a79760745 Gui: set a minimum width for quantity spin boxes in FEM dialogs to ignore the results of (minimum)sizeHint() 2022-06-12 20:25:40 +02:00
wmayer ac3390de12 Gui: add function to determine size that a quantity spin box would need to display a certain text 2022-06-12 20:01:41 +02:00
Kuzemko Alexsandr c2cfccf268 Crowdin Add some menu text for translation. 2022-06-12 13:02:41 -04:00
Uwe 505de3215b [GUI] fix screenshot watermark
as reported here: https://forum.freecadweb.org/viewtopic.php?p=601651#p601651
2022-06-12 18:39:14 +02:00
Uwe 4f91499ada [FEM] line filter, resolution tweak
- disable keyboard tracking for the resolution
2022-06-12 18:22:24 +02:00
Uwe 4813e30703 [FEM] fix line filter resolution
- when the resolution changes, the data must be refreshed for visualization and the plot
2022-06-12 18:18:26 +02:00
Uwe 8bbf9b8347 [Main] change URL
as reported in the forum: https://forum.freecadweb.org/viewtopic.php?p=601657#p601657
we should use our new URL
2022-06-12 18:12:28 +02:00
Uwe 3528c626e7 [FEM] fix plots of line filter
- when the line geometry changed, the axis data must be refreshed to get correct plots
2022-06-12 17:24:41 +02:00
Uwe a06cc956c5 [FEM] function dialogs size fix
- as suggested in https://github.com/FreeCAD/FreeCAD/commit/d4c180e9538d570a05849b22d4acc8f8624d0878#r75908012
the labels should have maximum size policy
2022-06-12 16:52:41 +02:00
Uwe e2856395a3 [FEM] remove hardcoding of spinbox sizes 2022-06-12 16:40:41 +02:00
Uwe a3a97d7b5e [FEM] fixes for line filter
- on changing a point coordinate, either by clicking a point or by changing the spinbox in the dialog, the color bar must be refreshed and data must be evaluated for all fields along the new line
2022-06-12 16:35:08 +02:00
Uwe 0c43dab796 [FEM] function dialogs fix
- keyboard tracking must be turned off
2022-06-12 16:25:02 +02:00
Uwe 298fb8983d [FEM] fix along line dialog
- as suggested in https://github.com/FreeCAD/FreeCAD/commit/d4c180e9538d570a05849b22d4acc8f8624d0878#r75908012
- keyboard tracking must be turned off
2022-06-12 16:17:21 +02:00
Zheng, Lei 75546946db Spreadsheet: fix border rendering for merged cells 2022-06-12 16:11:59 +02:00
Zheng, Lei 4d19e611f8 Spreadsheet: fix binding of merged cells 2022-06-12 16:11:59 +02:00
Zheng, Lei 47a5a6302e Spreadsheet: replace obsolete href with hiddenref in binding 2022-06-12 16:11:59 +02:00
Uwe 7b0b83a2e4 [FEM] fix crash with data point filter
- when the filter is upon another filter that e.g. clipped all data, we cannot access data
2022-06-12 14:56:54 +02:00
wmayer d81b016b2a PD: several fixes of shape binder:
* add action to context-menu to remove an element
* use an exclusive button group to avoid to have several buttons pressed at the same time
* allow to completely clear the support
* when pressing OK/Cancel then operate on the document the shape binder is part of (which isn't necessarily the active document)
* remove obsolete parameter from ViewProviderShapeBinder::highlightReferences()
2022-06-12 14:03:42 +02:00
wmayer 5a432fe9ac PD: allow to clear the shape when nullifying the Support property 2022-06-12 14:01:19 +02:00
Zheng, Lei e6a6d838a6 Spreadsheet: fix range selection 2022-06-12 13:51:09 +02:00
Yorik van Havre f3a8edcb5e Merge pull request #7004 from Roy-043/Arch-ArchSectionPlane-always-showed-plan-symbols-of-windows
Arch: ArchSectionPlane always showed plan symbols of windows
2022-06-12 11:58:40 +02:00
Yorik van Havre baa1105a53 Merged crowdin translations 2022-06-12 11:56:37 +02:00
Uwe 6c1c63cffe [FEM] point filter: fix data display for coordinate change
- not only by clicking the data must be shown, also by changing a single coordinate value in the dialog.
2022-06-12 04:51:19 +02:00
Uwe 9ef72fcd06 [FEM] fix color bar handling of point filter
- recoloring the gradient bar for a single point is senseless. One therefore already got dozens of errors that max = min in the console. Therefore don't recolor for point filters
2022-06-12 04:02:11 +02:00
Uwe 7521cfc7a0 [FEM] fix point filter output
fixes #7008:

- the point data must be read also when the center changed
- when the dialog is called it has only the value for the current field, thus recompute the feature to fill all fields with data
- on clicking on a mesh point display the value at the clicked position
- due to the object's recomputation at the start, a complete recomputation (for the whole pipeline) is needed on closing the dialog
2022-06-12 03:34:02 +02:00
Uwe 6d23205704 [FEM] fix display of point filter
- results of 1e8 or 1e-7 in fixed notation are almost unreadable, therefore use scientific notation if necessary
2022-06-12 01:05:26 +02:00
wmayer 30706f4d0f PD: allow to set object in shape binder dialog by typing its name 2022-06-12 00:38:48 +02:00
Uwe 6a877f7e29 [FEM] point filter: fix initialization issue
- we cannot assume to have a geometry at position (0, 0, 1) this initialize at (0, 0, 0)
- also don't hardcode the unit in the UI file

- also fix wrong property description
- property "Radius" is not used in the code and it seems it is only there as copy paste bug once the point filter was implemented. However close to a release, keep the property and just mention it is unused.
2022-06-12 00:25:58 +02:00
wmayer 007a5b351a PD: use WeakPtr to avoid any possible dangling pointers 2022-06-11 23:37:33 +02:00
VM4Dim 9010b88b22 Fix for non-Latin Group name in Tree View 2022-06-11 15:24:25 -04:00
wmayer a106f55ebe PD: show object label instead of internal name in shape binder dialog 2022-06-11 21:00:15 +02:00
wmayer b8434f2ddc Test: [skip ci] extend test for issue #6949 2022-06-11 16:10:09 +02:00
0penBrain 6e587d130d Expression: add unit test for issue #6948 2022-06-11 15:59:06 +02:00
0penBrain 38ec63cba1 [Bugfix] Expression: fix precedence+associativity management in parenthesis removal
Fixes #6948
2022-06-11 15:59:06 +02:00
wmayer fbb5555f27 Part: do not expect a face to be infinite if meshing it has failed
See https://forum.freecadweb.org/viewtopic.php?p=601240#p601240
2022-06-11 13:01:15 +02:00
Uwe 9b5aabe458 [FEM] fix unit handling of filter functions
- the function properties use already units but the dialogs were unitless
2022-06-11 04:54:51 +02:00
Uwe 9dc93b8f99 [skip CI] [FEM] sort UI file
I forgot to use our UI sorter
2022-06-11 04:46:21 +02:00
Uwe c8337118ba [skip CI] [FEM] whitespace and comments to keep overview 2022-06-11 04:28:21 +02:00
Uwe d13ecc1efa [Path] fix compilation with precompiled headers
- also sort includes to keep overview
2022-06-11 00:56:00 +02:00
Wanderer Fan 1b65b3f600 [TD]fix icons for dark schemes 2022-06-10 17:49:43 -04:00
Roy-043 f89f032231 Arch: ArchSectionPlane always showed plan symbols of windows 2022-06-10 22:32:45 +02:00
sliptonic 083a27dc68 Merge pull request #6886 from younghang/master
Path: Fix PointProjectionFailed
2022-06-10 09:06:38 -05:00
Uwe d4c180e953 [FEM] fix unit handling of line filter
- in contrary to other filters the properties have no unit handling
(there are several bugs in line filter and to fix them, unit handling is necessary)
2022-06-10 14:17:42 +02:00
Uwe fdaca02994 [skip CI] [FEM] fix initialization mistake
- initial point should be (0, 0, 0)
  (mistake introduced by me today)
2022-06-10 14:11:42 +02:00
Uwe 4c3c23776d [FEM] fix illegal storage access in point filter
- occurred when changing Field to "None"

- also remove doubled and unused code and add a blank line to separate the different filters in the code better
2022-06-10 13:16:23 +02:00
Yorik van Havre 19ffd1ca94 Merged crowdin translations 2022-06-10 11:03:57 +02:00
Yorik van Havre fa9c78611e Updated ts files 2022-06-10 10:29:18 +02:00
Uwe 825d95314e [FEM] fix unit handling of point result filter
- the App part used already units but the dialog worked unitless. This is error-prone and confusing. Therefore use unit widgets in the dialog.
- also fix issue that unit was not reset (after e.g. a temperature maybe a unitless strain should be shown)
2022-06-10 04:20:25 +02:00
Uwe 10c6d6eabf [skip CI] [PD] fix typo 2022-06-10 03:39:04 +02:00
Chris Hennes b54b3e6e32 Addon Manager: Fix bug in macro git repo 2022-06-09 19:50:05 -05:00
Uwe 6bb6bb4d24 [FEM] fix unit settings of data point filter 2022-06-10 02:42:17 +02:00
Uwe 8fb5ce3c43 [FEM] allow to copy and edit result data
- at the moment you cannot get the result data, for example to make your own plot. Also for the line you might want to have unequal x-steps etc. Especially for the data point filter not getting the data actually makes the tool quite useless.
- therefore set the properties to output
2022-06-10 02:41:08 +02:00
Uwe 43a14ab4df [FEM] fix result point filter upon line filter
having a point filter on a line filter is valid and useful, was maybe just forgotten once the line filter was added
2022-06-10 01:43:22 +02:00
Uwe dd00c46a8c [FEM] fix issue that all plot windows had the same name
- they all had the name "figure 1"
- thus make the name unique and this way also enable to have several plots open displaying different result types (for the line filter)
2022-06-10 00:55:02 +02:00
marioalexis 10edc03ec1 App: Clean up code in PropertyContainerPyImp.cpp 2022-06-09 18:46:41 -04:00
marioalexis 53e02bc851 App: Improve docstrings in PropertyContainerPy.xml 2022-06-09 18:46:41 -04:00
Uwe d17954276c [FEM] fix detached plot (#6998)
* [FEM] fix detached plot

the stress linearization plot is at the moment detached from FreeCAD's main window.
This PR fixes it the same way as in https://github.com/FreeCAD/FreeCAD/commit/920e8e046
2022-06-10 00:34:05 +02:00
Uwe c4fec57368 [FEM] fix linear filter plot (#6999)
* [FEM] fix linear filter plot

the plot one can create from within the linear filter is at the moment detached from FreeCAD's main window.
This PR fixes it the same way as in https://github.com/FreeCAD/FreeCAD/commit/920e8e046
2022-06-10 00:33:27 +02:00
marioalexis d8bf4dfeb9 App: Improve docstrings in MetadataPy.xml and fix memory leak 2022-06-09 17:48:45 -04:00
wmayer 7225e5f0ba App: issue #6892: FreeCAD fails to start 2022-06-09 15:40:37 +02:00
Yorik van Havre 68e8c19aaf Merged crowdin translations 2022-06-09 13:40:35 +02:00
wmayer 8d5a957eb0 Gui: use expresion 'keyboard shortcut' to avoid incorrect translation 2022-06-09 13:15:41 +02:00
wmayer e5fb5a6f27 Mesh: [skip ci] improve German translation 2022-06-09 12:56:43 +02:00
wmayer ecb1b3c3cc ReverseEngineering: [skip ci] improve German translation 2022-06-09 12:33:12 +02:00
wmayer 9a4ab21f2b FEM: improve German translation 2022-06-09 12:27:43 +02:00
Zheng Lei 9d7b7af48c Spreadsheet: fix range checking (#6997)
* App: add option to normalize a Range

- To make sure the range starts from top left and ends with bottom right
corner.
- Default is to not normalize on construction for backward compatibility.
-  fix range checking in range binding
2022-06-09 12:20:08 +02:00
wmayer 28c269cc5f Gui: improve German translation 2022-06-09 12:15:29 +02:00
Uwe 0f9ea612b6 [Spreadsheet] uniform and polish wording of binding feature 2022-06-09 02:14:14 +02:00
marioalexis 4148a33d15 Gui: Improve docstrings in AxisOriginPy.xml 2022-06-08 20:20:57 +02:00
marioalexis d7d22b1e7e App: Improve docstrings in GeoFeaturePy.xml 2022-06-08 19:20:04 +02:00
Zheng Lei 5864e17d9d Spreadsheet: improve range binding feature (#6995)
* Spreadsheet: improve range binding feature
2022-06-08 19:19:41 +02:00
0penBrain 920e8e0469 [FEM] Implement a better dialog layout management for histogram (#6989)
* [FEM] Implement a better dialog layout management for histogram
2022-06-08 16:51:01 +02:00
Chris Hennes c9cffae11d Sketcher: Tweak pluralization of DoF 2022-06-08 09:16:48 -05:00
Yorik van Havre c143d91978 Merge pull request #6991 from 0penBrain/draftGrid
Draft: fix grid spacing default initialization
2022-06-08 13:22:45 +02:00
wmayer f401cbe832 Part: in BRepOffsetAPI_MakeOffsetFix::MakeWire also consider the generated edges of the vertexes of the input shape 2022-06-08 13:02:07 +02:00
Yorik van Havre 2e4dcfc22a Generated ts files 2022-06-08 12:32:59 +02:00
Yorik van Havre b06f247f9f Merged crowdin translations 2022-06-08 12:28:54 +02:00
0penBrain e05e9a7247 Draft: fix grid spacing default initialization 2022-06-08 12:20:06 +02:00
Uwe 5792c502bf [TD] further dialog refinements to fix vertical spacing 2022-06-08 02:12:19 +02:00
Uwe ef1a835f4f [TD] fix dialog height settings 2022-06-08 02:05:44 +02:00
Uwe 18eb44d120 [TD] fix dialog height setting 2022-06-08 01:52:45 +02:00
Wanderer Fan d0323e13c1 [TD]add missing vertical spacer to ui 2022-06-07 19:18:39 -04:00
Wanderer Fan f31544dca8 [TD]missing vertical spacer in ui 2022-06-07 19:18:39 -04:00
Uwe f256e3caf4 [Gui] attempt to improve NaviCube rendering
When the NaviCube is relatively small, it looks clumsy on some screens. This PR tries to improve that.
2022-06-08 01:06:15 +02:00
marioalexis 0c6c3e5211 Base: Improve docstrings in PersistencePy.xml 2022-06-08 00:52:19 +02:00
Chris Hennes 9570d88a39 FEM: Enable translation of plot labels 2022-06-07 13:44:01 -05:00
Chris Hennes 6449e1bcf7 FEM: Enable translation of axis label 2022-06-07 13:10:42 -05:00
Chris Hennes 47bb1408da GUI: Add Vtk info to copied About data 2022-06-07 12:51:51 -05:00
wmayer 77627bbc23 Gui: add SoColorBarLabel as workaround for a Coin3D bug 2022-06-07 19:42:04 +02:00
Yorik van Havre b9b21ddac5 Merged crowdin translations 2022-06-07 13:34:53 +02:00
Yorik van Havre 242083bbf7 Merge pull request #6984 from Kuzma30/update_ts
Crowdin Run update.ts with latest source code.
2022-06-07 12:29:38 +02:00
Kuzemko Alexsandr eff8ecaafc Crowdin Run update.ts with latest source code. 2022-06-07 13:15:44 +03:00
wmayer 80bdc3f960 Gui: don't use cached value of color bar width if ratio of the canvas is less than 1.0 2022-06-07 11:30:00 +02:00
Wanderer Fan b4489422a5 [TD]abort dimensioning of spline edge 2022-06-06 18:47:51 -04:00
Wanderer Fan 8349a78dde [TD]fix icon in dialog 2022-06-06 18:47:51 -04:00
Chris Hennes fd47f2253a Draft: Fix menu text for Select Plane 2022-06-06 12:12:08 -05:00
wmayer 3cccd4d69e Gui: cache color bar width to avoid to compute it for every resize of the canvas 2022-06-06 19:11:00 +02:00
Kuzemko Alexsandr 721f253c59 Crowdin Update TechDraw.ts 2022-06-06 13:08:02 -04:00
Kuzemko Alexsandr 29cc754cfd [TD] Add ability to translate for some tooltip text. Fix incorrect use of tr(variable). 2022-06-06 13:08:02 -04:00
Chris Hennes af811b34b3 Addon Manager: Additional diagnostics for Macro updates 2022-06-06 11:46:56 -05:00
sliptonic 07422d2abe Merge pull request #6978 from sliptonic/bug/ghostpath
zero out Job.Path property if it exists
2022-06-06 11:43:13 -05:00
sliptonic 6462cdf231 zero out Job.Path property if it exists 2022-06-06 11:40:01 -05:00
Uwe 9156d591c9 [FEM] fix subsequent histogram plot call
fixes #6975
2022-06-06 18:26:18 +02:00
Uwe 4223e5d84d [skip CI] [Spreadsheet] change misleading word in dialog 2022-06-06 01:26:29 +02:00
Uwe 7955c0dfac [Spreadsheet] dialog fixes
- fixes to tooltips
- add 2 labels to make the dialog logic more clear
- remove non-functional help button
2022-06-06 00:46:42 +02:00
Wanderer Fan 681d961254 [TD]fix updating of shared view 2022-06-05 09:33:02 -04:00
Uwe 332cb9ec2f [FEM] fix wrong error message about comments
- fixes an annoying warning (that is output as error) about unused COMMENT
2022-06-05 13:42:41 +02:00
Uwe 34300c600f [FEM] add missing parser handling of '^' character (#6966)
* [FEM] add missing parser handling of '^' character

- it is common to use equations like "x^2" but one currently get only an error
- this PR fixes this by adding parsing support for the '^' character as power function

This way is it now also possible to calculate a root by e.g. "x^(0.5).
2022-06-05 13:13:49 +02:00
Kuzemko Alexsandr f7c64c7322 Crowdin Update Fem.ts 2022-06-05 12:38:12 +02:00
Uwe 7e638a624e [FEM] add missing tooltip
- should clarify the action of the button properly
2022-06-05 00:25:20 +02:00
Uwe b5b5375fe4 [FEM] result dialog: handle max shear stress
- max shear stress is supported but could not use in the Calculate section
- also sort the UI file with our sorting script
2022-06-05 00:12:51 +02:00
Uwe 23d65cc9f2 Merge branch 'master' of github.com:FreeCAD/FreeCAD 2022-06-04 22:42:13 +02:00
Uwe 75a8998432 [FEM] fix button text
- looking at the Git log this button never had a plot functionality
- for the discussion see: https://forum.freecadweb.org/viewtopic.php?f=18&t=69189
2022-06-04 22:41:58 +02:00
Ajinkya Dahale 6e97e9570c [Sketcher] Add missing newline 2022-06-04 22:35:55 +02:00
Kuzemko Alexsandr 27e3f3c153 Crowdin Update .ts after fixing script. 2022-06-04 15:09:19 -04:00
Kuzemko Alexsandr a42e1b0223 Crowdin Add full Part directory back to search path. 2022-06-04 15:09:19 -04:00
Kuzemko Alexsandr 176cf0d144 Part: Reformat JoinDeatures by Black, delete some comments. Reformat commented code too.
Now it proper recognize by lupdate.
2022-06-04 15:09:19 -04:00
Uwe 4d7e550d97 [FEM] fix results dialog equation input
- add missing tooltip and this way remove cryptic default input of the field
- since the field expects plain text, use a QPlainTextEdit
2022-06-04 19:58:31 +02:00
Uwe 3fe354718c [FEM] describe the tress variables
- there was no info what P1, P2 and P3 meant
- also rearrange to consume save horizontal space (was too wide on small screens)
2022-06-04 19:18:13 +02:00
Uwe 8567ef1849 [skip CI] [FEM] change strings to be consistent with the dialog 2022-06-04 19:06:14 +02:00
marioalexis 67c506d39e Base: Improve docstrings in VectorPy.xml 2022-06-04 15:39:05 +02:00
wmayer 9c8b21f5f4 Web: update browser commands after loading page 2022-06-04 13:21:41 +02:00
wmayer f37574e809 Base: raise TypeError if Vector is multiplied with unsupported type 2022-06-04 13:21:04 +02:00
wmayer 0d6b5b7f30 Base: use const char* 2022-06-04 13:20:07 +02:00
wmayer f7f85464a3 Base: include header in PCH 2022-06-04 13:18:08 +02:00
wmayer 31047be9fb Base: improve initialization according to cpp core guidelines 2022-06-04 13:17:27 +02:00
wmayer ca9355b5cb Base: remove redundant void 2022-06-04 13:14:55 +02:00
wmayer fc7f3f4e3d Base: avoid const_cast in FileInfo 2022-06-04 13:13:36 +02:00
Uwe 704feadc7c [skip CI] [FEM] fix typos 2022-06-04 01:33:34 +02:00
Uwe e41879c6ea [FEM] don't block FC by histogram plot window
fixes #6959
2022-06-04 01:28:55 +02:00
Wanderer Fan 2b0dd54fe7 [TD]fix preference file handling 2022-06-03 18:35:13 -04:00
Chris Hennes d73f9e3762 FEM: Add translation calls to task_result_mechanical.py 2022-06-03 11:42:52 -05:00
Uwe 134fa8b7ea [FEM] use proper histogram titles
- use for the histogram titles the same as in the CCX dialog and not our internal abbreviations
- in the CCX dialog don't use the term PEEQ but the common wording that also gives the user the info what this is about
2022-06-03 13:09:32 +02:00
Yorik van Havre e8f1bde367 Merged crowdin translations 2022-06-03 11:26:35 +02:00
Chris Hennes 2d32de3cd2 FEM: Tweak translatability of PEEQ 2022-06-02 16:26:05 -05:00
Wanderer Fan 56d289997c [TD]fix Dimension/Balloon movement 2022-06-02 16:33:25 -04:00
Chris Hennes 4dab407fbe Tools: Manually search for translatable files 2022-06-02 14:58:44 -05:00
Chris Hennes 34502193a2 i18n: Update TS files to ensure Python files are included 2022-06-02 14:57:49 -05:00
Chris Hennes d540de8bee i18n: TS files generated by lupdate 6.4.0dev 2022-06-02 13:41:37 -05:00
Chris Hennes acfbc72f50 Tools: Fix issues with updatets.py 2022-06-02 13:37:28 -05:00
Chris Hennes 3c1e446c2f Addon Manager: Don't translate placeholder text 2022-06-02 12:51:41 -05:00
Chris Hennes 2d5400f923 Sketcher: Fix typo in tooltip 2022-06-02 12:47:30 -05:00
Chris Hennes be16e1f52b Sketcher: Tweak tooltip language 2022-06-02 12:44:37 -05:00
Chris Hennes be8a4037db FEM: Fix typo 2022-06-02 10:49:55 -05:00
Wanderer Fan 977127012e [TD]fix misleading error messages 2022-06-02 11:39:21 -04:00
Chris Hennes 89432a969d TD: Set symbols to be non-translatable 2022-06-02 10:36:46 -05:00
Chris Hennes 7b204c01db Gui: Fix typo 2022-06-02 10:29:14 -05:00
marioalexis ee4f4e8cb7 Base: Improve docstrings in CoordinateSystemPy.xml 2022-06-02 16:26:31 +02:00
marioalexis 297e3520ec Base: Improve docstrings in TypePy.xml 2022-06-02 16:25:55 +02:00
Wanderer Fan 8891394d5a [TD]fix Rotation not applied 2022-06-02 09:09:53 -04:00
Wanderer Fan d223d4362c [TD]fix double draw on position change 2022-06-02 09:09:53 -04:00
Chris Hennes 213bf1ec61 Tools: Add Windows and Qt6 support to updatets.py 2022-06-01 21:30:27 -05:00
Chris Hennes d860c4bb2d PD: Fix w[z] plot in ShaftWizard 2022-06-01 19:48:42 -04:00
luz paz a0c0b2616c Fix various typos 2022-06-01 18:03:40 -04:00
Chris Hennes 07e38636b9 Addon Manager: Fix bug with updates being counted wrong 2022-06-01 15:01:38 -05:00
Chris Hennes a4b2bf584d Gui: Fix display of tooltips for GroupCommand
Fixes https://github.com/FreeCAD/FreeCAD-translations/issues/88 and https://github.com/FreeCAD/FreeCAD-translations/issues/72
2022-06-01 14:21:17 -05:00
Kuzemko Alexsandr 477eed10a4 [TD] Fix incorrect using of QT_TRANSLATE_NOOP in setText 2022-06-01 13:41:00 -04:00
Uwe 9946a3916e [FEM] TaskPostDataAtPoint: add missing support for electrostatics
- also update units to SI
2022-06-01 17:42:22 +02:00
Kuzemko Alexsandr a67701b85b Crowdin Add missing menu text for translation 2022-06-01 11:12:51 -04:00
Uwe 2de25dd04e [PD] fix Shaft wizard
- the functionality is now in FC's core, for more info see: https://forum.freecadweb.org/viewtopic.php?p=599044#p599044
and following
2022-06-01 16:13:09 +02:00
Kuzemko Alexsandr 3f04bf7b4d [TD] Add text to translate
This will fix https://github.com/FreeCAD/FreeCAD-translations/issues/47
2022-06-01 13:04:47 +02:00
wmayer 8c123bad50 App: add default macro directory to sys.path 2022-06-01 11:21:51 +02:00
Uwe eda43a2ef9 [Win installer] register all FC-specific file types
- to be able to get a clean system when uninstalling FC
2022-06-01 04:41:23 +02:00
Uwe 81d6401455 [Win installer] update website 2022-06-01 04:37:15 +02:00
Chris Hennes 5542bc9970 Addon Manager: Remove unnecessary translations 2022-05-31 20:35:10 -05:00
Chris Hennes 3dfb51d3ee Addon Manager: Expose pref page name to translate 2022-05-31 15:33:53 -05:00
marioalexis 79a5cde3b5 Base: Fix bad parse argument in AxisPyImp.cpp 2022-05-31 12:55:54 -04:00
Chris Hennes 33556d8a56 Part: Change _translate to translate 2022-05-31 10:05:44 -05:00
Chris Hennes b8952aaeb8 Image: Change _translate to translate 2022-05-31 10:05:22 -05:00
Kuzemko Alexsandr 819cfd7a11 [TD] Fix problem with translation (add TechDraw_ to context)
This will fix https://github.com/FreeCAD/FreeCAD-translations/issues 145-147
2022-05-31 09:30:48 -04:00
Yorik van Havre d447d75882 Merged crowdin translations 2022-05-31 13:31:52 +02:00
Kuzemko Alexsandr d920a5bf4d [Mesh] Add ability to translate
This fix https://github.com/FreeCAD/FreeCAD-translations/issues/53
2022-05-31 12:01:02 +02:00
marioalexis 35c872d4f2 Base: Improve docstrings in MatrixPy.xml 2022-05-31 11:48:04 +02:00
marioalexis 98cb5d50af Base: Fix undefined behaviour in row/col functions and code clean up 2022-05-31 11:48:04 +02:00
Kuzemko Alexsandr 62f65e12e2 Part: Change contex from AttachmentEditor to Part_EditAttachment
Add menu text "Create a copy" to translation
This may fix https://github.com/FreeCAD/FreeCAD-translations/issues/64
2022-05-31 11:25:44 +02:00
Chris Hennes f7b9a70ee5 Addon Manager: Build in error-checking in developer mode 2022-05-30 20:06:20 -05:00
Benjamin Alterauge 03f3852617 List all available test units, if none is selected.
From the command line (FreeCADCmd) only which not need the GUI.

A better description

Grammatically improvement

Use PrintMessage
2022-05-31 02:03:11 +02:00
Uwe 537acfdddd [Gui] code documentation of color bar 2022-05-31 01:59:54 +02:00
Chris Hennes 307cb3cda8 Gui: Check for Snap and add details to About 2022-05-30 13:19:02 -05:00
Kuzemko Alexsandr 0b574523e9 [TD] Fix redefine text in .ui (that has translation on crowdin) with English text without translation ability.
This will fix https://github.com/FreeCAD/FreeCAD-translations/issues/50
2022-05-30 10:41:00 -04:00
wmayer 8edb3e64cc Part: make DimensionLinear node kit unpickable
See forum thread: https://forum.freecadweb.org/viewtopic.php?f=3&t=69056
2022-05-30 15:43:27 +02:00
Yorik van Havre e13e3bcea3 Merge pull request #6899 from 0penBrain/draftGrid
Draft: fix issues with grid spacing parameter
2022-05-30 15:31:18 +02:00
Kuzemko Alexsandr c2e34be393 Part: Fix Chamfer parameter and Fillet parameter title. Also rename variable to more informative in .ui.
This will resolve issues https://github.com/FreeCAD/FreeCAD-translations/issues/74
2022-05-30 15:01:33 +02:00
wmayer c5296fbb92 Gui: initialize _bbox with correct default values and fix incorrect label postions if ratio of width/height is less than 1 2022-05-30 14:08:33 +02:00
wmayer 1723196166 Gui: fix shrinking and shifting of color bar if ratio of width/height is smaller than one 2022-05-30 12:59:55 +02:00
wmayer 37d2492719 Gui: refactor SoFCColorGradient::setViewportSize and SoFCColorLegend::setViewportSize 2022-05-30 12:49:48 +02:00
Yorik van Havre 47125d8fda Arch: Fixed position of rectangles in IFC export 2022-05-30 10:36:05 +02:00
Yorik van Havre d3d96816ce Merged crowdin translations 2022-05-30 10:01:02 +02:00
Uwe 7907b0f8b3 [Gui] describe gradient code better
- to make it easier to see what is happening (not yet perfect since the start numbers 4.0 and 5.0 are not clear yet)
- avoid a jump of the gradient bar when decreasing window size
- return for now only the direct bar width 8will be tested thoroughly now on several PCs if this will work)
2022-05-30 04:08:19 +02:00
wmayer c4cd127499 Gui: fix number display issue of color bar 2022-05-30 03:39:48 +02:00
wmayer 919271ed5e Gui: fix visibility of front nodes when moving an object to Part container 2022-05-30 03:21:52 +02:00
Uwe 79c218ad9a [Gui] fix default color gradient numbering
as reported here: https://forum.freecadweb.org/viewtopic.php?p=598390#p598390
we must assure the user sees not by default get several gradient labels
showing the same and labels showing 0.000
2022-05-30 02:57:29 +02:00
Wanderer Fan 7b79c9697c [TD]prevent spurious recompute on click/drag 2022-05-29 13:19:34 -04:00
wmayer 30f8015e71 Part: expose ChFi2d_ChamferAPI to Python 2022-05-29 12:24:32 +02:00
wmayer f94ab3ec84 Part: expose ChFi2d_AnaFilletAlgo to Python 2022-05-29 11:31:43 +02:00
wmayer b47f8d2605 Part: move ChFi2d wrappers to own sub-directory 2022-05-29 11:05:55 +02:00
marioalexis 8e1a23eadf Base: Improve docstrings in RotationPy.xml 2022-05-29 10:34:59 +02:00
Mateusz Skowroński 391c9a6bbf buttonClicked(int id) is deprecated since Qt 5.15. Use idClicked(int id) instead. 2022-05-28 16:46:59 -04:00
wmayer bf6dbd4606 Gui: react on picked point when double or right-clicking color bar 2022-05-28 18:25:52 +02:00
Yorik van Havre 8676d67a87 merged crowdin translations 2022-05-28 12:16:47 +02:00
wmayer a80d9e5ef8 Fem: [skip ci] fix deleting Result object if its children has been deleted beforehand 2022-05-28 12:08:44 +02:00
wmayer b07be87677 Part: expose ChFi2d_FilletAPI to Python and move to ChFi2d module 2022-05-28 11:10:45 +02:00
wmayer bd853e5ef2 Part: expose ChFi2d_FilletAlgo to Python 2022-05-28 10:37:04 +02:00
Chris Hennes 4c2972cb23 AddonManager: Work around thread-safety issue in update 2022-05-27 15:24:34 -05:00
Uwe 975b8eac52 [skip CI] add missing line ending 2022-05-27 20:39:22 +02:00
Uwe 836c6b889a add description on how to build installer from self-compiled FC 2022-05-27 20:37:26 +02:00
0penBrain 4474db7f50 Draft: force length unit in grid spacing in SelectPlane 2022-05-25 09:54:34 +02:00
0penBrain ccdbf99341 Draft: fix issues with grid spacing parameter 2022-05-25 09:02:12 +02:00
younghang 18120f8bcd Merge branch 'master' into master 2022-05-18 09:39:04 +08:00
younghang a21a5a2032 Fix whitespace 2022-05-18 09:36:16 +08:00
younghang 5ae3a0866e Merge branch 'master' into master 2022-05-17 09:03:56 +08:00
younghang 07d7ced8ec Path: Fix PointProjectionFailed in rebaseWire() 2022-05-16 10:08:35 +08:00
younghang 7630ee024b fix PointProjectionFailed 2022-05-16 00:04:44 +08:00
2026 changed files with 621810 additions and 485789 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 }}
+8 -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,12 +40,10 @@ install_manifest.txt
/src/Tools/offlinedoc/localwiki/
/src/Tools/offlinedoc/*.txt
OpenSCAD_rc.py
/\.idea/
.tags
tags
/\.vscode/
# crowdin file
src/Tools/freecad.zip
tsupdate_stderr.log
tsupdate_stdout.log
files_to_translate.txt
+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/"
+21 -7
View File
@@ -1127,7 +1127,8 @@ std::string Application::getUserMacroDir()
std::string Application::getResourceDir()
{
#ifdef RESOURCEDIR
std::string path(RESOURCEDIR);
// #6892: Conda may inject null characters => remove them
std::string path = std::string(RESOURCEDIR).c_str();
path.append("/");
QDir dir(QString::fromStdString(path));
if (dir.isAbsolute())
@@ -1141,7 +1142,8 @@ std::string Application::getResourceDir()
std::string Application::getLibraryDir()
{
#ifdef LIBRARYDIR
std::string path(LIBRARYDIR);
// #6892: Conda may inject null characters => remove them
std::string path = std::string(LIBRARYDIR).c_str();
QDir dir(QString::fromStdString(path));
if (dir.isAbsolute())
return path;
@@ -1154,7 +1156,8 @@ std::string Application::getLibraryDir()
std::string Application::getHelpDir()
{
#ifdef DOCDIR
std::string path(DOCDIR);
// #6892: Conda may inject null characters => remove them
std::string path = std::string(DOCDIR).c_str();
path.append("/");
QDir dir(QString::fromStdString(path));
if (dir.isAbsolute())
@@ -2160,7 +2163,7 @@ void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& v
("log-file", value<string>(), "Unlike --write-log this allows logging to an arbitrary file")
("user-cfg,u", value<string>(),"User config file to load/save user settings")
("system-cfg,s", value<string>(),"System config file to load/save system settings")
("run-test,t", value<string>() ,"Test case - or 0 for all")
("run-test,t", value<string>()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests.")
("module-path,M", value< vector<string> >()->composing(),"Additional module paths")
("python-path,P", value< vector<string> >()->composing(),"Additional python paths")
("single-instance", "Allow to run a single instance of the application")
@@ -2394,6 +2397,9 @@ void processProgramOptions(const variables_map& vm, std::map<std::string,std::st
if ( "0" == testCase) {
testCase = "TestApp.All";
}
else if (testCase.empty()) {
testCase = "TestApp.PrintAll";
}
mConfig["TestCase"] = testCase;
mConfig["RunMode"] = "Internal";
mConfig["ScriptFileName"] = "FreeCADTest";
@@ -2435,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;
@@ -2518,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"
+12 -2
View File
@@ -593,7 +593,12 @@ bool DocumentWeakPtrT::expired() const noexcept
return (d->_document == nullptr);
}
App::Document* DocumentWeakPtrT::operator->() noexcept
App::Document* DocumentWeakPtrT::operator*() const noexcept
{
return d->_document;
}
App::Document* DocumentWeakPtrT::operator->() const noexcept
{
return d->_document;
}
@@ -686,7 +691,12 @@ DocumentObjectWeakPtrT& DocumentObjectWeakPtrT::operator= (App::DocumentObject*
return *this;
}
App::DocumentObject* DocumentObjectWeakPtrT::operator->() noexcept
App::DocumentObject* DocumentObjectWeakPtrT::operator*() const noexcept
{
return d->get();
}
App::DocumentObject* DocumentObjectWeakPtrT::operator->() const noexcept
{
return d->get();
}
+21 -4
View File
@@ -294,11 +294,16 @@ public:
* \return true if the managed object has already been deleted, false otherwise.
*/
bool expired() const noexcept;
/*!
* \brief operator *
* \return pointer to the document
*/
App::Document* operator*() const noexcept;
/*!
* \brief operator ->
* \return pointer to the document
*/
App::Document* operator->() noexcept;
App::Document* operator->() const noexcept;
private:
// disable
@@ -334,10 +339,15 @@ public:
*/
DocumentObjectWeakPtrT& operator= (App::DocumentObject* p);
/*!
* \brief operator ->
* \return pointer to the document
* \brief operator *
* \return pointer to the document object
*/
App::DocumentObject* operator->() noexcept;
App::DocumentObject* operator*() const noexcept;
/*!
* \brief operator ->
* \return pointer to the document object
*/
App::DocumentObject* operator->() const noexcept;
/*!
* \brief operator ==
* \return true if both objects are equal, false otherwise
@@ -400,6 +410,13 @@ public:
ptr = p;
return *this;
}
/*!
* \brief operator ->
* \return pointer to the document object
*/
T* operator*() const {
return ptr.get<T>();
}
/*!
* \brief operator ->
* \return pointer to the document object
+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());
}
+5 -5
View File
@@ -1517,7 +1517,7 @@ void OperatorExpression::_toString(std::ostream &s, bool persistent,int) const
leftOperator = static_cast<OperatorExpression*>(left)->op;
if (left->priority() < priority()) // Check on operator priority first
needsParens = true;
else if (leftOperator == op) { // Equal priority?
else if (leftOperator == op) { // Same operator ?
if (!isLeftAssociative())
needsParens = true;
//else if (!isCommutative())
@@ -1588,14 +1588,14 @@ void OperatorExpression::_toString(std::ostream &s, bool persistent,int) const
rightOperator = static_cast<OperatorExpression*>(right)->op;
if (right->priority() < priority()) // Check on operator priority first
needsParens = true;
else if (rightOperator == op) { // Equal priority?
else if (rightOperator == op) { // Same operator ?
if (!isRightAssociative())
needsParens = true;
else if (!isCommutative())
needsParens = true;
}
else if (right->priority() == priority()) {
if (!isRightAssociative())
else if (right->priority() == priority()) { // Same priority ?
if (!isRightAssociative() || rightOperator == MOD)
needsParens = true;
}
@@ -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>
+3 -1
View File
@@ -111,7 +111,8 @@ def InitApplications():
AddPath = FreeCAD.ConfigGet("AdditionalModulePaths").split(";")
HomeMod = FreeCAD.getUserAppDataDir()+"Mod"
HomeMod = os.path.realpath(HomeMod)
MacroDir = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro").GetString("MacroPath")
MacroStd = App.getUserMacroDir(False)
MacroDir = App.getUserMacroDir(True)
MacroMod = os.path.realpath(MacroDir+"/Mod")
SystemWideMacroDir = FreeCAD.getHomePath()+'Macro'
SystemWideMacroDir = os.path.realpath(SystemWideMacroDir)
@@ -278,6 +279,7 @@ def InitApplications():
for i in path:
Log(" " + i + "\n")
# add MacroDir to path (RFE #0000504)
sys.path.append(MacroStd)
sys.path.append(MacroDir)
# add SystemWideMacroDir to path
sys.path.append(SystemWideMacroDir)
+23 -14
View File
@@ -11,37 +11,46 @@
FatherNamespace="App">
<Documentation>
<Author Licence="LGPL" Name="Jürgen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<UserDocu>This class does the whole placement and position handling</UserDocu>
<UserDocu>App.GeoFeature class.\n
Base class of all geometric document objects.
This class does the whole placement and position handling.
With the method `getPropertyOfGeometry` is possible to obtain
the main geometric property in general form, without reference
to any particular property name.</UserDocu>
</Documentation>
<Methode Name="getPaths">
<Documentation>
<UserDocu>returns all possible paths to the root of the document</UserDocu>
<UserDocu>getPaths()\n
Returns all possible paths to the root of the document.
Note: Not implemented.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getGlobalPlacement">
<Documentation>
<UserDocu>Returns the placement of the object in the global coordinate space, respecting all stacked relationships.
Note: This function is not available during recompute, as there the placements of parents can change
after the execution of this object, rendering the result wrong.</UserDocu>
<UserDocu>getGlobalPlacement() -> Base.Placement\n
Returns the placement of the object in the global coordinate space, respecting all stacked
relationships.
Note: This function is not available during recompute, as there the placements of parents
can change after the execution of this object, rendering the result wrong.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getPropertyNameOfGeometry">
<Documentation>
<UserDocu>Returns the property name of the actual geometry or None.
For example for a part object it returns the value Shape,
for a mesh the value Mesh and so on.
<UserDocu>getPropertyNameOfGeometry() -> str or None\n
Returns the property name of the actual geometry.
For example for a Part feature it returns the value 'Shape', for a mesh feature the value
'Mesh' and so on.
If an object has no such property then None is returned.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getPropertyOfGeometry">
<Documentation>
<UserDocu>Returns the property of the actual geometry or None.
For example for a part object it returns its Shape property,
for a mesh its Mesh property and so on.
<UserDocu>getPropertyOfGeometry() -> object or None\n
Returns the property of the actual geometry.
For example for a Part feature it returns its Shape property, for a Mesh feature its
Mesh property and so on.
If an object has no such property then None is returned.
Unlike to getPropertyNameOfGeometry this function returns the geometry,
not its name.
</UserDocu>
Unlike to getPropertyNameOfGeometry this function returns the geometry, not its name.</UserDocu>
</Documentation>
</Methode>
<CustomAttributes />
+9 -9
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;
@@ -554,7 +554,7 @@ void LinkBaseExtension::syncCopyOnChange()
// so the last object will be the copy of the original linked object
auto newLinked = copiedObjs.back();
// We are coping from the original linked object and we've already mutated
// We are copying from the original linked object and we've already mutated
// it, so we need to copy all CopyOnChange properties from the mutated
// object to the new copy.
std::vector<App::Property*> propList;
@@ -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());
}
+88 -62
View File
@@ -16,181 +16,207 @@
<Documentation>
<Author Licence="LGPL" Name="Chris Hennes" EMail="chennes@pioneerlibrarysystem.org" />
<UserDocu>
Metadata
A Metadata object reads an XML-formatted package metadata file and provides read-only access to its contents.
A single constructor is supported:
Metadata(file) -- Reads the XML file and provides access to the metadata it specifies.
</UserDocu>
<UserDocu>App.Metadata class.\n
A Metadata object reads an XML-formatted package metadata file and provides
read-only access to its contents.\n
The following constructors are supported:\n
Metadata()
Empty constructor.\n
Metadata(metadata)
Copy constructor.
metadata : App.Metadata\n
Metadata(file)
Reads the XML file and provides access to the metadata it specifies.
file : str\n XML file name.</UserDocu>
<DeveloperDocu>Metadata</DeveloperDocu>
</Documentation>
<Attribute Name="Name" ReadOnly="true">
<Documentation>
<UserDocu>String: the name of this item</UserDocu>
<UserDocu>String representing the name of this item.</UserDocu>
</Documentation>
<Parameter Name="Name" Type="Object" />
</Attribute>
<Attribute Name="Version" ReadOnly="true">
<Documentation>
<UserDocu>String: the version of this item in semantic triplet format</UserDocu>
<UserDocu>String representing the version of this item in semantic triplet format.</UserDocu>
</Documentation>
<Parameter Name="Version" Type="Object" />
</Attribute>
<Attribute Name="Description" ReadOnly="true">
<Documentation>
<UserDocu>String: the description of this item (text only, no markup allowed)</UserDocu>
<UserDocu>String representing the description of this item (text only, no markup allowed).</UserDocu>
</Documentation>
<Parameter Name="Description" Type="Object" />
</Attribute>
<Attribute Name="Maintainer" ReadOnly="true">
<Documentation>
<UserDocu>List of maintainer objects with 'name' and 'email' string attributes</UserDocu>
<UserDocu>List of maintainer objects with 'name' and 'email' string attributes.</UserDocu>
</Documentation>
<Parameter Name="Maintainer" Type="Object" />
</Attribute>
<Attribute Name="License" ReadOnly="true">
<Documentation>
<UserDocu>List of applicable licenses as objects with 'name' and 'file' string attributes</UserDocu>
<UserDocu>List of applicable licenses as objects with 'name' and 'file' string attributes.</UserDocu>
</Documentation>
<Parameter Name="License" Type="Object" />
</Attribute>
<Attribute Name="Urls" ReadOnly="true">
<Documentation>
<UserDocu>
List of URLs as objects with 'location' and 'type' string attributes, where type is one of:
* website
* repository
* bugtracker
* readme
* documentation
</UserDocu>
<UserDocu>List of URLs as objects with 'location' and 'type' string attributes, where type
is one of:
* website
* repository
* bugtracker
* readme
* documentation</UserDocu>
</Documentation>
<Parameter Name="Urls" Type="Object" />
</Attribute>
<Attribute Name="Author" ReadOnly="true">
<Documentation>
<UserDocu>List of author objects, each with a 'name' and a (potentially empty) 'email' string attribute</UserDocu>
<UserDocu>List of author objects, each with a 'name' and a (potentially empty) 'email'
string attribute.</UserDocu>
</Documentation>
<Parameter Name="Author" Type="Object" />
</Attribute>
<Attribute Name="Depend" ReadOnly="true">
<Documentation>
<UserDocu>
List of dependencies, as objects with the following attributes:
* package -- Required: must exactly match the contents of the 'name' element in the referenced package's package.xml file
* version_lt -- Optional: The dependency to the package is restricted to versions less than the stated version number
* version_lte -- Optional: The dependency to the package is restricted to versions less or equal than the stated version number
* version_eq -- Optional: The dependency to the package is restricted to a version equal than the stated version number
* version_gte -- Optional: The dependency to the package is restricted to versions greater or equal than the stated version number
* version_gt -- Optional: The dependency to the package is restricted to versions greater than the stated version number
* condition -- Optional: Conditional expression as documented in REP149
</UserDocu>
<UserDocu>List of dependencies, as objects with the following attributes:
* package
Required. Must exactly match the contents of the 'name' element in the
referenced package's package.xml file.
* version_lt
Optional. The dependency to the package is restricted to versions less than
the stated version number.
* version_lte
Optional. The dependency to the package is restricted to versions less or
equal than the stated version number.
* version_eq
Optional. The dependency to the package is restricted to a version equal
than the stated version number.
* version_gte
Optional. The dependency to the package is restricted to versions greater
or equal than the stated version number.
* version_gt
Optional. The dependency to the package is restricted to versions greater
than the stated version number.
* condition
Optional. Conditional expression as documented in REP149.</UserDocu>
</Documentation>
<Parameter Name="Depend" Type="Object" />
</Attribute>
<Attribute Name="Conflict" ReadOnly="true">
<Documentation>
<UserDocu>List of conflicts, format identical to dependencies</UserDocu>
<UserDocu>List of conflicts, format identical to dependencies.</UserDocu>
</Documentation>
<Parameter Name="Conflict" Type="Object" />
</Attribute>
<Attribute Name="Replace" ReadOnly="true">
<Documentation>
<UserDocu>List of things this item is considered by its author to replace: format identical to dependencies</UserDocu>
<UserDocu>List of things this item is considered by its author to replace. The format is
identical to dependencies.</UserDocu>
</Documentation>
<Parameter Name="Replace" Type="Object" />
</Attribute>
<Attribute Name="Tag" ReadOnly="true">
<Documentation>
<UserDocu>List of strings</UserDocu>
<UserDocu>List of strings.</UserDocu>
</Documentation>
<Parameter Name="Tag" Type="Object" />
</Attribute>
<Attribute Name="Icon" ReadOnly="true">
<Documentation>
<UserDocu>Relative path to an icon file</UserDocu>
<UserDocu>Relative path to an icon file.</UserDocu>
</Documentation>
<Parameter Name="Icon" Type="Object" />
</Attribute>
<Attribute Name="Classname" ReadOnly="true">
<Documentation>
<UserDocu>String: the name of the main Python class this item creates/represents</UserDocu>
<UserDocu>String representing the name of the main Python class this item
creates/represents.</UserDocu>
</Documentation>
<Parameter Name="Classname" Type="Object" />
</Attribute>
<Attribute Name="Subdirectory" ReadOnly="true">
<Documentation>
<UserDocu>String: the name of the subdirectory this content item is located in. If empty, the item is in a directory named the same as the content item.</UserDocu>
<UserDocu>String representing the name of the subdirectory this content item is located in.
If empty, the item is in a directory named the same as the content item.</UserDocu>
</Documentation>
<Parameter Name="Subdirectory" Type="Object" />
</Attribute>
<Attribute Name="File" ReadOnly="true">
<Documentation>
<UserDocu>A list of files associated with this item -- the meaning of each file is implementation-defined</UserDocu>
<UserDocu>List of files associated with this item.
The meaning of each file is implementation-defined.</UserDocu>
</Documentation>
<Parameter Name="File" Type="Object" />
</Attribute>
<Attribute Name="Content" ReadOnly="true">
<Documentation>
<UserDocu>A dictionary of lists of content items: defined recursively, each item is itself a Metadata object -- see package.xml file format documentation for details</UserDocu>
<UserDocu>Dictionary of lists of content items: defined recursively, each item is itself
a Metadata object.
See package.xml file format documentation for details.</UserDocu>
</Documentation>
<Parameter Name="Content" Type="Object" />
</Attribute>
<Attribute Name="FreeCADMin">
<Documentation>
<UserDocu>A string representing the minimum version of FreeCAD needed for this item. If unset it will be 0.0.0.</UserDocu>
<UserDocu>String representing the minimum version of FreeCAD needed for this item.
If unset it will be 0.0.0.</UserDocu>
</Documentation>
<Parameter Name="FreeCADMin" Type="Object" />
</Attribute>
<Attribute Name="FreeCADMax">
<Documentation>
<UserDocu>A string representing the maximum version of FreeCAD needed for this item. If unset it will be 0.0.0.</UserDocu>
<UserDocu>String representing the maximum version of FreeCAD needed for this item.
If unset it will be 0.0.0.</UserDocu>
</Documentation>
<Parameter Name="FreeCADMax" Type="Object" />
</Attribute>
<Methode Name="getLastSupportedFreeCADVersion">
<Documentation>
<UserDocu>getLastSupportedFreeCADVersion()
Search through all content package items, and determine if a maximum supported version of FreeCAD
is set. Returns None if no maximum version is set, or if *any* content item fails to provide a
maximum version (implying that that content item will work with all known versions).
</UserDocu>
<UserDocu>getLastSupportedFreeCADVersion() -> str or None\n
Search through all content package items, and determine if a maximum supported
version of FreeCAD is set.
Returns None if no maximum version is set, or if *any* content item fails to
provide a maximum version (implying that that content item will work with all
known versions).</UserDocu>
</Documentation>
</Methode>
<Methode Name="getFirstSupportedFreeCADVersion">
<Documentation>
<UserDocu>getFirstSupportedFreeCADVersion()
Search through all content package items, and determine if a minimum supported version of FreeCAD
is set. Returns 0.0 if no minimum version is set, or if *any* content item fails to provide a
minimum version (implying that that content item will work with all known versions -- technically
limited to 0.20 as the lowest known version since the metadata standard was added then).
</UserDocu>
<UserDocu>getFirstSupportedFreeCADVersion() -> str or None\n
Search through all content package items, and determine if a minimum supported
version of FreeCAD is set.
Returns 0.0 if no minimum version is set, or if *any* content item fails to
provide a minimum version (implying that that content item will work with all
known versions. Technically limited to 0.20 as the lowest known version since
the metadata standard was added then).</UserDocu>
</Documentation>
</Methode>
<Methode Name="supportsCurrentFreeCAD">
<Documentation>
<UserDocu>supportsCurrentFreeCAD()
Returns false if this metadata object directly indicates that it does not support the current
version of FreeCAD, or true if it makes no indication, or specifically indicates that it does
support the current version. Does not recurse into Content items.
</UserDocu>
<UserDocu>supportsCurrentFreeCAD() -> bool\n
Returns False if this metadata object directly indicates that it does not
support the current version of FreeCAD, or True if it makes no indication, or
specifically indicates that it does support the current version. Does not
recurse into Content items.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getGenericMetadata">
<Documentation>
<UserDocu>getGenericMetadata(name)
Get the list of GenericMetadata objects with key 'name'. Generic metadata objects are Python objects with
a string 'contents' and a dictionary of strings, 'attributes'. They represent unrecognized simple XML tags
in the metadata file.
</UserDocu>
<UserDocu>getGenericMetadata(name) -> list\n
Get the list of GenericMetadata objects with key 'name'.
Generic metadata objects are Python objects with a string 'contents' and a
dictionary of strings, 'attributes'. They represent unrecognized simple XML tags
in the metadata file.</UserDocu>
</Documentation>
</Methode>
+17 -10
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"
@@ -34,7 +35,7 @@ XERCES_CPP_NAMESPACE_USE
// Returns a string which represents the object e.g. when printed in Python
std::string MetadataPy::representation(void) const
{
MetadataPy::PointerType ptr = reinterpret_cast<MetadataPy::PointerType>(_pcTwinPointer);
MetadataPy::PointerType ptr = getMetadataPtr();
std::stringstream str;
str << "Metadata [Name=(";
str << ptr->name();
@@ -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;
}
@@ -288,10 +292,11 @@ Py::Object MetadataPy::getContent(void) const
PyObject* MetadataPy::getGenericMetadata(PyObject* args)
{
const char* name;
if (!PyArg_ParseTuple(args, "s!", &name))
if (!PyArg_ParseTuple(args, "s", &name))
return nullptr;
auto gm = (*getMetadataPtr())[name];
auto pyGenericMetadata = new Py::List;
Py::List pyGenericMetadata;
for (const auto& item : gm) {
Py::Dict pyItem;
pyItem["contents"] = Py::String(item.contents);
@@ -300,12 +305,12 @@ PyObject* MetadataPy::getGenericMetadata(PyObject* args)
pyAttributes[attribute.first] = Py::String(attribute.second);
}
pyItem["attributes"] = pyAttributes;
pyGenericMetadata->append(pyItem);
pyGenericMetadata.append(pyItem);
}
return pyGenericMetadata->ptr();
return Py::new_reference_to(pyGenericMetadata);
}
Py::Object MetadataPy::getFreeCADMin() const
Py::Object MetadataPy::getFreeCADMin() const
{
return Py::String(getMetadataPtr()->freecadmin().str());
}
@@ -316,10 +321,11 @@ void MetadataPy::setFreeCADMin(Py::Object args)
PyObject* p = args.ptr();
if (!PyArg_ParseTuple(p, "s", &version))
return;
getMetadataPtr()->setFreeCADMin(App::Meta::Version(version));
}
Py::Object MetadataPy::getFreeCADMax() const
Py::Object MetadataPy::getFreeCADMax() const
{
return Py::String(getMetadataPtr()->freecadmax().str());
}
@@ -330,6 +336,7 @@ void MetadataPy::setFreeCADMax(Py::Object args)
PyObject* p = args.ptr();
if (!PyArg_ParseTuple(p, "s", &version))
return;
getMetadataPtr()->setFreeCADMax(App::Meta::Version(version));
}
+70 -57
View File
@@ -12,126 +12,139 @@
DisableNotify="true">
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<UserDocu>This is a Persistence class</UserDocu>
<UserDocu>App.PropertyContainer class.</UserDocu>
</Documentation>
<Methode Name="getPropertyByName">
<Documentation>
<UserDocu>
getPropertyByName(name,checkOwner=0)
Return the value of a named property. Note that the returned property may not
always belong to this container (e.g. from a linked object).
* name: name of the property
* checkOwner: 0: just return the property
1: raise exception if not found or the property
does not belong to this container
2: return a tuple(owner,property_value)
</UserDocu>
<UserDocu>getPropertyByName(name, checkOwner=0) -> object or Tuple\n
Returns the value of a named property. Note that the returned property may not
always belong to this container (e.g. from a linked object).\n
name : str\n Name of the property.
checkOwner : int\n 0: just return the property.
1: raise exception if not found or the property does not belong to this container.
2: return a tuple (owner, propertyValue).</UserDocu>
</Documentation>
</Methode>
<Methode Name="getPropertyTouchList">
<Documentation>
<UserDocu>Return a list of index of touched values for list type properties.</UserDocu>
<UserDocu>getPropertyTouchList(name) -> tuple\n
Returns a list of index of touched values for list type properties.\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getTypeOfProperty">
<Documentation>
<UserDocu>Return the type of a named property. This can be (Hidden,ReadOnly,Output) or any combination. </UserDocu>
<UserDocu>getTypeOfProperty(name) -> list\n
Returns the type of a named property. This can be a list conformed by elements in
(Hidden, NoRecompute, NoPersist, Output, ReadOnly, Transient).\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getTypeIdOfProperty">
<Documentation>
<UserDocu>Returns the C++ class name of a named property.</UserDocu>
<UserDocu>getTypeIdOfProperty(name) -> str\n
Returns the C++ class name of a named property.\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setEditorMode">
<Documentation>
<UserDocu>Set the behaviour of the property in the property editor.
0 - default behaviour
1 - item is ready-only
2 - item is hidden
</UserDocu>
<UserDocu>setEditorMode(name, type) -> None\n
Set the behaviour of the property in the property editor.\n
name : str\n Property name.
type : int, sequence of str\n Property type.
0: default behaviour. 1: item is ready-only. 2: item is hidden. 3: item is hidden and read-only.
If sequence, the available items are 'ReadOnly' and 'Hidden'.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getEditorMode">
<Documentation>
<UserDocu>Get the behaviour of the property in the property editor.
It returns a list of strings with the current mode. If the list is empty there are no special restrictions.
If the list contains 'ReadOnly' then the item appears in the property editor but is disabled.
If the list contains 'Hidden' then the item even doesn't appear in the property editor.
</UserDocu>
<UserDocu>getEditorMode(name) -> list\n
Get the behaviour of the property in the property editor.
It returns a list of strings with the current mode. If the list is empty there are no
special restrictions.
If the list contains 'ReadOnly' then the item appears in the property editor but is
disabled.
If the list contains 'Hidden' then the item even doesn't appear in the property editor.\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getGroupOfProperty">
<Documentation>
<UserDocu>Return the name of the group which the property belongs to in this class. The properties sorted in different named groups for convenience.</UserDocu>
<UserDocu>getGroupOfProperty(name) -> str\n
Returns the name of the group which the property belongs to in this class.
The properties are sorted in different named groups for convenience.\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setGroupOfProperty">
<Documentation>
<UserDocu>Set the name of the group of a dynamic property.</UserDocu>
<UserDocu>setGroupOfProperty(name, group) -> None\n
Set the name of the group of a dynamic property.\n
name : str\n Property name.
group : str\n Group name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setPropertyStatus">
<Documentation>
<UserDocu>
setPropertyStatus(name,val): Set property status
name(String): property name
val(String|Int|[String|Int...]): text or integer value, or list/tuple of
values. Call getPropertyStatus() to get a list of supported text value.
If the text start with '-' or the integer value is negative, then the
status is cleared.
</UserDocu>
<UserDocu>setPropertyStatus(name, val) -> None\n
Set property status.\n
name : str\n Property name.
val : int, str, sequence of str or int\n Call getPropertyStatus() to get a list of supported text value.
If the text start with '-' or the integer value is negative, then the status is cleared.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getPropertyStatus">
<Documentation>
<UserDocu>
getPropertyStatus(name=''): Get property status.
name(String): property name. If name is empty, return a list of supported
text names of the status.
</UserDocu>
<UserDocu>getPropertyStatus(name='') -> list\n
Get property status.\n
name : str\n Property name. If empty, returns a list of supported text names of the status.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getDocumentationOfProperty">
<Documentation>
<UserDocu>Return the documentation string of the property of this class.</UserDocu>
<UserDocu>getDocumentationOfProperty(name) -> str\n
Returns the documentation string of the property of this class.\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setDocumentationOfProperty">
<Documentation>
<UserDocu>Set the documentation string of a dynamic property of this class.</UserDocu>
<UserDocu>setDocumentationOfProperty(name, docstring) -> None\n
Set the documentation string of a dynamic property of this class.\n
name : str\n Property name.
docstring : str\n Documentation string.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getEnumerationsOfProperty">
<Documentation>
<UserDocu>Return all enumeration strings of the property of this class or None if not a PropertyEnumeration.</UserDocu>
<UserDocu>getEnumerationsOfProperty(name) -> list or None\n
Return all enumeration strings of the property of this class or None if not a
PropertyEnumeration.\n
name : str\n Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="dumpPropertyContent" Keyword="true" Const="true">
<Documentation>
<UserDocu>Dumps the content of the property, both the XML representation as well as the additional datafiles
required, into a byte representation. It will be returned as byte array.
dumpPropertyContent(propertyname) -- returns a byte array with full content
dumpPropertyContent(propertyname, [Compression=1-9]) -- Sets the data compression from 0 (no) to 9 (max)
</UserDocu>
<UserDocu>dumpPropertyContent(Property, Compression=3) -> bytearray\n
Dumps the content of the property, both the XML representation and the additional
data files required, into a byte representation.\n
Property : str\n Property Name.
Compression : int\n Set the data compression level in the range [0, 9]. Set to 0 for no compression.</UserDocu>
</Documentation>
</Methode>
<Methode Name="restorePropertyContent">
<Documentation>
<UserDocu>Restore the content of given property from a byte representation as stored by \"dumpContent\".
It could be restored from any python object implementing the buffer protocol.
restorePropertyContent(propertyname, buffer) -- restores from the given byte array
</UserDocu>
<UserDocu>restorePropertyContent(name, obj) -> None\n
Restore the content of the object from a byte representation as stored by `dumpPropertyContent`.
It could be restored from any Python object implementing the buffer protocol.\n
name : str\n Property name.
obj : buffer\n Object with buffer protocol support.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="PropertiesList" ReadOnly="true">
<Documentation>
<UserDocu>A list of all property names</UserDocu>
<UserDocu>A list of all property names.</UserDocu>
</Documentation>
<Parameter Name="PropertiesList" Type="List"/>
</Attribute>
+76 -54
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"
@@ -54,16 +54,24 @@ PyObject* PropertyContainerPy::getPropertyByName(PyObject *args)
int checkOwner=0;
if (!PyArg_ParseTuple(args, "s|i", &pstr, &checkOwner))
return nullptr;
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(pstr);
if (prop) {
if(!checkOwner || (checkOwner==1 && prop->getContainer()==getPropertyContainerPtr()))
return prop->getPyObject();
Py::TupleN res(Py::asObject(prop->getContainer()->getPyObject()),
Py::asObject(prop->getPyObject()));
return Py::new_reference_to(res);
if (checkOwner < 0 || checkOwner > 2) {
PyErr_SetString(PyExc_ValueError, "'checkOwner' expected in the range [0, 2]");
return nullptr;
}
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", pstr);
return nullptr;
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(pstr);
if (!prop) {
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", pstr);
return nullptr;
}
if (!checkOwner || (checkOwner==1 && prop->getContainer()==getPropertyContainerPtr()))
return prop->getPyObject();
Py::TupleN res(Py::asObject(prop->getContainer()->getPyObject()), Py::asObject(prop->getPyObject()));
return Py::new_reference_to(res);
}
PyObject* PropertyContainerPy::getPropertyTouchList(PyObject *args)
@@ -71,6 +79,7 @@ PyObject* PropertyContainerPy::getPropertyTouchList(PyObject *args)
char *pstr;
if (!PyArg_ParseTuple(args, "s", &pstr))
return nullptr;
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(pstr);
if (prop && prop->isDerivedFrom(PropertyLists::getClassTypeId())) {
const auto &touched = static_cast<PropertyLists*>(prop)->getTouchList();
@@ -80,11 +89,14 @@ PyObject* PropertyContainerPy::getPropertyTouchList(PyObject *args)
ret.setItem(i++,Py::Long(idx));
return Py::new_reference_to(ret);
}
else if(!prop)
else if (!prop) {
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", pstr);
else
return nullptr;
}
else {
PyErr_Format(PyExc_AttributeError, "Property '%s' is not of list type", pstr);
return nullptr;
return nullptr;
}
}
PyObject* PropertyContainerPy::getTypeOfProperty(PyObject *args)
@@ -168,7 +180,7 @@ PyObject* PropertyContainerPy::setEditorMode(PyObject *args)
status.reset(Property::ReadOnly);
status.reset(Property::Hidden);
for (Py::Sequence::iterator it = seq.begin();it!=seq.end();++it) {
std::string str = (std::string)Py::String(*it);
std::string str = static_cast<std::string>(Py::String(*it));
if (str == "ReadOnly")
status.set(Property::ReadOnly);
else if (str == "Hidden")
@@ -210,28 +222,30 @@ PyObject* PropertyContainerPy::setPropertyStatus(PyObject *args)
PyObject *pyValue;
if (!PyArg_ParseTuple(args, "sO", &name, &pyValue))
return nullptr;
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(name);
if (!prop) {
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", name);
return nullptr;
}
auto linkProp = Base::freecad_dynamic_cast<App::PropertyLinkBase>(prop);
auto linkProp = Base::freecad_dynamic_cast<App::PropertyLinkBase>(prop);
std::bitset<32> status(prop->getStatus());
size_t count = 1;
bool isSeq = false;
if(PyList_Check(pyValue) || PyTuple_Check(pyValue)) {
if (PyList_Check(pyValue) || PyTuple_Check(pyValue)) {
isSeq = true;
count = PySequence_Size(pyValue);
}
for(size_t i=0;i<count;++i) {
for(size_t i=0; i<count; ++i) {
Py::Object item;
if(isSeq)
if (isSeq)
item = Py::Object(PySequence_GetItem(pyValue,i));
else
item = Py::Object(pyValue);
bool value = true;
if(item.isString()) {
if (item.isString()) {
const auto &statusMap = getStatusMap();
auto v = (std::string)Py::String(item);
if(v.size()>1 && v[0] == '-') {
@@ -248,7 +262,8 @@ PyObject* PropertyContainerPy::setPropertyStatus(PyObject *args)
return nullptr;
}
status.set(it->second,value);
}else if(item.isNumeric()) {
}
else if (item.isNumeric()) {
int v = Py::Int(item);
if(v<0) {
value = false;
@@ -257,7 +272,8 @@ PyObject* PropertyContainerPy::setPropertyStatus(PyObject *args)
if(v==0 || v>31)
PyErr_Format(PyExc_ValueError, "Status value out of range '%d'", v);
status.set(v,value);
} else {
}
else {
PyErr_SetString(PyExc_TypeError, "Expects status type to be Int or String");
return nullptr;
}
@@ -275,31 +291,34 @@ PyObject* PropertyContainerPy::getPropertyStatus(PyObject *args)
Py::List ret;
const auto &statusMap = getStatusMap();
if(!name[0]) {
if (!name[0]) {
for(auto &v : statusMap)
ret.append(Py::String(v.first.c_str()));
}else{
}
else {
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(name);
if (prop) {
if (!prop) {
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", name);
return nullptr;
}
auto linkProp = Base::freecad_dynamic_cast<App::PropertyLinkBase>(prop);
if(linkProp && linkProp->testFlag(App::PropertyLinkBase::LinkAllowPartial))
ret.append(Py::String("AllowPartial"));
auto linkProp = Base::freecad_dynamic_cast<App::PropertyLinkBase>(prop);
if (linkProp && linkProp->testFlag(App::PropertyLinkBase::LinkAllowPartial))
ret.append(Py::String("AllowPartial"));
std::bitset<32> bits(prop->getStatus());
for(size_t i=1;i<bits.size();++i) {
if(!bits[i]) continue;
bool found = false;
for(auto &v : statusMap) {
if(v.second == (int)i) {
ret.append(Py::String(v.first.c_str()));
found = true;
break;
}
std::bitset<32> bits(prop->getStatus());
for(size_t i=1; i<bits.size(); ++i) {
if(!bits[i]) continue;
bool found = false;
for(auto &v : statusMap) {
if(v.second == static_cast<int>(i)) {
ret.append(Py::String(v.first.c_str()));
found = true;
break;
}
if(!found)
ret.append(Py::Int((long)i));
}
if (!found)
ret.append(Py::Int(static_cast<long>(i)));
}
}
return Py::new_reference_to(ret);
@@ -312,6 +331,11 @@ PyObject* PropertyContainerPy::getEditorMode(PyObject *args)
return nullptr;
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(name);
if (!prop) {
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", name);
return nullptr;
}
Py::List ret;
if (prop) {
short Type = prop->getType();
@@ -357,7 +381,8 @@ PyObject* PropertyContainerPy::setGroupOfProperty(PyObject *args)
}
prop->getContainer()->changeDynamicProperty(prop,group,nullptr);
Py_Return;
} PY_CATCH
}
PY_CATCH
}
@@ -373,9 +398,9 @@ PyObject* PropertyContainerPy::getDocumentationOfProperty(PyObject *args)
return nullptr;
}
const char* Group = getPropertyContainerPtr()->getPropertyDocumentation(prop);
if (Group)
return Py::new_reference_to(Py::String(Group));
const char* docstr = getPropertyContainerPtr()->getPropertyDocumentation(prop);
if (docstr)
return Py::new_reference_to(Py::String(docstr));
else
return Py::new_reference_to(Py::String(""));
}
@@ -395,7 +420,8 @@ PyObject* PropertyContainerPy::setDocumentationOfProperty(PyObject *args)
}
prop->getContainer()->changeDynamicProperty(prop,nullptr,doc);
Py_Return;
} PY_CATCH
}
PY_CATCH
}
PyObject* PropertyContainerPy::getEnumerationsOfProperty(PyObject *args)
@@ -411,13 +437,10 @@ PyObject* PropertyContainerPy::getEnumerationsOfProperty(PyObject *args)
}
PropertyEnumeration *enumProp = dynamic_cast<PropertyEnumeration*>(prop);
if (!enumProp) {
Py_INCREF(Py_None);
return Py_None;
}
if (!enumProp)
Py_Return;
std::vector<std::string> enumerations = enumProp->getEnumVector();
Py::List ret;
for (std::vector<std::string>::const_iterator it = enumerations.begin(); it != enumerations.end(); ++it) {
ret.append(Py::String(*it));
@@ -432,7 +455,7 @@ Py::List PropertyContainerPy::getPropertiesList(void) const
getPropertyContainerPtr()->getPropertyMap(Map);
for (std::map<std::string,Property*>::const_iterator It=Map.begin();It!=Map.end();++It)
for (std::map<std::string,Property*>::const_iterator It=Map.begin(); It!=Map.end(); ++It)
ret.append(Py::String(It->first));
return ret;
@@ -442,12 +465,11 @@ Py::List PropertyContainerPy::getPropertiesList(void) const
PyObject* PropertyContainerPy::dumpPropertyContent(PyObject *args, PyObject *kwds)
{
int compression = 3;
char* property;
static char* kwds_def[] = {"Property", "Compression",nullptr};
const char* property;
static char* kwds_def[] = {"Property", "Compression", nullptr};
PyErr_Clear();
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|i", kwds_def, &property, &compression)) {
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|i", kwds_def, &property, &compression))
return nullptr;
}
Property* prop = getPropertyContainerPtr()->getPropertyByName(property);
if (!prop) {
+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]);
+23 -9
View File
@@ -37,7 +37,7 @@ using namespace App;
const int App::CellAddress::MAX_ROWS = 16384;
const int App::CellAddress::MAX_COLUMNS = 26 * 26 + 26;
Range::Range(const char * range)
Range::Range(const char * range, bool normalize)
{
std::string from;
std::string to;
@@ -62,28 +62,42 @@ Range::Range(const char * range)
row_end = end.row();
col_end = end.col();
if (normalize)
this->normalize();
row_curr = row_begin;
col_curr = col_begin;
}
Range::Range(int _row_begin, int _col_begin, int _row_end, int _col_end)
: row_curr(_row_begin)
, col_curr(_col_begin)
, row_begin(_row_begin)
Range::Range(int _row_begin, int _col_begin, int _row_end, int _col_end, bool normalize)
: row_begin(_row_begin)
, col_begin(_col_begin)
, row_end(_row_end)
, col_end(_col_end)
{
if (normalize)
this->normalize();
row_curr = row_begin;
col_curr = col_begin;
}
Range::Range(const CellAddress &from, const CellAddress &to)
: row_curr(from.row())
, col_curr(from.col())
, row_begin(from.row())
Range::Range(const CellAddress &from, const CellAddress &to, bool normalize)
: row_begin(from.row())
, col_begin(from.col())
, row_end(to.row())
, col_end(to.col())
{
if (normalize)
this->normalize();
row_curr = row_begin;
col_curr = col_begin;
}
void Range::normalize()
{
if (row_begin > row_end)
std::swap(row_begin, row_end);
if (col_begin > col_end)
std::swap(col_begin, col_end);
}
bool Range::next()
+6 -3
View File
@@ -117,14 +117,17 @@ protected:
class AppExport Range {
public:
Range(const char *range);
Range(const char *range, bool normalize=false);
Range(int _row_begin, int _col_begin, int _row_end, int _col_end);
Range(int _row_begin, int _col_begin, int _row_end, int _col_end, bool normalize=false);
Range(const CellAddress & from, const CellAddress & to);
Range(const CellAddress & from, const CellAddress & to, bool normalize=false);
bool next();
/** Make sure the range starts from top left and ends with bottom right corner **/
void normalize();
/** Current row */
inline int row() const { return row_curr; }
+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;
+1 -1
View File
@@ -69,7 +69,7 @@ int AxisPy::PyInit(PyObject* args, PyObject* /*kwd*/)
PyErr_Clear();
PyObject* d;
if (PyArg_ParseTuple(args, "O!O", &(Base::VectorPy::Type), &o,
if (PyArg_ParseTuple(args, "O!O!", &(Base::VectorPy::Type), &o,
&(Base::VectorPy::Type), &d)) {
// NOTE: The first parameter defines the base (origin) and the second the direction.
*getAxisPtr() = Base::Axis(static_cast<Base::VectorPy*>(o)->value(),
+120 -72
View File
@@ -14,196 +14,244 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the BoundBox export class</DeveloperDocu>
<UserDocu>Bound box class
A bounding box is an orthographic cube which is a way to describe outer boundaries.
You get a bounding box from a lot of 3D types. It is often used to check if a 3D
entity lies in the range of another object. Checking for bounding interference first
can save a lot of computing time!
Constructor:
App.BoundBox([Xmin,Ymin,Zmin,Xmax,Ymax,Zmax])
App.BoundBox(Tuple, Tuple)
App.BoundBox(Vector, Vector)
App.BoundBox(BoundBox)
</UserDocu>
<UserDocu>Base.BoundBox class.\n
This class represents a bounding box.
A bounding box is a rectangular cuboid which is a way to describe outer
boundaries and is obtained from a lot of 3D types.
It is often used to check if a 3D entity lies in the range of another object.
Checking for bounding interference first can save a lot of computing time!
An invalid BoundBox is represented by inconsistent values at each direction:
The maximum float value of the system at the minimum coordinates, and the
opposite value at the maximum coordinates.\n
The following constructors are supported:\n
BoundBox()
Empty constructor. Returns an invalid BoundBox.\n
BoundBox(boundBox)
Copy constructor.
boundBox : Base.BoundBox\n
BoundBox(xMin, yMin=0, zMin=0, xMax=0, yMax=0, zMax=0)
Define from the minimum and maximum values at each direction.
xMin : float\n Minimum value at x-coordinate.
yMin : float\n Minimum value at y-coordinate.
zMin : float\n Minimum value at z-coordinate.
xMax : float\n Maximum value at x-coordinate.
yMax : float\n Maximum value at y-coordinate.
zMax : float\n Maximum value at z-coordinate.\n
App.BoundBox(min, max)
Define from two containers representing the minimum and maximum values of the
coordinates in each direction.
min : Base.Vector, tuple\n Minimum values of the coordinates.
max : Base.Vector, tuple\n Maximum values of the coordinates.</UserDocu>
</Documentation>
<Methode Name="setVoid">
<Documentation>
<UserDocu>method setVoid()
Invalidate the bounding box</UserDocu>
<UserDocu>setVoid() -> None\n
Invalidate the bounding box.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isValid">
<Documentation>
<UserDocu>method isValid()
Checks if the bounding box is valid</UserDocu>
<UserDocu>isValid() -> bool\n
Checks if the bounding box is valid.</UserDocu>
</Documentation>
</Methode>
<Methode Name="add">
<Documentation>
<UserDocu>method add(BoundBox)
Add (enlarge) the given BoundBox</UserDocu>
<UserDocu>add(minMax) -> None
add(x, y, z) -> None\n
Increase the maximum values or decrease the minimum values of this BoundBox by
replacing the current values with the given values, so the bounding box can grow
but not shrink.\n
minMax : Base.Vector, tuple\n Values to enlarge at each direction.
x : float\n Value to enlarge at x-direction.
y : float\n Value to enlarge at y-direction.
z : float\n Value to enlarge at z-direction.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getPoint">
<Documentation>
<UserDocu>method getPoint(Int)
Get the point of the given index. The index must be in the range of [0,7]
</UserDocu>
<UserDocu>getPoint(index) ->Base.Vector\n
Get the point of the given index.
The index must be in the range of [0, 7].\n
index : int</UserDocu>
</Documentation>
</Methode>
<Methode Name="getEdge">
<Documentation>
<UserDocu>method getEdge(Int)
Get the edge points of the given index. The index must be in the range of [0,11]
</UserDocu>
<UserDocu>getEdge(index) -> tuple of Base.Vector\n
Get the edge points of the given index.
The index must be in the range of [0, 11].\n
index : int</UserDocu>
</Documentation>
</Methode>
<Methode Name="closestPoint">
<Documentation>
<UserDocu>method closestPoint(Vector)
Get the closest point of the bounding box to the given point
</UserDocu>
<UserDocu>closestPoint(point) -> Base.Vector
closestPoint(x, y, z) -> Base.Vector\n
Get the closest point of the bounding box to the given point.\n
point : Base.Vector, tuple\n Coordinates of the given point.
x : float\n X-coordinate of the given point.
y : float\n Y-coordinate of the given point.
z : float\n Z-coordinate of the given point.</UserDocu>
</Documentation>
</Methode>
<Methode Name="intersect">
<Documentation>
<UserDocu>method intersect(BoundBox|Vector Base, Vector Dir)
Checks if the given object intersects with the BoundBox. That can be:
- Another BoundBox
- A line, specified by Base and Dir
</UserDocu>
<UserDocu>intersect(boundBox2) -> bool
intersect(base, dir) -> bool\n
Checks if the given object intersects with this bounding box. That can be
another bounding box or a line specified by base and direction.\n
boundBox2 : Base.BoundBox
base : Base.Vector, tuple
dir : Base.Vector, tuple</UserDocu>
</Documentation>
</Methode>
<Methode Name="intersected">
<Documentation>
<UserDocu>method intersected(BoundBox)
Returns the intersection of this and the given bounding box.
</UserDocu>
<UserDocu>intersected(boundBox2) -> Base.BoundBox\n
Returns the intersection of this and the given bounding box.\n
boundBox2 : Base.BoundBox</UserDocu>
</Documentation>
</Methode>
<Methode Name="united">
<Documentation>
<UserDocu>method united(BoundBox)
Returns the union of this and the given bounding box.
</UserDocu>
<UserDocu>united(boundBox2) -> Base.BoundBox\n
Returns the union of this and the given bounding box.\n
boundBox2 : Base.BoundBox</UserDocu>
</Documentation>
</Methode>
<Methode Name="enlarge">
<Documentation>
<UserDocu>method enlarge(Float)
Enlarge the BoundBox by the given value in each direction.
A negative value shrinks the box.</UserDocu>
<UserDocu>enlarge(variation) -> None\n
Decrease the minimum values and increase the maximum values by the given value.
A negative value shrinks the bounding box.\n
variation : float</UserDocu>
</Documentation>
</Methode>
<Methode Name="getIntersectionPoint">
<Documentation>
<UserDocu>method Vector getIntersectionPoint(Vector Base, Vector Dir, [float epsilon=0.0001])
Calculate the intersection point of a line with the BoundBox
The Base point must lie inside the bounding box, if not an
exception is thrown.
</UserDocu>
<UserDocu>getIntersectionPoint(base, dir, epsilon=0.0001) -> Base.Vector\n
Calculate the intersection point of a line with the bounding box.
The base point must lie inside the bounding box, if not an exception is thrown.\n
base : Base.Vector\n Base point of the line.
dir : Base.Vector\n Direction of the line.
epsilon : float\n Bounding box size tolerance.</UserDocu>
</Documentation>
</Methode>
<Methode Name="move">
<Documentation>
<UserDocu> method move(Vector)
Move the BoundBox by the given vector
</UserDocu>
<UserDocu>move(displacement) -> None
move(x, y, z) -> None\n
Move the bounding box by the given values.\n
displacement : Base.Vector, tuple\n Displacement at each direction.
x : float\n Displacement at x-direction.
y : float\n Displacement at y-direction.
z : float\n Displacement at z-direction.</UserDocu>
</Documentation>
</Methode>
<Methode Name="scale">
<Documentation>
<UserDocu> method scale(x,y,z)
Scale the BoundBox by the given values in x, y and z
</UserDocu>
<UserDocu>scale(factor) -> None
scale(x, y, z) -> None\n
Scale the bounding box by the given values.\n
factor : Base.Vector, tuple\n Factor scale at each direction.
x : float\n Scale at x-direction.
y : float\n Scale at y-direction.
z : float\n Scale at z-direction.</UserDocu>
</Documentation>
</Methode>
<Methode Name="transformed">
<Documentation>
<UserDocu> method transformed(Matrix)
Return a new bounding box with the transformed corner of this bounding box
</UserDocu>
<UserDocu>transformed(matrix) -> Base.BoundBox\n
Returns a new BoundBox containing the transformed rectangular cuboid
represented by this BoundBox.\n
matrix : Base.Matrix\n Transformation matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isCutPlane">
<Documentation>
<UserDocu>method bool isCutPlane(Vector Base, Vector Normal)
Check if the plane specified by Base and Normal intersects (cuts) the BoundBox</UserDocu>
<UserDocu>isCutPlane(base, normal) -> bool\n
Check if the plane specified by base and normal intersects (cuts) this bounding
box.\n
base : Base.Vector
normal : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="isInside">
<Documentation>
<UserDocu>
method bool isInside(Vector Base|BoundBox box)
Check if the point or bounding box is inside this bounding box
</UserDocu>
<UserDocu>isInside(object) -> bool
isInside(x, y, z) -> bool\n
Check if a point or a bounding box is inside this bounding box.\n
object : Base.Vector, Base.BoundBox\n Object to check if it is inside this bounding box.
x : float\n X-coordinate of the point to check.
y : float\n Y-coordinate of the point to check.
z : float\n Z-coordinate of the point to check.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Center" ReadOnly="true">
<Documentation>
<UserDocu>Center point of the bounding box</UserDocu>
<UserDocu>Center point of the bounding box.</UserDocu>
</Documentation>
<Parameter Name="Center" Type="Object" />
</Attribute>
<Attribute Name="XMax" ReadOnly="false">
<Documentation>
<UserDocu>The maximum x boundary position</UserDocu>
<UserDocu>The maximum x boundary position.</UserDocu>
</Documentation>
<Parameter Name="XMax" Type="Float" />
</Attribute>
<Attribute Name="YMax" ReadOnly="false">
<Documentation>
<UserDocu>The maximum y boundary position</UserDocu>
<UserDocu>The maximum y boundary position.</UserDocu>
</Documentation>
<Parameter Name="YMax" Type="Float" />
</Attribute>
<Attribute Name="ZMax" ReadOnly="false">
<Documentation>
<UserDocu>The maximum z boundary position</UserDocu>
<UserDocu>The maximum z boundary position.</UserDocu>
</Documentation>
<Parameter Name="ZMax" Type="Float" />
</Attribute>
<Attribute Name="XMin" ReadOnly="false">
<Documentation>
<UserDocu>The minimum x boundary position</UserDocu>
<UserDocu>The minimum x boundary position.</UserDocu>
</Documentation>
<Parameter Name="XMin" Type="Float" />
</Attribute>
<Attribute Name="YMin" ReadOnly="false">
<Documentation>
<UserDocu>The minimum y boundary position</UserDocu>
<UserDocu>The minimum y boundary position.</UserDocu>
</Documentation>
<Parameter Name="YMin" Type="Float" />
</Attribute>
<Attribute Name="ZMin" ReadOnly="false">
<Documentation>
<UserDocu>The minimum z boundary position</UserDocu>
<UserDocu>The minimum z boundary position.</UserDocu>
</Documentation>
<Parameter Name="ZMin" Type="Float" />
</Attribute>
<Attribute Name="XLength" ReadOnly="true">
<Documentation>
<UserDocu>Length of the BoundBox in x direction</UserDocu>
<UserDocu>Length of the bounding box in x direction.</UserDocu>
</Documentation>
<Parameter Name="XLength" Type="Float" />
</Attribute>
<Attribute Name="YLength" ReadOnly="true">
<Documentation>
<UserDocu>Length of the BoundBox in y direction</UserDocu>
<UserDocu>Length of the bounding box in y direction.</UserDocu>
</Documentation>
<Parameter Name="YLength" Type="Float" />
</Attribute>
<Attribute Name="ZLength" ReadOnly="true">
<Documentation>
<UserDocu>Length of the BoundBox in z direction</UserDocu>
<UserDocu>Length of the bounding box in z direction.</UserDocu>
</Documentation>
<Parameter Name="ZLength" Type="Float" />
</Attribute>
<Attribute Name="DiagonalLength" ReadOnly="true">
<Documentation>
<UserDocu>Diagonal length of the BoundBox</UserDocu>
<UserDocu>Diagonal length of the bounding box.</UserDocu>
</Documentation>
<Parameter Name="DiagonalLength" Type="Float" />
</Attribute>
+24 -25
View File
@@ -311,23 +311,22 @@ PyObject* BoundBoxPy::getIntersectionPoint(PyObject *args)
{
PyObject *object,*object2;
double epsilon=0.0001;
if (PyArg_ParseTuple(args,"O!O!|d:Need base and direction vector",
&(Base::VectorPy::Type), &object,&(Base::VectorPy::Type), &object2, &epsilon)) {
Base::Vector3d point;
bool ok = getBoundBoxPtr()->IntersectionPoint(
*(static_cast<Base::VectorPy*>(object)->getVectorPtr()),
*(static_cast<Base::VectorPy*>(object2)->getVectorPtr()),
point, epsilon);
if (ok) {
return new VectorPy(point);
}
else {
PyErr_SetString(Base::PyExc_FC_GeneralError, "No intersection");
return nullptr;
}
}
else
if (!PyArg_ParseTuple(args,"O!O!|d;Need base and direction vector",
&(Base::VectorPy::Type), &object,&(Base::VectorPy::Type), &object2, &epsilon))
return nullptr;
Base::Vector3d point;
bool ok = getBoundBoxPtr()->IntersectionPoint(
*(static_cast<Base::VectorPy*>(object)->getVectorPtr()),
*(static_cast<Base::VectorPy*>(object2)->getVectorPtr()),
point, epsilon);
if (ok) {
return new VectorPy(point);
}
else {
PyErr_SetString(Base::PyExc_FC_GeneralError, "No intersection");
return nullptr;
}
}
PyObject* BoundBoxPy::move(PyObject *args)
@@ -344,13 +343,13 @@ PyObject* BoundBoxPy::move(PyObject *args)
}
PyErr_Clear();
if (PyArg_ParseTuple(args,"O!:Need vector to move",&PyTuple_Type, &object)) {
if (PyArg_ParseTuple(args,"O!",&PyTuple_Type, &object)) {
vec = getVectorFromTuple<double>(object);
break;
}
PyErr_Clear();
if (PyArg_ParseTuple(args,"O!:Need vector to move",&(Base::VectorPy::Type), &object)) {
if (PyArg_ParseTuple(args,"O!",&(Base::VectorPy::Type), &object)) {
vec = *(static_cast<Base::VectorPy*>(object)->getVectorPtr());
break;
}
@@ -382,13 +381,13 @@ PyObject* BoundBoxPy::scale(PyObject *args)
}
PyErr_Clear();
if (PyArg_ParseTuple(args,"O!:Need vector to scale",&PyTuple_Type, &object)) {
if (PyArg_ParseTuple(args,"O!",&PyTuple_Type, &object)) {
vec = getVectorFromTuple<double>(object);
break;
}
PyErr_Clear();
if (PyArg_ParseTuple(args,"O!:Need vector to scale",&(Base::VectorPy::Type), &object)) {
if (PyArg_ParseTuple(args,"O!",&(Base::VectorPy::Type), &object)) {
vec = *(static_cast<Base::VectorPy*>(object)->getVectorPtr());
break;
}
@@ -429,14 +428,14 @@ PyObject* BoundBoxPy::isCutPlane(PyObject *args)
return nullptr;
}
if (PyArg_ParseTuple(args,"O!O!:Need base and normal vector of a plane",
if (!PyArg_ParseTuple(args,"O!O!;Need base and normal vector of a plane",
&(Base::VectorPy::Type), &object,&(Base::VectorPy::Type), &object2))
retVal = getBoundBoxPtr()->IsCutPlane(
*(static_cast<Base::VectorPy*>(object)->getVectorPtr()),
*(static_cast<Base::VectorPy*>(object2)->getVectorPtr()));
else
return nullptr;
retVal = getBoundBoxPtr()->IsCutPlane(
*(static_cast<Base::VectorPy*>(object)->getVectorPtr()),
*(static_cast<Base::VectorPy*>(object2)->getVectorPtr()));
return Py::new_reference_to(retVal);
}
+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]) {
+27 -19
View File
@@ -14,68 +14,76 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the CoordinateSystem export class</DeveloperDocu>
<UserDocu></UserDocu>
<UserDocu>Base.CoordinateSystem class.\n
An orthonormal right-handed coordinate system in 3D space.\n
CoordinateSystem()
Empty constructor.</UserDocu>
</Documentation>
<Methode Name="setAxes">
<Documentation>
<UserDocu>setAxes(Axis or Vector z, Vector x)
Set axis or z direction and x direction</UserDocu>
<UserDocu>setAxes(axis, xDir) -> None\n
Set axis or Z-direction, and X-direction.
The X-direction is determined from the orthonormal compononent of `xDir`
with respect to `axis` direction.\n
axis : Base.Axis, Base.Vector
xDir : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="displacement" Const="true">
<Documentation>
<UserDocu>displacement(CoordinateSystem)
Computes the placement from this to the passed coordinate system</UserDocu>
<UserDocu>displacement(coordSystem2) -> Base.Placement\n
Computes the placement from this to the passed coordinate system `coordSystem2`.\n
coordSystem2 : Base.CoordinateSystem</UserDocu>
</Documentation>
</Methode>
<Methode Name="transformTo">
<Documentation>
<UserDocu>transformTo(Vector)
Computes the coordinates of the point in coordinates of this system
</UserDocu>
<UserDocu>transformTo(vector) -> Base.Vector\n
Computes the coordinates of the point in coordinates of this coordinate system.\n
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="transform">
<Documentation>
<UserDocu>transform(Rotation or Placement)
Applies the rotation or placement on this coordinate system
</UserDocu>
<UserDocu>transform(trans) -> None\n
Applies a transformation on this coordinate system.\n
trans : Base.Rotation, Base.Placement</UserDocu>
</Documentation>
</Methode>
<Methode Name="setPlacement">
<Documentation>
<UserDocu>setPlacment(Placement)
Set placement to the coordinate system.
</UserDocu>
<UserDocu>setPlacment(placement) -> None\n
Set placement to the coordinate system.\n
placement : Base.Placement</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Axis" ReadOnly="false">
<Documentation>
<UserDocu>Set or get axis</UserDocu>
<UserDocu>Set or get axis.</UserDocu>
</Documentation>
<Parameter Name="Axis" Type="Object" />
</Attribute>
<Attribute Name="XDirection" ReadOnly="false">
<Documentation>
<UserDocu>Set or get x direction</UserDocu>
<UserDocu>Set or get X-direction.</UserDocu>
</Documentation>
<Parameter Name="XDirection" Type="Object" />
</Attribute>
<Attribute Name="YDirection" ReadOnly="false">
<Documentation>
<UserDocu>Set or get y direction</UserDocu>
<UserDocu>Set or get Y-direction.</UserDocu>
</Documentation>
<Parameter Name="YDirection" Type="Object" />
</Attribute>
<Attribute Name="ZDirection" ReadOnly="false">
<Documentation>
<UserDocu>Set or get z direction</UserDocu>
<UserDocu>Set or get Z-direction.</UserDocu>
</Documentation>
<Parameter Name="ZDirection" Type="Object" />
</Attribute>
<Attribute Name="Position" ReadOnly="false">
<Documentation>
<UserDocu>Set or get position</UserDocu>
<UserDocu>Set or get position.</UserDocu>
</Documentation>
<Parameter Name="Position" Type="Object" />
</Attribute>
+9 -1
View File
@@ -181,11 +181,18 @@ std::string FileInfo::getTempFileName(const char* FileName, const char* Path)
buf += "/fileXXXXXX";
}
std::vector<char> vec;
std::copy(buf.begin(), buf.end(), std::back_inserter(vec));
vec.push_back('\0');
/* coverity[secure_temp] mkstemp uses 0600 as the mode and is safe */
int id = mkstemp(const_cast<char*>(buf.c_str()));
int id = mkstemp(vec.data());
if (id > -1) {
FILE* file = fdopen(id, "w");
fclose(file);
vec.pop_back(); // remove '\0'
std::string str(vec.begin(), vec.end());
buf.swap(str);
unlink(buf.c_str());
}
return buf;
@@ -512,6 +519,7 @@ bool FileInfo::copyTo(const char* NewName) const
FileInfo fi1(FileName);
FileInfo fi2(NewName);
Base::ifstream file(fi1, std::ios::in | std::ios::binary);
file.unsetf(std::ios_base::skipws);
Base::ofstream copy(fi2, std::ios::out | std::ios::binary);
file >> copy.rdbuf();
return file.is_open() && copy.is_open();
+1 -1
View File
@@ -60,7 +60,7 @@ public:
Vector2dPy(Py::PythonClassInstance *self, Py::Tuple &args, Py::Dict &kwds);
virtual ~Vector2dPy();
static void init_type(void);
static void init_type();
Py::Object getattro(const Py::String &name_);
int setattro(const Py::String &name_, const Py::Object &value);
virtual Py::Object repr();
+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()
{
+16 -26
View File
@@ -34,59 +34,49 @@
using namespace Base;
Matrix4D::Matrix4D ()
: dMtrx4D{{1.,0.,0.,0.},
{0.,1.,0.,0.},
{0.,0.,1.,0.},
{0.,0.,0.,1.}}
{
setToUnity();
}
Matrix4D::Matrix4D (float a11, float a12, float a13, float a14,
float a21, float a22, float a23, float a24,
float a31, float a32, float a33, float a34,
float a41, float a42, float a43, float a44 )
float a41, float a42, float a43, float a44)
: dMtrx4D{{a11,a12,a13,a14},
{a21,a22,a23,a24},
{a31,a32,a33,a34},
{a41,a42,a43,a44}}
{
dMtrx4D[0][0] = static_cast<double>(a11);
dMtrx4D[0][1] = static_cast<double>(a12);
dMtrx4D[0][2] = static_cast<double>(a13);
dMtrx4D[0][3] = static_cast<double>(a14);
dMtrx4D[1][0] = static_cast<double>(a21);
dMtrx4D[1][1] = static_cast<double>(a22);
dMtrx4D[1][2] = static_cast<double>(a23);
dMtrx4D[1][3] = static_cast<double>(a24);
dMtrx4D[2][0] = static_cast<double>(a31);
dMtrx4D[2][1] = static_cast<double>(a32);
dMtrx4D[2][2] = static_cast<double>(a33);
dMtrx4D[2][3] = static_cast<double>(a34);
dMtrx4D[3][0] = static_cast<double>(a41);
dMtrx4D[3][1] = static_cast<double>(a42);
dMtrx4D[3][2] = static_cast<double>(a43);
dMtrx4D[3][3] = static_cast<double>(a44);
}
Matrix4D::Matrix4D (double a11, double a12, double a13, double a14,
double a21, double a22, double a23, double a24,
double a31, double a32, double a33, double a34,
double a41, double a42, double a43, double a44 )
: dMtrx4D{{a11,a12,a13,a14},
{a21,a22,a23,a24},
{a31,a32,a33,a34},
{a41,a42,a43,a44}}
{
dMtrx4D[0][0] = a11; dMtrx4D[0][1] = a12; dMtrx4D[0][2] = a13; dMtrx4D[0][3] = a14;
dMtrx4D[1][0] = a21; dMtrx4D[1][1] = a22; dMtrx4D[1][2] = a23; dMtrx4D[1][3] = a24;
dMtrx4D[2][0] = a31; dMtrx4D[2][1] = a32; dMtrx4D[2][2] = a33; dMtrx4D[2][3] = a34;
dMtrx4D[3][0] = a41; dMtrx4D[3][1] = a42; dMtrx4D[3][2] = a43; dMtrx4D[3][3] = a44;
}
Matrix4D::Matrix4D (const Matrix4D& rclMtrx)
Matrix4D::Matrix4D (const Matrix4D& rclMtrx) : Matrix4D()
{
(*this) = rclMtrx;
}
Matrix4D::Matrix4D (const Vector3f& rclBase, const Vector3f& rclDir, float fAngle)
: Matrix4D()
{
setToUnity();
this->rotLine(rclBase,rclDir,fAngle);
}
Matrix4D::Matrix4D (const Vector3d& rclBase, const Vector3d& rclDir, double fAngle)
: Matrix4D()
{
setToUnity();
this->rotLine(rclBase,rclDir,fAngle);
}
+144 -110
View File
@@ -16,303 +16,337 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the Matrix export class</DeveloperDocu>
<UserDocu>A 4x4 Matrix</UserDocu>
<UserDocu>Base.Matrix class.\n
A 4x4 Matrix.
In particular, this matrix can represent an affine transformation, that is, given a
3D vector `x`, apply the transformation y = M*x + b, where the matrix `M` is a linear
map and the vector `b` is a translation.
`y` can be obtained using a linear transformation represented by the 4x4 matrix `A`
conformed by the augmented 3x4 matrix (M|b), augmented by row with (0,0,0,1), therefore:
(y, 1) = A*(x, 1).\n
The following constructors are supported:\n
Matrix()
Empty constructor.\n
Matrix(matrix)
Copy constructor.
matrix : Base.Matrix.\n
Matrix(*coef)
Define from 16 coefficients of the 4x4 matrix.
coef : sequence of float\n The sequence can have up to 16 elements which complete the matrix by rows.\n
Matrix(vector1, vector2, vector3, vector4)
Define from four 3D vectors which represent the columns of the 3x4 submatrix, useful
to represent an affine transformation. The fourth row is made up by (0,0,0,1).
vector1 : Base.Vector
vector2 : Base.Vector
vector3 : Base.Vector
vector4 : Base.Vector\n Default to (0,0,0). Optional.</UserDocu>
</Documentation>
<Methode Name="move">
<Documentation>
<UserDocu>
move(Vector)
Move the matrix along the vector
</UserDocu>
<UserDocu>move(vector) -> None
move(x, y, z) -> None\n
Move the matrix along a vector, equivalent to left multiply the matrix
by a pure translation transformation.\n
vector : Base.Vector, tuple
x : float\n `x` translation.
y : float\n `y` translation.
z : float\n `z` translation.</UserDocu>
</Documentation>
</Methode>
<Methode Name="scale">
<Documentation>
<UserDocu>
scale(Vector)
Scale the matrix with the vector
</UserDocu>
<UserDocu>scale(vector) -> None
scale(x, y, z) -> None
scale(factor) -> None\n
Scale the first three rows of the matrix.\n
vector : Base.Vector
x : float\n First row factor scale.
y : float\n Second row factor scale.
z : float\n Third row factor scale.
factor : float\n global factor scale.</UserDocu>
</Documentation>
</Methode>
<Methode Name="hasScale" Const="true">
<Documentation>
<UserDocu>
hasScale(tol=0.0)
<UserDocu>hasScale(tol=0) -> ScaleType\n
Return an enum value of ScaleType. Possible values are:
Uniform, NonUniformLeft, NonUniformRight, NoScaling or Other
if it's not a scale matrix
</UserDocu>
if it's not a scale matrix.\n
tol : float</UserDocu>
</Documentation>
</Methode>
<Methode Name="nullify">
<Documentation>
<UserDocu>nullify() - make this the null matrix</UserDocu>
<UserDocu>nullify() -> None\n
Make this the null matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isNull" Const="true">
<Documentation>
<UserDocu>isNull() - check if this is the null matrix</UserDocu>
<UserDocu>isNull() -> bool\n
Check if this is the null matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="unity">
<Documentation>
<UserDocu>unity() - make this matrix to unity</UserDocu>
<UserDocu>unity() -> None\n
Make this matrix to unity (4D identity matrix).</UserDocu>
</Documentation>
</Methode>
<Methode Name="isUnity" Const="true">
<Documentation>
<UserDocu>isUnity() - check if this is the unit matrix</UserDocu>
<UserDocu>isUnity() -> bool\n
Check if this is the unit matrix (4D identity matrix).</UserDocu>
</Documentation>
</Methode>
<Methode Name="transform">
<Documentation>
<UserDocu>transform(Vector,Matrix) - return the dot product of the two vectors</UserDocu>
<UserDocu>transform(vector, matrix2) -> None\n
Transform the matrix around a given point.
Equivalent to left multiply the matrix by T*M*T_inv, where M is `matrix2`, T the
translation generated by `vector` and T_inv the inverse translation.
For example, if `matrix2` is a rotation, the result is the transformation generated
by the current matrix followed by a rotation around the point represented by `vector`.\n
vector : Base.Vector
matrix2 : Base.Matrix</UserDocu>
</Documentation>
</Methode>
<Methode Name="col" Const="true">
<Documentation>
<UserDocu>
col(index)
Return the vector of a column
</UserDocu>
<UserDocu>col(index) -> Base.Vector\n
Return the vector of a column, that is, the vector generated by the three
first elements of the specified column.
index : int\n Required column index.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setCol">
<Documentation>
<UserDocu>
setCol(index, Vector)
Set the vector of a column
</UserDocu>
<UserDocu>setCol(index, vector) -> None\n
Set the vector of a column, that is, the three first elements of the specified
column by index.\n
index : int\n Required column index.
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="row" Const="true">
<Documentation>
<UserDocu>
row(index)
Return the vector of a row
</UserDocu>
<UserDocu>row(index) -> Base.Vector\n
Return the vector of a row, that is, the vector generated by the three
first elements of the specified row.\n
index : int\n Required row index.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setRow">
<Documentation>
<UserDocu>
setRow(index, Vector)
Set the vector of a row
</UserDocu>
<UserDocu>setRow(index, vector) -> None\n
Set the vector of a row, that is, the three first elements of the specified
row by index.\n
index : int\n Required row index.
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="trace" Const="true">
<Documentation>
<UserDocu>
trace()
Return the trace of the 3x3 sub-matrix as vector
</UserDocu>
<UserDocu>trace() -> Base.Vector\n
Return the diagonal of the 3x3 leading principal submatrix as vector.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setTrace">
<Documentation>
<UserDocu>
setTrace(Vector)
Set the trace of the 3x3 sub-matrix
</UserDocu>
<UserDocu>setTrace(vector) -> None\n
Set the diagonal of the 3x3 leading principal submatrix.\n
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="rotateX">
<Documentation>
<UserDocu>rotateX(float) - rotate around X</UserDocu>
<UserDocu>rotateX(angle) -> None\n
Rotate around X axis.
angle : float\n Angle in radians.</UserDocu>
</Documentation>
</Methode>
<Methode Name="rotateY">
<Documentation>
<UserDocu>rotateY(float) - rotate around Y</UserDocu>
<UserDocu>rotateY(angle) -> None\n
Rotate around Y axis.
angle : float\n Angle in radians.</UserDocu>
</Documentation>
</Methode>
<Methode Name="rotateZ">
<Documentation>
<UserDocu>rotateZ(float) - rotate around Z</UserDocu>
<UserDocu>rotateZ(angle) -> None\n
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|Vector)
Multiply a matrix or vector with this matrix
</UserDocu>
<UserDocu>multiply(matrix) -> Base.Matrix
multiply(vector) -> Base.Vector\n
Right multiply the matrix by the given object.
If the argument is a vector, this is augmented to the 4D vector (`vector`, 1).\n
matrix : Base.Matrix
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="multVec" Const="true">
<Documentation>
<UserDocu>
multVec(Vector) -> Vector
Compute the transformed vector using the matrix
</UserDocu>
<UserDocu>multVec(vector) -> Base.Vector\n
Compute the transformed vector using the matrix.
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="invert">
<Documentation>
<UserDocu>
invert() -> None
Compute the inverse matrix, if possible
</UserDocu>
<UserDocu>invert() -> None\n
Compute the inverse matrix in-place, if possible.</UserDocu>
</Documentation>
</Methode>
<Methode Name="inverse">
<Documentation>
<UserDocu>
inverse() -> Matrix
Compute the inverse matrix, if possible
</UserDocu>
<Methode Name="inverse" Const="true">
<Documentation><UserDocu>inverse() -> Base.Matrix\n
Compute the inverse matrix, if possible.</UserDocu>
</Documentation>
</Methode>
<Methode Name="transpose">
<Documentation>
<UserDocu>
transpose() -> None
Transpose the matrix.
</UserDocu>
<UserDocu>transpose() -> None\n
Transpose the matrix in-place.</UserDocu>
</Documentation>
</Methode>
<Methode Name="transposed" Const="true">
<Documentation>
<UserDocu>
transposed() -> Matrix
Returns a transposed copy of this matrix.
</UserDocu>
<UserDocu>transposed() -> Base.Matrix\n
Returns a transposed copy of this matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="determinant">
<Methode Name="determinant" Const="true">
<Documentation>
<UserDocu>
determinant() -> Float
Compute the determinant of the matrix
</UserDocu>
<UserDocu>determinant() -> float\n
Compute the determinant of the matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isOrthogonal">
<Methode Name="isOrthogonal" Const="true">
<Documentation>
<UserDocu>
isOrthogonal([Float]) -> Float
<UserDocu>isOrthogonal(tol=1e-6) -> float\n
Checks if the matrix is orthogonal, i.e. M * M^T = k*I and returns
the multiple of the identity matrix. If it's not orthogonal 0 is returned.
As argument you can set a tolerance which by default is 1.0e-6.
</UserDocu>
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(int) -> Matrix
Get the sub-matrix. The parameter must be in the range [1,4].
</UserDocu>
<UserDocu>submatrix(dim) -> Base.Matrix\n
Get the leading principal submatrix of the given dimension.
The (4 - `dim`) remaining dimensions are completed with the
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() -> string
Analyzes the type of transformation.
</UserDocu>
<UserDocu>analyze() -> str\n
Analyzes the type of transformation.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="A11" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (1,1) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A11" Type="Float" />
</Attribute>
<Attribute Name="A12" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (1,2) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A12" Type="Float" />
</Attribute>
<Attribute Name="A13" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (1,3) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A13" Type="Float" />
</Attribute>
<Attribute Name="A14" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (1,4) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A14" Type="Float" />
</Attribute>
<Attribute Name="A21" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (2,1) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A21" Type="Float" />
</Attribute>
<Attribute Name="A22" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (2,2) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A22" Type="Float" />
</Attribute>
<Attribute Name="A23" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (2,3) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A23" Type="Float" />
</Attribute>
<Attribute Name="A24" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (2,4) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A24" Type="Float" />
</Attribute>
<Attribute Name="A31" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (3,1) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A31" Type="Float" />
</Attribute>
<Attribute Name="A32" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (3,2) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A32" Type="Float" />
</Attribute>
<Attribute Name="A33" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (3,3) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A33" Type="Float" />
</Attribute>
<Attribute Name="A34" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (3,4) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A34" Type="Float" />
</Attribute>
<Attribute Name="A41" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (4,1) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A41" Type="Float" />
</Attribute>
<Attribute Name="A42" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (4,2) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A42" Type="Float" />
</Attribute>
<Attribute Name="A43" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (4,3) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A43" Type="Float" />
</Attribute>
<Attribute Name="A44" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The (4,4) matrix element.</UserDocu>
</Documentation>
<Parameter Name="A44" Type="Float" />
</Attribute>
<Attribute Name="A" ReadOnly="false">
<Documentation>
<UserDocu>The matrix elements</UserDocu>
<UserDocu>The matrix elements.</UserDocu>
</Documentation>
<Parameter Name="A" Type="Sequence" />
</Attribute>
+67 -64
View File
@@ -120,7 +120,7 @@ int MatrixPy::PyInit(PyObject* args, PyObject* /*kwd*/)
return 0;
}
PyErr_SetString(PyExc_TypeError, "matrix or up to 16 floats expected");
PyErr_SetString(PyExc_TypeError, "Base.Matrix, four Base.Vector or up to 16 floats expected");
return -1;
}
@@ -291,10 +291,9 @@ PyObject* MatrixPy::move(PyObject * args)
PY_TRY {
getMatrixPtr()->move(vec);
Py_Return;
}
PY_CATCH;
Py_Return;
}
PyObject* MatrixPy::scale(PyObject * args)
@@ -337,10 +336,9 @@ PyObject* MatrixPy::scale(PyObject * args)
PY_TRY {
getMatrixPtr()->scale(vec);
Py_Return;
}
PY_CATCH;
Py_Return;
}
PyObject* MatrixPy::hasScale(PyObject * args)
@@ -358,6 +356,7 @@ PyObject* MatrixPy::nullify(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;
PY_TRY {
getMatrixPtr()->nullify();
Py_Return;
@@ -369,6 +368,7 @@ PyObject* MatrixPy::isNull(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;
PY_TRY {
bool ok = getMatrixPtr()->isNull();
return Py::new_reference_to(Py::Boolean(ok));
@@ -380,18 +380,19 @@ PyObject* MatrixPy::unity(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;
PY_TRY {
getMatrixPtr()->setToUnity();
Py_Return;
}
PY_CATCH;
Py_Return;
}
PyObject* MatrixPy::isUnity(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;
PY_TRY {
bool ok = getMatrixPtr()->isUnity();
return Py::new_reference_to(Py::Boolean(ok));
@@ -421,86 +422,91 @@ PyObject* MatrixPy::transform(PyObject * args)
PyObject* MatrixPy::col(PyObject * args)
{
int index;
if (PyArg_ParseTuple(args, "i", &index)) {
index = index % 4;
Matrix4D* mat = getMatrixPtr();
Base::Vector3d v = mat->getCol(index);
return Py::new_reference_to(Py::Vector(v));
if (!PyArg_ParseTuple(args, "i", &index))
return nullptr;
if (index < 0 || index > 3) {
PyErr_SetString(PyExc_ValueError, "Index expected in the range [0, 3]");
return nullptr;
}
PyErr_SetString(PyExc_TypeError, "int expected");
return nullptr;
Matrix4D* mat = getMatrixPtr();
Base::Vector3d v = mat->getCol(index);
return Py::new_reference_to(Py::Vector(v));
}
PyObject* MatrixPy::setCol(PyObject * args)
{
int index;
PyObject* o;
if (PyArg_ParseTuple(args, "iO!", &index, &(VectorPy::Type), &o)) {
index = index % 4;
Base::Vector3d v = Py::Vector(o, false).toVector();
Matrix4D* mat = getMatrixPtr();
mat->setCol(index, v);
Py_Return;
if (!PyArg_ParseTuple(args, "iO!", &index, &(VectorPy::Type), &o))
return nullptr;
if (index < 0 || index > 3) {
PyErr_SetString(PyExc_ValueError, "Index expected in the range [0, 3]");
return nullptr;
}
PyErr_SetString(PyExc_TypeError, "int and Vector expected");
return nullptr;
Base::Vector3d v = Py::Vector(o, false).toVector();
Matrix4D* mat = getMatrixPtr();
mat->setCol(index, v);
Py_Return;
}
PyObject* MatrixPy::row(PyObject * args)
{
int index;
if (PyArg_ParseTuple(args, "i", &index)) {
index = index % 4;
Matrix4D* mat = getMatrixPtr();
Base::Vector3d v = mat->getRow(index);
return Py::new_reference_to(Py::Vector(v));
if (!PyArg_ParseTuple(args, "i", &index))
return nullptr;
if (index < 0 || index > 3) {
PyErr_SetString(PyExc_ValueError, "Index expected in the range [0, 3]");
return nullptr;
}
PyErr_SetString(PyExc_TypeError, "int expected");
return nullptr;
Matrix4D* mat = getMatrixPtr();
Base::Vector3d v = mat->getRow(index);
return Py::new_reference_to(Py::Vector(v));
}
PyObject* MatrixPy::setRow(PyObject * args)
{
int index;
PyObject* o;
if (PyArg_ParseTuple(args, "iO!", &index, &(VectorPy::Type), &o)) {
index = index % 4;
Base::Vector3d v = Py::Vector(o, false).toVector();
Matrix4D* mat = getMatrixPtr();
mat->setRow(index, v);
Py_Return;
if (!PyArg_ParseTuple(args, "iO!", &index, &(VectorPy::Type), &o))
return nullptr;
if (index < 0 || index > 3) {
PyErr_SetString(PyExc_ValueError, "Index expected in the range [0, 3]");
return nullptr;
}
PyErr_SetString(PyExc_TypeError, "int and Vector expected");
return nullptr;
Base::Vector3d v = Py::Vector(o, false).toVector();
Matrix4D* mat = getMatrixPtr();
mat->setRow(index, v);
Py_Return;
}
PyObject* MatrixPy::trace(PyObject * args)
{
if (PyArg_ParseTuple(args, "")) {
Matrix4D* mat = getMatrixPtr();
Base::Vector3d v = mat->trace();
return Py::new_reference_to(Py::Vector(v));
}
if (!PyArg_ParseTuple(args, ""))
return nullptr;
return nullptr;
Matrix4D* mat = getMatrixPtr();
Base::Vector3d v = mat->trace();
return Py::new_reference_to(Py::Vector(v));
}
PyObject* MatrixPy::setTrace(PyObject * args)
{
PyObject* o;
if (PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &o)) {
Base::Vector3d v = Py::Vector(o, false).toVector();
Matrix4D* mat = getMatrixPtr();
mat->setTrace(v);
Py_Return;
}
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &o))
return nullptr;
PyErr_SetString(PyExc_TypeError, "Vector expected");
return nullptr;
Base::Vector3d v = Py::Vector(o, false).toVector();
Matrix4D* mat = getMatrixPtr();
mat->setTrace(v);
Py_Return;
}
PyObject* MatrixPy::rotateX(PyObject * args)
@@ -528,10 +534,9 @@ PyObject* MatrixPy::rotateX(PyObject * args)
PY_TRY {
getMatrixPtr()->rotX(angle);
Py_Return;
}
PY_CATCH;
Py_Return;
}
PyObject* MatrixPy::rotateY(PyObject * args)
@@ -559,10 +564,9 @@ PyObject* MatrixPy::rotateY(PyObject * args)
PY_TRY {
getMatrixPtr()->rotY(angle);
Py_Return;
}
PY_CATCH;
Py_Return;
}
PyObject* MatrixPy::rotateZ(PyObject * args)
@@ -590,10 +594,9 @@ PyObject* MatrixPy::rotateZ(PyObject * args)
PY_TRY {
getMatrixPtr()->rotZ(angle);
Py_Return;
}
PY_CATCH;
Py_Return;
}
PyObject* MatrixPy::multiply(PyObject * args)
@@ -619,6 +622,7 @@ PyObject* MatrixPy::multVec(PyObject * args)
PyObject *obj;
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &obj))
return nullptr;
Base::Vector3d vec(static_cast<VectorPy*>(obj)->value());
getMatrixPtr()->multVec(vec, vec);
return new VectorPy(new Vector3d(vec));
@@ -630,16 +634,16 @@ PyObject* MatrixPy::invert(PyObject * args)
return nullptr;
PY_TRY {
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON)
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON) {
getMatrixPtr()->inverseGauss();
Py_Return;
}
else {
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot invert singular matrix");
return nullptr;
}
}
PY_CATCH;
Py_Return;
}
PyObject* MatrixPy::inverse(PyObject * args)
@@ -659,14 +663,13 @@ PyObject* MatrixPy::inverse(PyObject * args)
}
}
PY_CATCH;
Py_Return;
}
PyObject* MatrixPy::determinant(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;
return PyFloat_FromDouble(getMatrixPtr()->determinant());
}
@@ -675,6 +678,7 @@ PyObject* MatrixPy::submatrix(PyObject * args)
int dim;
if (!PyArg_ParseTuple(args, "i", &dim))
return nullptr;
if (dim < 1 || dim > 4) {
PyErr_SetString(PyExc_IndexError, "Dimension out of range");
return nullptr;
@@ -709,6 +713,7 @@ PyObject* MatrixPy::isOrthogonal(PyObject * args)
double eps=1.0e-06;
if (!PyArg_ParseTuple(args, "|d",&eps))
return nullptr;
const Base::Matrix4D& mat = *getMatrixPtr();
Base::Matrix4D trp = mat;
trp.transpose();
@@ -747,8 +752,6 @@ PyObject* MatrixPy::transposed(PyObject * args)
return new MatrixPy(m);
}
PY_CATCH;
Py_Return;
}
PyObject* MatrixPy::transpose(PyObject * args)
+3 -3
View File
@@ -174,7 +174,7 @@ MemDebug::~MemDebug()
*/
int MemDebug::sReportHook(int nRptType,char *szMsg,int *retVal)
{
char *RptTypes[] = { "Warning", "Error", "Assert" };
const char *RptTypes[] = { "Warning", "Error", "Assert" };
if ( ( nRptType > 0 ) || ( strstr( szMsg, "HEAP CORRUPTION DETECTED" ) ) )
fprintf( logFile, "%s: %s", RptTypes[nRptType], szMsg );
@@ -199,8 +199,8 @@ int __cdecl MemDebug::sAllocHook(
int nLine
)
{
char *operation[] = { " :", "Alloc :", "Realloc:", "Free :" };
char *blockType[] = { "Free", "Normal", "CRT", "Ignore", "Client" };
const char *operation[] = { " :", "Alloc :", "Realloc:", "Free :" };
const char *blockType[] = { "Free", "Normal", "CRT", "Ignore", "Client" };
if ( nBlockUse == _CRT_BLOCK ) // Ignore internal C runtime library allocations
return( 7 ); // (True = 7, False = 0)
+1 -1
View File
@@ -85,7 +85,7 @@ class ParameterManager;
* and exporting groups of parameters and enables streaming
* to a persistent medium via XML.
* \par
* Its main task is making user parameter persitent, saving
* Its main task is making user parameter persistent, saving
* last used values in dialog boxes, setting and retrieving all
* kind of preferences and so on.
* @see ParameterManager
+12 -12
View File
@@ -12,35 +12,35 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the Persistence class</DeveloperDocu>
<UserDocu>This is a persistence class</UserDocu>
<UserDocu>Base.Persistence class.\n
Class to dump and restore the content of an object.</UserDocu>
</Documentation>
<Attribute Name="Content" ReadOnly="true">
<Documentation>
<UserDocu>Content of the object in XML representation</UserDocu>
<UserDocu>Content of the object in XML representation.</UserDocu>
</Documentation>
<Parameter Name="Content" Type="String" />
</Attribute>
<Attribute Name="MemSize" ReadOnly="true">
<Documentation>
<UserDocu>Memory size of the object in byte</UserDocu>
<UserDocu>Memory size of the object in bytes.</UserDocu>
</Documentation>
<Parameter Name="MemSize" Type="Int"/>
</Attribute>
<Methode Name="dumpContent" Keyword="true" Const="true">
<Documentation>
<UserDocu>Dumps the content of the object, both the XML representation as well as the additional datafiles
required, into a byte representation. It will be returned as byte array.
dumpContent() -- returns a byte array with full content
dumpContent(Compression=1-9) -- Sets the data compression from 0 (no) to 9 (max)
</UserDocu>
<UserDocu>dumpContent(Compression=3) -> bytearray\n
Dumps the content of the object, both the XML representation and the additional
data files required, into a byte representation.\n
Compression : int\n Set the data compression level in the range [0,9]. Set to 0 for no compression.</UserDocu>
</Documentation>
</Methode>
<Methode Name="restoreContent">
<Documentation>
<UserDocu>Restore the content of the object from a byte representation as stored by \"dumpContent\".
It could be restored from any python object implementing the buffer protocol.
restoreContent(buffer) -- restores from the given byte array
</UserDocu>
<UserDocu>restoreContent(obj) -> None\n
Restore the content of the object from a byte representation as stored by `dumpContent`.
It could be restored from any Python object implementing the buffer protocol.\n
obj : buffer\n Object with buffer protocol support.</UserDocu>
</Documentation>
</Methode>
</PythonExport>
+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"
+1 -1
View File
@@ -66,7 +66,7 @@ Placement Placement::fromDualQuaternion(DualQuat qq)
return Placement(Vector3d(mvq.x.re,mvq.y.re, mvq.z.re), rot);
}
Base::Matrix4D Placement::toMatrix(void) const
Base::Matrix4D Placement::toMatrix() const
{
Base::Matrix4D matrix;
_rot.getValue(matrix);
+1 -1
View File
@@ -15,7 +15,7 @@
FatherNamespace="Base">
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<UserDocu>Base.Placement class\n
<UserDocu>Base.Placement class.\n
A Placement defines an orientation (rotation) and a position (base) in 3D space.
It is used when no scaling or other distortion is needed.\n
The following constructors are supported:\n
+1
View File
@@ -66,6 +66,7 @@
#include <string>
#include <list>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <stack>
+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;
}
+99 -81
View File
@@ -16,157 +16,175 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the Rotation export class</DeveloperDocu>
<UserDocu>
A Rotation using a quaternion.
The Rotation object can be created by:
-- an empty parameter list
-- a Rotation object
-- a Vector (axis) and a float (angle)
-- two Vectors (rotation from/to vector)
-- three floats (Euler angles) as yaw-pitch-roll in XY'Z'' convention
-- one string and three floats (Euler angles) as euler rotation
of a given type. Call toEulerSequence() for supported sequence types.
-- four floats (Quaternion) where the quaternion is specified as:
q=xi+yj+zk+w, i.e. the last parameter is the real part
-- three vectors that define rotated axes directions + an optional
3-characher string of capital letters 'X', 'Y', 'Z' that sets the
order of importance of the axes (e.g., 'ZXY' means z direction is
followed strictly, x is used but corrected if necessary, y is ignored).
</UserDocu>
<UserDocu>Base.Rotation class.\n
A Rotation using a quaternion.\n
The following constructors are supported:\n
Rotation()
Empty constructor.\n
Rotation(rotation)
Copy constructor.\n
Rotation(Axis, Radian)
Rotation(Axis, Degree)
Define from an axis and an angle (in radians or degrees according to the keyword).
Axis : Base.Vector
Radian : float
Degree : float\n
Rotation(vector_start, vector_end)
Define from two vectors (rotation from/to vector).
vector_start : Base.Vector
vector_end : Base.Vector\n
Rotation(angle1, angle2, angle3)
Define from three floats (Euler angles) as yaw-pitch-roll in XY'Z'' convention.
angle1 : float
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 toEulerAngles() for supported sequence types.
seq : str
angle1 : float
angle2 : float
angle3 : float\n
Rotation(x, y, z, w)
Define from four floats (quaternion) where the quaternion is specified as:
q = xi+yj+zk+w, i.e. the last parameter is the real part.
x : float
y : float
z : float
w : float\n
Rotation(dir1, dir2, dir3, seq)
Define from three vectors that define rotated axes directions plus an optional
3-characher string of capital letters 'X', 'Y', 'Z' that sets the order of
importance of the axes (e.g., 'ZXY' means z direction is followed strictly,
x is used but corrected if necessary, y is ignored).
dir1 : Base.Vector
dir2 : Base.Vector
dir3 : Base.Vector
seq : str\n
Rotation(matrix)
Define from a matrix rotation in the 4D representation.
matrix : Base.Matrix\n
Rotation(*coef)
Define from 16 or 9 elements which represent the rotation in the 4D matrix
representation or in the 3D matrix representation, respectively.
coef : sequence of float</UserDocu>
</Documentation>
<Methode Name="invert">
<Documentation>
<UserDocu>
invert() -> None
Sets the rotation to its inverse
</UserDocu>
<UserDocu>invert() -> None\n
Sets the rotation to its inverse.</UserDocu>
</Documentation>
</Methode>
<Methode Name="inverted">
<Documentation>
<UserDocu>
inverted() -> Rotation
Returns the inverse of the rotation
</UserDocu>
<UserDocu>inverted() -> Base.Rotation\n
Returns the inverse of the rotation.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isSame">
<Documentation>
<UserDocu>
isSame(Rotation, [tolerance=0])
Checks if the two quaternions perform the same rotation.
Optionally, a tolerance value greater than zero can be passed.
</UserDocu>
<UserDocu>isSame(rotation, tol=0) -> bool\n
Checks if `rotation` perform the same transformation as this rotation.\n
rotation : Base.Rotation
tol : float\n Tolerance used to compare both rotations.
If tol is negative or zero, no tolerance is used.</UserDocu>
</Documentation>
</Methode>
<Methode Name="multiply" Const="true">
<Documentation>
<UserDocu>
multiply(Rotation)
Multiply this quaternion with another quaternion
</UserDocu>
<UserDocu>multiply(rotation) -> Base.Rotation\n
Right multiply this rotation with another rotation.\n
rotation : Base.Rotation\n Rotation by which to multiply this rotation.</UserDocu>
</Documentation>
</Methode>
<Methode Name="multVec" Const="true">
<Documentation>
<UserDocu>
multVec(Vector) -> Vector
Compute the transformed vector using the rotation
</UserDocu>
<UserDocu>multVec(vector) -> Base.Vector\n
Compute the transformed vector using the rotation.\n
vector : Base.Vector\n Vector to be transformed.</UserDocu>
</Documentation>
</Methode>
<Methode Name="slerp" Const="true">
<Documentation>
<UserDocu>
slerp(Rotation, Float) -> Rotation
Spherical linear interpolation of this and a given rotation. The float must be in the range of 0 and 1
</UserDocu>
<UserDocu>slerp(rotation2, t) -> Base.Rotation\n
Spherical Linear Interpolation (SLERP) of this rotation and `rotation2`.\n
t : float\n Parameter of the path. t=0 returns this rotation, t=1 returns `rotation2`.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setYawPitchRoll">
<Documentation>
<UserDocu>
setYawPitchRoll(angle1, angle2, angle3)
Set the Euler angles of this rotation
as yaw-pitch-roll in XY'Z'' convention.
NOTE: The angles are in degree
</UserDocu>
<UserDocu>setYawPitchRoll(angle1, angle2, angle3) -> None\n
Set the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.\n
angle1 : float\n Angle around yaw axis in degrees.
angle2 : float\n Angle around pitch axis in degrees.
angle3 : float\n Angle around roll axis in degrees.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getYawPitchRoll" Const="true">
<Documentation>
<UserDocu>
getYawPitchRoll() -> list
Get the Euler angles of this rotation
as yaw-pitch-roll in XY'Z'' convention
NOTE: The angles are in degree
</UserDocu>
<UserDocu>getYawPitchRoll() -> tuple\n
Get the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.
The angles are given in degrees.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setEulerAngles">
<Documentation>
<UserDocu>
setEulerAngles(seq, angle1, angle2, angle3)
Set the Euler angles in a given sequence for this rotation.
'seq' is the Euler sequence name. You get all possible values with toEulerAngles()
</UserDocu>
<UserDocu>setEulerAngles(seq, angle1, angle2, angle3) -> None\n
Set the Euler angles in a given sequence for this rotation.
The angles must be given in degrees.\n
seq : str\n Euler sequence name. All possible values given by toEulerAngles().
angle1 : float
angle2 : float
angle3 : float </UserDocu>
</Documentation>
</Methode>
<Methode Name="toEulerAngles" Const="true">
<Documentation>
<UserDocu>
toEulerAngles(seq='') -> list
Get the Euler angles in a given sequence for this rotation.
Call this function without arguments to output all possible values of 'seq'.
</UserDocu>
<UserDocu>toEulerAngles(seq) -> list\n
Get the Euler angles in a given sequence for this rotation.\n
seq : str\n Euler sequence name. If not given, the function returns
all possible values of `seq`. Optional.</UserDocu>
</Documentation>
</Methode>
<Methode Name="toMatrix" Const="true">
<Documentation>
<UserDocu>
toMatrix()
convert the rotation to a matrix representation
</UserDocu>
<UserDocu>toMatrix() -> Base.Matrix\n
Convert the rotation to a 4D matrix representation.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isNull" Const="true">
<Documentation>
<UserDocu>
isNull() -> Bool
returns True if all Q values are zero
</UserDocu>
<UserDocu>isNull() -> bool\n
Returns True if all values in the quaternion representation are zero.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isIdentity" Const="true">
<Documentation>
<UserDocu>
isIdentity() -> Bool
returns True if the rotation equals the unity matrix
</UserDocu>
<UserDocu>isIdentity() -> bool\n
Returns True if the rotation equals the 4D identity matrix.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Q" ReadOnly="false">
<Documentation>
<UserDocu>The rotation elements (as quaternion)</UserDocu>
<UserDocu>The rotation elements (as quaternion).</UserDocu>
</Documentation>
<Parameter Name="Q" Type="Tuple" />
</Attribute>
<Attribute Name="Axis" ReadOnly="false">
<Documentation>
<UserDocu>The rotation axis of the quaternion</UserDocu>
<UserDocu>The rotation axis of the quaternion.</UserDocu>
</Documentation>
<Parameter Name="Axis" Type="Object" />
</Attribute>
<Attribute Name="RawAxis" ReadOnly="true">
<Documentation>
<UserDocu>The rotation axis without normalization</UserDocu>
<UserDocu>The rotation axis without normalization.</UserDocu>
</Documentation>
<Parameter Name="RawAxis" Type="Object" />
</Attribute>
<Attribute Name="Angle" ReadOnly="false">
<Documentation>
<UserDocu>The rotation angle of the quaternion</UserDocu>
<UserDocu>The rotation angle of the quaternion.</UserDocu>
</Documentation>
<Parameter Name="Angle" Type="Float" />
</Attribute>
+1 -1
View File
@@ -426,7 +426,7 @@ IODeviceOStreambuf::seekpos(std::streambuf::pos_type pos,
// ----------------------------------------------------------------------
IODeviceIStreambuf::IODeviceIStreambuf(QIODevice* dev) : device(dev)
IODeviceIStreambuf::IODeviceIStreambuf(QIODevice* dev) : device(dev), buffer{}
{
setg (buffer+pbSize, // beginning of putback area
buffer+pbSize, // read position
+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
+36 -15
View File
@@ -17,78 +17,99 @@ namespace Base {
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the Type class</DeveloperDocu>
<UserDocu>This is the Type class</UserDocu>
<UserDocu>Base.BaseType class.\n
This class is not intended to create instances of itself, but to get information
from the different types and create instances of them.
Regarding instantiation, this is possible in cases that inherit from the
Base::BaseClass class and are not abstract classes.</UserDocu>
</Documentation>
<Methode Name="fromName" Static="true">
<Documentation>
<UserDocu>Returns a type object by name</UserDocu>
<UserDocu>fromName(name) -> Base.BaseType\n
Returns a type object by name.\n
name : str</UserDocu>
</Documentation>
</Methode>
<Methode Name="fromKey" Static="true">
<Documentation>
<UserDocu>Returns a type object by key</UserDocu>
<UserDocu>fromKey(key) -> Base.BaseType\n
Returns a type id object by key.\n
key : int</UserDocu>
</Documentation>
</Methode>
<Methode Name="getNumTypes" Static="true">
<Documentation>
<UserDocu>Returns the number of type ids</UserDocu>
<UserDocu>getNumTypes() -> int\n
Returns the number of type ids created so far.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getBadType" Static="true">
<Documentation>
<UserDocu>Returns an invalid type id</UserDocu>
<UserDocu>getBadType() -> Base.BaseType\n
Returns an invalid type id.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getAllDerivedFrom" Static="true">
<Documentation>
<UserDocu>Returns all descendants</UserDocu>
<UserDocu>getAllDerivedFrom(type) -> list\n
Returns all descendants from the given type id.\n
type : str, Base.BaseType</UserDocu>
</Documentation>
</Methode>
<Methode Name="getParent" Const="true">
<Documentation>
<UserDocu>Returns the parent type id</UserDocu>
<UserDocu>getParent() -> Base.BaseType\n
Returns the parent type id.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isBad" Const="true">
<Documentation>
<UserDocu>Checks if the type id is invalid</UserDocu>
<UserDocu>isBad() -> bool\n
Checks if the type id is invalid.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isDerivedFrom" Const="true">
<Documentation>
<UserDocu>Returns true if given type is a father</UserDocu>
<UserDocu>isDerivedFrom(type) -> bool\n
Returns true if given type id is a father of this type id.\n
type : str, Base.BaseType</UserDocu>
</Documentation>
</Methode>
<Methode Name="getAllDerived" Const="true">
<Documentation>
<UserDocu>Returns all descendants</UserDocu>
<UserDocu>getAllDerived() -> list\n
Returns all descendants from this type id.</UserDocu>
</Documentation>
</Methode>
<Methode Name="createInstance">
<Documentation>
<UserDocu>Creates an instance of this type</UserDocu>
<UserDocu>createInstance() -> object\n
Creates an instance of this type id.</UserDocu>
</Documentation>
</Methode>
<Methode Name="createInstanceByName" Static="true">
<Documentation>
<UserDocu>Creates an instance of the named type</UserDocu>
<UserDocu>createInstanceByName(name, load=False) -> object\n
Creates an instance of the named type id.\n
name : str
load : bool\n Load named type id module.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Name" ReadOnly="true">
<Documentation>
<UserDocu>The name of the type id</UserDocu>
<UserDocu>The name of the type id.</UserDocu>
</Documentation>
<Parameter Name="Name" Type="String" />
</Attribute>
<Attribute Name="Key" ReadOnly="true">
<Documentation>
<UserDocu>The key of the type id</UserDocu>
<UserDocu>The key of the type id.</UserDocu>
</Documentation>
<Parameter Name="Key" Type="Long" />
</Attribute>
<Attribute Name="Module" ReadOnly="true">
<Documentation>
<UserDocu>Module in which this class is defined</UserDocu>
<UserDocu>Module in which this class is defined.</UserDocu>
</Documentation>
<Parameter Name="Module" Type="String"/>
</Attribute>
+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;
-17
View File
@@ -39,14 +39,6 @@ Vector3<_Precision>::Vector3 (_Precision fx, _Precision fy, _Precision fz)
{
}
template <class _Precision>
Vector3<_Precision>::Vector3 (const Vector3<_Precision>& rcVct)
: x(rcVct.x),
y(rcVct.y),
z(rcVct.z)
{
}
template <class _Precision>
_Precision& Vector3<_Precision>::operator [] (unsigned short usIndex)
{
@@ -155,15 +147,6 @@ Vector3<_Precision> Vector3<_Precision>::operator / (_Precision fDiv) const
return Vector3<_Precision>(this->x/fDiv,this->y/fDiv,this->z/fDiv);
}
template <class _Precision>
Vector3<_Precision>& Vector3<_Precision>::operator = (const Vector3<_Precision>& rcVct)
{
x = rcVct.x;
y = rcVct.y;
z = rcVct.z;
return *this;
}
template <class _Precision>
_Precision Vector3<_Precision>::operator * (const Vector3<_Precision>& rcVct) const
{
+5 -3
View File
@@ -91,8 +91,9 @@ public:
/// Construction
explicit Vector3 (_Precision fx = 0.0, _Precision fy = 0.0, _Precision fz = 0.0);
/// Construction
Vector3 (const Vector3<_Precision>& rcVct);
Vector3 (const Vector3<_Precision>& v) = default;
Vector3 (Vector3<_Precision>&& v) = default;
~Vector3 () = default;
/** @name Operator */
//@{
@@ -117,7 +118,8 @@ public:
Vector3 & operator *= (_Precision fScale);
Vector3 & operator /= (_Precision fDiv);
/// Assignment
Vector3 & operator = (const Vector3<_Precision>& rcVct);
Vector3 & operator = (const Vector3<_Precision>& v) = default;
Vector3 & operator = (Vector3<_Precision>&& v) = default;
/// Scalar product
_Precision operator * (const Vector3<_Precision>& rcVct) const;
/// Scalar product
+91 -75
View File
@@ -16,171 +16,187 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the Vector export class</DeveloperDocu>
<UserDocu>This class represents a 3D float vector</UserDocu>
<UserDocu>Base.Vector class.\n
This class represents a 3D float vector.
Useful to represent points in the 3D space.\n
The following constructors are supported:\n
Vector(x=0, y=0, z=0)
x : float
y : float
z : float\n
Vector(vector)
Copy constructor.
vector : Base.Vector\n
Vector(seq)
Define from a sequence of float.
seq : sequence of float.</UserDocu>
</Documentation>
<Methode Name="__reduce__" Const="true">
<Documentation>
<UserDocu>__reduce__()
Serialization of Vector objects
</UserDocu>
<UserDocu>__reduce__() -> tuple\n
Serialization of Vector objects.</UserDocu>
</Documentation>
</Methode>
<Methode Name="add" Const="true">
<Documentation>
<UserDocu>add(Vector)
returns the sum of this and another vector
</UserDocu>
<UserDocu>add(vector2) -> Base.Vector\n
Returns the sum of this vector and `vector2`.\n
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="sub" Const="true">
<Documentation>
<UserDocu>sub(Vector)
returns the difference of this and another vector
</UserDocu>
<UserDocu>sub(vector2) -> Base.Vector\n
Returns the difference of this vector and `vector2`.\n
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="negative" Const="true">
<Documentation>
<UserDocu>negative()
returns the negative (opposite) of this vector
</UserDocu>
<UserDocu>negative() -> Base.Vector\n
Returns the negative (opposite) of this vector.</UserDocu>
</Documentation>
</Methode>
<Methode Name="scale">
<Documentation>
<UserDocu>scale(Float,Float,Float)
scales (multiplies) this vector by a factor
</UserDocu>
<UserDocu>scale(x, y, z) -> Base.Vector\n
Scales in-place this vector by the given factor in each component.\n
x : float\n x-component factor scale.
y : float\n y-component factor scale.
z : float\n z-component factor scale.</UserDocu>
</Documentation>
</Methode>
<Methode Name="multiply">
<Documentation>
<UserDocu>multiply(Float)
multiplies (scales) this vector by a single factor
</UserDocu>
<UserDocu>multiply(factor) -> Base.Vector\n
Multiplies in-place each component of this vector by a single factor.
Equivalent to scale(factor, factor, factor).\n
factor : float</UserDocu>
</Documentation>
</Methode>
<Methode Name="dot" Const="true">
<Documentation>
<UserDocu>dot(Vector)
returns the dot product of the this vector with another one
</UserDocu>
<UserDocu>dot(vector2) -> float\n
Returns the scalar product (dot product) between this vector and `vector2`.\n
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="cross" Const="true">
<Documentation>
<UserDocu>cross(Vector)
returns the cross product between this and another vector
</UserDocu>
<UserDocu>cross(vector2) -> Base.Vector\n
Returns the vector product (cross product) between this vector and `vector2`.\n
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="isOnLineSegment" Const="true">
<Documentation>
<UserDocu>isOnLineSegment(Vector, Vector)
checks if Vector is on a line segment
</UserDocu>
<UserDocu>isOnLineSegment(vector1, vector2) -> bool\n
Checks if this vector is on the line segment generated by `vector1` and `vector2`.\n
vector1 : Base.Vector
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="getAngle" Const="true">
<Documentation>
<UserDocu>getAngle(Vector)
returns the angle in radians between this and another vector
</UserDocu>
<UserDocu>getAngle(vector2) -> float\n
Returns the angle in radians between this vector and `vector2`.\n
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="normalize">
<Documentation>
<UserDocu>normalize()
normalizes the vector to the length of 1.0
</UserDocu>
<UserDocu>normalize() -> Base.Vector\n
Normalizes in-place this vector to the length of 1.0.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isEqual">
<Documentation>
<UserDocu>isEqual(Vector, tolerance) -> Boolean
If the distance to the given point is less or equal to the tolerance
bith points are considered equal.
</UserDocu>
<UserDocu>isEqual(vector2, tol=0) -> bool\n
Checks if the distance between the points represented by this vector
and `vector2` is less or equal to the given tolerance.\n
vector2 : Base.Vector
tol : float</UserDocu>
</Documentation>
</Methode>
<Methode Name="projectToLine">
<Documentation>
<UserDocu>projectToLine(Vector pnt,Vector vec)
Projects the point 'pnt' on a line that goes through the origin with the direction vector 'vec'.
The result is the vector from point 'pnt' to the projected point.
NOTE: The result does not depend on the vector instance 'self'.
NOTE: This method modifies the vector instance 'self'.
</UserDocu>
<UserDocu>projectToLine(point, dir) -> Base.Vector\n
Projects `point` on a line that goes through the origin with the direction `dir`.
The result is the vector from `point` to the projected point.
The operation is equivalent to dir_n.cross(dir_n.cross(point)), where `dir_n` is
the vector `dir` normalized.
The method modifies this vector instance according to result and does not
depend on the vector itself.\n
point : Base.Vector
dir : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="projectToPlane">
<Documentation>
<UserDocu>projectToPlane(Vector,Vector)
projects the vector on a plane defined by a base point and a normal
</UserDocu>
<UserDocu>projectToPlane(base, normal) -> Base.Vector\n
Projects in-place this vector on a plane defined by a base point
represented by `base` and a normal defined by `normal`.\n
base : Base.Vector
normal : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="distanceToPoint" Const="true">
<Documentation>
<UserDocu>
distanceToPoint(Vector)
returns the distance to another point
</UserDocu>
<UserDocu>distanceToPoint(point2) -> float\n
Returns the distance to another point represented by `point2`.\n.
point : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="distanceToLine" Const="true">
<Documentation>
<UserDocu>distanceToLine(Vector,Vector)
returns the distance between this vector and a line defined by
a base point and a direction
</UserDocu>
<UserDocu>distanceToLine(base, dir) -> float\n
Returns the distance between the point represented by this vector
and a line defined by a base point represented by `base` and a
direction `dir`.\n
base : Base.Vector
dir : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="distanceToLineSegment" Const="true">
<Documentation>
<UserDocu>distanceToLineSegment(Vector,Vector)
returns the distance between this vector and a line segment defined by
a base point and a direction
</UserDocu>
<UserDocu>distanceToLineSegment(point1, point2) -> Base.Vector\n
Returns the vector between the point represented by this vector and the point
on the line segment with the shortest distance. The line segment is defined by
`point1` and `point2`.\n
point1 : Base.Vector
point2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="distanceToPlane" Const="true">
<Documentation>
<UserDocu>distanceToPlane(Vector,Vector)
returns the distance between this vector and a plane defined by
a base point and a normal
</UserDocu>
<UserDocu>distanceToPlane(base, normal) -> float\n
Returns the distance between this vector and a plane defined by a
base point represented by `base` and a normal defined by `normal`.\n
base : Base.Vector
normal : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Length" ReadOnly="false">
<Documentation>
<UserDocu>Length([Float]) -> Float
gets or sets the length of this vector
</UserDocu>
<UserDocu>Gets or sets the length of this vector.</UserDocu>
</Documentation>
<Parameter Name="Type" Type="Float" />
</Attribute>
<Attribute Name="x" ReadOnly="false">
<Documentation>
<UserDocu>x([Float]) -> Float
gets or sets the X component of this vector
</UserDocu>
<UserDocu>Gets or sets the X component of this vector.</UserDocu>
</Documentation>
<Parameter Name="x" Type="Float"/>
</Attribute>
<Attribute Name="y" ReadOnly="false">
<Documentation>
<UserDocu>y([Float]) -> Float
gets or sets the Y component of this vector
</UserDocu>
<UserDocu>Gets or sets the Y component of this vector.</UserDocu>
</Documentation>
<Parameter Name="y" Type="Float"/>
</Attribute>
<Attribute Name="z" ReadOnly="false">
<Documentation>
<UserDocu>z([Float]) -> Float
gets or sets the Z component of this vector
</UserDocu>
<UserDocu>Gets or sets the Z component of this vector.</UserDocu>
</Documentation>
<Parameter Name="z" Type="Float"/>
</Attribute>
+1 -3
View File
@@ -32,8 +32,6 @@
// inclusion of the generated files (generated out of VectorPy.xml)
#include "GeometryPyCXX.h"
#include "VectorPy.h"
#include "MatrixPy.h"
#include "RotationPy.h"
#include "VectorPy.cpp"
using namespace Base;
@@ -156,7 +154,7 @@ PyObject* VectorPy::number_multiply_handler(PyObject *self, PyObject *other)
return new VectorPy(a * b);
}
else {
PyErr_SetString(PyExc_NotImplementedError, "Not implemented");
PyErr_SetString(PyExc_TypeError, "A Vector can only be multiplied by Vector or number");
return nullptr;
}
}
+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})
+4 -3
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());
}
@@ -927,7 +928,7 @@ void RecentMacrosAction::setFiles(const QStringList& files)
auto check = Application::Instance->commandManager().checkAcceleratorForConflicts(qPrintable(accel_tmp));
if (check) {
recentFiles[index]->setShortcut(QKeySequence());
auto msg = QStringLiteral("Recent macros : shortcut %1 disabled because conflicting with %2")
auto msg = QStringLiteral("Recent macros : keyboard shortcut %1 disabled because conflicting with %2")
.arg(accel_tmp).arg(QLatin1String(check->getName()));
Base::Console().Warning("%s\n", qPrintable(msg));
}
@@ -936,7 +937,7 @@ void RecentMacrosAction::setFiles(const QStringList& files)
recentFiles[index]->setShortcut(accel);
}
}
recentFiles[index]->setStatusTip(tr("Run macro %1 (Shift+click to edit) shortcut: %2").arg(files[index]).arg(accel));
recentFiles[index]->setStatusTip(tr("Run macro %1 (Shift+click to edit) keyboard shortcut: %2").arg(files[index]).arg(accel));
recentFiles[index]->setVisible(true);
}
+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;
+19 -18
View File
@@ -13,71 +13,72 @@
Delete="true">
<Documentation>
<Author Licence="LGPL" Name="Zheng, Lei" EMail="realthunder.dev@gmail.com" />
<UserDocu>Class for creating a Coin3D representation of a coordinate system</UserDocu>
<UserDocu>Gui.AxisOrigin class.\n
Class for creating a Coin3D representation of a coordinate system.</UserDocu>
</Documentation>
<Methode Name="getElementPicked" Const="true">
<Documentation>
<UserDocu>getElementPicked(pickPoint): return the picked subelement</UserDocu>
<UserDocu>getElementPicked(pickedPoint) -> str\n
Returns the picked element name.\n
pickedPoint : coin.SoPickedPoint</UserDocu>
</Documentation>
</Methode>
<Methode Name="getDetailPath" Const="true">
<Documentation>
<UserDocu>
getDetailPath(subname,path): return Coin detail and path of an subelement
subelement: dot separated string reference to the sub element
pPath: output coin path leading to the returned element detail
</UserDocu>
<UserDocu>getDetailPath(subname, path) -> coin.SoDetail or None\n
Returns Coin detail of a subelement.
Note: Not fully implemented. Currently only returns None.\n
subname : str\n String reference to the subelement.
path: coin.SoPath\n Output Coin path leading to the returned element detail.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="AxisLength">
<Documentation>
<UserDocu>Get/set the axis length</UserDocu>
<UserDocu>Get/set the axis length.</UserDocu>
</Documentation>
<Parameter Name="AxisLength" Type="Float" />
</Attribute>
<Attribute Name="LineWidth">
<Documentation>
<UserDocu>Get/set the axis line width for rendering</UserDocu>
<UserDocu>Get/set the axis line width for rendering.</UserDocu>
</Documentation>
<Parameter Name="LineWidth" Type="Float" />
</Attribute>
<Attribute Name="PointSize">
<Documentation>
<UserDocu>Get/set the origin point size for rendering</UserDocu>
<UserDocu>Get/set the origin point size for rendering.</UserDocu>
</Documentation>
<Parameter Name="PointSize" Type="Float" />
</Attribute>
<Attribute Name="Scale">
<Documentation>
<UserDocu>Get/set auto scaling factor, 0 to disable</UserDocu>
<UserDocu>Get/set auto scaling factor, 0 to disable.</UserDocu>
</Documentation>
<Parameter Name="Scale" Type="Float" />
</Attribute>
<Attribute Name="Plane">
<Documentation>
<UserDocu>Get/set axis plane size and distance to axis line</UserDocu>
<UserDocu>Get/set axis plane size and distance to axis line.</UserDocu>
</Documentation>
<Parameter Name="Plane" Type="Tuple" />
</Attribute>
<Attribute Name="Labels">
<Documentation>
<UserDocu>
Get/set axis component names as a dictionary. Available keys are,
<UserDocu>Get/set axis component names as a dictionary.
Available keys are:
'O': origin
'X': x axis
'Y': y axis
'Z': z axis
'XY': xy plane
'XZ': xz plane
'YZ': yz plane
</UserDocu>
'YZ': yz plane</UserDocu>
</Documentation>
<Parameter Name="Labels" Type="Dict" />
</Attribute>
<Attribute Name="Node" ReadOnly='true'>
<Documentation>
<UserDocu>Get the Coin3D node</UserDocu>
<UserDocu>Get the Coin3D node.</UserDocu>
</Documentation>
<Parameter Name="Node" Type="Object" />
</Attribute>
+56 -33
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>";
}
@@ -53,16 +53,21 @@ std::string AxisOriginPy::representation(void) const
PyObject* AxisOriginPy::getElementPicked(PyObject* args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O",&obj))
if (!PyArg_ParseTuple(args, "O", &obj))
return nullptr;
void *ptr = nullptr;
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "_p_SoPickedPoint", obj, &ptr, 0);
SoPickedPoint *pp = reinterpret_cast<SoPickedPoint*>(ptr);
if(!pp)
throw Base::TypeError("type must be of coin.SoPickedPoint");
if (!ptr) {
PyErr_SetString(PyExc_TypeError, "'pickedPoint' must be a coin.SoPickedPoint");
return nullptr;
}
SoPickedPoint *pp = static_cast<SoPickedPoint*>(ptr);
std::string name;
if(!getAxisOriginPtr()->getElementPicked(pp,name))
if (!getAxisOriginPtr()->getElementPicked(pp,name))
Py_Return;
return Py::new_reference_to(Py::String(name));
}
@@ -70,89 +75,107 @@ PyObject* AxisOriginPy::getDetailPath(PyObject* args)
{
const char *sub;
PyObject *path;
if (!PyArg_ParseTuple(args, "sO",&sub,&path))
if (!PyArg_ParseTuple(args, "sO", &sub,&path))
return nullptr;
void *ptr = nullptr;
Base::Interpreter().convertSWIGPointerObj("pivy.coin", "_p_SoPath", path, &ptr, 0);
SoPath *pPath = reinterpret_cast<SoPath*>(ptr);
if(!pPath)
throw Base::TypeError("type must be of coin.SoPath");
if (!ptr) {
PyErr_SetString(PyExc_TypeError, "'path' must be a coin.SoPath");
return nullptr;
}
SoPath *pPath = static_cast<SoPath*>(ptr);
SoDetail *det = nullptr;
if(!getAxisOriginPtr()->getDetailPath(
sub,static_cast<SoFullPath*>(pPath),det))
{
if(det) delete det;
if (!getAxisOriginPtr()->getDetailPath(sub, static_cast<SoFullPath*>(pPath), det)) {
delete det;
Py_Return;
}
if(!det)
return Py::new_reference_to(Py::True());
return Base::Interpreter().createSWIGPointerObj("pivy.coin", "_p_SoDetail", (void*)det, 0);
if (!det)
Py_Return;
return Base::Interpreter().createSWIGPointerObj("pivy.coin", "_p_SoDetail", static_cast<void*>(det), 0);
}
Py::Float AxisOriginPy::getAxisLength() const {
Py::Float AxisOriginPy::getAxisLength() const
{
return Py::Float(getAxisOriginPtr()->getAxisLength());
}
void AxisOriginPy::setAxisLength(Py::Float size) {
void AxisOriginPy::setAxisLength(Py::Float size)
{
getAxisOriginPtr()->setAxisLength(size);
}
Py::Float AxisOriginPy::getLineWidth() const {
Py::Float AxisOriginPy::getLineWidth() const
{
return Py::Float(getAxisOriginPtr()->getLineWidth());
}
void AxisOriginPy::setLineWidth(Py::Float size) {
void AxisOriginPy::setLineWidth(Py::Float size)
{
getAxisOriginPtr()->setLineWidth(size);
}
Py::Float AxisOriginPy::getPointSize() const {
Py::Float AxisOriginPy::getPointSize() const
{
return Py::Float(getAxisOriginPtr()->getPointSize());
}
void AxisOriginPy::setPointSize(Py::Float size) {
void AxisOriginPy::setPointSize(Py::Float size)
{
getAxisOriginPtr()->setPointSize(size);
}
Py::Float AxisOriginPy::getScale() const {
Py::Float AxisOriginPy::getScale() const
{
return Py::Float(getAxisOriginPtr()->getScale());
}
void AxisOriginPy::setScale(Py::Float size) {
void AxisOriginPy::setScale(Py::Float size)
{
getAxisOriginPtr()->setScale(size);
}
Py::Tuple AxisOriginPy::getPlane() const {
Py::Tuple AxisOriginPy::getPlane() const
{
auto info = getAxisOriginPtr()->getPlane();
Py::Tuple ret(2);
ret.setItem(0,Py::Float(info.first));
ret.setItem(1,Py::Float(info.second));
return ret;
}
void AxisOriginPy::setPlane(Py::Tuple tuple) {
void AxisOriginPy::setPlane(Py::Tuple tuple)
{
float s,d;
if (!PyArg_ParseTuple(*tuple, "dd",&s,&d))
if (!PyArg_ParseTuple(*tuple, "ff",&s,&d))
throw Py::Exception();
getAxisOriginPtr()->setPlane(s,d);
}
Py::Dict AxisOriginPy::getLabels() const {
Py::Dict AxisOriginPy::getLabels() const
{
Py::Dict dict;
for(auto &v : getAxisOriginPtr()->getLabels())
for (auto &v : getAxisOriginPtr()->getLabels())
dict.setItem(Py::String(v.first),Py::String(v.second));
return dict;
}
void AxisOriginPy::setLabels(Py::Dict dict) {
void AxisOriginPy::setLabels(Py::Dict dict)
{
std::map<std::string,std::string> labels;
for(auto it=dict.begin();it!=dict.end();++it) {
for (auto it=dict.begin(); it!=dict.end(); ++it) {
const auto &value = *it;
labels[value.first.as_string()] = Py::Object(value.second).as_string();
}
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;}
+36 -29
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);
@@ -1061,6 +1068,7 @@ void GroupCommand::activated(int iMsg)
}
void GroupCommand::languageChange() {
Command::languageChange();
if (_pcAction)
setup(_pcAction);
}
@@ -1069,18 +1077,17 @@ void GroupCommand::setup(Action *pcAction) {
pcAction->setText(QCoreApplication::translate(className(), getMenuText()));
// The tooltip for the group is the tooltip of the active tool (that is, the tool that will
// be activated when the main portion of the button is clicked).
int idx = pcAction->property("defaultAction").toInt();
if(idx>=0 && idx<(int)cmds.size() && cmds[idx].first) {
auto cmd = cmds[idx].first;
pcAction->setIcon(BitmapFactory().iconFromTheme(cmd->getPixmap()));
pcAction->setChecked(cmd->getAction()->isChecked(),true);
const char *context = dynamic_cast<PythonCommand*>(cmd) ? cmd->getName() : cmd->className();
const char *tooltip = cmd->getToolTipText();
const char *statustip = cmd->getStatusTip();
if (!statustip || '\0' == *statustip)
statustip = tooltip;
recreateTooltip(context, pcAction);
pcAction->setStatusTip(QCoreApplication::translate(context,statustip));
cmd->recreateTooltip(context, cmd->getAction());
pcAction->setToolTip(cmd->getAction()->toolTip());
pcAction->setStatusTip(cmd->getAction()->statusTip());
}
}
@@ -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();
+5 -5
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);
@@ -870,7 +870,7 @@ public:
sGroup = "View";
sMenuText = QT_TR_NOOP("Link actions");
sToolTipText = QT_TR_NOOP("Link actions");
sWhatsThis = "Std_LinkActions";
sWhatsThis = "Std_LinkMakeRelative";
sStatusTip = QT_TR_NOOP("Link actions");
eType = AlterDoc;
bCanLog = false;
@@ -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();

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