Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

816 layouts for reflexion modeling #824

Merged
merged 116 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
42337c8
#816 Settings for incremental tree-map layout shown only if that layo…
koschke Jan 8, 2025
696331e
#816 Removed unused imports.
koschke Jan 8, 2025
db272d5
#816 The user can now select a separate node layout for the architect…
koschke Jan 8, 2025
1ce811c
#816 The user can now select a separate node layout for the architect…
koschke Jan 8, 2025
d5a1d65
#818 Layout for the architecture only.
koschke Jan 8, 2025
f1dec10
Improved documentation. Added more error diagnostics.
koschke Jan 11, 2025
8f1a60f
Updated to Unity version 6000.0.33f1.
koschke Jan 13, 2025
9347114
#816 Working on calculating two separate layouts. Work in progress.
koschke Jan 20, 2025
13c2ecb
Merge remote-tracking branch 'origin/master' into 816-layouts-for-ref…
koschke Jan 20, 2025
7b81714
Merge remote-tracking branch 'origin/master' into 816-layouts-for-ref…
koschke Jan 20, 2025
7248da6
Merge remote-tracking branch 'origin/master' into 816-layouts-for-ref…
koschke Jan 28, 2025
611fdb1
#816 Re-Draw button only shown when graph is drawn.
koschke Jan 28, 2025
40971f3
#816 More informative exception.
koschke Jan 28, 2025
6991bf3
#816 We will now wait less for a dashboard response.
koschke Jan 28, 2025
464f675
#816 Calculating the areas for implmentation and architecture works.
koschke Jan 29, 2025
d85fcd6
#816 Renamed parameters. Added documentation.
koschke Jan 29, 2025
217201b
#816 Improved documentation. Renamed parameter.
koschke Jan 29, 2025
e97c75d
#816 Improved documentation. Removed documentation of removed paramter.
koschke Jan 29, 2025
5896bbd
#816 Removed unused import.
koschke Jan 31, 2025
4b6f477
#816 Removed unused import.
koschke Jan 31, 2025
cfc4a3b
#816 Improved documentation.
koschke Jan 31, 2025
f60f7df
#816 Removed Cose Layout.
koschke Feb 1, 2025
f03704f
#816 Changed API of node layouts: rectangle parameter added.
koschke Feb 1, 2025
2e15dba
#816 Removed CoseGraphSettings. Added new table CloneCity. Moved Dyna…
koschke Feb 1, 2025
730aeb8
#816 Settings for Network Linux subsystem (clone information).
koschke Feb 1, 2025
4f7afed
#816 Removed AddCloneEdges(). Was introduced only for a VISSOFT publi…
koschke Feb 2, 2025
c5433c7
#816 Simplified new.
koschke Feb 2, 2025
2c778ff
#816 Documentation makes clear position and scale are worldspace.
koschke Feb 2, 2025
3e70593
#816 Simplified new.
koschke Feb 2, 2025
6220eb2
#816 Added Print() for debugging.
koschke Feb 2, 2025
c1eab15
#816 Fixed wrong calulation of "ratio closest to 1".
koschke Feb 2, 2025
c304ee1
#816 expanders has now the absolute difference of the aspect ratio fr…
koschke Feb 2, 2025
58db5d5
#816 Fixed comment.
koschke Feb 2, 2025
7b09755
#816 ScaleBy renamed to ScaleXZBy. ScaleXZBy scales only X/Z co-ordin…
koschke Feb 2, 2025
d2c94f0
#816 Scale renamed to ScaleXY. Scales only width and depth. Adjusted …
koschke Feb 3, 2025
bb45de0
#816 Configuration and graph for the Wettel test example.
koschke Feb 3, 2025
02fa2de
#816 A test example that has more deeply nested components.
koschke Feb 3, 2025
ecc62b3
#816 Simplified new.
koschke Feb 3, 2025
ed92561
#816 Still tinkering. It's more difficult than expected. We need a Re…
koschke Feb 3, 2025
012deb5
Merge branch '816-layouts-for-reflexion-modeling' of github.com:uni-b…
koschke Feb 3, 2025
34a8a01
#816 Math is directly visible due to using System.
koschke Feb 3, 2025
279c189
#816 Fixed height of inner nodes. Must be the input size, not groundL…
koschke Feb 3, 2025
d25adbc
#816 Removed unnecessary this.
koschke Feb 3, 2025
115fabd
#816 Pulled up Padding().
koschke Feb 3, 2025
ade5e39
#816 Removed unnecessary this. Improved documentation.
koschke Feb 3, 2025
7af17c1
#816 Removed actual parameter for padding.
koschke Feb 3, 2025
c26ef5d
#816 Padding has become a constant.
koschke Feb 3, 2025
bfe213f
#816 Added FIXME marker. Use AbsoluteScale instead of LocalScale cons…
koschke Feb 3, 2025
6d1da72
#816 Added ReversePadding() which allows us to remove the padding again.
koschke Feb 3, 2025
1ac58bd
#816 Padding is now no longer absolute but computed by NodeLayout.Pad…
koschke Feb 3, 2025
19cf6cf
#816 Removed unused method. Declared LevelLift as obsolete.
koschke Feb 3, 2025
f070481
#816 No lifting needed. Padding is removed only from leaves.
koschke Feb 3, 2025
1c56cd0
Merge remote-tracking branch 'origin/master' into 816-layouts-for-ref…
koschke Feb 3, 2025
b0a0a09
#816 Renamed file.
koschke Feb 4, 2025
aa1b076
#816 Removed dangling assembly reference.
koschke Feb 4, 2025
ac75576
#816 Removed obsolete LevelLift(). We have Stack().
koschke Feb 4, 2025
fa2599e
#816 Simplified new.
koschke Feb 4, 2025
691f6c8
#816 Removed unnecessary indirection.
koschke Feb 4, 2025
25d6d18
#816 Removed Manhattan. We will offer only hierarchical layouts from …
koschke Feb 4, 2025
8ecfb27
#818 Simplified new().
koschke Feb 4, 2025
18a8aa2
#816 Parent of IHierarchyNode can be set.
koschke Feb 5, 2025
f0a0f41
#816 Root must have a layout, too.
koschke Feb 5, 2025
ec1f9b9
#816 Re-ordered declarations. Introduced Modifiers region.
koschke Feb 5, 2025
f41a80d
#816 Reverted addition of assignable ILayoutNode.Parent.
koschke Feb 5, 2025
fba235f
#816 Apply, MoveTo, and Stack work on the NodeTransforms (not yet wor…
koschke Feb 5, 2025
9021e77
#816 Removed blank line.
koschke Feb 5, 2025
04af676
#816 Removed unnecessary this.
koschke Feb 7, 2025
20b303d
#814 Restructured layout methods.
koschke Feb 7, 2025
a0ed5a2
#816 Different values for Height.
koschke Feb 7, 2025
5235fc0
#716 Better colors for nodes.
koschke Feb 7, 2025
ad6ca0f
#816 Alternative configurations to test layouts.
koschke Feb 7, 2025
bb69e3c
#816 NodeLayout.Layout will move, scale, and stack the nodes to their…
koschke Feb 7, 2025
92a84e1
#816 GraphReader will report progress.
koschke Feb 7, 2025
ff35f27
#816 Fixed condition. Should have used negation.
koschke Feb 8, 2025
116799e
#816 Removed duplicated method.
koschke Feb 8, 2025
589fbf6
#816 Renamed NodeLayout.Layout to GetLayout. Added parameter centerPo…
koschke Feb 8, 2025
9765c79
#816 NodeLayout.Layout was renamed to GetLayout.
koschke Feb 10, 2025
b5e9d60
#816 Removed IGraphNode.Successors. This method was not used anywhere…
koschke Feb 10, 2025
88319d5
#816 Moved IGraphNode.HasType to IGameNode.
koschke Feb 10, 2025
94e9513
#816 Removed. Had no purpose anymore.
koschke Feb 10, 2025
d63a422
#816 Moved GraphRenderer.ToAbstractLayoutNodes() to EvolutionRenderer.
koschke Feb 10, 2025
e1d7675
#816 Moved HasType to IGameNode region.
koschke Feb 10, 2025
069d602
#816 Simplified new(). Other very minor code edits.
koschke Feb 10, 2025
3ec3a93
#816 Removed unused import.
koschke Feb 10, 2025
1df6779
#816 Restructured inheritance hierarchy of ILayoutNode.
koschke Feb 10, 2025
9e54732
#816 Removed unused import.
koschke Feb 10, 2025
8827bb4
#816 Fixed implementation of ID.
koschke Feb 11, 2025
4ca82c6
#816 Renamed NodeLayout.GetLayout to Create.
koschke Feb 11, 2025
c0b87ad
#816 Fixed indentation.
koschke Feb 11, 2025
fbd3b03
#816 Added IHiearchyNode.RemoveChild so that we can modify the hierarchy
koschke Feb 11, 2025
615bd76
#816 Fixed x co-ordindate of root NodeTransform. Must be x. Was y.
koschke Feb 11, 2025
36373ac
#816 Merged IGameNode.AbsoluteScale and LocalScale into one.
koschke Feb 11, 2025
6c99112
#816 Fixed actual parameter to rchitectureLayout.Create.
koschke Feb 11, 2025
40a3513
#816 Removed unused method.
koschke Feb 11, 2025
6ad2424
#816 The settings for a reflexion layout are now passed to the layout.
koschke Feb 12, 2025
3f7e58c
Added suggestion by bot.
koschke Feb 12, 2025
f0eb857
Added suggestion by bot.
koschke Feb 12, 2025
f572688
#816 Added an issue for the FIXME.
koschke Feb 12, 2025
9ac27c0
#816 Added documentation.
koschke Feb 12, 2025
329b090
#816 Added documentation.
koschke Feb 12, 2025
fca98c2
#816 Added documentation for type parameter.
koschke Feb 12, 2025
0f6df6f
#816 Added documentation.
koschke Feb 12, 2025
cb3b42a
#816 Removed unused parameter groundLevel.
koschke Feb 18, 2025
90337cb
#816 Fixed minor issues mentioned in the code review.
koschke Feb 18, 2025
14f7eab
#816 Fixed issues noted in the code review.
koschke Feb 18, 2025
7c9e137
Merge branch 'master' into 816-layouts-for-reflexion-modeling
koschke Feb 18, 2025
f5a4136
#816 Removed parameter doNotAddUniqueRoot.
koschke Feb 18, 2025
c15daf8
#816 Reverted comment style. The <paramref name="layoutNodes"/> will …
koschke Feb 18, 2025
986c89f
#816 Reflexion Layout is used.
koschke Feb 20, 2025
85d4f54
#816 Fixed typo.
koschke Feb 20, 2025
9d26d2c
#816 A unique root should not be added.
koschke Feb 20, 2025
a57e894
#816 Reflexion Layout is used for ReflexionCity.
koschke Feb 20, 2025
446c14f
#816 Re-introduced parameter doNotAddUniqueRoot.
koschke Feb 20, 2025
62b71a9
#816 Improved documentation.
koschke Feb 20, 2025
e1502de
#816 Better names for initially generated architecture and implementa…
koschke Feb 20, 2025
6feeb01
Merge branch '816-layouts-for-reflexion-modeling' of github.com:uni-b…
koschke Feb 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Assets/SEE/Controls/Actions/ContextMenuAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,16 @@ IEnumerable<PopupMenuEntry> options
_ => throw new ArgumentOutOfRangeException()
});

