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.
This commit is contained in:
David Carter
2023-09-14 22:52:48 -04:00
parent 6b0c054023
commit 902af79514
397 changed files with 19222 additions and 4312 deletions

View File

@@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
<PythonExport
Father="BaseClassPy"
Name="MaterialPy"
Twin="Material"
TwinPointer="Material"
Include="Mod/Material/App/Materials.h"
Namespace="Materials"
FatherInclude="Base/BaseClassPy.h"
FatherNamespace="Base"
Constructor="true"
Delete="true">
<Documentation>
<Author Licence="LGPL" Name="DavidCarter" EMail="dcarter@davidcarter.ca" />
<UserDocu>Material descriptions.</UserDocu>
</Documentation>
<Attribute Name="LibraryName" ReadOnly="true">
<Documentation>
<UserDocu>Model library name.</UserDocu>
</Documentation>
<Parameter Name="LibraryName" Type="String"/>
</Attribute>
<Attribute Name="LibraryRoot" ReadOnly="true">
<Documentation>
<UserDocu>Model library path.</UserDocu>
</Documentation>
<Parameter Name="LibraryRoot" Type="String"/>
</Attribute>
<Attribute Name="LibraryIcon" ReadOnly="true">
<Documentation>
<UserDocu>Model icon path.</UserDocu>
</Documentation>
<Parameter Name="LibraryIcon" Type="String"/>
</Attribute>
<Attribute Name="Name" ReadOnly="true">
<Documentation>
<UserDocu>Model name.</UserDocu>
</Documentation>
<Parameter Name="Name" Type="String"/>
</Attribute>
<Attribute Name="Directory" ReadOnly="true">
<Documentation>
<UserDocu>Model directory relative to the library root.</UserDocu>
</Documentation>
<Parameter Name="Directory" Type="String"/>
</Attribute>
<Attribute Name="UUID" ReadOnly="true">
<Documentation>
<UserDocu>Unique model identifier.</UserDocu>
</Documentation>
<Parameter Name="UUID" Type="String"/>
</Attribute>
<Attribute Name="Description" ReadOnly="true">
<Documentation>
<UserDocu>Description of the material.</UserDocu>
</Documentation>
<Parameter Name="Description" Type="String"/>
</Attribute>
<Attribute Name="URL" ReadOnly="true">
<Documentation>
<UserDocu>URL to a material reference.</UserDocu>
</Documentation>
<Parameter Name="URL" Type="String"/>
</Attribute>
<Attribute Name="Reference" ReadOnly="true">
<Documentation>
<UserDocu>Reference for material data.</UserDocu>
</Documentation>
<Parameter Name="Reference" Type="String"/>
</Attribute>
<Attribute Name="Parent" ReadOnly="true">
<Documentation>
<UserDocu>Parent material UUID.</UserDocu>
</Documentation>
<Parameter Name="Parent" Type="String"/>
</Attribute>
<Attribute Name="AuthorAndLicense" ReadOnly="true">
<Documentation>
<UserDocu>Author and license information.</UserDocu>
</Documentation>
<Parameter Name="AuthorAndLicense" Type="String"/>
</Attribute>
<Attribute Name="PhysicalModels" ReadOnly="true">
<Documentation>
<UserDocu>List of implemented models.</UserDocu>
</Documentation>
<Parameter Name="PhysicalModels" Type="List"/>
</Attribute>
<Attribute Name="AppearanceModels" ReadOnly="true">
<Documentation>
<UserDocu>List of implemented models.</UserDocu>
</Documentation>
<Parameter Name="AppearanceModels" Type="List"/>
</Attribute>
<Attribute Name="Tags" ReadOnly="true">
<Documentation>
<UserDocu>List of searchable tags.</UserDocu>
</Documentation>
<Parameter Name="Tags" Type="List"/>
</Attribute>
<Methode Name="hasPhysicalModel" ReadOnly="true">
<Documentation>
<UserDocu>Check if the material implements the physical model with the given UUID</UserDocu>
</Documentation>
</Methode>
<Methode Name="hasAppearanceModel" ReadOnly="true">
<Documentation>
<UserDocu>Check if the material implements the appearance model with the given UUID</UserDocu>
</Documentation>
</Methode>
<Methode Name="isPhysicalModelComplete" ReadOnly="true">
<Documentation>
<UserDocu>Check if the material implements the physical model with the given UUID, and has values defined for each property</UserDocu>
</Documentation>
</Methode>
<Methode Name="isAppearanceModelComplete" ReadOnly="true">
<Documentation>
<UserDocu>Check if the material implements the appearance model with the given UUID, and has values defined for each property</UserDocu>
</Documentation>
</Methode>
<Methode Name="hasPhysicalProperty" ReadOnly="true">
<Documentation>
<UserDocu>Check if the material implements the physical property with the given name</UserDocu>
</Documentation>
</Methode>
<Methode Name="hasAppearanceProperty" ReadOnly="true">
<Documentation>
<UserDocu>Check if the material implements the appearance property with the given name</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Properties" ReadOnly="true">
<Documentation>
<UserDocu>deprecated -- Dictionary of all material properties.</UserDocu>
</Documentation>
<Parameter Name="Properties" Type="Dict"/>
</Attribute>
<Attribute Name="PhysicalProperties" ReadOnly="true">
<Documentation>
<UserDocu>deprecated -- Dictionary of material physical properties.</UserDocu>
</Documentation>
<Parameter Name="PhysicalProperties" Type="Dict"/>
</Attribute>
<Attribute Name="AppearanceProperties" ReadOnly="true">
<Documentation>
<UserDocu>deprecated -- Dictionary of material appearance properties.</UserDocu>
</Documentation>
<Parameter Name="AppearanceProperties" Type="Dict"/>
</Attribute>
<Methode Name="getPhysicalValue" ReadOnly="true">
<Documentation>
<UserDocu>Get the value associated with the property</UserDocu>
</Documentation>
</Methode>
<Methode Name="getAppearanceValue" ReadOnly="true">
<Documentation>
<UserDocu>Get the value associated with the property</UserDocu>
</Documentation>
</Methode>
</PythonExport>
</GenerateModel>