Commit Graph

522 Commits

Author SHA1 Message Date
David Carter
3515db4a3b Materials: Add support for embedded images
Adds support for file types other than PNG to embedded images in
materials. Adds checks to prevent crashing when an unsupported image
type is used.
2025-07-02 11:01:59 -05:00
Syres916
39dc1e6210 [Gui] C++ preparation for deprecation of QCheckBox…
…stateChanged -> checkStateChanged
2025-06-13 10:40:48 +02:00
wmayer
2a7498c930 Helper function to get preferred delete key depending on platform 2025-06-09 18:10:52 +02:00
João Matos
bd58e7f3da Material: Fix unused parameters warnings. (#21584)
Just another round of compiler warnings fixes for material code.
2025-06-09 10:53:43 -05:00
David Carter
25aea8e142 Materials: Set array quantity format (#21647)
* Materials: Set array quantity format

When setting quantity formats, the default format is not actually the
default. Instead fixed format is, which causes issues for very small
and very large values. This was fixed for C++ but arrays created in
Python were not setting the format correctly.

* Apply suggestions from code review

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2025-06-04 16:27:37 +00:00
David Carter
8b9f576538 Materials: Pass by reference instead of pointers
Refactoring topass by reference instead of using existing pointers.
2025-06-02 11:32:08 -05:00
Yorik van Havre
640642eed2 Translations: Merged crowdin translations 2025-06-02 11:48:26 +02:00
Yorik van Havre
26e16765b0 Translations: updated ts files 2025-06-02 11:07:28 +02:00
David Carter
d68d5940bf Materials: Correct model spelling errors 2025-05-25 00:14:08 +02:00
David Carter
13b7991705 Materials: External interface refinements (#21524) 2025-05-24 08:25:44 +02:00
Kacper Donat
c77a6e57ae Materials: Fix MaterialManager being copied on getInstance() 2025-05-19 18:12:01 +02:00
Kacper Donat
038cc5dc8c Materials: Fix ModelManager being copied on getInstance() 2025-05-19 18:12:01 +02:00
Joao Matos
ddde5a9566 Fix warnings in ModelManagercode. 2025-05-15 01:02:55 +02:00
Chris Hennes
3178e13f04 Materials: Clean up unused variables
Updated error messages no longer refer to the exception object, resulting in compiler warnings.
2025-05-15 00:29:19 +02:00
Chris Hennes
952485dcbb Merge pull request #19907 from benj5378/getAttribute
Base: make getAttribute template
2025-05-12 10:39:55 -05:00
Benjamin Bræstrup Sayoc
2b1aec0041 Base: make getAttribute template 2025-05-09 15:54:57 +02:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
David Carter
b48c7c8dcc Materials: Default units (#20909)
Improves handling and assignment of default units

When creating a material without specifying units, no units are
currently assigned. This commit will assign the default units when none are
given, or throw an error when incompatible units are given. In the
latter case, the units are set to the property defaults.

This commit also incidentally fixed an issue when saving the material that
resulted in accessing an uninitialized pointer.
2025-05-05 11:31:25 -05:00
Chris Hennes
f55063855a Merge pull request #20540 from 3x380V/cleanup-schemas-management
Simplify UnitsSchemas management
2025-05-05 10:43:27 -05:00
Chris Hennes
db46f0499c Merge pull request #20449 from hyarion/refactor/cpp20-contains
Avoid using `count` and `std::find` where `contains` and `isEmpty` express intent better
2025-05-05 10:31:33 -05:00
David Carter
9bff1aa3c7 Material: Database manager fixes (#21132)
* Remove duplicate code from previous merge

* Caatch potential unknoiwn exceptions
2025-05-05 10:22:50 +02:00
David Carter
ba9624d8d4 Merge pull request #21046 from davesrocketshop/issue_13922_2
Update module dependencies to ensure that automated testing code is considered as well as direct dependencies. Update some automated tests to eliminate unwanted dependencies.
2025-05-04 17:02:50 -05:00
Benjamin Nauck
51f73c05c0 Material: use contains() and isEmpty() instead of count() where possible
# Conflicts:
#	src/Mod/Material/App/ModelLibrary.cpp
2025-05-03 22:22:10 +02:00
David Carter
8519b0c0b8 Materials: External Module Support
The final PR for the external module feature that allows materials to
be stored in an external datastore, webservice, etc.

This includes the final material manager classes, and the UI support in
the form of commands and preference pages.
2025-04-29 19:06:16 -05:00
David Carter
827ff3eb99 Materials: Model Manager External Interface (#20825)
* Materials: Model Manager External Interface

Implement the ModelManagerExternal class for the external Materials
interface.

This is part of the ongoing merges of code to support external material
interfaces. In this PR the ModelManagerExternal class is implemented,
along with changes to supporting classes required for this class.

* Apply reviewer feedback
2025-04-28 10:29:04 -05:00
Luz Paz
ac9b65aa65 Misc: Fix various typos
Found via codespell
2025-04-27 19:32:19 -05:00
Ladislav Michl
8369fb26d6 Test: fix MaterialTestCases failing on unicode character output 2025-04-27 00:45:54 +02:00
Kacper Donat
6c7c7a747d Material: Replace dynamic_cast with qobject_cast 2025-04-26 14:23:25 +02:00
Jacob Oursland
5c251e73ac python: apply const method annotations to impls. 2025-04-16 20:32:04 -07:00
David Carter
d29e7aa5be Materials: Use data classes in interface specification 2025-04-10 06:13:38 -04:00
David Carter
d5f01377a5 Material: Interface with an external module
The ExternalManager class calls python functions in an external module
to create, read, update, and delete material definitions. The API
provided by the modules must conform to that defined in the
MaterialManagerExternal.py file.

All communications with the external module is routed through this
class.
2025-03-31 22:46:12 -04:00
Luz Paz
97e172334b Fix 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,localy,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"`
2025-03-31 23:00:32 +02:00
Tiago Almeida
9ed3cf011f fix #20005: material editor issue
-Changed info.baseName() to
info.fileName().remove(QStringLiteral(".FCMat"), Qt::CaseInsensitive)
in MaterialLibrary.cpp to ensure that only the extension ".FCmat"
is removed from the file name bacause the previous version was removing
 everything in front of the first dot
2025-03-31 11:16:12 -05:00
Andrea
ce10f30aa6 [mod] clean
code clean
2025-03-31 11:01:39 -05:00
Benjamin Nauck
9b6494d689 Material: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
tritao
b45a3025e6 Material: Remove XML binding files. 2025-03-26 13:01:41 +01:00
Joao Matos
4ec136b252 Material: Convert XML bindings to Python. 2025-03-26 12:18:02 +01:00
David Carter
dd59cce8e9 Linter fixes 2025-03-18 20:33:10 -05:00
David Carter
ec1da540c6 Update src/Mod/Material/App/Materials.cpp
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-03-18 20:33:10 -05:00
David Carter
71101dfc6a Update src/Mod/Material/App/Library.cpp
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-03-18 20:33:10 -05:00
David Carter
9e1537c884 Update src/Mod/Material/App/Model.cpp
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-03-18 20:33:10 -05:00
David Carter
00c57a9d08 Materials: External Modules Part 1
Refactored code to support local and external material sources

This is the first PR in a series to support external modules. External
modules allow materials to be stored in external data sources such as
databases or web services. No new functionality is introduced in this
PR, rather it is a refactoring of code that will allow for changes to
be introduced in future PRs. Minor performance improvements have also
been made in the model and material managers.

The Python API has been enhanced for many data types to allow for
modification within Python.
2025-03-18 20:33:10 -05:00
tritao
cdab9c7837 CMake: Cleanup targets with transitive dependencies 2025-03-17 12:12:06 +00:00
Chris Hennes
3ce193ddb8 Merge pull request #19921 from mosfet80/QT_CLEAN
REMOVE old QT<= 5.14 code
2025-03-11 20:54:59 +00:00
Andrea
078e315d8f Remove unnecessary check (duplicated)
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
2025-03-10 21:53:00 +01:00
Andrea
2d4ab5af20 REMOVE old QT<= 5.14 code
Ubuntu 22.04  use qt 1.15.3.
In the code is still used qt code <5.10.
A cleanup was done by removing qT code version used in ubuntu 18.04.
2025-03-05 09:32:06 +01:00
Chris Hennes
1a2070c36f Merge pull request #19636 from kadet1090/color-in-base
Base: Move App::Color to Base
2025-03-02 16:36:40 -06:00
Benjamin Bræstrup Sayoc
ee1c73cd04 Build: suppress warnings from 3rd party libraries
Warnings from 3rd parties are not relevant and are only polluting the warning output. Marking these libraries as SYSTEM suppresses warning.

https://gcc.gnu.org/onlinedocs/cpp/Invocation.html#index-I
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html
2025-02-25 14:39:05 +00:00
Joao Matos
15076cb504 Core: Move PyCXX library to src/3rdParty. 2025-02-24 16:36:06 +00:00
Kacper Donat
36195d1981 Base: Add fromPercent and toPercent helpers 2025-02-23 22:51:13 +01:00