Compare commits

...

165 Commits

Author SHA1 Message Date
Chris Hennes 3d63fc6c2f cMake: Update version to 1.0.0RC2 2024-09-23 16:14:10 -05:00
Frank Martinez 99097c61f6 Splash Screen minimal show time. Issue #16264 2024-09-23 16:07:31 -05:00
Yorik van Havre b0d847ca15 Translations (#16754)
* Updated ts files

* merged crowdin translations

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-23 14:12:15 -04:00
bgbsww 95e93a3ab1 Match LS3 opcodes for sketch shape 2024-09-23 10:45:48 -05:00
3x380V e061f81beb TechDraw: Buggy Wayland custom cursors workaround (#16740)
* Gui: Minor polishing of cursor regression fix

* TD: Buggy Wayland custom cursors workaround

Until Qt v6.6 displaying custom cursors on Wayland is broken,
so add a workaround. See also QTBUG-95434.

Fix is the same as d3bb2068 ("Gui: Buggy Wayland custom cursors workaround")
plus subsequent fixes.
2024-09-23 10:43:28 -05:00
Christoph Moench-Tegeder 94d1a67d88 replace exec_program() with execute_process()
Recent CMake (>= 3.28) do not allow exec_program() any more by default,
but prefer execute_process(), which takes slightly different flags.
According to the documentation, exec_program() has been deprecated
since CMake 3.0 (which was released in 2014, so it should be common
enough that I don't feel like making allowances for any really old CMake).

References: https://cmake.org/cmake/help/latest/policy/CMP0153.html
2024-09-23 10:41:34 -05:00
WandererFan 8fe89409a5 [TD] Fix win file spec backslash (fix #16646) (#16689)
* [TD]add method to clean win filespecs

- '\' in strings passed to Python as filespecs is interpreted as
  an escape of the following character.
- replace '\' with '/'

* [TD]remove '\' from filespecs before use
2024-09-23 10:40:22 -05:00
Shai Seger 29d4c9f13a [Cam Simulator][1.0] Fix minor Ambient Occlusion bug. (#16665)
* Fix minor Ambient Occlusion bug.

* fix text cutting in CAM Simulator task panel. Issue #16707
2024-09-23 10:39:09 -05:00
wandererfan 98cb3ae80e [TD]fix BrokenView selection (fix #16567) 2024-09-23 10:37:11 -05:00
Kevin Martin 288b6e6943 DXF: Fix Import related behavior reported in issues #13597 and #16068 (#16511)
* Fix double-import on exception in ImportGUI.readDXF
The python code has a try/catch block intended to detect if the ImportGUI module is present and if so use its readDXF method, otherwise use Import.readDXF.
The block was incorrectly structured so that Import.readDXF would also be called if ImportGUI.readDXF raised an exception, causing the DXF file contents to be loaded twice into the drawing (at least, up to the point where the exception occurred)

* Make ImpExpDxfRead::MakeLayer use centralized accessor for Draft module
The importer class already had a method to find the python Draft module, but MakeLayer was doing the work itself. Now it uses the centralized accessor, which has also been improved to generate a message if the module can't be loaded.

* Give compounded objects names related to the containing layer name
If "Use Layers" is set and also "Group layers into blocks" the names of the generated compound objects will be based on the name of the containing layer.
If "Use Layers" is not set this will not occur because in general objects from several layers would be compounded together.
Fixes (partially) #16068, the remaining fix is likely just an explanation of the interaction of the options.
closes #13597

* Use correct (new) property name OverrideShapeAppearanceChildren
This corrects a bug created by commit 495a96a which renamed the layer property "OverrideShapeColorChildren" to "OverrideShapeAppearanceChildren" but missed this particular reference to the property by its old name.

The code here called PyObject_SetAttrString which, due to the wrong attribute name, set an expection state in the Python engine, ultimately causing the next attempt at importing a module to fail, with various consequences depending on why the module is being imported.

* Wrap PyObject_SetAttrString and PyObject_GetAttrString with error-checkers
In DEBUG compiles these methods are wrapped to report errors which can occur if the property cannot be referenced.

* Make some error-printers static instead of const
They don't need the CDxfRead object to work

* Display exceptions raised by ReadEntity
Although the DXF reader has an ignore-errors flag, it should still report any errors it encounters. The flag is deemed to mean that, after an error, the reader should continue to try to read the file rather than quitting on the first error.

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-23 17:28:32 +02:00
hasecilu 49aee8e57c Help: Don't open 404 documentation pages
Unfortunately, not all documentation is translated.

Instead of presenting to the user 404 code error pages is preferable to
show the documentation on English.

Status codes 200 and 404 are assumed as requests response.
2024-09-23 17:17:51 +02:00
David Carter 555299ddea Materials: Update install locations
Ensure icons and images are put in the correct location.
2024-09-23 10:04:52 -05:00
wandererfan a49e5c0c01 [TD]respect camera direction preference (fix #16593) 2024-09-23 09:23:59 -05:00
wandererfan 6eb92e6647 [TD]fix torus render (fix #16646) 2024-09-23 09:21:33 -05:00
wandererfan b99e34bd86 [TD]fix double pdf file on win (fix #16538) 2024-09-23 09:19:05 -05:00
marioalexis a48fd0f422 Fem: Use shape global placement in Mesh Netgen new implementation 2024-09-23 08:17:21 -05:00
marioalexis b164b49b81 Fem: Add offset between faces and wireframe in FemMesh view provider 2024-09-23 08:16:45 -05:00
marioalexis 162eeeb5de Fem: Use reference subshape transformation on the underlying geometry 2024-09-23 08:12:01 -05:00
Jiří Pinkava 7a1282a6da BIM: Fix tabstop order for Project Manager dialog
Until now not defined explicitly, using tab juped throught boxes in
order in which they were created, which is really jumpy user experience.
2024-09-23 12:15:19 +02:00
Kevin Martin 238c68d8eb DXF: Place objects in layer all at once rather than one at a time to improve DXF import speed dramatically. (#16596)
* Place objects in layer all at once rather than one at a time.
This reduces (by a factor of the number of objects in the layer) the number of times that the layer contents are traversed to set the properties of the contained objects.
This means the layer insertion of O(n) rather then O(n^2) on the number of objects.
Also remove a loop invariant in view_layer so the chidren are not traversed if colours or appearnces are not inherited from the layer.
Fixes #15732

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-23 11:41:41 +02:00
Kevin Martin 7cc34c9072 DXF: Remove O(n^2) time on DXF import with the legacy importer (#16611)
* Remove O(n^2) time on DXF import
Accumulates the contents of each layer in a local Python list, then at the end assignes all the objects at once into the layer. This avoids a very slow process of traversing the objects so far and (re-)updating their properties each time a new object is added.
Fixes #16604

* Correct last change to not damage existing layer contents.
The layer could already have contents if the DXF file is being Imported rather than Opened.
The original change would lose the previous layer contents.
2024-09-23 11:38:16 +02:00
hlorus b2b0af95d8 MeasureGui: Move _mMeasureType member to local variable
Fixes #16565
2024-09-22 20:35:25 -05:00
Florian Foinant-Willig 6afb4a0220 [PD] Fix Pad uptoshape and add unit test 2024-09-22 17:22:56 -05:00
Roy-043 50962ae9fe Correct tree icon for TechDraw_AreaDimension 2024-09-22 16:59:11 -05:00
Bas Ruigrok 87e2d01ccb Tux: Fix default orbit style shown in status bar 2024-09-22 16:57:48 -05:00
bgbsww 6625b675af Update method names and clean 2024-09-22 16:55:45 -05:00
Zheng, Lei 7c16b82e70 Transfer FeatureHole code 2024-09-22 16:55:45 -05:00
Benjamin Nauck 72ae812aa4 Use backspace as default to delete on mac
Only full size mac keyboards has a specific delete key, most doesn't.
2024-09-21 10:37:44 -05:00
bgbsww 4c3ffa617a Correct error in resolveElement 2024-09-21 10:36:39 -05:00
David Carter a5c4416bd0 Materials: Set transparency from DiffuseColor
Migrate the transparency from the DiffuseColor alpha channel to the
transparency color attribute. This allows the alpha channel to be
used as designed

fixes #14938
2024-09-21 10:35:54 -05:00
Chris Hennes 24f67f2d87 GUI: Fix mistake in cherry-picking
The cherry-pick lost the deletion of a line of code.
2024-09-20 09:17:12 -05:00
Jiří Pinkava 580e7879d4 Gui: Fix path to QRC file in PreferencePages UI file
QtCreator, when the file is opened, reports reference to .qrc filewhich
does not exists. It looks like a missing piece from ccb9d7faeb.
2024-09-20 08:43:27 -05:00
CalligaroV 3cf5f0e086 Sketcher/Gui: check if there's a 3D view while executing ViewProviderSketch::unsetEdit()
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-09-20 08:30:08 -05:00
supermixed 18de22a8a7 Core: Import STEP: Cancel button does not cancel (#16499)
* Fix importing .step file when user cancelled import settings dialog
* Refactor object loading python code, fix not using settings when STEP options dialog not shown
* Use custom exception type for user cancelling import instead of `RuntimeError`
* Pull python code out to external file
2024-09-20 08:25:44 -05:00
xtemp09 28bcea6613 [GUI] Move the Push In and Pull Out buttons to the left side
Closes #16587.
2024-09-20 08:20:02 -05:00
theosib 5755e70636 Filter out infinite shapes from Sweep available surfaces 2024-09-20 08:18:27 -05:00
theosib f65a9ffec5 Filter out infinite shapes from Loft available shapes 2024-09-20 08:18:27 -05:00
Frank Martinez 6d5c7ea855 Change fixed selection colors to style based palette. Issue #16454
GUI: Merged cherry-picked 6afc6c7757 to 1.0 branch
2024-09-20 08:11:53 -05:00
bgbsww ae7fe1bc2e Match Ruled Surface behavior to prior versions 2024-09-20 08:09:26 -05:00
Bas Ruigrok acbce24dd9 Gui: Fix segfault in align to selection tool 2024-09-20 08:06:45 -05:00
David Carter d0e0cf112f Materials: ShapeMaterial not properly restored
The ShapeMaterial variable was not being properly restored. It's UUID
was restored but the material was not being loaded and set
2024-09-20 08:05:01 -05:00
Florian Foinant-Willig 6310430e38 [PD] fix pad uptoface and uptoshape (#16030)
* [PD] fix Pad UpToFace and UpToShape
* specify struct pointers for Win
* Rename variables for MSVC compatibility - windows.h defines 'near' and 'far' as macros
* Add unit test

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-09-19 08:51:37 -05:00
bgbsww 064abb30ee Move the recompute dialog to after Gui opens instead of per document signal. 2024-09-19 08:49:27 -05:00
PaddleStroke 3c1b54200d Measure: Fix quickmeasure globalplacement. 2024-09-19 08:48:12 -05:00
Chris Hennes 25a0847e60 Addon Manager: Don't crash on bad XML
Wrap all metadata reads in try/except blocks and gracefully bail out if the data is bad.
2024-09-19 08:46:04 -05:00
Roy-043 5f7eb6c16f BIM: show AutoUpdate of existing ArchSchedule
Fixes #16655.
2024-09-19 14:18:21 +02:00
Yorik van Havre 915c05a289 Translations (#16582)
* updated ts files

* merged crowdin translations

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-19 09:37:33 +02:00
Syres916 a82eb29af1 [Draft] Improve the color activation and ability to change… (#16603)
* [Draft] Improve the color activation and ability to change size of the snap text

* [Draft] Correct dimension text size calculation
2024-09-19 09:04:06 +02:00
bgbsww e19f583e77 Sketcher: Do not consider missing external geometry to be an error (#16590)
* Do not consider missing external geometry to be an error; highlight in conflict color.
2024-09-18 15:18:29 -05:00
hlorus dd31321038 MeasureGui: Auto close task on document deletion 2024-09-18 13:04:15 -05:00
Zheng, Lei 4fd8b40f65 Base: fix XMLReader non-closing character stream 2024-09-18 12:59:23 -05:00
Benjamin Bræstrup Sayoc 89b118e125 Revert "[Measure] Fix redundant variable assignment"
Fixes #16564. This reverts commit a7831eee4b.

Co-authored-by: Murmele <Murmele@users.noreply.github.com>
2024-09-18 08:36:39 -05:00
bgbsww b215a96f5d If we are creating a Sketch inside a Body that is in a link, use link position 2024-09-18 08:35:37 -05:00
bgbsww eca9a105af Gui: fix python syntax in C++ code that broke some compilers (#16614) 2024-09-18 08:33:53 -05:00
marioalexis 814945f728 Fem: Replace old FemMesh Netgen object implementation 2024-09-16 19:16:42 -05:00
marioalexis 58d27094fa Fem: New implementation of FemMesh Netgen object 2024-09-16 19:16:42 -05:00
marioalexis 61cc23bda2 Fem: Add set of mesh elements from a list 2024-09-16 19:16:42 -05:00
Bas Ruigrok d4006c4937 App: Return root object placement if target and root object are the same in getGlobalPlacement
(cherry picked from commit 8db7191084)
2024-09-16 13:01:12 -06:00
Ladislav Michl fad1c30559 Main: simplify banner
FreeCAD advertizes itself too noisy way which brings no usefull
infomation. Unify banner for commandline and GUI application and
drop unicode '(C)' character.
2024-09-16 11:15:06 -05:00
Jiří Pinkava 57c23537d0 Gui: fix size of ComboBox in Preferences/Navigation
Fixes visual artifact in the Preferences/Navigation dialog. The
default value for this field is 0 (at least for some Qt versions),
which does not make sense, because the element would be invisible.

Also the element is actually invisible when editing the UI file in
QtCreator.

Using the default "max" value set for other fields.
2024-09-16 11:07:27 -05:00
hlorus 255bdadf88 Measure: Use getGlobalPlacement method (#16251)
* Initial commit to apply delta also for interactive measurement

* Not required special logic to check if possible, it can be easily checked if the property exists

* remember setting so it is not required to turn it always on

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

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

* Measure: Use getGlobalPlacement method

Fixes #16058

---------

Co-authored-by: Martin Marmsoler <martin.marmsoler@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-16 11:05:37 -05:00
CalligaroV 0312824742 Do the same for the elements selected in the Task Panel
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-09-16 11:01:40 -05:00
Zheng, Lei a323e03030 Sketcher/Toponaming: call SketchObject::convertSubName() in ViewProviderSketch::addSelection2() 2024-09-16 11:01:40 -05:00
marioalexis c0941f9e22 Fem: Enable cancel meshing for Gmsh - fixes #5914 2024-09-16 10:53:50 -05:00
marioalexis 7d13b17b1e Fem: Add base class for FemMesh task panels 2024-09-16 10:53:50 -05:00
Yorik van Havre b1e611d7e3 BIM: Support for IfcOpenShell 0.8 2024-09-16 10:51:49 -05:00
bgbsww 4a57077f73 Add override flag for recomputes; set it in relevant tests with old files. 2024-09-16 10:50:48 -05:00
bgbsww d1903eabc7 Move code for recompute dialog and disable warning 2024-09-16 10:50:48 -05:00
Zheng, Lei c093a79151 Transfer in LS3 code 2024-09-16 10:50:48 -05:00
qewer33 779e1b2bb5 Update about dialog thumbnail image 2024-09-16 10:46:45 -05:00
Shai Seger a86b0ad3fd [Cam Simulator][1.0] Limit anti alias samples for better compatibility. (#16416)
* Limit anti alias samples for better compatibility. might solve Wayland problem, issue #15665

* Antialias samples are taken from display prefs

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-16 10:42:19 -05:00
Jiří Pinkava b55d54a417 Sketcher: initialize geometry history limit variable (#16337)
* Sketcher: initialize geometry history limit variable

The variable seems to be uninitialized, valgrind complais about it.

The `git grep geoHistoryLevel` and the code ispection suggest it is never set.
If initialized to zero, most of the related code is never used, which
can point to the fact there is either another bug or the code is unused.

The variable was introduced in 42bf92ad12.

* Sketcher: Default geoHistoryLevel to 1

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-09-16 10:41:29 -05:00
wandererfan c5fef051f0 [TD]allow SaveCopy from MDIViewPage (fix #16447) 2024-09-16 10:36:09 -05:00
Roy-043 5e32fe2547 BIM: exportIFC.py fix UnboundLocalError
As shown in the image here:
https://github.com/FreeCAD/FreeCAD/issues/16485#issue-2523042111
2024-09-16 13:38:28 +02:00
Jiří Pinkava 192314b070 BIM: refactor wellcome window, drop most obvious comment 2024-09-16 13:29:27 +02:00
Jiří Pinkava aba9c8d74d BIM: drop unnecessary setPixmap from wellcome window
The image is already set in the UI file, it is not necessary to set it again
2024-09-16 13:29:18 +02:00
Jiří Pinkava 29ef93cbf3 BIM: adjust size of wellcome window to fit content
The actual optimal size of the window depends on many details, like UI style, system fonts,
OS etc ... so lets auto-resize the window to fit the content before display.
2024-09-16 13:29:10 +02:00
Roy-043 c6a273b789 Draft: Fix regression with layer print color
Problem with the same cause as #16212.
2024-09-16 10:08:25 +02:00
hoshengwei fa9d92a819 fix Material TaskPanel Load Preset not working bug 2024-09-16 10:04:00 +02:00
Kacper Donat 756d1a0a80 Gui: Use FreeCAD Theme only for FreeCAD stuff 2024-09-13 13:26:58 -06:00
Yorik van Havre 14ff4cb869 Draft: Fixed restrained movement - Fixes #16386 2024-09-13 13:20:59 -06:00
Bas Ruigrok 37b8fd1e40 Move isLink and isLinkGroup from AssemblyObject to DocumentObject 2024-09-13 13:10:59 -06:00
Bas Ruigrok 53b878869e Gui: Fix alignment direction for transformed objects 2024-09-13 13:10:59 -06:00
Bas Ruigrok d515ba9428 Move getGlobalPlacement from AssemblyObject to GeoFeature 2024-09-13 13:10:59 -06:00
Bas Ruigrok 131618941c Move splitSubName from AssemblyObject to Base::Tools 2024-09-13 13:10:59 -06:00
Jacob Oursland 196312941c Windows: Make FreeCAD.exe debuggable on PDB builds. 2024-09-13 12:30:47 -06:00
Jacob Oursland d8ea9a6bca CMake: conda-macos-* do not search Homebrew for dependencies. 2024-09-13 12:28:43 -06:00
Jacob Oursland 21af2176a6 Base: switch header include type for consistency with codebase. 2024-09-13 12:27:37 -06:00
Jiří Pinkava 358451359c GUI: Fix tree visibility click when a tree item gets collapsed
The tree can change shape during handling the mousePressEvent() event,
because some part of the tree can be (un)folded. This might lead to
shift of the three (up or down). The position of items in tree change
relatively to the position of mouse (which stays in place).
If the visibility click is handled after mousePressEvent, the shift in
position can lead to cursor beeing over visibility icon and the click
is handled like if the visibility icon vas clicked, which is unexpected.

Handling the visibility click first fixes this. The setAccepted(true),
was removed, it is left to the subroutine to set it.
2024-09-13 12:25:03 -06:00
Benjamin Bræstrup Sayoc d00aae972c [Measure] Redirect enter key press to apply button
Fixes #16401. Now call of the save function is dependent on whether the apply button is enabled. The button is only enabled if valid objects to save.
2024-09-13 08:43:07 -05:00
Benjamin Bræstrup Sayoc 4e5e193c76 [Measure] Fix redundant variable assignment 2024-09-13 08:43:07 -05:00
wmayer 1c9432539a Port: Include changes of FreeBSD port 2024-09-13 08:32:16 -05:00
Yorik van Havre add3a14b6e Draft: Fixed function case 2024-09-13 15:01:50 +02:00
Yorik van Havre 04ee5f8583 Draft: Fixes error in Draft trackers when not on a 3D view 2024-09-13 15:01:38 +02:00
hoshengwei 84ae76764e fix ArchMaterialTaskPanel wrong import BimClassification Path
1. fix ArchMaterialTaskPanel wrong import BimClassification Path and icon after BIM merge into Arch

2. change taskpanel name to BIM material 

3. fix Qt slot and signal (more up to date style)
2024-09-13 12:12:24 +02:00
Yorik van Havre 6f6205ff41 Merge branch 'releases/FreeCAD-1-0' of github.com:FreeCAD/FreeCAD into releases/FreeCAD-1-0 2024-09-13 12:09:14 +02:00
Roy-043 f655c2545b Use max instead of if-else for numerical checks (as per linter warning) 2024-09-13 12:09:08 +02:00
Roy-043 5b38fc606c Draft: fix division by zero and count is zero for path arrays
Fixes #16468.
2024-09-13 12:08:56 +02:00
Adrián Insaurralde Avalos 92663a8773 GUI: Fix splashscreen for single image (#16428)
* fix splashscreen for single image
* improve clarity of splashscreen load order logic
* fix splashscreen with no _2x variant
2024-09-12 21:50:19 -05:00
mosfet80 701dc43675 fix CXX standard selection
only   CXX 23, 20 and 17 standards are allowed
2024-09-12 21:36:34 -05:00
pre-commit-ci[bot] 1bf69792ad [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-09-12 21:23:43 -05:00
wmayer 6878ed9ffa Qt6: QLocale::countryToString and QLocale::country() are deprecated since Qt 6.6 2024-09-12 21:23:43 -05:00
wmayer c478d2e22e Qt6: Several methods of QMouseEvent are deprecated since Qt 6.0 2024-09-12 21:23:43 -05:00
wmayer 769d46729a Qt6: QColor::setNamedColor is deprecated since Qt 6.6 2024-09-12 21:23:43 -05:00
Benjamin Bræstrup Sayoc 022fb23068 [Gui] Handle unset style preferences in clipboard about info
FIxes #16391
2024-09-12 21:20:50 -05:00
CalligaroV 0a5ceb636c Sketcher/Toponaming: import code for SketchObject::checkSubName() from LS3
* applied review hints

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-09-12 21:12:17 -05:00
Zheng, Lei 8e7fe5c5f2 Sketcher/Toponaming: import code for SketchObject::checkSubName() from LS3
* import code
 * add modified_item assignment in TaskSketcherElements::onSelectionChanged() like for non ExternalEdge
2024-09-12 21:12:07 -05:00
luzpaz 15d79e8a7b TechDraw: fix typo ballon->balloon 2024-09-12 12:11:58 -05:00
Kacper Donat d5ab4bda33 Gui: Force OpenGL rendering for main window
This is big hack for Qt6 to force rendering using OpenGL from the
beginning. Since Qt6 OpenGL context is initialized only after creating
first QOpenGLWidget which results in window hiding and showing again
after some delay. This causes various timing issus as the window is not
supposed to do that.
2024-09-12 12:11:27 -05:00
wmayer e790200395 StartPage: Make sure to pass a container widget to the QScrollArea
Fixes #16047: FreeBSD: Segfault in StartView::firstStartWidgetDismissed
2024-09-12 12:11:14 -05:00
wmayer 1720ac8ac1 MSVC: Fix several compiler warnings 2024-09-12 12:11:00 -05:00
Yorik van Havre 072d21135a BIM: Fixed bug in BimViews - fixes #16452 2024-09-12 14:31:15 +02:00
Furgo 8a19e37bec Check location and call corresponding addObject, add missing import. Fixes #16435 2024-09-12 14:29:47 +02:00
Yorik van Havre a1c8874705 Merge branch 'releases/FreeCAD-1-0' of github.com:FreeCAD/FreeCAD into releases/FreeCAD-1-0 2024-09-12 11:01:25 +02:00
Roy-043 3a7448afac BIM: fix BIM_Setup license issue
FreeCAD currently has 19 standard licenses. BIM_Setup could only handle the first 10.

Forum post:
https://forum.freecad.org/viewtopic.php?p=781578#p781535
2024-09-12 11:01:13 +02:00
Benjamin Bræstrup Sayoc 983fdfc671 [TechDraw] Fix uncentered balloon label 2024-09-11 19:50:01 -05:00
xtemp09 c2834e873d [GUI] Make some strings untranslatable in Light Sources dialog 2024-09-11 08:41:34 -05:00
Adrián Insaurralde Avalos dafc018b68 CI: add version to cache key for libpack/ccache download actions for win 2024-09-10 17:42:26 -04:00
Adrián Insaurralde Avalos bc815fd244 Fix compiler cache for conda linux builds 2024-09-10 17:42:19 -04:00
spanner888 e3ac0e4d09 save after del, new, add (#16230)
Co-authored-by: spanner888 <spanner888@users.noreply.github.com>
2024-09-10 11:21:04 -05:00
sliptonic 6eefc8e649 set default directory for sanity (#15934)
Respond correctly if user cancels  Fixes #14796

Co-authored-by: Brad Collette <bradcollette@pop-os.localdomain>
2024-09-10 10:24:59 -05:00
Furgo 20065e644b BIM: Fixes profile tool positioning (#16305)
* [BIM] Get working plane when picking a point

Fixes: #16284

* Use the new way of getting the Draft Working Plane
2024-09-10 11:49:23 +02:00
Pieter Hijma 589027ebec Core: Fix duplicated extensions (see #16299) 2024-09-09 22:12:12 -05:00
Murmele 6e203e7083 Measure: Show delta option also in interactive mode (#16379)
* Initial commit to apply delta also for interactive measurement
* Not required special logic to check if possible, it can be easily checked if the property exists
* remember setting so it is not required to turn it always on
2024-09-09 21:39:57 -05:00
marioalexis f7108ddd92 Fem: Set Elmer result output format to Ascii 2024-09-09 11:35:43 -05:00
marioalexis af3ea3bab3 Fem: Allow only one shape type per mesh group - Partially revert #16076 2024-09-09 11:33:06 -05:00
Morimiue 4c473a17eb Sketcher: transfer constraints on conic's mid point to the newly created conic arc (e.g. ellipse arc)" -m "Fixes #15860" -m "When spliting a sketch curve, constraints on the original curve are transferred to the newly created curve. The original code did not consider the constraints on the center point of an ellipse arc. 2024-09-09 11:31:30 -05:00
xtemp09 0e9fa777b3 [GUI] Enable sort of zoom in Light Sources dialog 2024-09-09 11:28:10 -05:00
Yorik van Havre 0b9b4d5347 Translations (#16389)
* Translations: Updated ts files

* Translations: Merged crowdin translations

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-09 11:26:13 -05:00
wmayer 9f14e6e87b Core: Placement dialog
+ replace separate buttons with QDialogButtonBox
+ add convenience method setPlacementAndBindObject
+ use const DocumentObject
2024-09-09 11:25:31 -05:00
wmayer 8828587084 Core: Add option to ignore transactions in placement dialog 2024-09-09 11:25:31 -05:00
wmayer 687f01c84a Core: Expose Placement dialog to Python 2024-09-09 11:25:31 -05:00
wmayer d07ae89f72 Core: Change placement dialog to operate on passed selection objects 2024-09-09 11:25:30 -05:00
wmayer bb3c7afe95 Core: Refactor placement dialog 2024-09-09 11:25:30 -05:00
PaddleStroke 71c6a4f3d7 Assembly: Replace Offset and Rotation properties by Offset1 and Offset2, giving full control over JCS positions. 2024-09-09 11:22:22 -05:00
PaddleStroke bcd08a01ba Sketcher: Rectangle DSH: refactor the createShape function. 2024-09-09 11:15:15 -05:00
PaddleStroke 8108b93058 Sketcher: Fix round corner + thickness issue if radius + thickness = 0. 2024-09-09 11:15:15 -05:00
Florian Foinant-Willig e7acb60253 [PD] Fix helix placement 2024-09-09 11:11:50 -05:00
Kacper Donat 985089a26d Sketcher: AutoColor should update only colors
Previously AutoColor property forced reinitialization of all subscribed
parameters. It was mostly fine as most of them should stay in sync with
user settings but it also affected grids.
2024-09-09 18:08:29 +02:00
CalligaroV 2dd4526531 Call ComplexGeoData::ensureElementMap() in ComplexGeoData::readElements()
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-09-09 11:06:18 -05:00
Syres916 20b996ab12 [Spreadsheet] Fix CSV import by insert 2024-09-09 11:04:23 -05:00
wmayer d4feb51402 Port: Include some important changes of the OpenBSD port
Forum thread: https://forum.freecad.org/viewtopic.php?t=80792
2024-09-09 11:01:52 -05:00
Bas Ruigrok ec61f5e3fb Gui: Fix orthographic camera standard views in an empty scene 2024-09-09 11:00:05 -05:00
Bas Ruigrok 12b06306a3 Gui: Use Coin 4.0.3 fix for orthographic camera clipping 2024-09-09 10:58:54 -05:00
Benjamin Nauck e94e12723f Spreadsheet XLSX import: Fix bug causing xls import failing for some operators (#16336)
* Fix bug causing xls import failing for some comparisons

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

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

---------

Co-authored-by: Benjamin Nauck <benjamin.nauck@adlede.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-09 10:56:12 -05:00
Roy-043 d45016ee8a BIM: ArchFence: Fix some color issues
* ShapeAppearance property was misspelled.
* The post and section objects could not be Std_Parts (because they do not have a DIffuseColor).
* Minor improvements to the handling of Bodies.
* Removed the `if __name__ == '__main__':` section. This code is no longer relevant.
2024-09-09 17:52:08 +02:00
Furgo b7514bf848 [BIM] Separate profile name from label number (#16304)
* [BIM] Separate profile name from label number

Fixes: #16286

* Make internal name generic
2024-09-09 10:49:27 -05:00
MisterMakerNL 7a297f76bf changed selection colors 2024-09-09 10:49:27 -05:00
wandererfan 54eb7b3d9f [TD]fix initial balloon placement on rotated view (fix #16234) 2024-09-09 10:49:27 -05:00
Roy-043 280548fb50 BIM: BimWindow.py add missing imports 2024-09-09 17:49:01 +02:00
PaddleStroke 1a270ca088 Update Ondsel Solver 2024-09-09 09:40:33 -05:00
Roy-043 455cad24eb BIM: Fix window transparency
V1.0 fix for the transparency of glass panels in windows and doors.
2024-09-09 11:43:13 +02:00
huguesdpdn-aerospace 7a6a82e2ca PD: Xerces-C++ - Prepare for the latest version (backward compatible) 2024-09-08 20:32:08 -05:00
Jiří Pinkava 5fba69e328 OverlayManager: fix unititialized hideTab variable
The hideTab is of type bool, which is primitive type and is thus unitialized if new
instance of the class is created. The exception would be to for static
instance of the class, but that is not the case (only the pointer to the instance is static).

It was originaly initialized, but the initialization was removed in
9d5390ed83.
2024-09-08 20:14:03 -05:00
PaddleStroke 708e07e594 App::Link: fix crash with Draft Array (#16240)
* App::Link: fix crash with Draft Array
2024-09-08 17:13:38 -05:00
Benjamin Bræstrup Sayoc 9c95a7aa3a Add myself to contributors 2024-09-08 17:08:48 -05:00
Benjamin Bræstrup Sayoc 8cdcbe361f [Gui] Add style, theme and QtStyle to clipboard about info
Fixes #16272
2024-09-08 17:08:48 -05:00
Benjamin Bræstrup Sayoc 61bb5abfa2 [Gui] QtStyle preference consistency
Previously, the some of the code searched for the QtStyle in the wrong location
2024-09-08 17:08:48 -05:00
Syres916 422c7370a7 [Measure] Disable QuickMeasure for TechDraw, Spreadsheet, Part Container and Origin objects (#16225)
* [Measure] Disable QuickMeasure for TechDraw objects
* [Measure] Add spreadsheet, Part containers and origins to the exemptions
2024-09-08 16:51:24 -05:00
FEA-eng 0165db7e79 FEM: Update Material.ui 2024-09-08 16:29:08 -05:00
FEA-eng 3b192c533b FEM: Update write_femelement_material.py 2024-09-08 16:29:07 -05:00
FEA-eng 2b609b64ec FEM: Update task_material_common.py
Fix from benj5378
2024-09-08 16:29:07 -05:00
David Carter b05dc2da73 Materials: UI updates for transparency
Add missing UI elements to support per face transparencies:
- Setting per face transparencies
- show transparency information in the appearance inspector
- expose alpha channel in material properties dialog
2024-09-06 12:30:08 -05:00
Roy-043 aa1ec60f65 Draft: fix snapping to endpoints of dimension lines (V0.19 regression)
This fixes a regression introduced in V0.19 (!) when the type of linear dimensions was changed from "Dimension" to "LinearDimension".

Forum topic:
https://forum.freecad.org/viewtopic.php?t=90292
2024-09-05 13:18:40 +02:00
Chris Hennes 60a251354e Core: Update version number to 1.0.0RC1 2024-09-05 08:32:33 +02:00
884 changed files with 94199 additions and 87817 deletions
@@ -28,6 +28,9 @@ inputs:
compiler:
description: "Binary name/path of compiler to be used"
required: true
qt_major_version:
description: "Major version number of qt to be used"
required: true
outputs:
cacheKey:
description: "Cache key with distro and compiler version"
@@ -39,6 +42,6 @@ runs:
- id: generateCacheKey
shell: bash -l {0}
run: |
cacheKey=$(lsb_release -ds | tr -d ' ')-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)
cacheKey=$(lsb_release -ds | tr -d ' ')-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)-qt${{ inputs.qt_major_version }}
echo "Generated cache key : $cacheKey"
echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT
@@ -59,7 +59,7 @@ runs:
id: getCached
with:
path: ${{ inputs.ccachebindir }}
key: ccacheforwin
key: ccacheforwin-${{ inputs.ccacheversion }}
- name: Download ccache
shell: bash
if: steps.getCached.outputs.cache-hit != 'true'
@@ -59,7 +59,7 @@ runs:
id: getCached
with:
path: ${{ inputs.libpackdir }}
key: libpackforwin
key: libpackforwin-${{ inputs.libpackname }}
- name: Download libpack
shell: bash
if: steps.getCached.outputs.cache-hit != 'true'
@@ -152,6 +152,7 @@ jobs:
uses: ./.github/workflows/actions/linux/generateCacheKey
with:
compiler: ${{ env.CXX }}
qt_major_version: 5
- name: Restore Compiler Cache
uses: actions/cache@v4
with:
@@ -102,6 +102,7 @@ jobs:
uses: ./.github/workflows/actions/linux/generateCacheKey
with:
compiler: ${{ env.CXX }}
qt_major_version: 5
- name: Restore Compiler Cache
uses: actions/cache@v4
with:
@@ -108,15 +108,16 @@ jobs:
uses: ./.github/workflows/actions/linux/generateCacheKey
with:
compiler: ${{ env.CXX }}
qt_major_version: 6
- name: Restore Compiler Cache
uses: actions/cache@v4
with:
save-always: true
path: ${{ env.CCACHE_DIR }}
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}-qt6
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-qt6-
FC-${{ steps.genCacheKey.outputs.cacheKey }}-qt6-
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-
FC-${{ steps.genCacheKey.outputs.cacheKey }}-
- name: Print CCache statistics before build, reset stats and print config
run: |
ccache -s
+3 -4
View File
@@ -27,11 +27,10 @@ endif()
project(FreeCAD)
set(PACKAGE_VERSION_NAME "Vulcan")
set(PACKAGE_VERSION_MAJOR "0")
set(PACKAGE_VERSION_MINOR "22")
set(PACKAGE_VERSION_MAJOR "1")
set(PACKAGE_VERSION_MINOR "0")
set(PACKAGE_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release)
set(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string)
set(PACKAGE_VERSION_SUFFIX "RC2") # either "dev" for development snapshot or "" (empty string)
set(PACKAGE_BUILD_VERSION "0") # used when the same FreeCAD version will be re-released (for example using an updated LibPack)
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
+4
View File
@@ -151,6 +151,10 @@
},
"cmakeExecutable": "${sourceDir}/conda/cmake.sh",
"cacheVariables": {
"CMAKE_IGNORE_PREFIX_PATH": {
"type": "STRING",
"value": "/opt/homebrew;/usr/local/homebrew"
},
"CMAKE_INCLUDE_PATH": {
"type": "FILEPATH",
"value": "${sourceDir}/.conda/freecad/include"
@@ -46,7 +46,7 @@ macro(CompilerChecksAndSetups)
set(CMAKE_CXX_STANDARD 23)
elseif(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+20")
set(CMAKE_CXX_STANDARD 20)
elseif(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+17")
else()#Enabled C++17
set(CMAKE_CXX_STANDARD 17)
endif()
@@ -34,6 +34,7 @@ macro(SetGlobalCompilerAndLinkerSettings)
if(FREECAD_RELEASE_PDB)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG")
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
endif(FREECAD_RELEASE_PDB)
if(FREECAD_RELEASE_SEH)
# remove /EHsc or /EHs flags because they are incompatible with /EHa
+10 -1
View File
@@ -25,6 +25,11 @@
* DEALINGS IN THE SOFTWARE.
*/
// convenience for all the BSDs
#if defined( __FreeBSD__) || defined( __NetBSD__) || defined( __OpenBSD__)
#define __BSD
#endif
#if defined( _WIN32 )
#if defined( _MSC_VER )
#include <codecvt>
@@ -44,6 +49,10 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#elif defined(__BSD)
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#elif defined( __APPLE__ )
#include <sys/types.h>
#include <unistd.h>
@@ -483,7 +492,7 @@ uint64_t CheckedFile::lseek64( int64_t offset, int whence )
#endif
#elif defined( __linux__ )
int64_t result = ::lseek64( fd_, offset, whence );
#elif defined( __APPLE__ )
#elif defined( __APPLE__ ) || defined(__BSD)
int64_t result = ::lseek( fd_, offset, whence );
#else
#error "no supported OS platform defined"
+44 -1
View File
@@ -427,6 +427,10 @@ void Application::setupPythonException(PyObject* module)
Base::PyExc_FC_PropertyError = PyErr_NewException("Base.PropertyError", PyExc_AttributeError, nullptr);
Py_INCREF(Base::PyExc_FC_PropertyError);
PyModule_AddObject(module, "PropertyError", Base::PyExc_FC_PropertyError);
Base::PyExc_FC_AbortIOException = PyErr_NewException("Base.PyExc_FC_AbortIOException", PyExc_BaseException, nullptr);
Py_INCREF(Base::PyExc_FC_AbortIOException);
PyModule_AddObject(module, "AbortIOException", Base::PyExc_FC_AbortIOException);
}
// clang-format on
@@ -3323,7 +3327,46 @@ void Application::ExtractUserPath()
mConfig["UserMacroPath"] = Base::FileInfo::pathToString(macro) + PATHSEP;
}
#if defined (FC_OS_LINUX) || defined(FC_OS_CYGWIN) || defined(FC_OS_BSD)
// TODO: Consider using this for all UNIX-like OSes
#if defined(__OpenBSD__)
#include <cstdio>
#include <cstdlib>
#include <sys/param.h>
#include <QCoreApplication>
std::string Application::FindHomePath(const char* sCall)
{
// We have three ways to start this application either use one of the two executables or
// import the FreeCAD.so module from a running Python session. In the latter case the
// Python interpreter is already initialized.
std::string absPath;
std::string homePath;
if (Py_IsInitialized()) {
// Note: realpath is known to cause a buffer overflow because it
// expands the given path to an absolute path of unknown length.
// Even setting PATH_MAX does not necessarily solve the problem
// for sure but the risk of overflow is rather small.
char resolved[PATH_MAX];
char* path = realpath(sCall, resolved);
if (path)
absPath = path;
}
else {
int argc = 1;
QCoreApplication app(argc, (char**)(&sCall));
absPath = QCoreApplication::applicationFilePath().toStdString();
}
// should be an absolute path now
std::string::size_type pos = absPath.find_last_of("/");
homePath.assign(absPath,0,pos);
pos = homePath.find_last_of("/");
homePath.assign(homePath,0,pos+1);
return homePath;
}
#elif defined (FC_OS_LINUX) || defined(FC_OS_CYGWIN) || defined(FC_OS_BSD)
#include <cstdio>
#include <cstdlib>
#include <sys/param.h>
+4 -4
View File
@@ -546,10 +546,10 @@ void ComplexGeoData::readElements(Base::XMLReader& reader, size_t count)
}
}
}
_elementMap->setElementName(IndexedName(reader.getAttribute("value"), types),
MappedName(reader.getAttribute("key")),
Tag,
&sids);
ensureElementMap()->setElementName(IndexedName(reader.getAttribute("value"), types),
MappedName(reader.getAttribute("key")),
Tag,
&sids);
}
if (invalid_count != 0) {
FC_ERR("Found " << invalid_count << " invalid string id"); // NOLINT
+1
View File
@@ -1475,6 +1475,7 @@ Document::readObjects(Base::XMLReader& reader)
void Document::addRecomputeObject(DocumentObject *obj) {
if(testStatus(Status::Restoring) && obj) {
setStatus(Status::RecomputeOnRestore, true);
d->touchedObjs.insert(obj);
obj->touch();
}
+1
View File
@@ -77,6 +77,7 @@ public:
RestoreError = 10,
LinkStampChanged = 11, // Indicates during restore time if any linked document's time stamp has changed
IgnoreErrorOnRecompute = 12, // Don't report errors if the recompute failed
RecomputeOnRestore = 13, // Mark pending recompute on restore for migration purposes
};
/** @name Properties */
+6
View File
@@ -442,6 +442,12 @@ public:
/* Return true to cause PropertyView to show linked object's property */
virtual bool canLinkProperties() const {return true;}
/* Return whether this object is a link */
virtual bool isLink() const {return false;};
/* Return whether this object is a link group */
virtual bool isLinkGroup() const {return false;};
/* Return true to bypass duplicate label checking */
virtual bool allowDuplicateLabel() const {return false;}
+63 -1
View File
@@ -25,6 +25,8 @@
#include <App/GeoFeaturePy.h>
#include <Base/Tools.h>
#include "ComplexGeoData.h"
#include "Document.h"
#include "GeoFeature.h"
@@ -157,7 +159,7 @@ DocumentObject *GeoFeature::resolveElement(DocumentObject *obj, const char *subn
}
if(geoFeature)
*geoFeature = geo;
if(!obj || (filter && obj!=filter))
if(!obj || (filter && geo!=filter))
return nullptr;
if(!element || !element[0]) {
if(append)
@@ -270,3 +272,63 @@ GeoFeature::getHigherElements(const char *element, bool silent) const
return {};
return prop->getComplexData()->getHigherElements(element, silent);
}
Base::Placement GeoFeature::getPlacementFromProp(App::DocumentObject* obj, const char* propName)
{
Base::Placement plc = Base::Placement();
auto* propPlacement = dynamic_cast<App::PropertyPlacement*>(obj->getPropertyByName(propName));
if (propPlacement) {
plc = propPlacement->getValue();
}
return plc;
}
Base::Placement GeoFeature::getGlobalPlacement(App::DocumentObject* targetObj,
App::DocumentObject* rootObj,
const std::string& sub)
{
if (!targetObj || !rootObj || sub.empty()) {
return Base::Placement();
}
std::vector<std::string> names = Base::Tools::splitSubName(sub);
App::Document* doc = rootObj->getDocument();
Base::Placement plc = getPlacementFromProp(rootObj, "Placement");
if (targetObj == rootObj) return plc;
for (auto& name : names) {
App::DocumentObject* obj = doc->getObject(name.c_str());
if (!obj) {
return Base::Placement();
}
plc = plc * getPlacementFromProp(obj, "Placement");
if (obj == targetObj) {
return plc;
}
if (obj->isLink()) {
// Update doc in case its an external link.
doc = obj->getLinkedObject()->getDocument();
}
}
// If targetObj has not been found there's a problem
return Base::Placement();
}
Base::Placement GeoFeature::getGlobalPlacement(App::DocumentObject* targetObj,
App::PropertyXLinkSub* prop)
{
if (!targetObj || !prop) {
return Base::Placement();
}
std::vector<std::string> subs = prop->getSubValues();
if (subs.empty()) {
return Base::Placement();
}
return getGlobalPlacement(targetObj, prop->getValue(), subs[0]);
}
+4
View File
@@ -179,6 +179,10 @@ public:
/// Return the higher level element names of the given element
virtual std::vector<Data::IndexedName> getHigherElements(const char *name, bool silent=false) const;
static Base::Placement getPlacementFromProp(DocumentObject* obj, const char* propName);
static Base::Placement getGlobalPlacement(DocumentObject* targetObj, DocumentObject* rootObj, const std::string& sub);
static Base::Placement getGlobalPlacement(DocumentObject* targetObj, PropertyXLinkSub* prop);
protected:
void onChanged(const Property* prop) override;
// void onDocumentRestored() override;
+15
View File
@@ -2282,6 +2282,16 @@ bool Link::canLinkProperties() const {
return true;
}
bool Link::isLink() const
{
return ElementCount.getValue() == 0;
}
bool Link::isLinkGroup() const
{
return ElementCount.getValue() > 0;
}
//////////////////////////////////////////////////////////////////////////////////////////
namespace App {
@@ -2309,6 +2319,11 @@ bool LinkElement::canDelete() const {
return !owner || !owner->getDocument()->getObjectByID(_LinkOwner.getValue());
}
bool LinkElement::isLink() const
{
return true;
}
App::Link* LinkElement::getLinkGroup() const
{
std::vector<App::DocumentObject*> inList = getInList();
+6
View File
@@ -556,6 +556,10 @@ public:
}
bool canLinkProperties() const override;
bool isLink() const override;
bool isLinkGroup() const override;
};
using LinkPython = App::FeaturePythonT<Link>;
@@ -600,6 +604,8 @@ public:
_handleChangedPropertyName(reader,TypeName,PropName);
}
bool isLink() const override;
App::Link* getLinkGroup() const;
};
+5
View File
@@ -58,7 +58,12 @@ directly. If you did not intend to use a system-defined macro
using namespace App;
namespace fs = boost::filesystem;
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
#else
XERCES_CPP_NAMESPACE_USE
#endif
namespace MetadataInternal
{
+5
View File
@@ -30,7 +30,12 @@
#include "MetadataPy.cpp"
using namespace Base;
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
#else
XERCES_CPP_NAMESPACE_USE
#endif
// Returns a string which represents the object e.g. when printed in Python
std::string MetadataPy::representation() const
+5
View File
@@ -56,7 +56,12 @@
#include <Base/Stream.h>
#include <Base/XMLTools.h>
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
#else
XERCES_CPP_NAMESPACE_USE
#endif
using namespace App;
namespace {
+6
View File
@@ -32,11 +32,17 @@
#include <string>
#include <xercesc/util/XercesDefs.hpp>
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
namespace XERCES_CPP_NAMESPACE { class DOMNode; class DOMElement; class DOMDocument; }
#else
XERCES_CPP_NAMESPACE_BEGIN
class DOMDocument;
class DOMElement;
class DOMNode;
XERCES_CPP_NAMESPACE_END
#endif
namespace App
{
+11
View File
@@ -3018,6 +3018,17 @@ void PropertyMaterialList::setTransparency(int index, float val)
hasSetValue();
}
void PropertyMaterialList::setTransparencies(const std::vector<float>& transparencies)
{
aboutToSetValue();
setSize(transparencies.size(), _lValueList[0]);
for (std::size_t i = 0; i < transparencies.size(); i++) {
_lValueList[i].transparency = transparencies[i];
}
hasSetValue();
}
const Color& PropertyMaterialList::getAmbientColor() const
{
return _lValueList[0].ambientColor;
+1
View File
@@ -1156,6 +1156,7 @@ public:
void setTransparency(float);
void setTransparency(int index, float);
void setTransparencies(const std::vector<float>& transparencies);
const Color& getAmbientColor() const;
const Color& getAmbientColor(int index) const;
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation type="unfinished"></translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Без назвы</translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Sense nom</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ které odkazují na stejný konfigurovatelný objekt</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Nepojmenovaný</translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Unavngivet</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ angewendet werden soll, die das gleiche konfigurierbare Objekt referenzieren</tr
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Unbenannt</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Ανώνυμο</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ que hacen referencia al mismo objeto configurable</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Sin nombre</translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Sin nombre</translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Izenik gabea</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ that reference the same configurable object</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Nimetön</translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Nouveau</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ na sve veze koje referenciraju isti konfigurabilni objekt</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Neimenovano</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ amelyek ugyanarra a konfigurálható tárgyra hivatkoznak</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Névtelen</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ che fanno riferimento allo stesso oggetto configurabile</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Senza nome</translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation></translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation></translation>
</message>
+2 -3
View File
@@ -7,14 +7,13 @@
<location filename="../../Link.cpp" line="118"/>
<source>Stores the last user choice of whether to apply CopyOnChange setup to all links
that reference the same configurable object</source>
<translation type="unfinished">Stores the last user choice of whether to apply CopyOnChange setup to all links
that reference the same configurable object</translation>
<translation> CopyOnChange </translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation></translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Be pavadinimo</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ die verwijzen naar hetzelfde configureerbare object</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Naamloos</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ które odnoszą się do tego samego obiektu konfigurowalnego</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Nienazwany</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ que referenciam o mesmo objeto configurável</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Sem nome</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ that reference the same configurable object</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Sem nome</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ care fac referire la același obiect configurabil</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Nedenumit</translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Безымянный</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ za vse povezave, ki se sklicujejo na isti nastavljivi predmet</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Neimenovan</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ that reference the same configurable object</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Bez imena</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Без имена</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ that reference the same configurable object</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Namnlös</translation>
</message>
+7 -7
View File
@@ -14,7 +14,7 @@ uygulanmayacağına ilişkin son kullanıcı seçimini saklar</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>İsimsiz</translation>
</message>
@@ -24,32 +24,32 @@ uygulanmayacağına ilişkin son kullanıcı seçimini saklar</translation>
<message>
<location filename="../../Origin.cpp" line="142"/>
<source>X-axis</source>
<translation type="unfinished">X-axis</translation>
<translation>X-ekseni</translation>
</message>
<message>
<location filename="../../Origin.cpp" line="143"/>
<source>Y-axis</source>
<translation type="unfinished">Y-axis</translation>
<translation>Y-ekseni</translation>
</message>
<message>
<location filename="../../Origin.cpp" line="144"/>
<source>Z-axis</source>
<translation type="unfinished">Z-axis</translation>
<translation>Z-ekseni</translation>
</message>
<message>
<location filename="../../Origin.cpp" line="145"/>
<source>XY-plane</source>
<translation type="unfinished">XY-plane</translation>
<translation>XY-düzlemi</translation>
</message>
<message>
<location filename="../../Origin.cpp" line="146"/>
<source>XZ-plane</source>
<translation type="unfinished">XZ-plane</translation>
<translation>XZ-düzlemi</translation>
</message>
<message>
<location filename="../../Origin.cpp" line="147"/>
<source>YZ-plane</source>
<translation type="unfinished">YZ-plane</translation>
<translation>YZ-düzlemi</translation>
</message>
</context>
<context>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Без назви</translation>
</message>
+1 -1
View File
@@ -14,7 +14,7 @@ that reference the same configurable object</translation>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation>Sense nom</translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation></translation>
</message>
+1 -1
View File
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
<context>
<name>QObject</name>
<message>
<location filename="../../Application.cpp" line="459"/>
<location filename="../../Application.cpp" line="463"/>
<source>Unnamed</source>
<translation></translation>
</message>
+5 -1
View File
@@ -35,8 +35,12 @@
#include "InputSource.h"
#include "XMLTools.h"
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
#else
XERCES_CPP_NAMESPACE_USE
#endif
using namespace Base;
using namespace std;
+9 -1
View File
@@ -32,10 +32,18 @@
#include <FCGlobal.h>
#endif
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
namespace XERCES_CPP_NAMESPACE
{
class BinInputStream;
}
#else
XERCES_CPP_NAMESPACE_BEGIN
class BinInputStream;
XERCES_CPP_NAMESPACE_END
#endif
namespace Base
{
+6 -3
View File
@@ -50,7 +50,7 @@
#endif
#include <boost/algorithm/string.hpp>
#include "fmt/printf.h"
#include <fmt/printf.h>
#include "Parameter.h"
#include "Parameter.inl"
@@ -60,8 +60,12 @@
FC_LOG_LEVEL_INIT("Parameter", true, true)
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
#else
XERCES_CPP_NAMESPACE_USE
#endif
using namespace Base;
@@ -77,7 +81,6 @@ using namespace Base;
// - XStr
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class DOMTreeErrorReporter: public ErrorHandler
{
public:
+13 -1
View File
@@ -65,7 +65,18 @@ using PyObject = struct _object;
#pragma warning(disable : 4275)
#endif
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
namespace XERCES_CPP_NAMESPACE
{
class DOMNode;
class DOMElement;
class DOMDocument;
class XMLFormatTarget;
class InputSource;
} // namespace XERCES_CPP_NAMESPACE
#else
XERCES_CPP_NAMESPACE_BEGIN
class DOMNode;
class DOMElement;
@@ -73,6 +84,7 @@ class DOMDocument;
class XMLFormatTarget;
class InputSource;
XERCES_CPP_NAMESPACE_END
#endif
class ParameterManager;
+1
View File
@@ -49,6 +49,7 @@ PyObject* Base::PyExc_FC_ExpressionError = nullptr;
PyObject* Base::PyExc_FC_ParserError = nullptr;
PyObject* Base::PyExc_FC_CADKernelError = nullptr;
PyObject* Base::PyExc_FC_PropertyError = nullptr;
PyObject* Base::PyExc_FC_AbortIOException = nullptr;
typedef struct { //NOLINT
PyObject_HEAD
+1
View File
@@ -431,6 +431,7 @@ BaseExport extern PyObject* PyExc_FC_ExpressionError;
BaseExport extern PyObject* PyExc_FC_ParserError;
BaseExport extern PyObject* PyExc_FC_CADKernelError;
BaseExport extern PyObject* PyExc_FC_PropertyError;
BaseExport extern PyObject* PyExc_FC_AbortIOException;
/** Exception handling for python callback functions
* Is a convenience macro to manage the exception handling of python callback
+9 -1
View File
@@ -46,8 +46,12 @@
#include <zipios++/zipinputstream.h>
#include <boost/iostreams/filtering_stream.hpp>
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
#else
XERCES_CPP_NAMESPACE_USE
#endif
using namespace std;
@@ -177,6 +181,8 @@ bool Base::XMLReader::read()
void Base::XMLReader::readElement(const char* ElementName)
{
bool ok {};
endCharStream();
int currentLevel = Level;
std::string currentName = LocalName;
do {
@@ -244,6 +250,8 @@ bool Base::XMLReader::isEndOfDocument() const
void Base::XMLReader::readEndElement(const char* ElementName, int level)
{
endCharStream();
// if we are already at the end of the current element
if ((ReadType == EndElement || ReadType == StartEndElement) && ElementName
&& LocalName == ElementName && (level < 0 || level == Level)) {
+10 -1
View File
@@ -42,11 +42,20 @@ namespace zipios
{
class ZipInputStream;
}
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
namespace XERCES_CPP_NAMESPACE
{
class DefaultHandler;
class SAX2XMLReader;
} // namespace XERCES_CPP_NAMESPACE
#else
XERCES_CPP_NAMESPACE_BEGIN
class DefaultHandler;
class SAX2XMLReader;
XERCES_CPP_NAMESPACE_END
#endif
namespace Base
{
+2 -2
View File
@@ -6,12 +6,12 @@
<message>
<location filename="../../UnitsApi.cpp" line="69"/>
<source>Standard (mm, kg, s, °)</source>
<translation type="unfinished">Standard (mm, kg, s, °)</translation>
<translation>Estandarra (mm, kg, s, °)</translation>
</message>
<message>
<location filename="../../UnitsApi.cpp" line="71"/>
<source>MKS (m, kg, s, °)</source>
<translation type="unfinished">MKS (m, kg, s, °)</translation>
<translation>MKS (m, kg, s, °)</translation>
</message>
<message>
<location filename="../../UnitsApi.cpp" line="73"/>
+4 -4
View File
@@ -6,12 +6,12 @@
<message>
<location filename="../../UnitsApi.cpp" line="69"/>
<source>Standard (mm, kg, s, °)</source>
<translation type="unfinished">Standard (mm, kg, s, °)</translation>
<translation>Standart (mm/kg/s/derece)</translation>
</message>
<message>
<location filename="../../UnitsApi.cpp" line="71"/>
<source>MKS (m, kg, s, °)</source>
<translation type="unfinished">MKS (m, kg, s, °)</translation>
<translation>MKS (m/kg/s/derece)</translation>
</message>
<message>
<location filename="../../UnitsApi.cpp" line="73"/>
@@ -36,12 +36,12 @@
<message>
<location filename="../../UnitsApi.cpp" line="81"/>
<source>Metric small parts &amp; CNC (mm, mm/min)</source>
<translation type="unfinished">Metric small parts &amp; CNC (mm, mm/min)</translation>
<translation>Metrik küçük parçalar ve CNC (mm, mm/min)</translation>
</message>
<message>
<location filename="../../UnitsApi.cpp" line="83"/>
<source>Imperial for Civil Eng (ft, ft/s)</source>
<translation type="unfinished">Imperial for Civil Eng (ft, ft/s)</translation>
<translation>İngiliz Ölçü Birimi (ft, ft/sec)</translation>
</message>
<message>
<location filename="../../UnitsApi.cpp" line="85"/>
@@ -11,7 +11,7 @@
<message>
<location filename="../../UnitsApi.cpp" line="71"/>
<source>MKS (m, kg, s, °)</source>
<translation type="unfinished">MKS (m, kg, s, °)</translation>
<translation>MKS (m, kg, s, °)</translation>
</message>
<message>
<location filename="../../UnitsApi.cpp" line="73"/>
@@ -36,7 +36,7 @@
<message>
<location filename="../../UnitsApi.cpp" line="81"/>
<source>Metric small parts &amp; CNC (mm, mm/min)</source>
<translation type="unfinished">Metric small parts &amp; CNC (mm, mm/min)</translation>
<translation> &amp; CNC (mm, mm/min)</translation>
</message>
<message>
<location filename="../../UnitsApi.cpp" line="83"/>
@@ -46,7 +46,7 @@
<message>
<location filename="../../UnitsApi.cpp" line="85"/>
<source>FEM (mm, N, s)</source>
<translation type="unfinished">FEM (mm, N, s)</translation>
<translation>FEM (mm, N, s)</translation>
</message>
<message>
<location filename="../../UnitsApi.cpp" line="87"/>
+21
View File
@@ -372,3 +372,24 @@ std::string Base::Tools::currentDateTimeString()
.toString(Qt::ISODate)
.toStdString();
}
std::vector<std::string> Base::Tools::splitSubName(const std::string& subname)
{
// Turns 'Part.Part001.Body.Pad.Edge1'
// Into ['Part', 'Part001', 'Body', 'Pad', 'Edge1']
std::vector<std::string> subNames;
std::string subName;
std::istringstream subNameStream(subname);
while (std::getline(subNameStream, subName, '.')) {
subNames.push_back(subName);
}
// Check if the last character of the input string is the delimiter.
// If so, add an empty string to the subNames vector.
// Because the last subname is the element name and can be empty.
if (!subname.empty() && subname.back() == '.') {
subNames.push_back(""); // Append empty string for trailing dot.
}
return subNames;
}
+2
View File
@@ -325,6 +325,8 @@ struct BaseExport Tools
static std::string joinList(const std::vector<std::string>& vec, const std::string& sep = ", ");
static std::string currentDateTimeString();
static std::vector<std::string> splitSubName(const std::string& subname);
};
+5
View File
@@ -26,7 +26,12 @@
#include "XMLTools.h"
using namespace Base;
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
#else
XERCES_CPP_NAMESPACE_USE
#endif
std::unique_ptr<XMLTranscoder> XMLTools::transcoder; // NOLINT
+11 -1
View File
@@ -31,12 +31,22 @@
#include <Base/Exception.h>
#ifndef XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_QUALIFIER
using namespace XERCES_CPP_NAMESPACE;
namespace XERCES_CPP_NAMESPACE
{
class DOMNode;
class DOMElement;
class DOMDocument;
} // namespace XERCES_CPP_NAMESPACE
#else
XERCES_CPP_NAMESPACE_BEGIN
class DOMNode;
class DOMElement;
class DOMDocument;
XERCES_CPP_NAMESPACE_END
#endif
// Helper class
class BaseExport XMLTools
+1
View File
@@ -18,6 +18,7 @@ Bartlomiej Niemiec
Bas Ruigrok (Rexbas)
bejant
Benjamin Alterauge
Benjamin Bræstrup Sayoc
Bernd Hahnebach
bgbsww
blobfish (tanderson69)
+1
View File
@@ -28,6 +28,7 @@ configure_file(__init__.py.template ${NAMESPACE_INIT})
set(EXT_FILES
freecad_doc.py
module_io.py
part.py
partdesign.py
project_utility.py
+13
View File
@@ -0,0 +1,13 @@
def OpenInsertObject(importerModule, objectPath, importMethod, docName = ""):
try:
importArgs = []
importKwargs = {}
if docName:
importArgs.append(docName)
if hasattr(importerModule, "importOptions"):
importKwargs["options"] = importerModule.importOptions(objectPath)
getattr(importerModule, importMethod)(objectPath, *importArgs, **importKwargs)
except PyExc_FC_AbortIOException:
pass
+79 -37
View File
@@ -81,6 +81,7 @@
#include "PythonDebugger.h"
#include "MainWindowPy.h"
#include "MDIViewPy.h"
#include "Placement.h"
#include "SoFCDB.h"
#include "Selection.h"
#include "SelectionFilterPy.h"
@@ -359,6 +360,7 @@ struct PyMethodDef FreeCADGui_methods[] = {
} // namespace Gui
// clang-format off
Application::Application(bool GUIenabled)
{
// App::GetApplication().Attach(this);
@@ -377,7 +379,6 @@ Application::Application(bool GUIenabled)
App::GetApplication().signalShowHidden.connect(
std::bind(&Gui::Application::slotShowHidden, this, sp::_1));
// NOLINTEND
// install the last active language
ParameterGrp::handle hPGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp");
hPGrp = hPGrp->GetGroup("Preferences")->GetGroup("General");
@@ -452,6 +453,10 @@ Application::Application(bool GUIenabled)
Base::Interpreter().addType(UiLoaderPy::type_object(), module, "UiLoader");
PyResource::init_type();
Gui::Dialog::TaskPlacementPy::init_type();
Base::Interpreter().addType(Gui::Dialog::TaskPlacementPy::type_object(),
module, "TaskPlacement");
// PySide additions
PyModule_AddObject(module, "PySideUic", Base::Interpreter().addModule(new PySideUicModule));
@@ -555,6 +560,7 @@ Application::Application(bool GUIenabled)
MacroCommand::load();
}
}
// clang-format on
Application::~Application()
{
@@ -589,6 +595,7 @@ Application::~Application()
// creating std commands
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void Application::open(const char* FileName, const char* Module)
{
WaitCursor wc;
@@ -626,22 +633,25 @@ void Application::open(const char* FileName, const char* Module)
Command::doCommand(Command::App,
"FreeCAD.openDocument('%s')",
unicodepath.c_str());
Gui::Application::checkForRecomputes();
}
}
else {
// issue module loading
Command::doCommand(Command::App, "import %s", Module);
// check for additional import options
std::stringstream str;
str << "if hasattr(" << Module << ", \"importOptions\"):\n"
<< " options = " << Module << ".importOptions(u\"" << unicodepath << "\")\n"
<< " " << Module << ".open(u\"" << unicodepath << "\", options = options)\n"
<< "else:\n"
<< " " << Module << ".open(u\"" << unicodepath << "\")\n";
std::string code = str.str();
Gui::Command::runCommand(Gui::Command::App, code.c_str());
// Load using provided python module
{
Base::PyGILStateLocker locker;
Py::Module moduleIo(PyImport_ImportModule("freecad.module_io"));
const auto dictS = moduleIo.getDict().keys().as_string();
if (!moduleIo.isNull() && moduleIo.hasAttr("OpenInsertObject"))
{
const Py::TupleN args(
Py::Module(PyImport_ImportModule(Module)),
Py::String(unicodepath),
Py::String("open")
);
moduleIo.callMemberFunction("OpenInsertObject", args);
}
}
// ViewFit
if (sendHasMsgToActiveView("ViewFit")) {
@@ -706,30 +716,22 @@ void Application::importFrom(const char* FileName, const char* DocName, const ch
}
}
// check for additional import options
std::stringstream str;
if (DocName) {
str << "if hasattr(" << Module << ", \"importOptions\"):\n"
<< " options = " << Module << ".importOptions(u\"" << unicodepath
<< "\")\n"
<< " " << Module << ".insert(u\"" << unicodepath << "\", \"" << DocName
<< "\", options = options)\n"
<< "else:\n"
<< " " << Module << ".insert(u\"" << unicodepath << "\", \"" << DocName
<< "\")\n";
// Load using provided python module
{
Base::PyGILStateLocker locker;
Py::Module moduleIo(PyImport_ImportModule("freecad.module_io"));
const auto dictS = moduleIo.getDict().keys().as_string();
if (!moduleIo.isNull() && moduleIo.hasAttr("OpenInsertObject"))
{
const Py::TupleN args(
Py::Module(PyImport_ImportModule(Module)),
Py::String(unicodepath),
Py::String("insert"),
Py::String(DocName)
);
moduleIo.callMemberFunction("OpenInsertObject", args);
}
}
else {
str << "if hasattr(" << Module << ", \"importOptions\"):\n"
<< " options = " << Module << ".importOptions(u\"" << unicodepath
<< "\")\n"
<< " " << Module << ".insert(u\"" << unicodepath
<< "\", options = options)\n"
<< "else:\n"
<< " " << Module << ".insert(u\"" << unicodepath << "\")\n";
}
std::string code = str.str();
Gui::Command::runCommand(Gui::Command::App, code.c_str());
// Commit the transaction
if (doc && !pendingCommand) {
@@ -971,6 +973,46 @@ void Application::slotShowHidden(const App::Document& Doc)
signalShowHidden(*doc->second);
}
void Application::checkForRecomputes() {
std::vector<App::Document *> docs;
for (auto doc: App::GetApplication().getDocuments()) {
if (doc->testStatus(App::Document::RecomputeOnRestore)) {
docs.push_back(doc);
doc->setStatus(App::Document::RecomputeOnRestore, false);
}
}
// Certain tests want to use very old .FCStd files. We should not prompt during those tests, so this
// allows them to 'FreeCAD.ConfigSet("SuppressRecomputeRequiredDialog", "True")`
const std::map<std::string, std::string>& Map = App::Application::Config();
auto value = Map.find("SuppressRecomputeRequiredDialog");
bool skip = value != Map.end() && ! value->second.empty(); // Any non empty string is true.
if (docs.empty() || skip )
return;
WaitCursor wc;
wc.restoreCursor();
auto res = QMessageBox::warning(getMainWindow(), QObject::tr("Recomputation required"),
QObject::tr("Some document(s) require recomputation for migration purposes. "
"It is highly recommended to perform a recomputation before "
"any modification to avoid compatibility problems.\n\n"
"Do you want to recompute now?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
if (res != QMessageBox::Yes)
return;
bool hasError = false;
for (auto doc: App::Document::getDependentDocuments(docs, true)) {
try {
doc->recompute({}, false, &hasError);
} catch (Base::Exception &e) {
e.ReportException();
hasError = true;
}
}
if (hasError)
QMessageBox::critical(getMainWindow(), QObject::tr("Recompute error"),
QObject::tr("Failed to recompute some document(s).\n"
"Please check report view for more details."));
}
void Application::slotActiveDocument(const App::Document& Doc)
{
std::map<const App::Document*, Gui::Document*>::iterator doc = d->documents.find(&Doc);
+2
View File
@@ -74,6 +74,8 @@ public:
void exportTo(const char* FileName, const char* DocName, const char* Module);
/// Reload a partial opened document
App::Document *reopen(App::Document *doc);
/// Prompt about recomputing if needed
static void checkForRecomputes();
//@}
+31
View File
@@ -54,6 +54,8 @@ class BitmapFactoryInstP
public:
QMap<std::string, const char**> xpmMap;
QMap<std::string, QPixmap> xpmCache;
bool useIconTheme;
};
}
@@ -93,7 +95,9 @@ void BitmapFactoryInst::destruct ()
BitmapFactoryInst::BitmapFactoryInst()
{
d = new BitmapFactoryInstP;
restoreCustomPaths();
configureUseIconTheme();
}
BitmapFactoryInst::~BitmapFactoryInst()
@@ -111,6 +115,14 @@ void BitmapFactoryInst::restoreCustomPaths()
}
}
void Gui::BitmapFactoryInst::configureUseIconTheme()
{
Base::Reference<ParameterGrp> group = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Bitmaps/Theme");
d->useIconTheme = group->GetBool("UseIconTheme", group->GetBool("ThemeSearchPaths", false));
}
void BitmapFactoryInst::addPath(const QString& path)
{
QDir::addSearchPath(QString::fromLatin1("icons"), path);
@@ -174,6 +186,10 @@ bool BitmapFactoryInst::findPixmapInCache(const char* name, QPixmap& px) const
QIcon BitmapFactoryInst::iconFromTheme(const char* name, const QIcon& fallback)
{
if (!d->useIconTheme) {
return iconFromDefaultTheme(name, fallback);
}
QString iconName = QString::fromUtf8(name);
QIcon icon = QIcon::fromTheme(iconName, fallback);
if (icon.isNull()) {
@@ -206,6 +222,21 @@ bool BitmapFactoryInst::loadPixmap(const QString& filename, QPixmap& icon) const
return !icon.isNull();
}
QIcon Gui::BitmapFactoryInst::iconFromDefaultTheme(const char* name, const QIcon& fallback)
{
QIcon icon;
QPixmap px = pixmap(name);
if (!px.isNull()) {
icon.addPixmap(px);
return icon;
} else {
return fallback;
}
return icon;
}
QPixmap BitmapFactoryInst::pixmap(const char* name) const
{
if (!name || *name == '\0')
+5
View File
@@ -75,6 +75,10 @@ public:
* If no such icon is found in the current theme fallback is returned instead.
*/
QIcon iconFromTheme(const char* name, const QIcon& fallback = QIcon());
/** Returns the QIcon corresponding to name in the default (FreeCAD's) icon theme.
* If no such icon is found in the current theme fallback is returned instead.
*/
QIcon iconFromDefaultTheme(const char* name, const QIcon& fallback = QIcon());
/// Retrieves a pixmap by name
QPixmap pixmap(const char* name) const;
/** Retrieves a pixmap by name and size created by an
@@ -150,6 +154,7 @@ public:
private:
bool loadPixmap(const QString& path, QPixmap&) const;
void restoreCustomPaths();
void configureUseIconTheme();
static BitmapFactoryInst* _pcSingleton;
BitmapFactoryInst();
+5
View File
@@ -1318,7 +1318,11 @@ StdCmdDelete::StdCmdDelete()
sWhatsThis = "Std_Delete";
sStatusTip = QT_TR_NOOP("Deletes the selected objects");
sPixmap = "edit-delete";
#ifdef FC_OS_MACOSX
sAccel = "Backspace";
#else
sAccel = keySequenceToAccel(QKeySequence::Delete);
#endif
eType = ForEdit;
}
@@ -1562,6 +1566,7 @@ void StdCmdPlacement::activated(int iMsg)
plm->setPropertyName(QLatin1String("Placement"));
plm->setSelection(selection);
plm->bindObject();
plm->clearSelection();
}
}
Gui::Control().showDialog(plm);
+1 -1
View File
@@ -402,7 +402,7 @@ void DlgAddPropertyVarSet::onEditFinished() {
checkGroup();
checkType();
}
catch (const CreatePropertyException& e) {
catch (const CreatePropertyException&) {
if (!namePropertyToAdd.empty()) {
clearCurrentProperty();
}
+83 -75
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>292</width>
<height>247</height>
<height>296</height>
</rect>
</property>
<property name="windowTitle">
@@ -41,58 +41,6 @@
<property name="spacing">
<number>6</number>
</property>
<item row="4" column="0" colspan="2">
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="textLabel4">
<property name="text">
<string>Shininess:</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>81</width>
<height>31</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="shininess">
<property name="suffix">
<string notr="true">%</string>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
@@ -100,31 +48,27 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="textLabel4">
<property name="text">
<string>Shininess:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::ColorButton" name="ambientColor">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::ColorButton" name="emissiveColor">
<property name="text">
<string/>
<property name="allowTransparency">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="textLabel3">
<item row="6" column="0">
<widget class="QPushButton" name="buttonReset">
<property name="text">
<string>Specular color:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::ColorButton" name="diffuseColor">
<property name="text">
<string/>
<string>Reset</string>
</property>
</widget>
</item>
@@ -135,11 +79,67 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="shininess">
<property name="minimumSize">
<size>
<width>122</width>
<height>0</height>
</size>
</property>
<property name="suffix">
<string notr="true">%</string>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::ColorButton" name="emissiveColor">
<property name="text">
<string/>
</property>
<property name="allowTransparency">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="textLabel3">
<property name="text">
<string>Specular color:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::ColorButton" name="specularColor">
<property name="text">
<string/>
</property>
<property name="allowTransparency">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QPushButton" name="buttonDefault">
<property name="text">
<string>Default</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::ColorButton" name="diffuseColor">
<property name="text">
<string/>
</property>
<property name="allowTransparency">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
@@ -150,16 +150,25 @@
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="buttonReset">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Reset</string>
<string>Transparency:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QPushButton" name="buttonDefault">
<property name="text">
<string>Default</string>
<widget class="QSpinBox" name="transparency">
<property name="minimumSize">
<size>
<width>122</width>
<height>0</height>
</size>
</property>
<property name="suffix">
<string>%</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
@@ -188,7 +197,6 @@
<tabstop>diffuseColor</tabstop>
<tabstop>emissiveColor</tabstop>
<tabstop>specularColor</tabstop>
<tabstop>shininess</tabstop>
</tabstops>
<resources/>
<connections>
+13
View File
@@ -62,6 +62,8 @@ void DlgMaterialPropertiesImp::setupConnections()
this, &DlgMaterialPropertiesImp::onSpecularColorChanged);
connect(ui->shininess, qOverload<int>(&QSpinBox::valueChanged),
this, &DlgMaterialPropertiesImp::onShininessValueChanged);
connect(ui->transparency, qOverload<int>(&QSpinBox::valueChanged),
this, &DlgMaterialPropertiesImp::onTransparencyValueChanged);
connect(ui->buttonReset, &QPushButton::clicked,
this, &DlgMaterialPropertiesImp::onButtonReset);
connect(ui->buttonDefault, &QPushButton::clicked,
@@ -130,6 +132,14 @@ void DlgMaterialPropertiesImp::onShininessValueChanged(int sh)
customMaterial.shininess = (float)sh / 100.0F;
}
/**
* Sets the current transparency.
*/
void DlgMaterialPropertiesImp::onTransparencyValueChanged(int sh)
{
customMaterial.transparency = (float)sh / 100.0F;
}
/**
* Reset the colors to the Coin3D defaults
*/
@@ -159,6 +169,9 @@ void DlgMaterialPropertiesImp::setButtonColors(const App::Material& mat)
ui->shininess->blockSignals(true);
ui->shininess->setValue((int)(100.0F * (mat.shininess + 0.001F)));
ui->shininess->blockSignals(false);
ui->transparency->blockSignals(true);
ui->transparency->setValue((int)(100.0F * (mat.transparency + 0.001F)));
ui->transparency->blockSignals(false);
}
#include "moc_DlgMaterialPropertiesImp.cpp"
+1
View File
@@ -63,6 +63,7 @@ private:
void onEmissiveColorChanged();
void onSpecularColorChanged();
void onShininessValueChanged(int);
void onTransparencyValueChanged(int);
void onButtonReset();
void onButtonDefault();
void setButtonColors(const App::Material& mat);
+1
View File
@@ -117,6 +117,7 @@ struct DocumentP
Connection connectStartLoadDocument;
Connection connectFinishLoadDocument;
Connection connectShowHidden;
Connection connectFinishRestoreDocument;
Connection connectFinishRestoreObject;
Connection connectExportObjects;
Connection connectImportObjects;
+16 -20
View File
@@ -153,14 +153,19 @@ void FileDialog::accept()
QFileDialog::accept();
}
void FileDialog::getPossibleSuffixes(QStringList& possibleSuffixes, const QRegularExpression& rx,
const QString* suffixDescriptions)
void FileDialog::getSuffixesDescription(QStringList& suffixes, const QString* suffixDescriptions)
{
QRegularExpression rx;
// start the raw string with a (
// match a *, a . and at least one word character (a-z, A-Z, 0-9, _) with \*\.\w+
// end the raw string with a )
rx.setPattern(QLatin1String(R"(\*\.\w+)"));
QRegularExpressionMatchIterator i = rx.globalMatch(*suffixDescriptions);
while (i.hasNext()) {
QRegularExpressionMatch match = i.next();
QString suffix = match.captured(1);
possibleSuffixes << suffix;
QString suffix = match.captured(0);
suffixes << suffix;
}
}
@@ -195,22 +200,13 @@ QString FileDialog::getSaveFileName (QWidget * parent, const QString & caption,
filterToSearch = &filter;
}
QRegularExpression rx;
rx.setPattern(QLatin1String(R"(\s\((\*\.\w{1,})\W)"));
QStringList possibleSuffixes;
getPossibleSuffixes(possibleSuffixes, rx, filterToSearch);
auto match = rx.match(*filterToSearch);
if (match.hasMatch()) {
int index = match.capturedStart();
int length = match.capturedLength();
// get the suffix with the leading dot but ignore the surrounding ' (*' and ')'
int offsetStart = 3;
int offsetEnd = 4;
QString suffix = filterToSearch->mid(index + offsetStart, length - offsetEnd);
QString fiSuffix = QLatin1String("*.") + fi.suffix(); // To match with possibleSuffixes
if (fi.suffix().isEmpty() || !possibleSuffixes.contains(fiSuffix)) {
dirName += suffix;
}
QStringList filterSuffixes;
getSuffixesDescription(filterSuffixes, filterToSearch);
QString fiSuffix = QLatin1String("*.") + fi.suffix(); // To match with filterSuffixes
if (fi.suffix().isEmpty() || !filterSuffixes.contains(fiSuffix)) {
// there is no suffix or not a suffix that matches the filter, so
// default to the first suffix of the filter
dirName += filterSuffixes[0].mid(1);
}
}
+1 -2
View File
@@ -89,8 +89,7 @@ private:
bool hasSuffix(const QString&) const;
static QList<QUrl> fetchSidebarUrls();
static QString workingDirectory;
static void getPossibleSuffixes(QStringList& possibleSuffixes, const QRegularExpression& rx,
const QString* suffixDescriptions);
static void getSuffixesDescription(QStringList& suffixes, const QString* suffixDescriptions);
};
// ----------------------------------------------------------------------
Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 70 KiB

File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff

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