Commit Graph

1377 Commits

Author SHA1 Message Date
Kacper Donat
cc2efa90f8 Base: Add isNullOrEmpty string helper
This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
2025-02-21 15:04:43 +01:00
Benjamin Bræstrup Sayoc
6f619b5f1c Base: remove unneeded includes 2025-02-18 11:07:57 -06:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
82b5ce2d10 [ Doxygen ] Improved Param Group Subgroup Methods (#19546) 2025-02-17 11:24:05 -06:00
Benjamin Bræstrup Sayoc
5f86a65a5e Base: use QStringLiteral 2 2025-02-16 19:52:23 +01:00
Joao Matos
aace8f7bee CMake: Modernize build files using outdated Python variables. 2025-02-16 10:21:26 -06:00
Andrea
146d8a356b change MIN_boost_version
ubuntu version 20.04 is no longer supported.
The minimum boost version used for freecad is now 1.74 (ubuntu 22.04) https://launchpad.net/ubuntu/jammy/+package/libboost-system-dev
2025-02-15 13:33:32 -06:00
Benjamin Nauck
0128e267ce Add [[nodiscard]] to Vector3 (#19544)
* Add nodiscard to vector3
2025-02-14 14:14:45 -06:00
tritao
80b299bb88 Base: Move zipios library to 3rdParty folder. 2025-02-14 13:08:28 -06:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
cbcc6d983d Base: [ Doxygen ] Improved parameter attribute methods (#19491) 2025-02-11 11:44:52 -06:00
Chris Hennes
a3004c2c0a Merge pull request #19142 from hyarion/refactor/add-template-addobject
Add new addObject<T>() function
2025-02-11 09:42:47 -06:00
Chris Hennes
6ea90ba9af Merge pull request #18594 from Flast/performance/base/find_element
Base: Improved FindElement performance by reducing call of transcode
2025-02-10 14:33:49 -06:00
Benjamin Nauck
a3703098f8 Base: Minor code cleanup in Type 2025-02-10 18:33:00 +01:00
Benjamin Nauck
b51e83f252 Base: Add missing const to Type::createInstance 2025-02-10 18:32:59 +01:00
tritao
f7a0cece08 Base: Remove Boost-based filesystem and switch to standard <filesystem> 2025-02-10 10:48:54 -06:00
Chris Hennes
b18150e048 Merge pull request #19479 from tritao/base-cleanup-xml-generation
Base: Minor cleanups to base XML bindings generation
2025-02-10 09:34:50 -06:00
tritao
b83db107cd Base: Minor cleanups to base XML bindings. 2025-02-08 13:14:22 +00:00
tritao
2145b742eb Base: Standardize on Py::Long type for Python bindings. 2025-02-08 13:14:22 +00:00
tritao
5117c82d33 Base: Clean documentation for PyObjectBase.h. 2025-02-08 13:14:22 +00:00
pre-commit-ci[bot]
304150b038 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-02-08 02:44:47 +00:00
Chris Hennes
1dfeb5eff2 Base: Add comments to new macros 2025-02-07 20:41:44 -06:00
tritao
4260bd6fa4 Gui: Minor cleanups. 2025-02-05 22:13:07 +00:00
wandererfan
53ba838ac2 [Units]fix bad length multiplier in MeterDecimal 2025-01-28 01:55:25 -06:00
Chris Hennes
c4485527fc Merge pull request #19011 from marioalexis84/fem-electromagnetic_boundary_condtion 2025-01-27 15:15:59 -06:00
Benjamin Nauck
02c8bfff69 Add constraints to templates in BaseClass using static_asserts 2025-01-27 16:08:18 +01:00
André Kapelrud
aaa976953d Base: Add surface charge density unit 2025-01-22 11:17:59 -03:00
Yorik van Havre
0213b4fc6c Translations (#18923)
* 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>
2025-01-13 21:30:30 -06:00
Tobias Frost
460da406f8 spelling fixes (#18688)
* Fixes spelling of "Allow to" to "Allow one to"

and those variants:
Allows to -> Allows one to
allow to -> allow one to
allows to -> allows one to

* Fix "Let's -> Lets"

(and lower case variant.)

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

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

* Update src/3rdParty/salomesmesh/inc/MED_Wrapper.hxx

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Base/PyObjectBase.cpp
Update src/App/ExtensionContainer.h
Update src/App/PropertyContainer.h

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Use gerund in user-facing texts.

* Use gerund for two more user-facing strings.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Tobias Frost <tobi@debian.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-01-13 11:22:20 -06:00
Chris Hennes
0517e3dc10 Merge pull request #17564 from kadet1090/new-transform-dialog
Gui: New transform dialog
2025-01-13 11:18:26 -06:00
Kevin Martin
346be29042 Address the poor performance of the existing unique-name generation (part 1) (#18589)
* Change Address the poor performance of the existing unique-name generation

As described in Issue 16849, the existing Tools::getUniqueName method
requires calling code to form a vector of existing names to be avoided.

This leads to poor performance both in the O(n) cost of building such a
vector and also getUniqueName's O(n) algorithm for actually generating
the unique name (where 'n' is the number of pre-existing names).

This has  particularly noticeable cost in documents with large numbers
of DocumentObjects because generating both Names and Labels for each new
object incurs this cost. During an operation such as importing this
results in an O(n^2) time spent generating names.

The other major cost is in the saving of the temporary backup file,
which uses name generation for the "files" embedded in the Zip file.
Documents can easily need several such "files" for each object in the
document.

This is the first part of the correction, adding an efficient class for
managing sets of unique names.

New class UniqueNameManager keeps a list of existing names organized in
a manner that eases unique-name generation. This class essentially acts
as a set of names, with the ability to add and remove names and check if
a name is already there, with the added ability to take a prototype name
and generate a unique form for it which is not already in the set.

a new unit test for UniqueNameManager has been added as well.

There is a small regression, compared to the existing unique-name code,
insofar as passing a prototype name like "xyz1234" to the old code would
yield "xyz1235" whether or not "xyz1234" already existed, while the new
code will return the next name above the currently-highest name on the
"xyz" model, which could be "xyz" or "xyz1" or "xyz0042"..
2025-01-13 10:57:53 -06:00
Kacper Donat
4702c72fb8 Gui: Rework TaskCSysDragger into new Transform Dialog
This commit refactor ViewProviderDragger and TaskCSysDragger to be more
modern and to support selecting TransformOrigin.
2025-01-04 16:32:52 +01:00
Kacper Donat
e12bdfc29c Part: Add midpoint attachement mode
This adds midpoint attachement mode to Attacher. It works just like
method for finding placement of JCS in Assembly.
2025-01-04 16:32:52 +01:00
Kacper Donat
431f46a4fe ServiceProvider: Use std::string as key for services map
This fixes potantial crash that can happen on certain platforms like
macOS due to `typeid(T).name()` returning different pointers to string
which does not happen on all platforms.
2025-01-04 16:32:47 +01:00
Kacper Donat
3774830a46 ServiceProvider: Better naming of methods
This commit renames methods of ServiceProvider to be easier to
understand. It also replaces the misleading singleton with more correct
here global instance of class.
2025-01-04 16:32:47 +01:00
Kohei Takahashi
194a9f9751 Base: Expanded FindAttribute() to get rid of frequent constant transcode 2024-12-31 10:30:23 +09:00
Kohei Takahashi
7ae463f245 Base: Added helper macro for caching transcode-ed string literal 2024-12-26 17:16:45 +09:00
Ladislav Michl
49ce1e0449 Base: Quantity: use std::nan 2024-12-23 17:48:42 +01:00
Ladislav Michl
3bddb723d5 Base: UnitsSchema: return std::string 2024-12-23 17:48:42 +01:00
Ladislav Michl
0b3adee2ab Base: Quantity: return std::string 2024-12-23 17:48:42 +01:00
Ladislav Michl
9f7218ac75 Base: Units: remove unused defines 2024-12-23 17:48:42 +01:00
Ladislav Michl
379d7ea9d5 Base: Units: return std::string 2024-12-23 17:48:42 +01:00
Ladislav Michl
24f4deef70 Base: Units: reimplement getTypeString() using container 2024-12-23 17:48:42 +01:00
Ladislav Michl
539b7d43cf Base: Units: hide internals 2024-12-23 17:48:42 +01:00
wmayer
134ebd34ce Core: Format Placement::toString() and fix const correctness 2024-12-19 11:15:50 +01:00
Kohei Takahashi
8752982b78 Base: Improved FindElement performance by reducing call of transcode 2024-12-18 20:19:12 +09:00
PaddleStroke
f3fa6daecc Placement::tostring Fix fmt expression 2024-12-18 11:31:22 +01:00
PaddleStroke
27be2ff16f Placement: Adds a helper to print the value of the placement. 2024-12-16 12:30:25 -05:00
Benjamin Nauck
39402e2083 Revert "Address the poor performance of the existing unique-name generation (#17944)"
This reverts commit 83202d8ad6.

# Conflicts:
#	src/Base/Tools.cpp
#	src/Base/Tools.h
2024-12-16 17:31:43 +01:00
Chris Hennes
52e9ea0adc Base: Add missing PCH include to ServiceProvider 2024-12-13 20:28:42 -05:00
wmayer
02a5538fba Fix several compiler warnings:
* Fix [-Wsign-compare]
* Fix [-Wc++20-designator]: designated initializers are a C++20 extension
* Fix [-Wunused-parameter]
2024-12-13 20:28:04 -05:00
Kacper Donat
d835cde3a5 Base: Add Services and ServiceProvider
This is intended to be used for intra-module communication. Modules can
specify service that are then implemented by other modules. This way
we can use features from for example part in Core without relying on the
Part module explicitly.

Base does provide Service definition - which is basically an abstract
class with pure virtual methods. This service then can be implemented
in other modules and accessed in runtime via ServiceProvider class that
stores all implementations.

ServiceProvider does store multiple implementations so in theory it is
possible to use it to provide granular implementations. For example,
part can provide CenterOfMass service that provides center of mass for
part features, mesh can implement another one for meshes and then we can
iterate over all implementations and find one that can provide center of
2024-12-13 12:01:13 -05:00