====== Layer Class ====== [[https://github.com/LibreCAD/LibreCAD_3/blob/master/lcUI/widgets/layers.h|Github Link]] namespace lc::ui::widgets ---- ===== Add Layer ===== ---- ==== Description ==== Add a new layer. Color can be added as individual rgb values or through color object. * Layer Shared Pointer - //Layer// * Layer Name - //string// * returns //Layer// * Layer Name - //string// , Line width - //double// * returns //Layer// * Layer Name - //string// , Red - //int// , Green - //int//, Blue - //int// * returns //Layer// * Layer Name - //string// , Color - //lc::Color// * returns //Layer// * Layer Name - //string// , Line width - //double// , Red - //int// , Green - //int//, Blue - //int// * returns //Layer// * Layer Name - //string// , Line width - //double// , Color - //lc::Color// * returns //Layer// ==== Examples ==== * local layers = mainWindow:layers() * layers:addLayer(layer1) * local layer1 = layers:addLayer("Layer1") * local layer1 = layers:addLayer("Layer1", 2) * local layer1 = layers:addLayer("Layer1", 255, 255, 255) * local layer1 = layers:addLayer("Layer1", lc.Color(1,1,1)) * local layer1 = layers:addLayer("Layer1", 2, 255, 255, 255) * local layer1 = layers:addLayer("Layer1", 2, lc.Color(1,1,1)) ---- ===== Remove Layer ===== ---- ==== Description ==== Remove layer by passing in the layer on or by passing in the the layer object. * Layer Name - //string// * Layer Shared Pointer - //Layer// ==== Examples ==== * layers:removeLayer("Layer1") * layers:removeLayer(layer1) ---- ===== Find Layer ===== ---- ==== Description ==== Find layer by label. * Layer Label - //string// * returns //Layer// ==== Examples ==== * local layer1 = layers:layerByName("Layer1") ---- ===== Rename Layer ===== ---- ==== Description ==== Rename the given layer to a new layer name. * Old Layer Name - //string// , New Layer Name - //string// * Layer - //layer// , New Layer Name - //string// ==== Examples ==== * layers:renameLayer("OldLayer", "NewLayer") * layers:renameLayer(oldLayer, "NewLayer") ---- ===== Replace Layer ===== ---- ==== Description ==== Replace the given layer with the the new layer passed as the second argument. * Old Layer Name - //string// , New Layer - //Layer// * Old Layer - //layer// , New Layer - //Layer// ==== Examples ==== * layers:replaceLayer("OldLayer", newLayer) * layers:replaceLayer(oldLayer, newLayer) ----