Commit Graph

39618 Commits

Author SHA1 Message Date
Yorik van Havre
9efa615fb4 BIM: Fixed shape loading - fixes #18391 2024-12-13 12:22:04 -05:00
David Kaufman
1955f28053 [CAM] implement multipass profile operations (#17326)
* implement multipass profile operations

* [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-12-13 11:20:32 -06:00
wmayer
00f6fbeaa3 PD: Fix possible crash in up to shape 2024-12-13 12:15:49 -05:00
wmayer
e7e410323e Sketch: Fix possible crash in BSpline::splineValue
There is an underflow of an unsigned int in the calling instance that sets the parameter 'p' to 2**32-1.
But the size of the passed vector is 0. To fix the crash first check if p is less then the size of the vector.

See: https://forum.freecad.org/viewtopic.php?t=92815
2024-12-13 12:08:31 -05:00
WandererFan
f12999724b [TD]respect locale for date autofill (#18132)
* [TD]respect locale for date autofill

* [TD]fix merge conflict

* Apply suggestions from code review

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-12-13 11:07:54 -06:00
Kacper Donat
aed305da64 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
Syres916
752b5dcf68 [Gui] Tree, set FontSize on start of application 2024-12-13 11:58:24 -05:00
LarryWoestman
f1e67c9641 CAM: fixed A, B, and C axis handling; added relevant tests (#18103)
* CAM:  fixed A, B, and C axis handling; added relevant tests

* [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-12-13 10:55:47 -06:00
Kevin Martin
83202d8ad6 Address the poor performance of the existing unique-name generation (#17944)
* 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 update includes the following changes:

Create UniqueNameManager to keep 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.

Eliminate Tools::getUniqueName

Make DocumentObject naming use the new UniqueNameManager class

Make DocumentObject Label naming use the new UniqueNameManager class.
Labels are not always unique; unique labels are generated if the
settings at the time request it (and other conditions). Because of this
the Label management requires additionally keeping a map of counts
for labels which already exist more than once.
These collections are maintained via notifications of value changes on
the Label properties of the objects in the document.

Add Document::containsObject(DocumentObject*) for a definitive
test of an object being in a Document. This is needed because
DocumentObjects can be in a sort of limbo (e.g. when they are in the
Undo/Redo lists) where they have a parent linkage to the Document but
should not participate in Label collision checks.

Rename Document.getStandardObjectName to getStandardObjectLabel
to better represent what it does.

Use new UniqueNameManager for Writer internal filenames within the zip
file.

Eliminate unneeded Reader::FileNames collection. The file names
already exist in the FileList collection elements. The only existing
use for the FileNames collection was to determine if there were any
files at all, and with FileList and FileNames being parallel
vectors, they both had the same length so FileList could be used
for this test..

Use UniqueNameManager for document names and labels. This uses ad hoc
UniqueNameManager objects created on the spot on the assumption that
document creation is relatively rare and there are few documents, so
although the cost is O(n), n itself is small.

Use an ad hoc UniqueNameManager to name new DymanicProperty entries.
This is only done if a property of the proposed name already exists,
since such a check is more-or-less O(log(n)), almost never finds a
collision, and avoids the O(n) building of the UniqueNameManager.
If there is a collision an ad-hoc UniqueNameManager is built
and discarded after use.
The property management classes have a bit of a mess of methods
including several to populate various collection types with all
existing properties. Rather than introducing yet another such
collection-specific method to fill a UniqueNameManager, a
visitProperties method was added which calls a passed function for
each property. The existing code would be simpler if existing
fill-container methods all used this.
Ideally the PropertyContainer class would keep a central directory of
all properties ("static", Dynamic, and exposed by ExtensionContainer and
other derivations) and a permanent UniqueNameManager. However the
Property management is a bit of a mess making such a change a project
unto itself.

The unit tests for Tools:getUniqueName have been changed to test
UniqueNameManager.makeUniqueName instead.
This revealed a small regression 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".

* Correct wrong case on include path

* Implement suggested code changes
Also change the semantics of visitProperties to not have any short-circuit return

* Remove reference through undefined iterator

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

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

* Fix up some comments for DOxygen

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-13 10:54:46 -06:00
xtemp09
b1f93bc51e [Spreadsheet] Enable zoom in Spreadsheet (#16130)
* [Spreadsheet] Enable zoom in Spreadsheet

Closes #6094. This commit also fixes page tab order of Spreadsheet
settings in Preferences.

* Spreadsheet: apply clang-format

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-12-13 10:52:51 -06:00
Chris Hennes
0416ec1b4e Merge pull request #18405 from FreeCAD/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2024-12-13 11:52:03 -05:00
marioalexis
c02aa87a35 Fem: Make it possible to run CalculiX with one core - fixes #18339 2024-12-13 11:50:59 -05:00
marioalexis
7550d54a01 Base: Add electromagnetic potential unit 2024-12-13 11:49:44 -05:00
efferre79
fe57e3176d cmake fixes for external OndselSolver building (#18379)
* Assembly: fix building with external OndselSolver

This commit pairs with f35b075e271e9cb3451f3439f7dc0274841a0838.
It solves two issues:

- remove hardcoded includes of 3rdparty files
- add missing include_directories()

* Assembly: add check for external OndselSolver includes
2024-12-13 10:46:46 -06:00
wasd845
f4f611163d Add export config directory specification feature (#15235) 2024-12-13 10:44:30 -06:00
mosfet80
eef368ae63 Cleqn BaseTests.py
Clean code
2024-12-13 11:42:37 -05:00
Florian Foinant-Willig
c4528eb3a5 PartDesign: fix helix with negative angle 2024-12-13 11:41:55 -05:00
Kacper Donat
d1f706050d TopoNaming: Refine - mark joined faces as modified not generated
This is parity change with LS3: a9810d509a/src/Mod/Part/App/TopoShapeEx.cpp (L3357)
2024-12-13 11:41:29 -05:00
Chris Hennes
426a079262 Merge pull request #18200 from wwmayer/refactor_ply
Refactor and optimize PLY reader
2024-12-13 11:40:29 -05:00
Snow Faerie
8bc062b6e8 Fix and add menu accelerators (#15532)
* Fix and add menu accelerators: menus common to all workbenches

I use menu accelerators fairly often, so I find it very frustrating when
they are missing, or worse, they don't work due to the same letter being
assigned to several commands.

This patch adds accelerators to lots of menu entries missing them and
fixes broken accelerators.

Wherever possible, standard accelerator keys are used:
https://doc.qt.io/qt-5/accelerators.html

This commit covers accelerator fixes that are common to all workbenches.
Accelerator fixes for specific workbenches will be done in separate
commits.

* Add missing accelerators: Spreadsheet workbench
2024-12-13 10:39:30 -06:00
Chris Hennes
9a7063395a Merge pull request #18346 from wwmayer/fix_sketch
Fix SketchObjectPy::addExternal
2024-12-13 11:37:51 -05:00
Patryk Skowroński
ad419828b0 Update for 3Dconnexion NavLib integration (#18433)
* Fixed QuickZoom crash & picking in ortho view

* Fixed QuickZoom for high DPI screens

* Fixed return value for SetHitLookFrom

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>

* Removed whitespace from GetPointerPosition

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>

---------

Co-authored-by: Patryk Skowroński <pskowronski@3dconnexion.com>
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2024-12-13 08:41:11 -06:00
wmayer
7c3164ff61 Part: Fix compiler warnings [-Wodr]
Type 'struct EdgePoints' violates the C++ One Definition Rule because it's defined in two different translation units
2024-12-13 09:24:19 -05:00
PaddleStroke
6780d8a514 Dark theme: tweak error color (#18468)
* Update FreeCAD Dark.cfg

* Update FreeCAD Dark.cfg

* Update FreeCAD Dark.cfg
2024-12-13 13:55:17 +01:00
Ronny Standtke
d057fd7960 fixed loading of bim tutorial images 2024-12-12 10:46:08 +01:00
Yorik van Havre
2cc8c3e4c5 BIM: Fixes appearance defects coming from recent transparency and #18298 2024-12-12 09:43:02 +01:00
Yorik van Havre
7f456d854f BIM: Fixed whitespace 2024-12-11 10:24:43 +01:00
Yorik van Havre
1d6e60f558 BIM: NativeIFC 2D support - axes 2024-12-11 10:24:43 +01:00
Yorik van Havre
a8b4fb485e BIM: NativeIFC 2D support - small fixes 2024-12-11 10:24:43 +01:00
Yorik van Havre
a62ce903d3 BIM: NativeIFC 2D support - better context detetcion 2024-12-11 10:24:43 +01:00
Yorik van Havre
8577d1bb46 BIM: NativeIFC 2D support - misc fixes cf comment #2383181661 2024-12-11 10:24:43 +01:00
Yorik van Havre
af84424a77 BIM: NativeIFC 2D support - section planes 2024-12-11 10:24:43 +01:00
Yorik van Havre
8406eae6c1 BIM: NativeIFC 2D support - optimized export of FreeCAD dimensions 2024-12-11 10:24:43 +01:00
Yorik van Havre
9c53a024c0 BIM: NativeIFC 2D support - dimensions 2024-12-11 10:24:43 +01:00
Yorik van Havre
4fba4abe5f BIM: Workaround for objects needing recompute 2024-12-11 10:24:43 +01:00
Yorik van Havre
a2793dc903 BIM: NativeIFC 2D support - handling orphan elements and drawing groups 2024-12-11 10:24:43 +01:00
Yorik van Havre
bf4a988301 BIM: NativeIFC 2D support - texts 2024-12-11 10:24:43 +01:00
Yorik van Havre
9c9d451ac6 BIM: NativeIFC 2D support - basic import/export + linework annotations 2024-12-11 10:24:43 +01:00
Yorik van Havre
7913280486 BIM: Support for NativeIFC in BimViews 2024-12-11 09:23:59 +01:00
Yorik van Havre
992e6d397c BIM: Support for active container 2024-12-11 09:23:59 +01:00
Yorik van Havre
fbd7d201d5 BIM: BimViews upgrade 2024-12-11 09:23:59 +01:00
wmayer
438c6d730f Core: Fix pre-selection of coordinate system 2024-12-10 19:11:55 +01:00
wmayer
ab5b53e972 Sketcher: Fix warning [-Wmaybe-uninitialized] 2024-12-10 12:32:41 -05:00
PaddleStroke
8b6b66040c SoShapeScale: Fix SoShapeScale does not take DPI scaling into account 2024-12-10 17:15:13 +01:00
PaddleStroke
396963006b Core: SoShapeScale fix weird scaling on viewport resize. See https://github.com/FreeCAD/FreeCAD/issues/18382#issuecomment-2527623758 2024-12-10 17:15:13 +01:00
luzpaz
20d64a7f0f Fix various typos
Found via `codespell -q 3 -L aci,addmin,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,aply,apoints,ba,beginn,behaviour,bloaded,bottome,brushin,bu,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,documentin,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,findn,fle,freez,graphin,hist,iff,incrementin,indexin,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,leadin,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,renderin,rin,ro,rougly,sectionin,seperator,serie,shs,sinc,siz,som,strack,substraction,te,technic,thist,thru,tread,tru,ue,uint,unter,uptodate,vas,vertexes,vew,wallthickness,whitespaces -S "./.git,*.po,*.ts,*.pdf,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./src/Base/StackWalker.cpp,./build/doc/SourceDoc,./tools/build/WindowsInstaller/lang,./src/Mod/TechDraw/Templates/locale"`
2024-12-10 15:09:51 +01:00
wmayer
ce55d6be75 Gui: Rename ViewProviderDatum::getRoot() to ViewProviderDatum::getDatumRoot()
Before the change the compiler raised the warning: 'Gui::ViewProviderDatum::getRoot' hides overloaded virtual function [-Werror,-Woverloaded-virtual]
In the base class the method getRoot() is declared as const while in ViewProviderDatum it's not and that's why it's considered as an overloaded method.
However, this signature causes two problems:
1. In the client code it's not always clear which version of getRoot() should be called
2. It violates const-correctness

So, trying to declare the method ViewProviderDatum::getRoot() as const it now overrides the method of the base class (and fixes the warning) but
this doesn't lead to the expected result: See https://forum.freecad.org/viewtopic.php?p=796064#p796064

The other option is to rename the method. And this gives the expected result now.
2024-12-10 12:49:42 +01:00
pre-commit-ci[bot]
9caa6d2c7b [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-12-09 17:29:33 -05:00
pre-commit-ci[bot]
b0b843e34b [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-clang-format: 7d85583be209cb547946c82fbe51f4bc5dd1d017 → fed9a1f62c22af0bc846a260ebfeb0844368fd93](7d85583be2...fed9a1f62c)
2024-12-09 17:29:33 -05:00
Jacob Oursland
16ac5f9977 PartDesign: Fix failing TNP test. 2024-12-09 17:27:28 -05:00