Commit Graph

329 Commits

Author SHA1 Message Date
wmayer
b26c18ad39 Material: fix Qt6 build failure and minor optimizations 2023-11-22 01:48:07 +01:00
wmayer
624b5a396a MSVC: fix warnings about unused variable 2023-11-21 23:10:03 +01:00
David Carter
332bf7ed08 Material: Continued Material enahncements
Continues the work of the material subsystem improvements.

Several important items are included in this merge. In terms of new
capabilities, this merge adds List and MultiLineString as valid
property types, complete with editing dialogs. This will help with
backwards compatibility for external workbenches, such as Render.

Stability has been a big focus. New unit tests help to verify features
work as expected. Bugs have been fixed and crashes avoided.

Material cards have had a renaming to their tree structure. For
example, 'StandardMeterials' is redundant, so this was renamed to
'Standard'. The cards themselves are more compliant fully passing the
yamllint tests.

More soon.
2023-11-20 12:19:29 -06:00
Chris Hennes
f25af97811 Update translations 2023-11-09 12:23:56 -06:00
Chris Hennes
37a8e348c6 Merge pull request #11231 from DeflateAwning/http-cleanup
Find and replace http://freecad to https://freecad
2023-11-06 11:16:13 -06:00
wmayer
74d017f4de Material: fix Python bindings
* fix reference counting of Python objects
* fix crashes in several methods
2023-11-03 16:41:11 +01:00
wmayer
9f86d63289 Material: fix compiler warning with Qt6
QVariant::Type is deprecated since Qt 6.0 and shouldn't be used in new code
2023-11-03 16:41:11 +01:00
wmayer
3d7375e3ad Material: fix compiler warnings
* unused parameter 'parent' [-Wunused-parameter]
* reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to false [-Wtautological-undefined-compare]
2023-11-03 16:41:11 +01:00
wmayer
84b01b70e0 Material: fix 'explicitly defaulted copy constructor is implicitly deleted [-Wdefaulted-function-deleted]' 2023-11-03 16:41:11 +01:00
wmayer
04163c74a0 Material: single-argument constructors must be marked as explicit 2023-11-03 16:41:11 +01:00
wmayer
bd06dd0ed5 Material: fix diagnostic errors with the clang code model 2023-11-03 16:41:11 +01:00
wmayer
cbf02165d6 Material: remove several unreferenced variables 2023-11-03 16:41:11 +01:00
wmayer
ec0d9774fd Material: use get_filename_component() instead of cmake_path() to support older CMake versions 2023-11-03 16:41:11 +01:00
wmayer
05d8ae65fe Material: QMetaType::type(const char*) is deprecatred and shouldn't be used in new code
And it looks like that QMetaType::type("Base::Quantity") neither works with Qt5 nor with Qt6 because it returns 0 as id that means the type is unknown.
2023-11-03 16:41:11 +01:00
wmayer
4f24d60675 Material: fix build failure with Qt6
setCodec() has been removed from QTextStream
2023-11-03 16:41:11 +01:00
wmayer
3e28d81436 Material: fix -Winconsistent-missing-override 2023-11-03 16:41:11 +01:00
DeflateAwning
1e3179e9bc Find and replace http://freecad.org to https://freecad.org
Find and replace:
http:\/\/(.{0,10})freecad
https://$1freecad
Done in all remaining files (after doing it in SVGs in the last commit)
2023-10-29 22:39:22 -06:00
DeflateAwning
46b3c02647 Change http to https in SVGs
Find and replace:
http:\/\/(.{0,10})freecad
https://$1freecad
Include: *.svg
2023-10-29 22:32:59 -06:00
David Carter
d1e96a5195 Material: Material editor enhancements
Continues the work of the material subsystem improvements.

This merge covers the continued development of the material editor. The
primary improvements are in the handling of 2D and 3D array properties.
These properties are now fully editable, and can be saved and restored.

