-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added reroute nodes (no special view for them yet)
- Loading branch information
Showing
7 changed files
with
147 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using NetPrints.Core; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
|
||
namespace NetPrints.Graph | ||
{ | ||
/// <summary> | ||
/// Node representing a reroute node. Does nothing by itself. | ||
/// Used for layouting in the editor. | ||
/// </summary> | ||
[DataContract] | ||
public class RerouteNode : Node | ||
{ | ||
public int ExecRerouteCount { get => InputExecPins.Count; } | ||
public int DataRerouteCount { get => InputDataPins.Count; } | ||
|
||
public RerouteNode(Method method, int numExecs, IEnumerable<Tuple<BaseType, BaseType>> dataTypes) | ||
: base(method) | ||
{ | ||
for (int i = 0; i < numExecs; i++) | ||
{ | ||
AddInputExecPin($"Exec{i}"); | ||
AddOutputExecPin($"Exec{i}"); | ||
} | ||
|
||
if (dataTypes != null) | ||
{ | ||
int index = 0; | ||
foreach (var dataType in dataTypes) | ||
{ | ||
AddInputDataPin($"Data{index}", dataType.Item1); | ||
AddOutputDataPin($"Data{index}", dataType.Item2); | ||
} | ||
} | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return "Reroute"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters