Layers Class

Layers can be added as a group or individually. When added as a group, addLayerGroup method in projectClass iterates over the list of layers and adds them one by one using addLayer method which is used to add individual layers.

The methods on the left call the methods on the right in the table.

Method in Project Class

Method in Layers Class

projectClass.addLayerGroup()

layersClass.addLayer()

projectClass.addLayer()

layersClass.addLayer()

projectClass.setLayerValue()

layersClass.setLayerValue()

Adding layers as a group. Can set to a class using projectClass.addLayerGroup(Layers)
    projectClass.addLayerGroup({waterLayer ; bilInnerHead ; bilTails ; bilOuterHead})
Adding layers individually. Can set to a class using projectClass.addLayer(Layer)
    waterLayer = {
        'Water Layer',...           % Layer name
        'Water thick',...
        'Water SLD',...
        'Bilayer heads rough',...    % Outer interface of the water layer is a bilayer headgroup
        'Water hydr',...
        'Bulk out'
    };

    projectClass.addLayer(waterLayer);

Reference

class API.projectClass.layersClass(SLDValues)
addLayer(paramNames, varargin)

Add a layer to the layers table The expected input is a string array of parameter names defined in the project’s parameter class and a variable number of layer parameters. The layer can be specified with no parameters, just a layer name (char), or a fully defined layer, which consists of either all except two parameters (no hydration) or all parameters. Parameters can be specified either by name or by index.

layers.addLayer(parameters.varTable{:, 1}); layers.addLayer(parameters.varTable{:, 1}, ‘New layer’); layers.addLayer(parameters.varTable{:, 1}, ‘Another layer’, 1, 2, 3);

static findParameter(inputVal, paramNames)

Find whether or not a proposed layer parameter is included in a list of parameters, or obtain a parameter by index. The expected inputs are the potential layer parameter value (either name or index) and a list of parameter names.

layersClass(SLDValues)

Construct a layers class including an empty layers table The optional input is a cell array of the required SLD parameters.

layers = layersClass();

setLayerValue(row, col, inputValue, paramNames)

Change the value of a given layer parameter in the table (excluding the layer name). The row and column of the parameter can both be specified by either name or index. The expected input is a row parameter (name or index), a column parameter (name or index), the new value to be set at that row and column, and a string array of parameter names defined in the project’s parameter class.

layers.setLayerValue(1, 1, ‘origin’, parameters.varTable{:, 1});

toStruct(paramNames)

Convert the layers class to a struct.

layers.toStruct()