The cards now separate the author and license. These were previously
saved as a single item. Future support will be provided for standard
open source licenses.

Saving operations validate the cards to ensure UUIDs of materials are
considered. Warnings are given when a save could potentially impact the
models, such as saving over a material instead of creating a new
instance.

The editor is still not complete. There are a number of functional
elements, such as drag/drop operations, folder creation, and deletion
operations that need to be added to the main tree. State needs to be
saved and restored to improve the user experience. The appearance
preview also needs significant work. This will be handled in a future
PR.
2023-10-24 12:36:36 -04:00
wmayer
80d8bfd4b8 Material: remove several unreferenced variables 2023-10-11 12:04:26 +02:00
David Carter
b724c39c4d Material: Update Python tests to work with other locales
Update Python tests to work with other locales

This fixes issues #10917 and #10924

Numeric values were beign compared to strings that did not take into account localizations. The test was modified to work regardless of localization.

There is still a known issue when working with pt_BR.UTF8. The default encoder for this localization is not UTF8 resulting in an error working with a parameter that returned the UTF character for the Greek letter mu in its units.
2023-10-07 19:44:13 +02:00
Chris Hennes
6c9be93378 Update translations 2023-09-29 22:57:37 -05:00
Chris Hennes
8bb7523f9b Merge pull request #10863 from wwmayer/material_fixes
Material: fix build failure with Qt6
2023-09-29 22:50:18 -05:00
wmayer
fa3c0418c3 Material: use get_filename_component() instead of cmake_path() to support older CMake versions 2023-09-29 07:32:58 -05:00
wmayer
f4c6504aa1 Material: QMetaType::type(const char*) is deprecatred and shouldn't be used in new code 2023-09-29 11:05:07 +02:00
wmayer
0eb789a1e2 Material: fix build failure with Qt6 2023-09-29 10:09:39 +02:00
wmayer
11e4072fb7 Material: include some more required header files
as otherwise the parser of the clang code model raises a lot of error messages
2023-09-28 15:33:03 -05:00
marioalexis
4630bdbcb1 Material: Include needed header file 2023-09-28 14:55:55 +02:00
wmayer
b01a41237a Mat: fix several compiler warnings:
* -Winconsistent-missing-override
* -Wtautological-undefined-compare
2023-09-27 21:38:56 -05:00
David Carter
37c7169ee4 Material: Material handling enhancements
Rework of the material handling system.

This first part concntrates on a rework of the material cards.
Rather than use a fixed list of possible properties, properties can
be defined separately in their own files and mixed to provide a
complete list of possible properties. Properties can be inherited.

The cards then provide values for the properties. These can also
be inherited allowing for small changes in cards as required.

The new property definitions are more extensive than previously.
2 and 3 dimensional arrays of properties can be defined. Values
are obtained by calling an API instead of reading from a dictionary.

For compatibility, a Python dictionary of values can be obtained
similar to how it was done previously, but this is considered a
deprecated API and won't support the newer advanced features.

The editor is completely reworked. It will be able to edit older format
material cards, but can only save them in the new format.

For testing during the development phase, a system preference can
specifiy wether the old or new material editors are to be used. This
option will be removed before release.
2023-09-25 11:04:15 -04:00
David Carter
902af79514 Material: Material handling enhancements
Rework of the material handling system.

This first part concntrates on a rework of the material cards.
Rather than use a fixed list of possible properties, properties can
be defined separately in their own files and mixed to provide a
complete list of possible properties. Properties can be inherited.

The cards then provide values for the properties. These can also
be inherited allowing for small changes in cards as required.

The new property definitions are more extensive than previously.
2 and 3 dimensional arrays of properties can be defined. Values
are obtained by calling an API instead of reading from a dictionary.

For compatibility, a Python dictionary of values can be obtained
similar to how it was done previously, but this is considered a
deprecated API and won't support the newer advanced features.

The editor is completely reworked. It will be able to edit older format
material cards, but can only save them in the new format.

