* MOD: assembly clean
clean code
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update AssemblyLink.cpp
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* renamed SoFCCSysDragger to SoTransformDragger
* moved TDragger, RDragger and TPlanarDragger to separate files and also renamed them to be more descriptive
* fixed hasher ref bug and fixed speed of updateJCSPlacements
* remove debug info
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix hasher mismatch when editing or creating a joint
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix issues raised in PR
* add warning
* [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>
* Assembly: Fix: Select datum should not show dragger.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update ViewProviderAssembly.cpp
* [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>
Unparented popups can easily get lost in backround, but they still block top level event loop when run with ::exec() thus preventing interactions with main window. This mainly happens on wayland. Setting the parent ensures they are always kept on top and reasonably positioned.
before including the library, it is uselessly checked if the variable __QtAll__ and __InventorAll__ have been defined. The same check is performed again once the library is included
Menu texts in the Assembly WB are in title case without articles.
The following menu texts did not follow that 'standard':
* Insert a new part
* Create a Fixed Joint
* 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>
* 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>
* 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
This commit is generated using regex based find and replace:
```
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*getObject\(\s*\)\)/getObject<$1>/
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*([^)]*)\s*->\s*getObject\(\s*\)\)/$2->getObject<$1>()/
```
To regenerate if needed.
Description of Defects in migrationScript2 and migrationScript4:
Several additional issues have been identified in the Assembly
functions migrationScript4 and migrationScript2, beyond those fixed in
patch 71f0104bb2.
One common problem is that the Joint property Reference1 or Reference2
can be set to an invalid format. For example, user can manually cause
this issue by assigning an incorrect reference (e.g., the Z-axis) to
these properties via the FreeCAD GUI. When this happens, internal
errors (exceptions and their corresponding Python call stack) are
reported in the Report View. However, such information is not helpful
for the user to fix their 3D model.
Issues with the Current Implementation (Using migrationScript4 as
Reference):
- Lack of Type Validation for Reference1 and Reference2:
The script does not check whether joint.Reference1[1] or
joint.Reference2[1] is a sequence. If this condition is not met,
statements like:
sub1 = joint.Reference1[1][0]
will throw an exception, printing the Python call stack.
- Lack of Length Validation for Sequences:
The script does not ensure that the sequence length is sufficient
for indexing. For example, joint.Reference1 and joint.Reference2
must each have at least two elements to allow:
joint.Reference1[1][1]
joint.Reference2[1][1]
Without validation, such calls can result in exceptions, printing the
Python call stack.
- No Feedback on Problematic Joint:
The user is not informed about which Assembly joint in the object
hierarchy has an invalid Reference1 or Reference2. Depending on the
size of the 3D model, identifying the defect can be time-consuming
and frustrating without proper feedback.
This patch is focused on:
- Reporting Problematic Joint Path:
A new function has been added to retrieve the full path to the
Assembly joint. The return value (a string) is used to report the
issue.
- Improved Exception Handling:
Instead of adding more conditional checks (see above), exception
handling is implemented. AttributeError, IndexError, and TypeError
exceptions are caught. The exception message (excluding the call
stack) is displayed at the end of a user-friendly warning.
- User-Friendly Warnings in the Report View:
A single-line warning is now shown in the Report View, containing
the following details:
- Source of Warning: 'Assembly joint'
- Location in the 3D Model: e.g., 'Assembly_XY.object_XY.joint_XY'
- Problematic Attribute: e.g., 'ReferenceXY'
- Exception Message: e.g., 'list index out of range'
- Refactoring and Optimization:
The functions were refactored and optimized at the end of the
conversion process.
Advantages:
- Cleaner Report View:
Internal errors (e.g., Python call stacks) are no longer logged in
the Report View, as they are not useful for end users. Only the
exception message is displayed.
- Improved User Feedback:
Users can now identify the problematic Assembly joint in the object
hierarchy, saving significant time and effort.
- Robust and Concise Code:
The solution simplifies the code while increasing its robustness.
* Assembly: Joint Object : encapsulate the joint creation widget such that the task can be subclassed and ui customized by other commands.
* Assembly: Insert New Part
* Update src/Mod/Assembly/CommandInsertNewPart.py
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
---------
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
* Move back util functions to AssemblyUtils again
* Add getPropertyByName<T>() helper
* Improve constness in AssemblyUtils
* [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>