// We want to empower the user to load the implementation and architecture, separately.
// This method loads only the implementation.
void LoadImplementation()
{
LoadReflexionDataProperty dialog = new();
dialog.Open();
WaitForInputAsync(dialog).Forget();
}

// This method loads only the architecture.
void LoadArchitecture()
{
LoadReflexionDataProperty dialog = new();
Expand All @@ -366,17 +369,17 @@ async UniTask WaitForInputAsync(LoadReflexionDataProperty dialog)
{
await UniTask.WaitWhile(dialog.WaitForInputOrCancel);
SEEReflexionCity city = graphElement.GameObject().ContainingCity<SEEReflexionCity>();
if (dialog.TryGetImplementationDataPaths(out DataPath implGXL, out DataPath projectFolder))
if (dialog.TryGetImplementationDataPaths(out DataPath implDataPath, out DataPath projectFolder))
{
city.LoadAndDrawSubgraphAsync(implGXL, projectFolder).Forget();
new LoadPartOfReflexionCityNetAction(city.transform.parent.name, false, implGXL, projectFolder).Execute();
city.LoadAndDrawSubgraphAsync(implDataPath, projectFolder).Forget();
new LoadPartOfReflexionCityNetAction(city.transform.parent.name, false, implDataPath, projectFolder).Execute();

}

if (dialog.TryGetArchitectureDataPath(out DataPath archGXL))
if (dialog.TryGetArchitectureDataPath(out DataPath archDataPath))
{
city.LoadAndDrawSubgraphAsync(archGXL).Forget();
new LoadPartOfReflexionCityNetAction(city.transform.parent.name, true, archGXL).Execute();
city.LoadAndDrawSubgraphAsync(archDataPath).Forget();
new LoadPartOfReflexionCityNetAction(city.transform.parent.name, true, archDataPath).Execute();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/SEE/Controls/Actions/ShuffleAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private void Update()
// The node operator that is going to be used to move the city-root node
nodeOperator = cityRootNode.gameObject.NodeOperator();

// Where exactly have we hit the plane containing cideRootNode (if at all)?
// Where exactly have we hit the plane containing cityRootNode (if at all)?
if (Raycasting.RaycastPlane(new UnityEngine.Plane(Vector3.up, cityRootNode.position), out Vector3 cityPlaneHitPoint))
{
gizmo.gameObject.SetActive(true);
Expand Down
13 changes: 12 additions & 1 deletion Assets/SEE/DataModel/DG/IO/GXLParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,11 @@ private void EnsureExpectedEndTag()
/// </summary>
/// <param name="gxl">Stream containing GXL data that shall be processed</param>
/// <param name="name">Name of the GXL data stream. Only used for display purposes in log messages</param>
/// <param name="changePercentage">to report progress</param>
/// <param name="token">token with which the loading can be cancelled</param>
public virtual async UniTask LoadAsync(Stream gxl, string name, CancellationToken token = default)
public virtual async UniTask LoadAsync(Stream gxl, string name,
Action<float> changePercentage = null,
CancellationToken token = default)
{
Name = name;

Expand All @@ -194,6 +197,8 @@ public virtual async UniTask LoadAsync(Stream gxl, string name, CancellationToke
// Defined only at the EndElement, e.g. </string> here.
string lastText = string.Empty;

bool firstEdgeRead = false;

try
{
await UniTask.SwitchToThreadPool();
Expand Down Expand Up @@ -237,6 +242,11 @@ public virtual async UniTask LoadAsync(Stream gxl, string name, CancellationToke
StartNode();
break;
case State.InEdge:
if (!firstEdgeRead)
{
firstEdgeRead = true;
changePercentage?.Invoke(0.5f);
}
StartEdge();
break;
case State.InType:
Expand Down Expand Up @@ -402,6 +412,7 @@ public virtual async UniTask LoadAsync(Stream gxl, string name, CancellationToke
{
Reader.Close();
await UniTask.SwitchToMainThread();
changePercentage?.Invoke(1.0f);
}

if (Context.Count > 0)
Expand Down
14 changes: 10 additions & 4 deletions Assets/SEE/DataModel/DG/IO/GraphReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ public GraphReader(HashSet<string> hierarchicalEdgeTypes, string basePath, strin
/// <param name="path">path of the GXL data</param>
/// <param name="hierarchicalEdgeTypes">edge types forming the node hierarchy</param>
/// <param name="basePath">the base path of the graph</param>
/// <param name="changePercentage">to report progress</param>
/// <param name="token">token with which the loading can be cancelled</param>
/// <param name="logger">logger to log the output</param>
/// <returns>loaded graph</returns>
public static async UniTask<Graph> LoadAsync(DataPath path, HashSet<string> hierarchicalEdgeTypes, string basePath, CancellationToken token = default, Utils.ILogger logger = null)
public static async UniTask<Graph> LoadAsync(DataPath path, HashSet<string> hierarchicalEdgeTypes, string basePath,
Action<float> changePercentage = null, CancellationToken token = default,
Utils.ILogger logger = null)
{
GraphReader graphReader = new(hierarchicalEdgeTypes, basePath, logger: logger);
await graphReader.LoadAsync(await path.LoadAsync(), path.Path, token);
await graphReader.LoadAsync(await path.LoadAsync(), path.Path, changePercentage, token);
return graphReader.GetGraph();
}

Expand All @@ -75,10 +78,13 @@ public static async UniTask<Graph> LoadAsync(DataPath path, HashSet<string> hier
/// </summary>
/// <param name="gxl">Stream containing GXL data that shall be processed</param>
/// <param name="name">Name of the GXL data stream. Only used for display purposes in log messages</param>
/// <param name="changePercentage">to report progress</param>
/// <param name="token">token with which the loading can be cancelled</param>
public override async UniTask LoadAsync(Stream gxl, string name = "[unknown]", CancellationToken token = default)
public override async UniTask LoadAsync(Stream gxl, string name = "[unknown]",
Action<float> changePercentage = null,
CancellationToken token = default)
{
await base.LoadAsync(gxl, name, token);
await base.LoadAsync(gxl, name, changePercentage, token);
graph.BasePath = basePath;
if (!string.IsNullOrWhiteSpace(rootName))
{
Expand Down
1 change: 0 additions & 1 deletion Assets/SEE/DataModel/DG/Node.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using SEE.Tools.ReflexionAnalysis;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace SEE.DataModel.DG
Expand Down
52 changes: 0 additions & 52 deletions Assets/SEE/Game/City/AbstractSEECity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Sirenix.Serialization;
using SEE.DataModel.DG;
using SEE.GO;
using SEE.Layout.NodeLayouts.Cose;
using SEE.Utils;
using Sirenix.OdinInspector;
using UnityEngine;
Expand Down Expand Up @@ -264,13 +263,6 @@ public ColorRange GetColorForMetric(string metricName)
[Tooltip("Settings for the selection of edges."), TabGroup(EdgeFoldoutGroup), RuntimeTab(EdgeFoldoutGroup)]
public EdgeSelectionAttributes EdgeSelectionSettings = new();

/// <summary>
/// The cose graph settings.
/// </summary>
[HideInInspector]
[Obsolete]
public CoseGraphAttributes CoseGraphSettings = new(); // FIXME put into CitySettings.cs

/// <summary>
/// The metrics for the visualization of erosions.
/// </summary>
Expand Down Expand Up @@ -697,50 +689,6 @@ protected static void DumpNodeMetrics(ICollection<Graph> graphs)
}
}

/// <summary>
/// Saves all data needed for the listing of the dirs in gui in cosegraphSettings
/// </summary>
/// <param name="graph"></param>
[Obsolete]
public void SetupCompoundSpringEmbedder(Graph graph)
{
if (NodeLayoutSettings.Kind == NodeLayoutKind.CompoundSpringEmbedder)
{
Dictionary<string, bool> dirs = CoseGraphSettings.ListInnerNodeToggle;
// the new directories
Dictionary<string, bool> dirsLocal = new();

Dictionary<string, NodeLayoutKind> dirsLayout = new();
Dictionary<string, NodeShapes> dirsShape = new();

foreach (Node node in graph.Nodes())
{
if (!node.IsLeaf())
{
dirsShape.Add(node.ID, NodeTypes[node.Type].Shape);
dirsLocal.Add(node.ID, false);
dirsLayout.Add(node.ID, NodeLayoutSettings.Kind);
}
}

// if the key isn't in the old dictionaries
//dirsLocal = dirsLocal.Where(i => !dirs.ContainsKey(i.Key)).ToDictionary(i => i.Key, i => i.Value);

bool diff1 = dirs.Keys.Except(dirsLocal.Keys).Any();
bool diff2 = dirsLocal.Keys.Except(dirs.Keys).Any();

if (dirs.Count != dirsLocal.Count || diff1 || diff2)
{
CoseGraphSettings.InnerNodeShape = dirsShape;
CoseGraphSettings.InnerNodeLayout = dirsLayout;
CoseGraphSettings.ListInnerNodeToggle = dirsLocal;
}

CoseGraphSettings.LoadedForNodeTypes = NodeTypes.Where(type => type.Value.IsRelevant)
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.IsRelevant);
}
}

/// <summary>
/// Adds the initial root node type to the <see cref="NodeTypes"/>.
/// By default it is assigned the royal blue color and <see cref="ShowNames"/> is false.
Expand Down
Loading
Loading