private void GetType(object sender, EventArgs e) { if (sender is ToolStripMenuItem item && item.Tag is TransfiniteCurveType) { this.type = (TransfiniteCurveType)item.Tag; ExpireSolution(true); } }
public override bool Read(GH_IReader reader) { int aIndex = -1; if (reader.TryGetInt32("type", ref aIndex)) { type = (TransfiniteCurveType)aIndex; } return(base.Read(reader)); }
/// <summary> /// Transfinite curve constraint. /// </summary> /// <param name="tag"> ID of the underlying curve. </param> /// <param name="type"> Curve distribution type. </param> /// <param name="nodesCount"> Number of nodes to be uniformly placed nodes on the curve. </param> /// <param name="coef"> Geometrical progression with power Coef for node distribution when using Progression type. </param> /// <returns></returns> public static ITransfinite Curve(int tag, TransfiniteCurveType type, int nodesCount, double coef) { ITransfinite data = new ITransfinite(); data.Dim = 1; data.Tag = tag; data.MethodType = type.ToString(); data.NodesNumber = nodesCount; data.Coef = coef; return(data); }