-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInputTerminalElement.cs
78 lines (70 loc) · 2.24 KB
/
InputTerminalElement.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using MetaphysicsIndustries.Crystalline;
using MetaphysicsIndustries.Epiphany;
using System.Windows.Forms;
namespace MetaphysicsIndustries.Amethyst
{
[Serializable]
public class InputTerminalElement : TerminalElement
{
public InputTerminalElement(InputTerminal terminal)
:base(terminal)
{
}
protected override void InitTerminals2()
{
System.Type conType = Terminal.ConnectionBase.TypeForConnection;
OutputConnectionBase con = OutputConnectionBase.ConstructOutputConnection(conType,"");
Node.OutputConnectionBases.Add(con);
OutputTerminal term = new OutputTerminal(con);
term.Side = BoxOrientation.Right;
term.Position = Height / 2;
Terminals.Add(term);
base.InitTerminals();
}
protected override PointF[] GetPolygon()
{
PointF[] pt = new PointF[3];
if (Terminal == null)
{
//pt = new PointF[1];
}
else if (Terminal.Side == BoxOrientation.Up)
{
pt[0].X = -1;
pt[1].Y = 1.732f;
pt[2].X = 1;
}
else if (Terminal.Side == BoxOrientation.Right)
{
pt[0].Y = -1;
pt[1].X = -1.732f;
pt[2].Y = 1;
}
else if (Terminal.Side == BoxOrientation.Down)
{
pt[0].X = -1;
pt[1].Y = -1.732f;
pt[2].X = 1;
}
else //if (Terminal.Side == BoxOrientation.Left)
{
pt[0].Y = -1;
pt[1].X = 1.732f;
pt[2].Y = 1;
}
return pt;
}
public InputTerminal InputTerminal
{
get { return (InputTerminal)Terminal; }
}
protected override Terminal CreateTerminal(Type type, string name)
{
return new InputTerminal(InputConnectionBase.ConstructInputConnection(type, name));
}
}
}