Cabinet Style Parametrization
Β
"Global Style" allows storing all the arrays of the default value(s) for the product parameters.
Definition
The Global Style is a list of parameters i.e. an array of values that can be defined in the application distribution, which defines the default value(s) for one parameter of type 7 (product) π.
Default Style in Application Distribution
The list of this global style inherits from the default style that is set in the application distribution. The default style has a version number set to 0 by default.
This application distribution global style will be released to a new version incremented to "1", which contains the following.
Parameter | Description |
---|---|
"version" number | To maintain the backward compatibility with the old format (version number "0"), it will be mandatory to specify the number: "version":1 |
linearStyle | This is a mandatory section composed of limited list mapping parameters and reference IDs for linear parameters (worktop, plinth, wallEdgeStrip, wallPanel, cornice, decoStrip). The list is formatted as such: name of the parameter : reference ID . |
furnitureStyle | This is a mandatory section composed of a list of references defined for the other nonlinear parameters. It could be as many parameters as needed. This section will be dynamic if an "apply action" will be made by the user, this parameter will be added. The list is formatted as such: name of the parameter: array of reference(s) ID |
wallStyle | This is an optional section composed of a list of references for those nonlinear parameters that are "not touching the floor" (see below) for which the style could be different between wall cabinet and floor cabinet. The list is formatted as such: name of the parameter: array of reference(s) ID |
floorStyle | An optional section composed of a list of references for those non-linear parameters that are "touching the floor" (see the below) for which the style could be different between wall cabinet and floor cabinet. The list is formatted as such: name of the parameter: array of reference(s) ID |
Thanks to these definitions, the format of the global style has changed and shows a separation between the linear parameters and other (non-linear, regular furniture) parameters.
This is separation is clear in the illustration below.
Associated Rules
(Not) Touching the Floor
The code distinction to classify furniture either in floorStyle or in wallStyle is based on the "touching the floor" notion.
π Touching the floor means that the bottom of the bounding box is near to the floor.
Priority in case of Insertion
At the insertion, if a parameter is present in the three sections furnitureStyle, floorStyle, and wallStyle, the code will:
- Determine, depending on the altitude, if this furniture is "wall" or "floor"
- Apply in priority the array of value(s) present in the corresponding section wallStyle if the altitude > 0, or floorStyle if the altitude = 0.
Not Dynamic Lists
The lists floorStyle and wallStyle are not dynamic. The parameters present in these lists are those defined in the default Style (application distribution) or in the SetUp Setting iFrame message π. If a parameter is not present in the "default style" lists, it will not be added dynamically to the two new lists (the "global style").
π The dynamicity is still valid for the furnitureStyle global style list.
Apply Action
In case of an Apply action (or Delete/Add) and the update of the Global style, if a parameter is present in the three sections furnitureStyle, floorStyle, and wallStyle, the new array of value(s) will be set for this parameter for the three sections. This will have the following consequences: at the first "Apply" (delete/add) in the scene for one parameter, there is no more floor/wall distinction in the global style.
Optional Sections
The lists of floorStyle and wallStyle are optionals, the global style can be defined only with linearStyle and furnitureStyle.
If a user saves a project and the two lists floorStyle and wallStyle are not in the global style, these lists are not dynamically added to the global style at the save.
Setting from the "SetUp Settings" IFrame Message
Following the same principle, this dynamic default style could be set by the SetUp Settings iframe message, coming from the need mapping for example:(see the documentation of SetUp Settings).
β The SetUp Settings global style is added and overwrites the application distribution defaultStyle, only if the parameter ignoreStyleFromiframe is not present or not 'true' in the application distribution.
Process
The SetUp Setting is added to the application distribution "defaultStyle":
- If a parameter value is present both in application distribution and SetUp Setting the value of SetUp Setting will overwrite the value coming from application distribution.
- If a parameter is not present in the SetUp Setting but present in the application distribution, it will be conserved in the application global style.
- If a parameter is present in the SetUp Setting but not present in the application distribution, it will be added to the application global style.
Mandatory Linear Parameters
Two mandatory linear parameters for the Bathroom application must be launched correctly.
The linear parameters worktop and plinth have to be present in the global style at the launch of the application. If not, they have to be present at least in one of those files:
- The file of application distribution default style;
- The SetUp Settings file.
Initialization
SetUp Settings and default style files are only defining the global style at the launch of the application
Let us take the example of a user who changes the global style afterward with some "Apply" actions and save her/his project. When s/he will re-open the project, the global style will be exactly the one at the safe moment.
The application distribution default style and SetUp Settings will never interfere with the global style after the first launch of the application.
New Format "Versionstyle:1"
π As the format is dynamic and with an array of values, it has been completely redefined.
The global style is no more hardcoded with "parameternameID" but only with "parametername". The most important consequence is the way to define different styles between "wall cabinets" and "base cabinets".
Global Style Update after Apply Actions
When the user sets a reference with an to apply action (Apply to all, Apply to Selection, Apply to all linears ...), a specific treatment is done on the global style to define the new default values for product parameters.
The mechanism of the update is depending on the parameters category and the fact that this parameter is present or not in the ApplyAllRule π.
Linear Parameters
Every action of "Apply" for these linear parameters will update the value of the parameter: refID of the global style list
- worktop, wallEdgeStrip, plinth: "Apply to all linears" or "Apply to the selected linear"
- wallPanel: "Apply to selection" or "Apply to the selected linear"
- cornice, decoStrip: "Apply to all" or "Apply to selection"
Example:
This allows the next cabinet to be inserted in the scene with the updated value of linear parameters (Inheritance).
Non-Linear Parameters Not in the ApplyAllRule
Every action of "Apply": "Apply to all" or "Apply to selection" will update the value of "parameter: array of refID" of the global style list, as illustrated below.
worktopLight
(De)Activation
For this parameter worktopLight, activation or deactivation can be managed by the possible value 'null' (as this value 'null' is part of the possible values at the top-assembly level).
Thus, the notion of activation or deactivation will be managed by the value of this option recorded in the global style:
Value | Description |
---|---|
[ refID ] | ] The next cabinet with this parameter will come with a worktop light by default with the corresponding reference. |
[ null ] | The next cabinet with this parameter will come with no worktop light by default. |
Linear Parameters (De)Activation
For linear parameters e.g. cornice, she activation or deactivation is managed with a dedicated parameter for the corniceOption. Therefore, if an array of reference IDs is stored in the global style, it does not mean that the next cabinet will come by default with cornice. And because only the parameters of type 7 products are stored in the global style, the corniceOption (type 3 boolean) is not managed in this global style list (See the dedicated section for this).
πIf one parameter from which the "Apply" action is made, is not yet part of the global style list, this parameter will be added.
Non-Linear Parameters in the ApplyAllRule
Every action of "Apply" ("Apply to all" or "Apply to selection") will update the value(s) of every parameter present in the same ApplyAllRule.
We will call "parameter" the source parameter from which the Apply action is triggered, and "other parameters", all the parameters present in the same ApplyAllRule rule but not directly called in the "Apply" action.
If one of the other parameters in the rule has an "empty" value, the existing value in the global style list will not be updated.
If the parameter from which the Apply action has been made, is not already present in the global style list, this parameter is added to the global style list with the corresponding value(s).
For the other parameters of the ApplyAllRule rule, if one of these other parameters is not yet part of the global style list, this parameter will be added.
First example
With the frame, the user changes from a wall cabinet, frame from white to black.
As the "black wall cabinet" is part of the second entry of the dedicated ApplyAllRule, the full list where "black wall cabinet" is included will be stored in the global style list as the new default value(s) for the frame parameter.
π The entire array of the ApplyAllRule is stored in the global style list.
Second example
With the fronts, if the user changes from drawerFront the value in "red"
As the drawerFront is part of one rule of the ApplyAllRule, the system will try to update every parameter (if this parameter already exists in the global style list) with the corresponding value of the one applied on drawerFront.
In this example: To drawerFront: red will correspond front: [ red1 , red2 ]and dishwasherFront: [ red 3 , red 4 ]. Please note in this example, the same as for the "frame" parameter, an array of values will be updated for "front" and "dishwasherFront".
For the parameter glassFront, as the corresponding value is empty, nothing will be changed in the global style list, the value will remain "white".
π If another parameter other than the one from which the Apply action has been triggered is included in the same rule and is not already in the global style list, it will be automatically added to this global style list. If the same parameter value is present for the same parameter, the value taken in case of selection will be the first possible one.
Third Example
For the following configuration:
If a value is present several times in ApplyAllRule for one parameter, the "Apply" action will trigger the first value found.
For example: For the glassFront
, there are several same white
references to match the white gloss, white mat, or beige other front styles, so if the user does an "Apply" on the parameter glassFront
and chose white, the first corresponding value will be applied: [ white gloss 1, white gloss 2 ]
for front
, [ white gloss ]
for drawerFront, etc.
Difference Between "Null" and "Empty"
As described before, a 'null' is a regular value as any "reference ID" of a product, and it will be managed accordingly. A 'null' can be a possible value in the global style list (for worktopLight for example, as described).
The "empty" value will mean for the management of the global style: do nothing on the global style list.
Example
For this configuration:
If the user does an "Apply to all" from the parameter front value red, as the corresponding value for the parameter glassFront is empty, the pop-in will be triggered only if there is an entry displayPopInForEmptyValue with the value "true" in the ApplyAllRule.
If this entry is not present in the ApplyAllRule, the default value is false, meaning an empty value will have the consequence to not launch the pop-in.
"Apply Action" with "Add" and "Delete"
The "Apply" action could be made also by the "Add" or "Delete" button in the following case:
For the parameter which the number of possible values is: 2, a valid reference and null for example drawerLight.
In the planner, if for one cabinet, the default value is the valid reference, the edit panel will propose the user to "Delete" the drawerLight..
This action will update the global style with the "null" value for the parameter drawerLight.
If the user clicks on "Add", the new default value for drawerLight is the valid reference:
Important Precision on the Behaviour of 'Null' Values
The 'null' value is a way to manage the activation / disable of one product, so it could not be managed as other regular value, but inactivation/disable context, so note the two important precisions on the management of "null" values hereinafter.
We have called "induced" parameters, the parameter updated in the global style because these parameters are present in the same rule as the parameter from which the apply action is made.
If an "induced" parameter has an existing value of 'null', the system will not update this value with the corresponding value in the ApplyAllRule to not reactivate a parameter disable.
In case of a "Delete", the system will update the global style with a "null" value in the global style for this parameter, in this case, the system will not look into the ApplyAll action: a 'null' value does not trigger any rule of the ApplyAllRule, even if a 'null' value is present in the ApplyAllRule for this parameter.
Β
Β