Commit Graph

357 Commits

Author SHA1 Message Date
Mihail Dumitrescu
0346c94b50 Add ParallelPlane attachment mode.
It results in an attachment similar to ObjectXY but with the XY plane translated to pass through a selected vertex.

It is most useful to place sketches: pick a plane (XY, XZ, YZ) or another sketch then select a vertex to automatically translate the sketch in the Z-direction. In contrast to the Translate mode it does not change the origin.
2024-06-10 10:47:00 -05:00
wmayer
526cc024ad Part: Add AttacherEngine of type PropertyEnumeration
This is added to conveniently change the attacher type of a Part object.

Hint: A new property is used to avoid to break project files when opening it with an older version.

See also forum thread: https://forum.freecad.org/viewtopic.php?t=87891
2024-06-03 11:24:09 -05:00
Chris Hennes
c622221c70 Test: Support system GTest, and give warning if no submodule (#13662) 2024-06-03 10:40:35 -05:00
wmayer
0490c0195a tests: Add unit tests for getElementTypes() 2024-05-31 11:42:01 +02:00
David Carter
c5df1b3e55 Materials: Editor UI enhancements
When creating a new material, assigning the basic
rendering model to the material resulted in an all
black color. This will now be assigned the default
color as specified in the preferences.

The name of the material Properties tab has been
changed to Physical for improved consistency in
the user interface.
2024-05-27 11:35:00 -05:00
David Carter
a0fdc86948 Material: Appearance and Material inspectors
Dialogs to view the Appearance and Material properties of an object

These inspectors are intended to be used when debugging Appearance and
Material issues in a model.

The Appearance inspector displays the appearance properties of an
object. This will be more useful once PR 13792 is merged which migrates
parts to use ShapeAppearance instead of DiffuseColor. This shows each
of the appearance properties per face for the object.

The Material inspector shows the material, models, and properties
assigned to a model. It displays useful debugging information such as
the UUID and file paths associated with eacch of the items. This is
useful when finding and resolving model conflicts.

The material inspector now gives the option of copying the information
to the clipboard.
2024-05-27 10:50:35 -05:00
Chris Hennes
5dadd2c3c3 Toponaming: Test fixes 2024-05-20 12:40:52 -05:00
David Carter
ed01d5cffa Material: Material API fixes
Corrects an issue in the API where a new material may not have a UUID.
Corrected the test case to reflect the changes and better document the
process.

Added a test case for material filters.
2024-05-20 10:43:02 -05:00
bgbsww
e50ef22e7b Minor test tweaks, and small fixes to pass tests 2024-05-17 19:14:01 -05:00
bgbsww
80d43f51a1 Simplify offset tests 2024-05-17 08:10:43 -04:00
ppphp
7096125038 fix some warnings: cmake string quotes and float mark (#13909)
Co-authored-by: liukaiwen <kaiwen.liu@zixel.cn>
2024-05-13 11:55:59 -04:00
bgbsww
d3c5df86ee Toponaming: bring in missing code fragments in Part 2024-05-12 23:08:06 -04:00
bgbsww
5054cace46 Rework makeElementChamfer to match current parms, and add PartDesign code for Chamfers 2024-05-12 13:28:20 -05:00
bgbsww
9fc744fbe3 Fix tests, slip in TNP defense 2024-05-07 13:42:21 -04:00
Chris Hennes
d112e8661f Merge pull request #13727 from wwmayer/fix_warnings
Fix compiler warnings
2024-05-01 10:29:21 -05:00
Chris Hennes
cb789e1be9 Tests: Disable DocumentObserverTest pending refactor
The 'normalized' test fails on Windows Conda, and the overall test class needs work.
2024-05-01 10:28:08 -05:00
wmayer
2ea6bc17b6 Fix various compiler warnings:
* fix -Wunused-parameter
* fix -Wunused-function
* fix -Wunused-private-field
* fix -Wunused-variable
* fix -Winconsistent-missing-override
2024-04-30 16:59:31 +02:00
sliptonic
3f46f1f8cc Merge pull request #13650 from chennes/firstStartWidget
Start: First start widget
2024-04-29 11:42:50 -05:00
CalligaroV
767b2bd5e4 App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Fixed a mistake made in getSubObjectListFlatten()
 * Applied modifications according to review comments

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-29 11:42:18 -05:00
CalligaroV
3109301e52 App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Formatted and refactored code imported for the DocumentObject class
 * Formatted and refactored code imported for the SubObjectT class

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-29 11:42:18 -05:00
CalligaroV
2721918d10 App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Added test for SubObjectT::hasSubObject()
 * Added test for SubObjectT::hasSubElement()
 * Added test for SubObjectT::normalize()
 * Added test for SubObjectT::normalized()

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-29 11:42:18 -05:00
CalligaroV
38d9c936eb App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Added test for DocumentObject::getSubObjectList()

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-29 11:42:18 -05:00
Chris Hennes
5c46dfd600 Start: Create 'First Start' screen 2024-04-28 12:57:00 -05:00
Chris Hennes
5766505f20 Tests: Ensure MSVC has M_PI
Somewhere in the test suite GTest is including cmath (or something related) and not declaring this, so later includes of it by the tests are being ignored.
2024-04-28 12:56:21 -05:00
Chris Hennes
9101454c4d Merge pull request #13495 from wwmayer/material_colors
Support to customize all material colors
2024-04-22 11:09:05 -05:00
farley
789bbeedf6 Core: Fix searching model tree does not work for numbers #12723 (#13377)
* Fix problem #12723: Searching model tree does not work for numbers
- Modify ExpressionTokenizer::perform
- Add tests tokenizeCompletion
2024-04-22 10:55:42 -05:00
wmayer
6d6ca16198 Tests: add unit tests for Color class 2024-04-19 13:07:54 +02:00
wmayer
0c25b29680 Base: Fix possible race condition when restarting the application
When restarting the application (e.g. after installing an addon) the application will be closed and a new instance will be launched. Now it can happen that the old instance is still busy writing the config files to disk while the new instance wants to read them in. At this time it's possible that a config file is in an invalid state so that the new instance will ignore it but then starts with a default configuration.
Later when closing the new instance the config files will be overwritten and destroy the user's original settings.

By using a lock file this race condition will be avoided. It uses a timeout of 1 second that should be enough for the old instance to write the files to disk.
2024-04-18 23:07:58 -05:00
wmayer
a713d5f96f Tests: add more unit tests for ParameterGrp 2024-04-17 21:45:26 +02:00
bgbsww
0d8631973e Toponaming/Part: Fix hashing, hasher mismatches, and adjust test results to match 2024-04-15 23:00:27 -05:00
Chris Hennes
2f81d8712b Toponaming/Base: Add ASCII stream output class (#13209)
* Toponaming/Base: Add ASCII stream output class

* Remove the ref from std::string

* Update based on review comments
2024-04-15 17:58:11 +02:00
bgbsww
9ebb23f234 Toponaming/Part: Initialize the hasher so that it operates 2024-04-13 22:41:57 -05:00
wmayer
69bcabeb0b Tests: add Parameter tests 2024-04-12 23:37:56 +02:00
bgbsww
942ebd58f0 Toponaming/Part: Add deprecation comments, clean up code 2024-04-09 21:17:08 -04:00
CalligaroV
11bed3b8da App/Toponaming: GeoFeature - fixes #13009 - fixes #13248
* Restored previous logic of GeoFeature::getElementName()
 * Added precompiler directive to use the old logic if FC_USE_TNP_FIX isn't defined, otherwise use the new logic
 * Reworked SketchObjectTest::getElementName() as a consequence of the previous points

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-04 22:09:12 -05:00
David Carter
ba20441935 Material: Material appearance
Uses new material system for appearance

Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.

The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.

A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
2024-04-04 07:39:58 -05:00
wmayer
c96fd71e4f Fix several compiler warnings
* fix -Winconsistent-missing-override
* fix -Wunused-but-set-variable
* fix -Wunused-parameter
* fix -Wunused-lambda-capture
* fix -Wunused-private-field
* fix -Wpessimizing-move
2024-04-03 10:04:56 +02:00
wmayer
4263ab1937 C++: replace deprecated vsprintf and sprintf
With future C++ compilers the methods vsprintf and sprintf are declared as deprecated due to security issues.
They are replaced with the secure counterpart of the fmt library

Fixes the compiler warnings -Wdeprecated-declarations
2024-04-03 10:04:56 +02:00
David Carter
8776c5bf98 Material: Add thermal reference temperature (#13026)
* Material: Add thermal reference temperature

Fixes #13019

Adds the property 'Thermal Expansion Reference Temperature' to
the Thermal properties

* Fix delegates
2024-04-01 11:00:45 -05:00
wmayer
d46b738b79 Test: add unit tests for mesh grid creation 2024-03-30 00:21:58 +01:00
Chris Hennes
34f53e097b Merge pull request #12535 from CalligaroV/toponaming-WireJoiner
Part/Toponaming: Transfer WireJoiner
2024-03-28 09:17:49 -05:00
bgbsww
f297666cd9 Toponaming/Part: Fix elementMatch to use full clause and be deterministic 2024-03-26 23:01:54 -05:00
CalligaroV
2d66dfbf40 Part/Toponaming: Transfer WireJoiner
* Added test for WireJoiner::IsDeleted()
 * Fixed a typo in test for WireJoiner::Modified()
 * Fixed a typo in test for WireJoiner::Generated()

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-03-26 09:57:47 +01:00
CalligaroV
c6d3ada29d Part/Toponaming: Transfer WireJoiner
* Added test for WireJoiner::Generated()

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-03-26 09:57:47 +01:00
CalligaroV
c70f34b1f4 Part/Toponaming: Transfer WireJoiner
* Added test for WireJoiner::Modified()
 * Fixed typo in test for WireJoiner::getResultWires()

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-03-26 09:57:47 +01:00
CalligaroV
66c08664a5 Part/Toponaming: Transfer WireJoiner
* Added test for WireJoiner::Build()
 * Fixed typo in test for WireJoiner::getResultWires()

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-03-26 09:57:47 +01:00
CalligaroV
0834709375 Part/Toponaming: Transfer WireJoiner
* Added test for WireJoiner::getResultWires()
 * Replaced references in test for WireJoiner::getOpenWires() with more correct references
 * Added a comment in WireJoiner::WireJoinerP::getResultWires() to better explain how it works

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-03-26 09:57:47 +01:00
CalligaroV
0d4502c177 Part/Toponaming: Transfer WireJoiner
* Added test for WireJoiner::getOpenWires()

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-03-26 09:57:47 +01:00
CalligaroV
f4e5af7447 Part/Toponaming: Transfer WireJoiner
* Added test for WireJoiner::setTolerance()

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-03-26 09:57:47 +01:00
CalligaroV
5337869ca6 Part/Toponaming: Transfer WireJoiner
* Added test for WireJoiner::setMergeEdges()
 * Changed position of some comments

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-03-26 09:57:47 +01:00