For testing during the development phase, a system preference can
specifiy wether the old or new material editors are to be used. This
option will be removed before release.
2023-09-25 11:04:01 -04:00
Roy-043
85c2c973d8 Material: Avoid dictionary.keys() where possible 2023-08-10 00:59:02 +02:00
luzpaz
38a01939e0 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
wmayer
351a25681a Material: fix icon path 2023-03-27 11:27:32 +02:00
Yorik van Havre
2cd27ce328 updated ts files 2023-02-27 15:35:51 +01:00
Uwe
7eb560bdab [Material] add new card to CMake 2023-02-26 04:21:32 +01:00
Vladimir
d9950a5e4e [Material] Add Titanium alloy to materials (#8636)
* Add Titanium alloy
2023-02-26 03:53:39 +01:00
luzpaz
9df1f9f8f5 [Material] fix grammar 2023-02-25 09:59:24 +01:00
Uwe
aa1725ff2c [Material] add heat parameters to aluminum alloys 2023-02-24 16:46:40 +01:00
Uwe
688e42df89 [Material] remove unused Help button in editor dialog 2023-02-24 03:47:19 +01:00
Uwe
04695d9c4c [Material] fix major bug of wrong decimals
This PR fixes the long-standing major bug that for languages using ',' as decimal separator the material editor was useless. (bug no. 10 in https://forum.freecad.org/viewtopic.php?t=56912)
  the issue was that the value was handled as text. This PR:
- using a spinbox instead if a text edit to modify numbers (has also the advantage to be able to change values by spinning)
- sets min/max properly for all number data types

- also avoid rounding artifacts when changing Float values
2023-02-23 03:06:44 +01:00
luzpaz
72166fed46 Fix misc. typos and whitespace 2023-02-22 23:46:18 +01:00
Uwe
69645d0220 [Material] [skip ci] fix card for Graphite
- decimal sign was mixed ',' and '.' causing problems
2023-02-22 21:16:05 +01:00
Uwe
6a689e3e97 [Material] fix bugs for external material files
- handle case that material cards are chosen from folders outside of the standard material folders

- also reduce singleStep size for spin edits for more convenience
2023-02-22 05:25:06 +01:00
Uwe
e1e65e5b3a [Material] fix card selection bug
- fixes bug number 7 of this list: https://forum.freecad.org/viewtopic.php?style=5&p=489666#p489666

- also fix warning about too short variable name
2023-02-19 07:46:52 +01:00
Uwe
51a3428276 [FEM] fix material handling of fluids
- the material editor failed for Fluid materials because this info was not passed to it. Instead always solid materials were loaded.

- also fix warning about too long variable name and remove unnecessary debug code
2023-02-19 02:57:12 +01:00
Uwe
c19efe0842 [Material] fix bugs with missing icons
- at the moment you get several warnings about missing icons when starting the Material editor
  The reason is that they are not registered in CMake

- also remove icon from Material icon editor. As it is a child of FreeCAD it should have the same FreeCAD icon as all other FreeCAD widgets.

- also fix warning about too short variable name
2023-02-19 00:47:44 +01:00
Uwe
b104dba959 [Material] editor: improve float input
- it is very annoying to get a dozen decimals on editing floats. 6 do the job for all cases and a spinBox is preferred.
2023-02-11 04:14:30 +01:00
Uwe
a2ffadcb59 [FEM] use magnetization constraint for 2D
- uses the constraint for 2D magnetodynamics to perform e.g. Elmer's tutorial non. 15

- modify the Material manager to get rid of magnetization but keep the vectorial functionality because in future there will be support for e.g. birefringence materials etc.
2023-02-09 15:43:42 +01:00
Uwe
7c4a3c160c [Material] allow to use vectorial properties
- for electromagnetics we have vector fields and thus need to specify components
- as first step use the new material "Magnetization"

- also get rid of annoying debug messages output on normal use in the material dialog
2023-02-09 07:26:22 +01:00