public static RatesCurveGroupDefinition config(Period[] dscOisTenors, string[] dscIdValues, Period[] fwd3FraTenors, Period[] fwd3IrsTenors, string[] fwd3IdValues, Period[] fwd6FraTenors, Period[] fwd6IrsTenors, string[] fwd6IdValues) { CurveNode[] dscNodes = new CurveNode[dscOisTenors.Length]; for (int i = 0; i < dscOisTenors.Length; i++) { dscNodes[i] = FixedOvernightSwapCurveNode.of(FixedOvernightSwapTemplate.of(Period.ZERO, Tenor.of(dscOisTenors[i]), EUR_FIXED_1Y_EONIA_OIS), QuoteId.of(StandardId.of(SCHEME, dscIdValues[i]))); } CurveNode[] fwd3Nodes = new CurveNode[fwd3IdValues.Length]; fwd3Nodes[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(EUR_EURIBOR_3M), QuoteId.of(StandardId.of(SCHEME, fwd3IdValues[0]))); for (int i = 0; i < fwd3FraTenors.Length; i++) { fwd3Nodes[i + 1] = FraCurveNode.of(FraTemplate.of(fwd3FraTenors[i], EUR_EURIBOR_3M), QuoteId.of(StandardId.of(SCHEME, fwd3IdValues[i + 1]))); } for (int i = 0; i < fwd3IrsTenors.Length; i++) { fwd3Nodes[i + 1 + fwd3FraTenors.Length] = FixedIborSwapCurveNode.of(FixedIborSwapTemplate.of(Period.ZERO, Tenor.of(fwd3IrsTenors[i]), EUR_FIXED_1Y_EURIBOR_3M), QuoteId.of(StandardId.of(SCHEME, fwd3IdValues[i + 1 + fwd3FraTenors.Length]))); } CurveNode[] fwd6Nodes = new CurveNode[fwd6IdValues.Length]; fwd6Nodes[0] = IborFixingDepositCurveNode.of(IborFixingDepositTemplate.of(EUR_EURIBOR_6M), QuoteId.of(StandardId.of(SCHEME, fwd6IdValues[0]))); for (int i = 0; i < fwd6FraTenors.Length; i++) { fwd6Nodes[i + 1] = FraCurveNode.of(FraTemplate.of(fwd6FraTenors[i], EUR_EURIBOR_6M), QuoteId.of(StandardId.of(SCHEME, fwd6IdValues[i + 1]))); } for (int i = 0; i < fwd6IrsTenors.Length; i++) { fwd6Nodes[i + 1 + fwd6FraTenors.Length] = FixedIborSwapCurveNode.of(FixedIborSwapTemplate.of(Period.ZERO, Tenor.of(fwd6IrsTenors[i]), EUR_FIXED_1Y_EURIBOR_6M), QuoteId.of(StandardId.of(SCHEME, fwd6IdValues[i + 1 + fwd6FraTenors.Length]))); } InterpolatedNodalCurveDefinition DSC_CURVE_DEFN = InterpolatedNodalCurveDefinition.builder().name(DSCON_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).interpolator(INTERPOLATOR_LINEAR).extrapolatorLeft(EXTRAPOLATOR_FLAT).extrapolatorRight(EXTRAPOLATOR_FLAT).nodes(dscNodes).build(); InterpolatedNodalCurveDefinition FWD3_CURVE_DEFN = InterpolatedNodalCurveDefinition.builder().name(FWD3_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).interpolator(INTERPOLATOR_LINEAR).extrapolatorLeft(EXTRAPOLATOR_FLAT).extrapolatorRight(EXTRAPOLATOR_FLAT).nodes(fwd3Nodes).build(); InterpolatedNodalCurveDefinition FWD6_CURVE_DEFN = InterpolatedNodalCurveDefinition.builder().name(FWD6_CURVE_NAME).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.ZERO_RATE).dayCount(CURVE_DC).interpolator(INTERPOLATOR_LINEAR).extrapolatorLeft(EXTRAPOLATOR_FLAT).extrapolatorRight(EXTRAPOLATOR_FLAT).nodes(fwd6Nodes).build(); return(RatesCurveGroupDefinition.builder().name(CURVE_GROUP_NAME).addCurve(DSC_CURVE_DEFN, EUR, EUR_EONIA).addForwardCurve(FWD3_CURVE_DEFN, EUR_EURIBOR_3M).addForwardCurve(FWD6_CURVE_DEFN, EUR_EURIBOR_6M).build()); }
public void DrawGUI(bool renderCurves) { //Data node = target as CurveNode; parentSpline = node.GetComponentInParent <BezierSpline>(); handleTransform = node.transform; handleRotation = (Tools.pivotRotation == PivotRotation.Local ? node.transform.rotation : Quaternion.identity); //Rendering SetInTangentGizmo(); SetOutTangentGizmo(); if (renderCurves && parentSpline != null) { if (node.index == null || node.index == -1) { node.index = parentSpline.GetIndexOfNode(node); } if (node.index != -1) { RenderAdjacentCurves(); } } }
public Vector2 GetPosition(float progress) { int i; GetNodeProgress(progress, out progress, out i); return(CurveNode.GetInvervalPosition(points[i], points[i + 1], progress)); }
public RenderNodeAction OnCurve(CurveNode node) { // Customize tessellation of annotation curves if (m_currentElem.Category.CategoryType == CategoryType.Annotation) { IList <XYZ> list = new List <XYZ>(); Curve curve = node.GetCurve(); if (curve is Line) { Line l = curve as Line; list.Add(l.GetEndPoint(0)); list.Add(l.GetEndPoint(1)); } else { list = curve.Tessellate(); } Utilities.addTo(m_points, list); return(RenderNodeAction.Skip); } return(RenderNodeAction.Proceed); }
private Vector2 GetTangent(CurveNode node, SelectedCurveType type) { if (type == SelectedCurveType.inTangent) { return(node.inTangent); } return(node.outTangent); }
public Vector2 GetVelocity(float progress) { int i; GetNodeProgress(progress, out progress, out i); return(CurveNode.GetFirstDerivative(points[i], points[i + 1], progress)); }
void AddCurveNode() { BaseNode pn = new CurveNode(); pn.name = "new Curve Node"; nodeList.Add(pn); Repaint(); }
public override NodeViewModel CreateModel() { ModifierNode result = null; switch (modifyType) { case ModifyType.Abs: result = new AbsNode(); break; case ModifyType.Clamp: var clampNode = new ClampNode(); (clampNode.Lower.Editor as FloatEditorViewModel).Value = lower; (clampNode.Upper.Editor as FloatEditorViewModel).Value = upper; result = clampNode; break; case ModifyType.Exponent: var exponentNode = new ExponentNode(); (exponentNode.Exponent.Editor as FloatEditorViewModel).Value = exponent; result = exponentNode; break; case ModifyType.Invert: result = new InvertNode(); break; case ModifyType.ScaleBias: var scaleBiasNode = new ScaleBiasNode(); (scaleBiasNode.Scale.Editor as FloatEditorViewModel).Value = scale; (scaleBiasNode.Bias.Editor as FloatEditorViewModel).Value = bias; result = scaleBiasNode; break; case ModifyType.Scale2d: var scale2dNode = new Scale2DNode(); (scale2dNode.Scale2d.Editor as ValueEditorViewModel <Vector2>).Value = scale2d; result = scale2dNode; break; case ModifyType.Curve: result = new CurveNode(); // TODO break; case ModifyType.Terrace: result = new TerraceNode(); // TODO break; } result.Name = name; result.Position = pos; return(result); }
void OnTriggerExit2D(Collider2D other) { if (other.CompareTag("Human") && m_Carrying == false) { m_OnHuman = false; } if (other.CompareTag("Curve")) { this.mEnteredCurveNode = null; } }
public static void RenderCurve(CurveNode lhs, CurveNode rhs) { Handles.color = Color.white; Vector2 lineStart = CurveNode.GetInvervalPosition(lhs, rhs, 0f); for (int i = 0; i < lineRenderSteps; i++) { Vector2 lineEnd = CurveNode.GetInvervalPosition(lhs, rhs, (i + 1) / (float)lineRenderSteps); Handles.DrawLine(lineStart, lineEnd); lineStart = lineEnd; } }
void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Human") && m_Carrying == false) { m_OnHuman = true; m_Human = other.transform.parent.gameObject; m_HumanAnim = m_Human.GetComponentInChildren <Animator>(); CheckHumanFacingRight(); } if (other.CompareTag("Curve")) { this.mEnteredCurveNode = other.GetComponent <CurveNode>(); } }
public static Vector2 GetFirstDerivative(CurveNode lhs, CurveNode rhs, float t) { Vector2 lhsOutBezierPoint = lhs.transform.TransformPoint(lhs.outTangent); Vector2 rhsInBezierPoint = rhs.transform.TransformPoint(rhs.inTangent); t = Mathf.Clamp01(t); float t2 = t * t; float oneMinusT = 1f - t; float oneMinusT2 = oneMinusT * oneMinusT; return(3f * oneMinusT2 * (lhsOutBezierPoint - lhs.position) + 6f * oneMinusT * t * (rhsInBezierPoint - lhsOutBezierPoint) + 3f * t2 * (rhs.position - rhsInBezierPoint)); }
internal static ObservableId key(CurveNode node) { if (node is FraCurveNode) { return(((FraCurveNode)node).RateId); } else if (node is FixedIborSwapCurveNode) { return(((FixedIborSwapCurveNode)node).RateId); } else { //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: throw new System.ArgumentException("Unsupported node type " + node.GetType().FullName); } }
private CurveNode _GenerateNodeLocal(Vector2 spawnLocation) { GameObject newObject = Instantiate(new GameObject(), this.transform); newObject.transform.localPosition = spawnLocation; newObject.name = "Curve Node"; newObject.tag = "Curve"; CurveNode node = newObject.AddComponent <CurveNode>(); CircleCollider2D nodeCollider = newObject.AddComponent <CircleCollider2D>(); nodeCollider.radius = StartEndColliderSize; nodeCollider.isTrigger = true; node.inTangent = new Vector2(-1, 0); node.outTangent = new Vector2(1, 0); return(newObject.GetComponent <CurveNode>()); }
public int?index; // To be set by parent curve data structure //AG: Cubic Hermite Spline Interpolation //According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline //AG: Currently unused, look at GetIntervalPosition below public static float DetermineIntervalPositon(CurveNode lhs, CurveNode rhs, float currentInverval) { float intervalLength = rhs.intervalKeyframe - lhs.intervalKeyframe; float m0 = lhs.outTangent.normalized.y / lhs.outTangent.normalized.x * intervalLength; float m1 = rhs.inTangent.normalized.y / rhs.inTangent.normalized.y * intervalLength; float interval = currentInverval; float interval2 = interval * interval; float interval3 = interval2 * interval; float a = 2 * interval3 - 3 * interval2 + 1; //2t^3 - 3t^2 + 1 float b = interval3 - 2 * interval2 + interval; //t^3 - 2t^2 + t float c = -2 * interval3 + 3 * interval2; //-2t^3 + 3t^2 float d = interval3 - interval2; return(a * lhs.position.y + b * m0 + c * m1 + d * rhs.position.y); }
//Bezier Interpolation public static Vector2 GetInvervalPosition(CurveNode lhs, CurveNode rhs, float t) { Vector2 lhsOutBezierPoint = lhs.transform.TransformPoint(lhs.outTangent); Vector2 rhsInBezierPoint = rhs.transform.TransformPoint(rhs.inTangent); t = Mathf.Clamp01(t); float t2 = t * t; float t3 = t2 * t; float oneMinusT = 1f - t; float oneMinusT2 = oneMinusT * oneMinusT; float oneMinusT3 = oneMinusT2 * oneMinusT; return(oneMinusT3 * lhs.position + //(1-t)^3 * Point0 3f * oneMinusT2 * t * lhsOutBezierPoint + //3 * (1-t)^2 * t * Point1 3f * oneMinusT * t2 * rhsInBezierPoint + //3 * (1-t) * t^2 + Point2 t3 * rhs.position); //t^3 }
public RenderNodeAction OnCurve(CurveNode node) { // tessellate annotations OnCurve to support Wireframe annotation export if (m_currentElem.Category.CategoryType == CategoryType.Annotation) { IList <XYZ> list = new List <XYZ>(); Curve curve = node.GetCurve(); if (curve is Line) { Line l = curve as Line; list.Add(l.GetEndPoint(0)); list.Add(l.GetEndPoint(1)); } else { list = curve.Tessellate(); } Utilities.addTo(m_points, list); } return(RenderNodeAction.Proceed); }
private void InitializeTreeView() { StockNode treeNode1; foreach (string entry in this.theme.Keys) { if (entry.ToUpper().EndsWith("GRAPH")) { GraphNode treeNode = new GraphNode(entry, this.graphMenuStrip, Color.White, Color.LightGray, true, Color.LightGray, GraphChartMode.BarChart); if (entry.ToUpper().Contains("VOLUME")) { treeNode.ImageKey = "VH"; treeNode.SelectedImageKey = "VH"; } this.treeView1.Nodes.Add(treeNode); foreach (string line in this.theme[entry]) { try { string[] fields = line.Split('|'); switch (fields[0].ToUpper()) { case "GRAPH": string[] colorItem = fields[1].Split(':'); treeNode.GraphBackgroundColor = Color.FromArgb(int.Parse(colorItem[0]), int.Parse(colorItem[1]), int.Parse(colorItem[2]), int.Parse(colorItem[3])); colorItem = fields[2].Split(':'); treeNode.GraphTextBackgroundColor = Color.FromArgb(int.Parse(colorItem[0]), int.Parse(colorItem[1]), int.Parse(colorItem[2]), int.Parse(colorItem[3])); treeNode.GraphShowGrid = bool.Parse(fields[3]); colorItem = fields[4].Split(':'); treeNode.GraphGridColor = Color.FromArgb(int.Parse(colorItem[0]), int.Parse(colorItem[1]), int.Parse(colorItem[2]), int.Parse(colorItem[3])); treeNode.GraphMode = (GraphChartMode)Enum.Parse(typeof(GraphChartMode), fields[5]); if (treeNode.Text.ToUpper() == "CLOSEGRAPH") { if (fields.Length >= 7) { treeNode.SecondaryPen = GraphCurveType.PenFromString(fields[6]); } else { treeNode.SecondaryPen = new Pen(Color.DarkGoldenrod, 1); } } break; case "DATA": if (treeNode.Text.ToUpper() == "CLOSEGRAPH") { if (fields[1] == "CLOSE") { treeNode1 = new CurveNode(fields[1], null, GraphCurveType.PenFromString(fields[2]), bool.Parse(fields[3])); treeNode.Nodes.Add(treeNode1); } else { if (bool.Parse(fields[3])) // Normaly Other than close is not visible... { treeNode1 = new CurveNode(fields[1], null, GraphCurveType.PenFromString(fields[2]), bool.Parse(fields[3])); treeNode.Nodes.Add(treeNode1); } } } else { if (fields[1] != "VOLUME" && bool.Parse(fields[3])) // Normaly Other than close is not visible... { treeNode1 = new CurveNode(fields[1], null, GraphCurveType.PenFromString(fields[2]), bool.Parse(fields[3])); treeNode.Nodes.Add(treeNode1); } } break; case "INDICATOR": { IStockIndicator stockIndicator = (IStockIndicator)StockViewableItemsManager.GetViewableItem(line); treeNode1 = new IndicatorNode(stockIndicator.Name, this.indicatorMenuStrip, stockIndicator); for (int i = 0; i < stockIndicator.SeriesCount; i++) { CurveNode curveNode = new CurveNode(stockIndicator.SerieNames[i], null, stockIndicator.SeriePens[i], true, stockIndicator.SerieVisibility[i]); treeNode1.Nodes.Add(curveNode); curveNode.ImageKey = treeNode1.ImageKey; curveNode.SelectedImageKey = treeNode1.SelectedImageKey; } treeNode.Nodes.Add(treeNode1); } break; case "PAINTBAR": { IStockPaintBar stockPaintBar = (IStockPaintBar)StockViewableItemsManager.GetViewableItem(line); treeNode1 = new PaintBarsNode(stockPaintBar.Name, this.indicatorMenuStrip, stockPaintBar); for (int i = 0; i < stockPaintBar.SeriesCount; i++) { CurveNode curveNode = new CurveNode(stockPaintBar.SerieNames[i], null, stockPaintBar.SeriePens[i], true, stockPaintBar.SerieVisibility[i]); treeNode1.Nodes.Add(curveNode); curveNode.ImageKey = treeNode1.ImageKey; curveNode.SelectedImageKey = treeNode1.SelectedImageKey; } treeNode.Nodes.Add(treeNode1); } break; case "TRAILSTOP": { IStockTrailStop stockTrailStop = (IStockTrailStop)StockViewableItemsManager.GetViewableItem(line); treeNode1 = new TrailStopsNode(stockTrailStop.Name, this.indicatorMenuStrip, stockTrailStop); for (int i = 0; i < stockTrailStop.SeriesCount; i++) { CurveNode curveNode = new CurveNode(stockTrailStop.SerieNames[i], null, stockTrailStop.SeriePens[i], false, true); treeNode1.Nodes.Add(curveNode); curveNode.ImageKey = treeNode1.ImageKey; curveNode.SelectedImageKey = treeNode1.SelectedImageKey; } treeNode.Nodes.Add(treeNode1); } break; case "DECORATOR": { IStockDecorator stockDecorator = (IStockDecorator)StockViewableItemsManager.GetViewableItem(line); treeNode1 = new DecoratorNode(stockDecorator.Name, this.indicatorMenuStrip, stockDecorator); for (int i = 0; i < stockDecorator.SeriesCount; i++) { treeNode1.Nodes.Add(new CurveNode(stockDecorator.SerieNames[i], null, stockDecorator.SeriePens[i], true, stockDecorator.SerieVisibility[i])); } for (int i = 0; i < stockDecorator.EventCount; i++) { treeNode1.Nodes.Add(new EventNode(stockDecorator.EventNames[i], null, stockDecorator.EventPens[i], true, stockDecorator.EventVisibility[i])); } foreach (TreeNode childNode in treeNode.Nodes) { if (childNode.Text == stockDecorator.DecoratedItem) { childNode.Nodes.Add(treeNode1); break; } } } break; case "TRAIL": { IStockTrail stockTrail = (IStockTrail)StockViewableItemsManager.GetViewableItem(line); treeNode1 = new TrailNode(stockTrail.Name, this.indicatorMenuStrip, stockTrail); for (int i = 0; i < stockTrail.SeriesCount; i++) { treeNode1.Nodes.Add(new CurveNode(stockTrail.SerieNames[i], null, stockTrail.SeriePens[i], true, true)); } foreach (TreeNode childNode in treeNode.Nodes) { if (childNode.Text == stockTrail.TrailedItem) { childNode.Nodes.Add(treeNode1); break; } } } break; case "LINE": treeNode.Nodes.Add(new LineNode("LINE_" + fields[1], this.indicatorMenuStrip, GraphCurveType.PenFromString(fields[2]), float.Parse(fields[1]))); break; default: continue; } } catch (System.Exception e) { StockLog.Write(e); } } } } foreach (TreeNode node in this.treeView1.Nodes) { node.Expand(); } this.treeView1.SelectedNode = treeView1.Nodes[0]; }
private void ActivatePaintBarConfigPanel(CurveNode curveNode) { this.MakeVisible(this.paintBarGroupBox); this.suspendPreview = true; this.lineTypeComboBox.Parent = this.paintBarGroupBox; this.thicknessComboBox.Parent = this.paintBarGroupBox; this.lineColorPanel.Parent = this.paintBarGroupBox; if (curveNode.SupportVisibility) { this.visibleCheckBox.Parent = paintBarGroupBox; this.visibleCheckBox.Visible = true; this.visibleCheckBox.Checked = curveNode.Visible; } else { this.visibleCheckBox.Visible = false; } this.lineTypeComboBox.SelectedItem = curveNode.CurvePen.DashStyle.ToString(); this.thicknessComboBox.SelectedItem = (int)curveNode.CurvePen.Width; this.lineColorPanel.BackColor = curveNode.CurvePen.Color; this.curvePreviewLabel.Parent = this.paintBarGroupBox; this.previewPanel.Parent = this.paintBarGroupBox; this.suspendPreview = false; this.previewPanel.Refresh(); }
private void ActivateCurveConfigPanel(CurveNode curveNode) { this.MakeVisible(curveConfigBox); this.suspendPreview = true; StockNode parentNode = (StockNode)this.treeView1.SelectedNode.Parent; this.lineTypeComboBox.Enabled = !( (parentNode.Type == NodeType.PaintBars) || (parentNode.Type == NodeType.Trail)|| (parentNode.Type == NodeType.Indicator && ((IndicatorNode)parentNode).ViewableItem.DisplayStyle == IndicatorDisplayStyle.SupportResistance)); this.lineTypeComboBox.Parent = curveConfigBox; this.thicknessComboBox.Parent = curveConfigBox; this.lineColorPanel.Parent = curveConfigBox; if (curveNode.SupportVisibility) { this.visibleCheckBox.Parent = curveConfigBox; this.visibleCheckBox.Visible = true; this.visibleCheckBox.Checked = curveNode.Visible; } else { this.visibleCheckBox.Visible = false; } this.lineTypeComboBox.SelectedItem = curveNode.CurvePen.DashStyle.ToString(); this.thicknessComboBox.SelectedItem = (int)curveNode.CurvePen.Width; this.lineColorPanel.BackColor = curveNode.CurvePen.Color; this.curvePreviewLabel.Parent = this.curveConfigBox; this.previewPanel.Parent = this.curveConfigBox; this.suspendPreview = false; this.previewPanel.Refresh(); }
public int GetIndexOfNode(CurveNode node) { return(points.FindIndex(listNode => listNode == node)); }
/// <summary> /// initializes the Diagram data /// </summary> private void InitializeDiagram() { Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 25, 120, 75); rect.FillStyle.Color = Color.FromArgb(240, 242, 240); rect.FillStyle.ForeColor = Color.White; rect.FillStyle.Type = FillStyleType.LinearGradient; rect.LineStyle.LineColor = Color.DarkGray; AddLabel(rect, "Rectangle", Position.Center); diagram1.Model.AppendChild(rect); Syncfusion.Windows.Forms.Diagram.RoundRect roundRect = new Syncfusion.Windows.Forms.Diagram.RoundRect(400, 25, 120, 75, MeasureUnits.Pixel); roundRect.FillStyle.Color = Color.FromArgb(240, 242, 240); roundRect.FillStyle.ForeColor = Color.White; roundRect.LineStyle.LineColor = Color.DarkGray; roundRect.FillStyle.Type = FillStyleType.LinearGradient; AddLabel(roundRect, "RoundRect1", Position.Center); diagram1.Model.AppendChild(roundRect); Ellipse ellipse1 = new Ellipse(100, 125, 120, 80); ellipse1.FillStyle.Color = Color.FromArgb(240, 242, 240); ellipse1.FillStyle.ForeColor = Color.White; ellipse1.LineStyle.LineColor = Color.DarkGray; ellipse1.FillStyle.Type = FillStyleType.LinearGradient; AddLabel(ellipse1, "Ellipse", Position.Center); diagram1.Model.AppendChild(ellipse1); Polygon poly = new Polygon(new PointF[] { new PointF(160, 235), new PointF(100, 265), new PointF(120, 325), new PointF(200, 325), new PointF(220, 265) }); poly.FillStyle.Color = Color.FromArgb(240, 242, 240); poly.FillStyle.ForeColor = Color.White; poly.FillStyle.Type = FillStyleType.LinearGradient; poly.LineStyle.LineColor = Color.DarkGray; AddLabel(poly, "Polygon", Position.Center); diagram1.Model.AppendChild(poly); SemiCircle semiCircle = new SemiCircle(400, 125, 120, 75); semiCircle.FillStyle.Color = Color.FromArgb(240, 242, 240); semiCircle.FillStyle.ForeColor = Color.White; semiCircle.FillStyle.Type = FillStyleType.LinearGradient; semiCircle.LineStyle.LineColor = Color.DarkGray; AddLabel(semiCircle, "SemiCircle", Position.Center); diagram1.Model.AppendChild(semiCircle); TextNode textNode = new TextNode("TextNode1", new RectangleF(400, 245, 120, 50)); textNode.FontStyle.Size = 9; textNode.FontStyle.Family = "Segoe UI"; textNode.HorizontalAlignment = StringAlignment.Center; textNode.VerticalAlignment = StringAlignment.Center; textNode.LineStyle.LineColor = Color.DarkGray; textNode.FontColorStyle.Color = Color.Black; diagram1.Model.AppendChild(textNode); RichTextNode richTextNode = new RichTextNode(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Meiryo UI;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}} {\colortbl ;\red255\green0\blue0;\red0\green64\blue128;} \viewkind4\uc1\pard\b\f0\fs17 This is a text symbol\f1 \b0\f0 designed using the \cf1\b\i Essential Diagram\i0 \cf2\ul RichText\ulnone node\cf0\b0 .\par \i\f1\fs20\par }", new RectangleF(400, 320, 120, 100)); richTextNode.LineStyle.LineColor = Color.DarkGray; diagram1.Model.AppendChild(richTextNode); #if !NETCORE BitmapNode bmpNode = new BitmapNode(@"..\..\..\..\..\..\common\Images\Diagram\OrgChart Layout\image3.png"); #else BitmapNode bmpNode = new BitmapNode(@"..\..\..\..\..\..\..\common\Images\Diagram\OrgChart Layout\image3.png"); #endif bmpNode.Name = "BitmapNode1"; bmpNode.PinPoint = new PointF(700, 75); bmpNode.Size = new SizeF(120, 100); bmpNode.LineStyle.LineWidth = 0; diagram1.Model.AppendChild(bmpNode); ClosedCurveNode curve = new ClosedCurveNode(new PointF[] { new PointF(120, 350), new PointF(120, 450), new PointF(220, 400) }); curve.FillStyle.Color = Color.FromArgb(240, 242, 240); curve.FillStyle.ForeColor = Color.White; curve.FillStyle.Type = FillStyleType.LinearGradient; curve.LineStyle.LineColor = Color.DarkGray; AddLabel(curve, "ClosedCurve", Position.Center); diagram1.Model.AppendChild(curve); CurveNode curve1 = new CurveNode(new PointF[] { new PointF(120, 100), new PointF(120, 200), new PointF(220, 150) }); curve1 = new CurveNode(new PointF[] { new PointF(0, 30), new PointF(4.99999952f, 25), new PointF(18.3333321f, 0), new PointF(30, 0), new PointF(41.66666641f, 0), new PointF(58.33333321f, 30), new PointF(70, 30), new PointF(81.66666f, 30), new PointF(95, 4.99999952f), new PointF(100, 0) }); AddLabel(curve1, "CurveNode", Position.Center); diagram1.Model.AppendChild(curve1); CircularArc circular = new CircularArc(new RectangleF(640, 150, 100, 100), 0, 270); circular.FillStyle.Color = Color.FromArgb(240, 242, 240); circular.FillStyle.ForeColor = Color.White; circular.FillStyle.Type = FillStyleType.LinearGradient; circular.LineStyle.LineColor = Color.DarkGray; circular.PinPoint = new PointF(700, 200); AddLabel(circular, "CircularArc", Position.Center); diagram1.Model.AppendChild(circular); Line line1 = new Line(new PointF(700, 320), new PointF(700, 430)); line1.LineStyle.LineColor = Color.DarkGray; AddLabel(line1, "line", Position.TopCenter); diagram1.Model.AppendChild(line1); PolylineNode polyLine = new PolylineNode(new PointF[] { new PointF(640, 500), new PointF(760, 500), new PointF(640, 540), new PointF(760, 540) }); polyLine.LineStyle.LineColor = Color.DarkGray; polyLine.LineStyle.LineWidth = 1; Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(polyLine, "PolyLine Node"); label.OffsetX = polyLine.BoundingRectangle.Width / 5f; label.OffsetY = polyLine.BoundingRectangle.Height + 10; label.FontStyle.Family = "Segoe UI"; label.FontColorStyle.Color = Color.Black; label.FontStyle.Size = 9; polyLine.Labels.Add(label); diagram1.Model.AppendChild(polyLine); BezierCurve bezier = new BezierCurve(new PointF[] { new PointF(100, 470), new PointF(160, 470), new PointF(160, 560), new PointF(220, 560) }); AddLabel(bezier, "BezierCurve", Position.BottomCenter); diagram1.Model.AppendChild(bezier); SplineNode spline = new SplineNode(new PointF[] { new PointF(400, 460), new PointF(520, 500), new PointF(400, 520) }); spline.LineStyle.LineColor = Color.Black; spline.LineStyle.LineWidth = 1; AddLabel(spline, "Spline", Position.BottomCenter); diagram1.Model.AppendChild(spline); }
private void AddNodeToList(CurveNode newNode) { newNode.index = points.Count; points.Add(newNode); distances.Add(10f); }