/// <summary> /// Removes attribute specified by its id from all the vertices. /// </summary> /// <param name="id">Specifies the attribute to be removed</param> public void RemoveAttribute(string id) { AttributeInfos.Remove(id); foreach (Vertex vertex in Vertices) { vertex.Attributes.Remove(id); } }
// ================================================================================================== // UNIFORM / VERTEX MANIPULATION // ================================================================================================== /// <summary> /// Adds new attribute for all vertices. /// </summary> /// <param name="attributeInfo">Structure describing the attribute</param> public void AddAttribute(AttributeInfo attributeInfo) { AttributeInfos.Add(attributeInfo.Id, attributeInfo); // Ensure that all vertices will have this attribute. foreach (Vertex vertex in Vertices) { var newVariable = attributeInfo.CreateNewVariable(); newVariable.PropertyChanged += OnAttributeChange; vertex.Attributes.Add(attributeInfo.Id, newVariable); } }