diff --git a/Assets/SEE/Utils/BoundsVisualizer.cs b/Assets/Editor/BoundsVisualizer.cs
similarity index 91%
rename from Assets/SEE/Utils/BoundsVisualizer.cs
rename to Assets/Editor/BoundsVisualizer.cs
index ad2de8af99..fb174e2980 100644
--- a/Assets/SEE/Utils/BoundsVisualizer.cs
+++ b/Assets/Editor/BoundsVisualizer.cs
@@ -1,7 +1,10 @@
-using SEE.GO;
+#if UNITY_EDITOR
+
+using SEE.Extensions;
+using SEE.Utils;
using UnityEngine;
-namespace SEE.Utils
+namespace SEEEditor
{
///
/// Draws and updates a visual bounding box for debugging.
@@ -9,6 +12,8 @@ namespace SEE.Utils
/// Enables Gizmos in the Unity Editor to see the bounding box.
///
///
+ /// Intended to be added to the game object whose bounding box
+ /// is to be visualized.
[ExecuteAlways]
public class BoundsVisualizer : MonoBehaviour
{
@@ -75,9 +80,9 @@ void OnDrawGizmos()
return;
}
- Gizmos.color = BoundsColor;
- Gizmos.matrix = matrix;
- Gizmos.DrawWireCube(center.Value, size.Value);
+ UnityEngine.Gizmos.color = BoundsColor;
+ UnityEngine.Gizmos.matrix = matrix;
+ UnityEngine.Gizmos.DrawWireCube(center.Value, size.Value);
}
///
@@ -113,3 +118,5 @@ public enum BoundsType
}
}
}
+
+#endif
\ No newline at end of file
diff --git a/Assets/SEE/Utils/BoundsVisualizer.cs.meta b/Assets/Editor/BoundsVisualizer.cs.meta
similarity index 100%
rename from Assets/SEE/Utils/BoundsVisualizer.cs.meta
rename to Assets/Editor/BoundsVisualizer.cs.meta
diff --git a/Assets/Editor/ClearMap.cs b/Assets/Editor/ClearMap.cs
index b62145b393..8efea734e9 100644
--- a/Assets/Editor/ClearMap.cs
+++ b/Assets/Editor/ClearMap.cs
@@ -1,6 +1,6 @@
#if UNITY_EDITOR
-using SEE.Game;
+using SEE.GraphElementRefs;
using UnityEditor;
namespace SEEEditor
diff --git a/Assets/Editor/DumpMap.cs b/Assets/Editor/DumpMap.cs
index 5e618f7787..0e0869a37b 100644
--- a/Assets/Editor/DumpMap.cs
+++ b/Assets/Editor/DumpMap.cs
@@ -1,6 +1,6 @@
#if UNITY_EDITOR
-using SEE.Game;
+using SEE.GraphElementRefs;
using UnityEditor;
namespace SEEEditor
diff --git a/Assets/Editor/EdgeRefEditor.cs b/Assets/Editor/EdgeRefEditor.cs
index 624e954a3e..147f7c0813 100644
--- a/Assets/Editor/EdgeRefEditor.cs
+++ b/Assets/Editor/EdgeRefEditor.cs
@@ -1,6 +1,6 @@
#if UNITY_EDITOR
-using SEE.GO;
+using SEE.GraphElementRefs;
using UnityEditor;
using UnityEngine;
diff --git a/Assets/Editor/GraphElementEditor.cs b/Assets/Editor/GraphElementEditor.cs
index 8e8dcd8f80..0b1366136d 100644
--- a/Assets/Editor/GraphElementEditor.cs
+++ b/Assets/Editor/GraphElementEditor.cs
@@ -1,7 +1,7 @@
#if UNITY_EDITOR
using SEE.DataModel.DG;
-using SEE.GO;
+using SEE.GraphElementRefs;
using UnityEditor;
using UnityEngine;
diff --git a/Assets/Editor/NodeRefEditor.cs b/Assets/Editor/NodeRefEditor.cs
index 8b629e08f0..5f77bff9bd 100644
--- a/Assets/Editor/NodeRefEditor.cs
+++ b/Assets/Editor/NodeRefEditor.cs
@@ -1,6 +1,6 @@
#if UNITY_EDITOR
-using SEE.GO;
+using SEE.GraphElementRefs;
using UnityEditor;
using UnityEngine;
diff --git a/Assets/Editor/PrepareCCForSEE.cs b/Assets/Editor/PrepareCCForSEE.cs
index a2e58d282f..24eed9e389 100644
--- a/Assets/Editor/PrepareCCForSEE.cs
+++ b/Assets/Editor/PrepareCCForSEE.cs
@@ -2,7 +2,7 @@
using CrazyMinnow.SALSA;
using RootMotion.FinalIK;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Net;
using SEE.Utils;
using SEE.Game.Avatars;
diff --git a/Assets/Editor/ShowNormalVectors.cs b/Assets/Editor/ShowNormalVectors.cs
index 260012479e..566a9d7d0f 100644
--- a/Assets/Editor/ShowNormalVectors.cs
+++ b/Assets/Editor/ShowNormalVectors.cs
@@ -1,6 +1,6 @@
#if UNITY_EDITOR
-using SEE.GO;
+using SEE.Extensions;
using UnityEditor;
using UnityEngine;
diff --git a/Assets/Editor/TextGUIAndPaperResizerEditor.cs b/Assets/Editor/TextGUIAndPaperResizerEditor.cs
deleted file mode 100644
index cc6900de4f..0000000000
--- a/Assets/Editor/TextGUIAndPaperResizerEditor.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-#if UNITY_EDITOR
-
-using SEE.GO;
-using UnityEditor;
-using UnityEngine;
-
-namespace SEEEditor
-{
- ///
- /// Custom editor for TextGUIAndPaperResizer.
- ///
- [CustomEditor(typeof(TextGUIAndPaperResizer))]
- public class TextGUIAndPaperResizerEditor : Editor
- {
- private TextGUIAndPaperResizer _sourceGuiAndPaperResizer;
-
- private SerializedProperty TheTextProp;
- private SerializedProperty TheMarginProp;
- private SerializedProperty TheScaleProp;
-
- private void OnEnable()
- {
- TheTextProp = serializedObject.FindProperty("text");
- TheMarginProp = serializedObject.FindProperty("Margin");
- TheScaleProp = serializedObject.FindProperty("FontScale");
- }
-
- public override void OnInspectorGUI()
- {
- serializedObject.Update();
- EditorGUI.BeginChangeCheck();
- EditorGUILayout.BeginVertical();
-
- EditorGUILayout.PrefixLabel(new GUIContent("Text", "left/right and top/bottom")); // label for text area
- TheTextProp.stringValue = EditorGUILayout.TextArea(TheTextProp.stringValue, GUILayout.MaxHeight(75));
- TheMarginProp.vector2Value = EditorGUILayout.Vector2Field(new GUIContent("Margin", "left/right and top/bottom"), TheMarginProp.vector2Value);
- TheScaleProp.floatValue = EditorGUILayout.FloatField(new GUIContent("Font Scale", "Scale of the font: \n1.00 = 89 chars per meter in a line,\n0.21 = 89 chars per line on a A4 paper"), TheScaleProp.floatValue);
-
- EditorGUILayout.EndVertical();
- if (EditorGUI.EndChangeCheck())
- {
- serializedObject.ApplyModifiedProperties();
- _sourceGuiAndPaperResizer = (TextGUIAndPaperResizer)target;
- _sourceGuiAndPaperResizer.OnGuiChangedHandler();
- }
-
- // Show default inspector property editor
- //DrawDefaultInspector ();
- }
- }
-}
-
-#endif
diff --git a/Assets/Editor/TextGUIAndPaperResizerEditor.cs.meta b/Assets/Editor/TextGUIAndPaperResizerEditor.cs.meta
deleted file mode 100644
index 486d9db481..0000000000
--- a/Assets/Editor/TextGUIAndPaperResizerEditor.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 6998e39421282e84ba7be067fff4a2ef
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Editor/UserSettingsBuildProcessor.cs b/Assets/Editor/UserSettingsBuildProcessor.cs
index b5324f18db..25751dc607 100644
--- a/Assets/Editor/UserSettingsBuildProcessor.cs
+++ b/Assets/Editor/UserSettingsBuildProcessor.cs
@@ -1,5 +1,5 @@
using System.IO;
-using SEE.User;
+using SEE.UserSettings;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
@@ -30,12 +30,12 @@ internal sealed class UserSettingsBuildProcessor : IPreprocessBuildWithReport
///
public void OnPreprocessBuild(BuildReport report)
{
- UserSettings userSettings = UserSettings.Instance;
+ UserSetting userSettings = UserSetting.Instance;
if (userSettings == null)
{
throw new BuildFailedException(
- $"Cannot regenerate user settings because no {nameof(UserSettings)} component exists in the currently loaded scene." +
+ $"Cannot regenerate user settings because no {nameof(UserSetting)} component exists in the currently loaded scene." +
"Open the SEEStart scene before creating a player build.");
}
diff --git a/Assets/Editor/WorldTransform.cs b/Assets/Editor/WorldTransform.cs
index 4fe1b856fc..e0b60805b3 100644
--- a/Assets/Editor/WorldTransform.cs
+++ b/Assets/Editor/WorldTransform.cs
@@ -1,6 +1,6 @@
#if UNITY_EDITOR
-using SEE.GO;
+using SEE.Extensions;
using UnityEditor;
using UnityEngine;
diff --git a/Assets/Plugins/ZFBrowser/Scripts/BrowserInput.cs b/Assets/Plugins/ZFBrowser/Scripts/BrowserInput.cs
index 63ae9c6225..e0aa71dce2 100644
--- a/Assets/Plugins/ZFBrowser/Scripts/BrowserInput.cs
+++ b/Assets/Plugins/ZFBrowser/Scripts/BrowserInput.cs
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:dc0644730d9a00ca8ede04cda7289d7b6ae13a14fe1ec8fc464c90421414bc63
-size 10918
+oid sha256:f8332f64aa2c24f73363edcd5cc54a3e15994ed47aa3ab1c881707ac7ea1503d
+size 10929
diff --git a/Assets/SEE/GameObjects.meta b/Assets/SEE/ActionHistory.meta
similarity index 77%
rename from Assets/SEE/GameObjects.meta
rename to Assets/SEE/ActionHistory.meta
index 51d423d864..4791bffa97 100644
--- a/Assets/SEE/GameObjects.meta
+++ b/Assets/SEE/ActionHistory.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 59dfebccc4563e043b00aa8e934b39db
+guid: f233c1da6d5c6d641bdea282278101a9
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Assets/SEE/Utils/History/ActionHistory.cs b/Assets/SEE/ActionHistory/ActionHistory.cs
similarity index 99%
rename from Assets/SEE/Utils/History/ActionHistory.cs
rename to Assets/SEE/ActionHistory/ActionHistory.cs
index ab26bd7f7b..5a5564f742 100644
--- a/Assets/SEE/Utils/History/ActionHistory.cs
+++ b/Assets/SEE/ActionHistory/ActionHistory.cs
@@ -1,10 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using SEE.Controls.ReversibleActions;
using SEE.Net.Actions;
using SEE.Tools.OpenTelemetry;
-namespace SEE.Utils.History
+namespace SEE.ReversibleActionHistory
{
///
/// Thrown in case an Undo is called although there is no action
diff --git a/Assets/SEE/Utils/History/ActionHistory.cs.meta b/Assets/SEE/ActionHistory/ActionHistory.cs.meta
similarity index 100%
rename from Assets/SEE/Utils/History/ActionHistory.cs.meta
rename to Assets/SEE/ActionHistory/ActionHistory.cs.meta
diff --git a/Assets/SEE/Controls/Actions/GlobalActionHistory.cs b/Assets/SEE/ActionHistory/GlobalActionHistory.cs
similarity index 96%
rename from Assets/SEE/Controls/Actions/GlobalActionHistory.cs
rename to Assets/SEE/ActionHistory/GlobalActionHistory.cs
index 8cb03acf62..fbd3885fc0 100644
--- a/Assets/SEE/Controls/Actions/GlobalActionHistory.cs
+++ b/Assets/SEE/ActionHistory/GlobalActionHistory.cs
@@ -1,7 +1,7 @@
-using SEE.Utils.History;
-using static SEE.Utils.History.ActionHistory;
+using SEE.Controls.ReversibleActions;
+using static SEE.ReversibleActionHistory.ActionHistory;
-namespace SEE.Controls.Actions
+namespace SEE.ReversibleActionHistory
{
///
/// This class manages the history of actions triggered by the player and that
diff --git a/Assets/SEE/Controls/Actions/GlobalActionHistory.cs.meta b/Assets/SEE/ActionHistory/GlobalActionHistory.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/GlobalActionHistory.cs.meta
rename to Assets/SEE/ActionHistory/GlobalActionHistory.cs.meta
diff --git a/Assets/SEE/Audio/Audio.cs b/Assets/SEE/Audio/Audio.cs
new file mode 100644
index 0000000000..0554ec72cd
--- /dev/null
+++ b/Assets/SEE/Audio/Audio.cs
@@ -0,0 +1,6 @@
+///
+/// Plays sounds for events during the game (e.g., hovering a game node).
+///
+namespace SEE.Audio
+{
+}
diff --git a/Assets/SEE/Audio/Audio.cs.meta b/Assets/SEE/Audio/Audio.cs.meta
new file mode 100644
index 0000000000..83c5f6d285
--- /dev/null
+++ b/Assets/SEE/Audio/Audio.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 1ec3249938db2c2479fb5d1488a32167
\ No newline at end of file
diff --git a/Assets/SEE/Audio/AudioGameObject.cs b/Assets/SEE/Audio/AudioGameObject.cs
index d0b1730841..417c99f8f7 100644
--- a/Assets/SEE/Audio/AudioGameObject.cs
+++ b/Assets/SEE/Audio/AudioGameObject.cs
@@ -1,4 +1,4 @@
-using SEE.GO;
+using SEE.Extensions;
using System.Collections.Generic;
using SEE.Utils;
using UnityEngine;
@@ -6,8 +6,7 @@
namespace SEE.Audio
{
///
- /// An Object that contains a SEE game object
- /// and an audio queue and makes the sounds originate
+ /// An object that contains a SEE game object and an audio queue and makes the sounds originate
/// from the game object in 3D space.
///
public class AudioGameObject
diff --git a/Assets/SEE/Audio/AudioManagerImpl.cs b/Assets/SEE/Audio/AudioManagerImpl.cs
index 75461f4971..570ef4e611 100644
--- a/Assets/SEE/Audio/AudioManagerImpl.cs
+++ b/Assets/SEE/Audio/AudioManagerImpl.cs
@@ -1,5 +1,5 @@
+using SEE.UserSettings;
using SEE.Net.Actions.GraphElement;
-using SEE.User;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
@@ -10,7 +10,7 @@
namespace SEE.Audio
{
///
- /// Implements the IAudioManager interface.
+ /// Implements the interface.
///
public class AudioManagerImpl : MonoBehaviour, IAudioManager
{
@@ -277,10 +277,10 @@ private void TriggerVolumeChanges()
///
public float MusicVolume
{
- get => UserSettings.Instance.Audio.MusicVolume;
+ get => UserSetting.Instance.Audio.MusicVolume;
set
{
- UserSettings.Instance.Audio.MusicVolume = Mathf.Clamp(value, 0f, 1f);
+ UserSetting.Instance.Audio.MusicVolume = Mathf.Clamp(value, 0f, 1f);
TriggerVolumeChanges();
}
}
@@ -288,10 +288,10 @@ public float MusicVolume
///
public float SoundEffectsVolume
{
- get => UserSettings.Instance.Audio.SoundEffectsVolume;
+ get => UserSetting.Instance.Audio.SoundEffectsVolume;
set
{
- UserSettings.Instance.Audio.SoundEffectsVolume = Mathf.Clamp(value, 0f, 1f);
+ UserSetting.Instance.Audio.SoundEffectsVolume = Mathf.Clamp(value, 0f, 1f);
TriggerVolumeChanges();
}
}
@@ -299,10 +299,10 @@ public float SoundEffectsVolume
///
public bool MusicMuted
{
- get => UserSettings.Instance.Audio.MusicMuted;
+ get => UserSetting.Instance.Audio.MusicMuted;
set
{
- UserSettings.Instance.Audio.MusicMuted = value;
+ UserSetting.Instance.Audio.MusicMuted = value;
TriggerVolumeChanges();
PauseMusic();
}
@@ -311,10 +311,10 @@ public bool MusicMuted
///
public bool SoundEffectsMuted
{
- get => UserSettings.Instance.Audio.SoundEffectsMuted;
+ get => UserSetting.Instance.Audio.SoundEffectsMuted;
set
{
- UserSettings.Instance.Audio.SoundEffectsMuted = value;
+ UserSetting.Instance.Audio.SoundEffectsMuted = value;
TriggerVolumeChanges();
}
}
@@ -322,10 +322,10 @@ public bool SoundEffectsMuted
///
public bool RemoteSoundEffectsMuted
{
- get => UserSettings.Instance.Audio.RemoteSoundEffectsMuted;
+ get => UserSetting.Instance.Audio.RemoteSoundEffectsMuted;
set
{
- UserSettings.Instance.Audio.RemoteSoundEffectsMuted = value;
+ UserSetting.Instance.Audio.RemoteSoundEffectsMuted = value;
TriggerVolumeChanges();
}
}
@@ -438,7 +438,7 @@ private void QueueSoundEffect(SoundEffect soundEffect, GameObject sourceObject,
AudioGameObject controlObject = soundEffectGameObjects.FirstOrDefault(x => x.AttachedObject == sourceObject);
if (controlObject == null)
{
- controlObject = new AudioGameObject(sourceObject, SoundEffectsVolume, UserSettings.Instance.Audio.SoundEffectsMuted);
+ controlObject = new AudioGameObject(sourceObject, SoundEffectsVolume, UserSetting.Instance.Audio.SoundEffectsMuted);
soundEffectGameObjects.Add(controlObject);
}
controlObject.EnqueueSoundEffect(GetAudioClipFromSoundEffectName(soundEffect));
diff --git a/Assets/SEE/CameraPaths/CameraPath.cs b/Assets/SEE/CameraPaths/CameraPath.cs
index 34ba9a5138..1736c6e164 100644
--- a/Assets/SEE/CameraPaths/CameraPath.cs
+++ b/Assets/SEE/CameraPaths/CameraPath.cs
@@ -1,5 +1,5 @@
using SEE.Game;
-using SEE.GO.Factories;
+using SEE.Factories;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
diff --git a/Assets/SEE/CameraPaths/CameraRecorder.cs b/Assets/SEE/CameraPaths/CameraRecorder.cs
index 160d4779bb..83942996a8 100644
--- a/Assets/SEE/CameraPaths/CameraRecorder.cs
+++ b/Assets/SEE/CameraPaths/CameraRecorder.cs
@@ -1,4 +1,4 @@
-using SEE.Controls;
+using SEE.Controls.KeyActions;
using SEE.Utils;
using System.Collections.Generic;
using System.IO;
diff --git a/Assets/SEE/CameraPaths/PathReplay.cs b/Assets/SEE/CameraPaths/PathReplay.cs
index fe92bbd7d7..aa56c2507b 100644
--- a/Assets/SEE/CameraPaths/PathReplay.cs
+++ b/Assets/SEE/CameraPaths/PathReplay.cs
@@ -1,4 +1,4 @@
-using SEE.Controls;
+using SEE.Controls.KeyActions;
using SEE.Utils;
using System;
using System.Collections.Generic;
diff --git a/Assets/SEE/GameObjects/Menu.meta b/Assets/SEE/Cities.meta
similarity index 77%
rename from Assets/SEE/GameObjects/Menu.meta
rename to Assets/SEE/Cities.meta
index e12d726b20..fcd7da2889 100644
--- a/Assets/SEE/GameObjects/Menu.meta
+++ b/Assets/SEE/Cities.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 1521264504027d04c88bdec42ea65e3b
+guid: ee13fa859a230314eba4eaebc2758601
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Assets/SEE/Cities/Cities.cs b/Assets/SEE/Cities/Cities.cs
new file mode 100644
index 0000000000..7bc28887ad
--- /dev/null
+++ b/Assets/SEE/Cities/Cities.cs
@@ -0,0 +1,13 @@
+///
+/// Consists of components related to code-city game objects.
+/// A code-city is a Unity GameObject holding an instance of a subclass of
+/// . It is the child of a table
+/// game object. Game nodes and game edges are placed underneath the code-city
+/// object as children. Generally, there is only one root game node and all
+/// other game nodes are transitive descendants of the root game node. The
+/// game edges are likewise children of the root game node, but they do not form
+/// a hierarchy.
+///
+namespace SEE.Cities
+{
+}
diff --git a/Assets/SEE/Cities/Cities.cs.meta b/Assets/SEE/Cities/Cities.cs.meta
new file mode 100644
index 0000000000..5bc2a16452
--- /dev/null
+++ b/Assets/SEE/Cities/Cities.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: f675b16db8d6b454cb6a8d5997539550
\ No newline at end of file
diff --git a/Assets/SEE/GameObjects/CitiesHolder.cs b/Assets/SEE/Cities/CitiesHolder.cs
similarity index 86%
rename from Assets/SEE/GameObjects/CitiesHolder.cs
rename to Assets/SEE/Cities/CitiesHolder.cs
index 62ab05f20c..9d5770a04a 100644
--- a/Assets/SEE/GameObjects/CitiesHolder.cs
+++ b/Assets/SEE/Cities/CitiesHolder.cs
@@ -2,12 +2,13 @@
using System.Collections.Generic;
using UnityEngine;
-namespace SEE.GameObjects
+namespace SEE.Cities
{
///
- /// This component provides a map that assigns each key (tableID) to the respective game object,
- /// on which an component can be attached.
+ /// This component provides a map that assigns each tableID (key) to the respective
+ /// code-city game object which an component can be attached to.
///
+ /// This component is part of the DesktopPlayer.prefab.
public class CitiesHolder : MonoBehaviour
{
///
@@ -32,7 +33,8 @@ public GameObject Find(string tableID)
try
{
return Cities[tableID];
- } catch (KeyNotFoundException)
+ }
+ catch (KeyNotFoundException)
{
return null;
}
diff --git a/Assets/SEE/GameObjects/CitiesHolder.cs.meta b/Assets/SEE/Cities/CitiesHolder.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/CitiesHolder.cs.meta
rename to Assets/SEE/Cities/CitiesHolder.cs.meta
diff --git a/Assets/SEE/GameObjects/CitySelectionManager.cs b/Assets/SEE/Cities/CitySelectionManager.cs
similarity index 92%
rename from Assets/SEE/GameObjects/CitySelectionManager.cs
rename to Assets/SEE/Cities/CitySelectionManager.cs
index 32ea2086e9..34c4f51e9a 100644
--- a/Assets/SEE/GameObjects/CitySelectionManager.cs
+++ b/Assets/SEE/Cities/CitySelectionManager.cs
@@ -1,19 +1,24 @@
using Cysharp.Threading.Tasks;
-using SEE.Controls;
using SEE.Game;
using SEE.Game.City;
-using SEE.GO;
+using SEE.Gizmos;
+using SEE.Extensions;
using SEE.Net.Actions.City;
using SEE.UI.Notification;
using SEE.UI.PropertyDialog.CitySelection;
using SEE.Utils;
using UnityEngine;
+using SEE.Controls.KeyActions;
-namespace SEE.GameObjects
+namespace SEE.Cities
{
///
/// Component for selecting a city to be added to the table.
///
+ /// This component will be attached to a code-city game object.
+ /// A code-city game object is a an instance
+ /// of a concrete subclass of is
+ /// attached to. It is part of the UniversalTable.prefab.
public class CitySelectionManager : MonoBehaviour
{
///
diff --git a/Assets/SEE/GameObjects/CitySelectionManager.cs.meta b/Assets/SEE/Cities/CitySelectionManager.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/CitySelectionManager.cs.meta
rename to Assets/SEE/Cities/CitySelectionManager.cs.meta
diff --git a/Assets/SEE/GameObjects/Plane.cs b/Assets/SEE/Cities/Plane.cs
similarity index 92%
rename from Assets/SEE/GameObjects/Plane.cs
rename to Assets/SEE/Cities/Plane.cs
index 2f5016aca9..ab3731f271 100644
--- a/Assets/SEE/GameObjects/Plane.cs
+++ b/Assets/SEE/Cities/Plane.cs
@@ -1,6 +1,6 @@
using UnityEngine;
-namespace SEE.GO
+namespace SEE.Cities
{
///
/// Represents a plane on which the city objects can be placed defined as
@@ -9,6 +9,10 @@ namespace SEE.GO
/// (MaxX, MaxZ) denotes the right back corner
/// YPosition denotes the y co-ordinate of the plane
///
+ ///
+ /// A is attached to a code-city game object holding
+ /// an instance of a concrete subclass of .
+ ///
public class Plane : MonoBehaviour
{
///
diff --git a/Assets/SEE/GameObjects/Plane.cs.meta b/Assets/SEE/Cities/Plane.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Plane.cs.meta
rename to Assets/SEE/Cities/Plane.cs.meta
diff --git a/Assets/SEE/Controls/Actions.meta b/Assets/SEE/Components.meta
similarity index 77%
rename from Assets/SEE/Controls/Actions.meta
rename to Assets/SEE/Components.meta
index 63215fd290..4f495b02f2 100644
--- a/Assets/SEE/Controls/Actions.meta
+++ b/Assets/SEE/Components.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 1cd782d49369bf94c820888abbdecfa4
+guid: ff359eefb6891a448bd5126f335cf9b4
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Assets/SEE/Components/Components.cs b/Assets/SEE/Components/Components.cs
new file mode 100644
index 0000000000..a001bd210f
--- /dev/null
+++ b/Assets/SEE/Components/Components.cs
@@ -0,0 +1,7 @@
+///
+/// Provides s to be attached
+/// to game nodes and game edges.
+///
+namespace SEE.Components
+{
+}
diff --git a/Assets/SEE/Components/Components.cs.meta b/Assets/SEE/Components/Components.cs.meta
new file mode 100644
index 0000000000..af1393dfa4
--- /dev/null
+++ b/Assets/SEE/Components/Components.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: ea578600d49477d468b576acb9191cc0
\ No newline at end of file
diff --git a/Assets/SEE/Components/GameEdges.meta b/Assets/SEE/Components/GameEdges.meta
new file mode 100644
index 0000000000..00b67cd2c6
--- /dev/null
+++ b/Assets/SEE/Components/GameEdges.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 69f65bb17b5bcf14abde152fe258b0b3
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Components/GameEdges/GameEdges.cs b/Assets/SEE/Components/GameEdges/GameEdges.cs
new file mode 100644
index 0000000000..4631659ed8
--- /dev/null
+++ b/Assets/SEE/Components/GameEdges/GameEdges.cs
@@ -0,0 +1,6 @@
+///
+/// Namespace for components to be attached to game edges.
+///
+namespace SEE.Components.GameEdges
+{
+}
diff --git a/Assets/SEE/Components/GameEdges/GameEdges.cs.meta b/Assets/SEE/Components/GameEdges/GameEdges.cs.meta
new file mode 100644
index 0000000000..b66cc66f94
--- /dev/null
+++ b/Assets/SEE/Components/GameEdges/GameEdges.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 1e861fbd095d9ea4ea6e587cdb64ee21
\ No newline at end of file
diff --git a/Assets/SEE/GameObjects/SEESpline.cs b/Assets/SEE/Components/GameEdges/SEESpline.cs
similarity index 99%
rename from Assets/SEE/GameObjects/SEESpline.cs
rename to Assets/SEE/Components/GameEdges/SEESpline.cs
index 4abe89a0ad..0c1894a638 100644
--- a/Assets/SEE/GameObjects/SEESpline.cs
+++ b/Assets/SEE/Components/GameEdges/SEESpline.cs
@@ -2,8 +2,9 @@
using SEE.Game;
using SEE.Game.City;
using SEE.Game.Operator;
-using SEE.GO.Factories;
+using SEE.Factories;
using SEE.Utils;
+using SEE.Extensions;
using Sirenix.OdinInspector;
using System;
using System.Collections.Generic;
@@ -11,7 +12,7 @@
using UnityEngine;
using Frame = TinySpline.Frame;
-namespace SEE.GO
+namespace SEE.Components.GameEdges
{
///
/// This class serves as a bridge between TinySpline's representation of
@@ -47,6 +48,8 @@ namespace SEE.GO
/// needs to be applied immediately, call after
/// setting one or more properties.
///
+ /// This component is expected to be attached to a game
+ /// object representing a graph edge, i.e., a game edge.
public class SEESpline : SerializedMonoBehaviour
{
///
diff --git a/Assets/SEE/GameObjects/SEESpline.cs.meta b/Assets/SEE/Components/GameEdges/SEESpline.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/SEESpline.cs.meta
rename to Assets/SEE/Components/GameEdges/SEESpline.cs.meta
diff --git a/Assets/SEE/Components/GameNodes.meta b/Assets/SEE/Components/GameNodes.meta
new file mode 100644
index 0000000000..6c761a89f7
--- /dev/null
+++ b/Assets/SEE/Components/GameNodes.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2a35d861aedb8f549a32964af8ddbe72
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/GameObjects/BranchCity.meta b/Assets/SEE/Components/GameNodes/BranchCity.meta
similarity index 100%
rename from Assets/SEE/GameObjects/BranchCity.meta
rename to Assets/SEE/Components/GameNodes/BranchCity.meta
diff --git a/Assets/SEE/GameObjects/BranchCity/AuthorEdge.cs b/Assets/SEE/Components/GameNodes/BranchCity/AuthorEdge.cs
similarity index 97%
rename from Assets/SEE/GameObjects/BranchCity/AuthorEdge.cs
rename to Assets/SEE/Components/GameNodes/BranchCity/AuthorEdge.cs
index 18a6941286..4980262c83 100644
--- a/Assets/SEE/GameObjects/BranchCity/AuthorEdge.cs
+++ b/Assets/SEE/Components/GameNodes/BranchCity/AuthorEdge.cs
@@ -1,10 +1,10 @@
using SEE.Game.City;
-using SEE.GO;
-using SEE.GO.Factories;
+using SEE.Extensions;
+using SEE.Factories;
using System;
using UnityEngine;
-namespace SEE.GameObjects.BranchCity
+namespace SEE.Components.GameNodes.BranchCity
{
///
/// Attribute of an author edge connecting an
@@ -12,7 +12,7 @@ namespace SEE.GameObjects.BranchCity
///
/// This component will be attached to connections between authors and their edited files.
[RequireComponent(typeof(LineRenderer))]
- public class AuthorEdge : VCSDecorator
+ public class AuthorEdge : VCS
{
///
/// Reference to the target node this edge connects to.
diff --git a/Assets/SEE/GameObjects/BranchCity/AuthorEdge.cs.meta b/Assets/SEE/Components/GameNodes/BranchCity/AuthorEdge.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/BranchCity/AuthorEdge.cs.meta
rename to Assets/SEE/Components/GameNodes/BranchCity/AuthorEdge.cs.meta
diff --git a/Assets/SEE/GameObjects/BranchCity/AuthorRef.cs b/Assets/SEE/Components/GameNodes/BranchCity/AuthorRef.cs
similarity index 97%
rename from Assets/SEE/GameObjects/BranchCity/AuthorRef.cs
rename to Assets/SEE/Components/GameNodes/BranchCity/AuthorRef.cs
index c2cda72205..fbccbc76f0 100644
--- a/Assets/SEE/GameObjects/BranchCity/AuthorRef.cs
+++ b/Assets/SEE/Components/GameNodes/BranchCity/AuthorRef.cs
@@ -1,16 +1,16 @@
using SEE.Game.Operator;
-using SEE.GO;
+using SEE.Extensions;
using Sirenix.Serialization;
using System.Collections;
using System.Collections.Generic;
-namespace SEE.GameObjects.BranchCity
+namespace SEE.Components.GameNodes.BranchCity
{
///
/// Holds the connections of a file to all its authors.
/// This component will be attached to all file game nodes in a .
///
- public class AuthorRef : VCSDecorator, IEnumerable
+ public class AuthorRef : VCS, IEnumerable
{
///
/// The edges to the authors of this specific file.
diff --git a/Assets/SEE/GameObjects/BranchCity/AuthorRef.cs.meta b/Assets/SEE/Components/GameNodes/BranchCity/AuthorRef.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/BranchCity/AuthorRef.cs.meta
rename to Assets/SEE/Components/GameNodes/BranchCity/AuthorRef.cs.meta
diff --git a/Assets/SEE/GameObjects/BranchCity/AuthorSphere.cs b/Assets/SEE/Components/GameNodes/BranchCity/AuthorSphere.cs
similarity index 97%
rename from Assets/SEE/GameObjects/BranchCity/AuthorSphere.cs
rename to Assets/SEE/Components/GameNodes/BranchCity/AuthorSphere.cs
index c4d61b3c4e..af588cd5f9 100644
--- a/Assets/SEE/GameObjects/BranchCity/AuthorSphere.cs
+++ b/Assets/SEE/Components/GameNodes/BranchCity/AuthorSphere.cs
@@ -1,19 +1,19 @@
-using SEE.Controls.Actions;
using SEE.Game;
-using SEE.GO;
-using SEE.GO.Factories;
+using SEE.Extensions;
+using SEE.Factories;
using SEE.GraphProviders.VCS;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
+using SEE.Components.Objects;
-namespace SEE.GameObjects.BranchCity
+namespace SEE.Components.GameNodes.BranchCity
{
///
/// Attributes of an author sphere.
///
/// This component will be attached to all author spheres.
- public class AuthorSphere : VCSDecorator
+ public class AuthorSphere : VCS
{
///
/// The identity of the author.
diff --git a/Assets/SEE/GameObjects/BranchCity/AuthorSphere.cs.meta b/Assets/SEE/Components/GameNodes/BranchCity/AuthorSphere.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/BranchCity/AuthorSphere.cs.meta
rename to Assets/SEE/Components/GameNodes/BranchCity/AuthorSphere.cs.meta
diff --git a/Assets/SEE/Components/GameNodes/BranchCity/BranchCity.cs b/Assets/SEE/Components/GameNodes/BranchCity/BranchCity.cs
new file mode 100644
index 0000000000..98f045c347
--- /dev/null
+++ b/Assets/SEE/Components/GameNodes/BranchCity/BranchCity.cs
@@ -0,0 +1,7 @@
+///
+/// Contains components for game nodes and edges used for cities
+/// representing VCS data.
+///
+namespace SEE.Components.GameNodes.BranchCity
+{
+}
diff --git a/Assets/SEE/Components/GameNodes/BranchCity/BranchCity.cs.meta b/Assets/SEE/Components/GameNodes/BranchCity/BranchCity.cs.meta
new file mode 100644
index 0000000000..1df4a9a533
--- /dev/null
+++ b/Assets/SEE/Components/GameNodes/BranchCity/BranchCity.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 138fa35540c9637499d0badd6b900988
\ No newline at end of file
diff --git a/Assets/SEE/GameObjects/BranchCity/VCSDecorator.cs b/Assets/SEE/Components/GameNodes/BranchCity/VCS.cs
similarity index 88%
rename from Assets/SEE/GameObjects/BranchCity/VCSDecorator.cs
rename to Assets/SEE/Components/GameNodes/BranchCity/VCS.cs
index c8009199e7..07dba214ea 100644
--- a/Assets/SEE/GameObjects/BranchCity/VCSDecorator.cs
+++ b/Assets/SEE/Components/GameNodes/BranchCity/VCS.cs
@@ -1,14 +1,14 @@
-using SEE.GO;
+using SEE.Extensions;
using Sirenix.OdinInspector;
-namespace SEE.GameObjects.BranchCity
+namespace SEE.Components.GameNodes.BranchCity
{
///
/// Abstract super class of game node and edge decorators in the
/// context of a . Provides
/// a cached access to the containing city.
///
- public abstract class VCSDecorator : SerializedMonoBehaviour
+ public abstract class VCS : SerializedMonoBehaviour
{
///
/// Backing field for .
diff --git a/Assets/SEE/Components/GameNodes/BranchCity/VCS.cs.meta b/Assets/SEE/Components/GameNodes/BranchCity/VCS.cs.meta
new file mode 100644
index 0000000000..37c61efd60
--- /dev/null
+++ b/Assets/SEE/Components/GameNodes/BranchCity/VCS.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 126a23176bff2d04c84d7a862a4fc798
\ No newline at end of file
diff --git a/Assets/SEE/Components/GameNodes/GameNodes.cs b/Assets/SEE/Components/GameNodes/GameNodes.cs
new file mode 100644
index 0000000000..f052e2afc9
--- /dev/null
+++ b/Assets/SEE/Components/GameNodes/GameNodes.cs
@@ -0,0 +1,6 @@
+///
+/// Namespace for components to be attached to game nodes.
+///
+namespace SEE.Components.GameNodes
+{
+}
diff --git a/Assets/SEE/Components/GameNodes/GameNodes.cs.meta b/Assets/SEE/Components/GameNodes/GameNodes.cs.meta
new file mode 100644
index 0000000000..0b38337ffd
--- /dev/null
+++ b/Assets/SEE/Components/GameNodes/GameNodes.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 8666dab8a5f4b7344aabbd38ba2f3d65
\ No newline at end of file
diff --git a/Assets/SEE/Components/GraphElements.meta b/Assets/SEE/Components/GraphElements.meta
new file mode 100644
index 0000000000..6e904a112a
--- /dev/null
+++ b/Assets/SEE/Components/GraphElements.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 632cec02e074d3e45bc520e9670b8102
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Components/GraphElements/GraphElements.cs b/Assets/SEE/Components/GraphElements/GraphElements.cs
new file mode 100644
index 0000000000..9ad2f43ee3
--- /dev/null
+++ b/Assets/SEE/Components/GraphElements/GraphElements.cs
@@ -0,0 +1,7 @@
+///
+/// Namespace for components to be attached to game nodes or edges.
+///
+
+namespace SEE.Components.GraphElements
+{
+}
diff --git a/Assets/SEE/Components/GraphElements/GraphElements.cs.meta b/Assets/SEE/Components/GraphElements/GraphElements.cs.meta
new file mode 100644
index 0000000000..9930933ba6
--- /dev/null
+++ b/Assets/SEE/Components/GraphElements/GraphElements.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: e32966a5dbccc9d45923202fa928e5f5
\ No newline at end of file
diff --git a/Assets/SEE/Controls/Interactables/Outline.cs b/Assets/SEE/Components/GraphElements/Outline.cs
similarity index 95%
rename from Assets/SEE/Controls/Interactables/Outline.cs
rename to Assets/SEE/Components/GraphElements/Outline.cs
index e24c187551..b0ac1b9074 100644
--- a/Assets/SEE/Controls/Interactables/Outline.cs
+++ b/Assets/SEE/Components/GraphElements/Outline.cs
@@ -11,12 +11,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using SEE.GO;
+using SEE.Extensions;
using UnityEngine;
using UnityEngine.Assertions;
-namespace SEE.Controls.Interactables
+namespace SEE.Components.GraphElements
{
+ ///
+ /// Draws an outline for a game node or edge.
+ ///
[DisallowMultipleComponent]
public class Outline : MonoBehaviour
{
@@ -103,6 +106,13 @@ private class ListVector3
///
public const float DefaultWidth = 1.0f;
+ ///
+ /// Adds an to the given .
+ ///
+ /// A game node or edge.
+ /// The color of the outline.
+ /// The width of the outline.
+ /// Resulting outline.
public static Outline Create(GameObject go, Color color, float outlineWidth = DefaultWidth)
{
Outline result = null;
@@ -286,7 +296,7 @@ private void LoadSmoothNormals()
// Retrieve or generate smooth normals
int index = bakeKeys.IndexOf(meshFilter.sharedMesh);
List smoothNormals =
- (index >= 0) ? bakeValues[index].Data : SmoothNormals(meshFilter.sharedMesh);
+ index >= 0 ? bakeValues[index].Data : SmoothNormals(meshFilter.sharedMesh);
// Store smooth normals in UV3
meshFilter.sharedMesh.SetUVs(3, smoothNormals);
diff --git a/Assets/SEE/Controls/Interactables/Outline.cs.meta b/Assets/SEE/Components/GraphElements/Outline.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Interactables/Outline.cs.meta
rename to Assets/SEE/Components/GraphElements/Outline.cs.meta
diff --git a/Assets/SEE/Components/Objects.meta b/Assets/SEE/Components/Objects.meta
new file mode 100644
index 0000000000..e44be0aeae
--- /dev/null
+++ b/Assets/SEE/Components/Objects.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 923617103c14d264099a59e8b103bbda
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/GameObjects/FaceCamera.cs b/Assets/SEE/Components/Objects/FaceCamera.cs
similarity index 97%
rename from Assets/SEE/GameObjects/FaceCamera.cs
rename to Assets/SEE/Components/Objects/FaceCamera.cs
index 636ae74c2a..50c8e86560 100644
--- a/Assets/SEE/GameObjects/FaceCamera.cs
+++ b/Assets/SEE/Components/Objects/FaceCamera.cs
@@ -3,12 +3,13 @@
using SEE.Utils;
using UnityEngine;
-namespace SEE.GO
+namespace SEE.Components.Objects
{
///
/// This script can be added to any game object to make it always face
/// the main camera. It supports locking of all three axes.
///
+ /// It is used in the Playername.prefab.
public class FaceCamera : MonoBehaviour
{
///
diff --git a/Assets/SEE/GameObjects/FaceCamera.cs.meta b/Assets/SEE/Components/Objects/FaceCamera.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/FaceCamera.cs.meta
rename to Assets/SEE/Components/Objects/FaceCamera.cs.meta
diff --git a/Assets/SEE/Components/Objects/Objects.cs b/Assets/SEE/Components/Objects/Objects.cs
new file mode 100644
index 0000000000..b96353c270
--- /dev/null
+++ b/Assets/SEE/Components/Objects/Objects.cs
@@ -0,0 +1,7 @@
+///
+/// Namespace for components to be attached any kind of game object,
+/// including game nodes and edges.
+///
+namespace SEE.Components.Objects
+{
+}
diff --git a/Assets/SEE/Components/Objects/Objects.cs.meta b/Assets/SEE/Components/Objects/Objects.cs.meta
new file mode 100644
index 0000000000..36d2c1cf86
--- /dev/null
+++ b/Assets/SEE/Components/Objects/Objects.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 8b3f3bfba7b856046b276ad8816b273b
\ No newline at end of file
diff --git a/Assets/SEE/Controls/Actions/HighlightErosion.cs.meta b/Assets/SEE/Controls/Actions/HighlightErosion.cs.meta
deleted file mode 100644
index c46c5ae22e..0000000000
--- a/Assets/SEE/Controls/Actions/HighlightErosion.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 33c1f00e7e614d51b2e84ca6b66438a1
-timeCreated: 1626044414
\ No newline at end of file
diff --git a/Assets/SEE/Controls/Actions/HighlightedInteractableObjectAction.cs.meta b/Assets/SEE/Controls/Actions/HighlightedInteractableObjectAction.cs.meta
deleted file mode 100644
index a93d04ee3d..0000000000
--- a/Assets/SEE/Controls/Actions/HighlightedInteractableObjectAction.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 609466bdbaa25914cabd3299e483343c
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/SEE/Controls/Actions/InteractableObjectAction.cs.meta b/Assets/SEE/Controls/Actions/InteractableObjectAction.cs.meta
deleted file mode 100644
index 1e6ac19953..0000000000
--- a/Assets/SEE/Controls/Actions/InteractableObjectAction.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 5361607a692b5dc4dab1c581d58f792d
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/SEE/Controls/CodeCityActions.meta b/Assets/SEE/Controls/CodeCityActions.meta
new file mode 100644
index 0000000000..3c582c8502
--- /dev/null
+++ b/Assets/SEE/Controls/CodeCityActions.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 30f499db94975e04785038d283d826b9
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Controls/Actions/ShuffleAction.cs b/Assets/SEE/Controls/CodeCityActions/ShuffleAction.cs
similarity index 96%
rename from Assets/SEE/Controls/Actions/ShuffleAction.cs
rename to Assets/SEE/Controls/CodeCityActions/ShuffleAction.cs
index a6e1243f4e..81fff1590b 100644
--- a/Assets/SEE/Controls/Actions/ShuffleAction.cs
+++ b/Assets/SEE/Controls/CodeCityActions/ShuffleAction.cs
@@ -1,14 +1,16 @@
using SEE.Game;
using SEE.Game.Operator;
-using SEE.UI3D;
-using SEE.GO;
-using SEE.Net.Actions;
+using SEE.Gizmos;
+using SEE.Extensions;
using SEE.Utils;
using UnityEngine;
using UnityEngine.Assertions;
+using SEE.GraphElementRefs;
+using Plane = SEE.Cities.Plane;
using SEE.Net.Actions.GraphElement;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.CodeCityActions
{
///
/// Implements shuffling a code city on its plane.
@@ -159,7 +161,7 @@ private void Update()
{
if (cityRootNode && !shuffling)
{
- GO.Plane plane = cityRootNode.GetComponentInParent();
+ Plane plane = cityRootNode.GetComponentInParent();
nodeOperator.MoveTo(plane.CenterTop);
new ShuffleNetAction(cityRootNode.name, plane.CenterTop).Execute();
gizmo.gameObject.SetActive(false);
diff --git a/Assets/SEE/Controls/Actions/ShuffleAction.cs.meta b/Assets/SEE/Controls/CodeCityActions/ShuffleAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ShuffleAction.cs.meta
rename to Assets/SEE/Controls/CodeCityActions/ShuffleAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ZoomAction.cs b/Assets/SEE/Controls/CodeCityActions/ZoomAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/ZoomAction.cs
rename to Assets/SEE/Controls/CodeCityActions/ZoomAction.cs
index e2723102d7..5c2384b061 100644
--- a/Assets/SEE/Controls/Actions/ZoomAction.cs
+++ b/Assets/SEE/Controls/CodeCityActions/ZoomAction.cs
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using SEE.Game.Operator;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Net.Actions.GraphElement;
using SEE.Utils;
using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.CodeCityActions
{
///
/// Implements zooming into or out of a code city.
diff --git a/Assets/SEE/Controls/Actions/ZoomAction.cs.meta b/Assets/SEE/Controls/CodeCityActions/ZoomAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ZoomAction.cs.meta
rename to Assets/SEE/Controls/CodeCityActions/ZoomAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ZoomActionDesktop.cs b/Assets/SEE/Controls/CodeCityActions/ZoomActionDesktop.cs
similarity index 94%
rename from Assets/SEE/Controls/Actions/ZoomActionDesktop.cs
rename to Assets/SEE/Controls/CodeCityActions/ZoomActionDesktop.cs
index b960bd88f2..d2bfd5b582 100644
--- a/Assets/SEE/Controls/Actions/ZoomActionDesktop.cs
+++ b/Assets/SEE/Controls/CodeCityActions/ZoomActionDesktop.cs
@@ -1,12 +1,14 @@
using SEE.Game;
-using SEE.GO;
using SEE.Utils;
-using static SEE.GO.GameObjectExtensions;
using UnityEngine;
using SEE.Game.Operator;
+using SEE.Gizmos;
+using Plane = SEE.Cities.Plane;
+using SEE.Extensions;
using SEE.Net.Actions.GraphElement;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.CodeCityActions
{
///
/// Zoom actions holding data about zooming into or out of the city
@@ -51,9 +53,9 @@ private void Update()
Debug.LogError($"ZoomActionDesktop.Update: rootTransform for hovered {io.name} has no parent.\n");
return;
}
- if (!rootTransform.parent.TryGetComponent(out GO.Plane clippingPlane) || clippingPlane == null)
+ if (!rootTransform.parent.TryGetComponent(out Plane clippingPlane) || clippingPlane == null)
{
- Debug.LogError($"ZoomActionDesktop.Update: parent for hovered {io.name} has no {typeof(GO.Plane)}.\n");
+ Debug.LogError($"ZoomActionDesktop.Update: parent for hovered {io.name} has no {typeof(Plane)}.\n");
return;
}
@@ -89,7 +91,7 @@ private void Update()
// only if zoomSteps equals 0, which is excluded because of the if condition.
Vector2 centerOfTableAfterZoom = zoomSteps == -(int)zoomState.CurrentTargetZoomSteps ? rootTransform.position.XZ() : cursor.Cursor.ComputeCenter().XZ();
Vector2 toCenterOfTable = clippingPlane.CenterXZ - centerOfTableAfterZoom;
- Vector2 zoomCenter = clippingPlane.CenterXZ - (toCenterOfTable * (zoomFactor / (zoomFactor - 1.0f)));
+ Vector2 zoomCenter = clippingPlane.CenterXZ - toCenterOfTable * (zoomFactor / (zoomFactor - 1.0f));
const float duration = 2.0f * ZoomState.DefaultZoomDuration;
zoomState.PushZoomCommand(zoomCenter, zoomSteps, duration);
}
diff --git a/Assets/SEE/Controls/Actions/ZoomActionDesktop.cs.meta b/Assets/SEE/Controls/CodeCityActions/ZoomActionDesktop.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ZoomActionDesktop.cs.meta
rename to Assets/SEE/Controls/CodeCityActions/ZoomActionDesktop.cs.meta
diff --git a/Assets/SEE/Controls/Controls.cs b/Assets/SEE/Controls/Controls.cs
new file mode 100644
index 0000000000..6c5d8f04f7
--- /dev/null
+++ b/Assets/SEE/Controls/Controls.cs
@@ -0,0 +1,6 @@
+///
+/// Controllers reacting to user interactions.
+///
+namespace SEE.Controls
+{
+}
diff --git a/Assets/SEE/Controls/Controls.cs.meta b/Assets/SEE/Controls/Controls.cs.meta
new file mode 100644
index 0000000000..929fd2e672
--- /dev/null
+++ b/Assets/SEE/Controls/Controls.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: c82881d266f867a41a95732dfea9f6ea
\ No newline at end of file
diff --git a/Assets/SEE/Controls/Interactables/InteractableBaseObject.cs b/Assets/SEE/Controls/Interactables/InteractableBaseObject.cs
index ed99753829..55fe70d3bd 100644
--- a/Assets/SEE/Controls/Interactables/InteractableBaseObject.cs
+++ b/Assets/SEE/Controls/Interactables/InteractableBaseObject.cs
@@ -1,5 +1,5 @@
using SEE.Game;
-using SEE.Game.SceneManipulation;
+using SEE.SceneManipulation;
using UnityEngine;
namespace SEE.Controls
diff --git a/Assets/SEE/Controls/Interactables/InteractableGraphElement.cs b/Assets/SEE/Controls/Interactables/InteractableGraphElement.cs
index e9a56ecc24..04b8aded8e 100644
--- a/Assets/SEE/Controls/Interactables/InteractableGraphElement.cs
+++ b/Assets/SEE/Controls/Interactables/InteractableGraphElement.cs
@@ -1,5 +1,6 @@
using SEE.Game.Operator;
-using SEE.GO;
+using SEE.Extensions;
+using SEE.GraphElementRefs;
using UnityEngine;
namespace SEE.Controls.Interactables
diff --git a/Assets/SEE/Controls/Interactables/InteractableObject.cs b/Assets/SEE/Controls/Interactables/InteractableObject.cs
index 032e0b6e00..aec63adc08 100644
--- a/Assets/SEE/Controls/Interactables/InteractableObject.cs
+++ b/Assets/SEE/Controls/Interactables/InteractableObject.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using SEE.GO;
using SEE.Utils;
using UnityEngine;
using UnityEngine.Assertions;
@@ -9,26 +8,49 @@
using SEE.Audio;
using SEE.Game;
using SEE.Game.Avatars;
+using SEE.UserSettings;
namespace SEE.Controls
{
///
- /// components can be attached to different kinds of objects such as game
- /// nodes or edges but also markers or scroll views in metric charts. A HoverFlag indicates
- /// to which kind of game object the hovering event relates to. A HoverFlag is used as a
- /// single bit that occurs in hovering flags.
+ /// components can be attached to
+ /// different kinds of objects such as game nodes or edges but also
+ /// markers or scroll views in metric charts. A
+ /// indicates to which kind of game object the hovering event relates to.
+ /// A is used as a single bit that occurs in
+ /// hovering flags.
///
public enum HoverFlag
{
- None = 0x0, // nothing is being hovered over
- World = 0x1, // an object in the city world is being hovered over (game nodes or edges and the like)
- ChartMarker = 0x2, // a marker in a chart is being hovered over
- ChartMultiSelect = 0x4, // multiple markers in a chart are being hovered over (within a rectangular bound)
- ChartScrollViewToggle = 0x8, // the scroll view of a metric chart is being hovered over
+ ///
+ /// Nothing is being hovered over.
+ ///
+ None = 0x0,
+ ///
+ /// An object in the city world is being hovered over (game nodes or edges
+ /// and the like).
+ ///
+ World = 0x1,
+ ///
+ /// A marker in a chart is being hovered over.
+ ///
+ ChartMarker = 0x2,
+ ///
+ /// Multiple markers in a chart are being hovered over (within a
+ /// rectangular bound).
+ ///
+ ChartMultiSelect = 0x4,
+ ///
+ /// The scroll view of a metric chart is being hovered over.
+ ///
+ ChartScrollViewToggle = 0x8,
}
///
- /// User-interactable graph elements.
+ /// User-interactable objects reacting to hovering, selecting, grabbing.
+ /// components can be attached to
+ /// different kinds of objects such as game nodes or edges but also
+ /// markers or scroll views in metric charts.
///
public abstract class InteractableObject : InteractableObjectBase
{
@@ -784,7 +806,7 @@ public delegate void MulitPlayerReplaceSelectAction(List rep
///
private void OnMouseEnter()
{
- if (User.UserSettings.IsDesktop
+ if (UserSetting.IsDesktop
&& !Raycasting.IsMouseOverGUI() && IsInteractable())
{
SetHoverFlag(HoverFlag.World, true, true);
@@ -800,7 +822,7 @@ private void OnMouseEnter()
///
private void OnMouseOver()
{
- if (User.UserSettings.IsDesktop)
+ if (UserSetting.IsDesktop)
{
bool isFlagSet = IsHoverFlagSet(HoverFlag.World);
bool isMouseOverGUI = Raycasting.IsMouseOverGUI();
@@ -825,7 +847,7 @@ private void OnMouseOver()
///
private void OnMouseExit()
{
- if (User.UserSettings.IsDesktop
+ if (UserSetting.IsDesktop
&& IsHoverFlagSet(HoverFlag.World))
{
SetHoverFlag(HoverFlag.World, false, true);
diff --git a/Assets/SEE/Controls/Interactables/Interactables.cs b/Assets/SEE/Controls/Interactables/Interactables.cs
new file mode 100644
index 0000000000..be182d6499
--- /dev/null
+++ b/Assets/SEE/Controls/Interactables/Interactables.cs
@@ -0,0 +1,8 @@
+///
+/// Home of and its subclasses.
+/// An handles hovering, selection,
+/// and grabbing of interactable game objects.
+///
+namespace SEE.Controls.Interactables
+{
+}
diff --git a/Assets/SEE/Controls/Interactables/Interactables.cs.meta b/Assets/SEE/Controls/Interactables/Interactables.cs.meta
new file mode 100644
index 0000000000..74f60f5355
--- /dev/null
+++ b/Assets/SEE/Controls/Interactables/Interactables.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: fe30c80f38bdcdd4a9524a7ef5df9a40
\ No newline at end of file
diff --git a/Assets/SEE/Controls/KeyActions/KeyActions.cs b/Assets/SEE/Controls/KeyActions/KeyActions.cs
new file mode 100644
index 0000000000..1264921235
--- /dev/null
+++ b/Assets/SEE/Controls/KeyActions/KeyActions.cs
@@ -0,0 +1,6 @@
+///
+/// Manages user actions that can be triggered by a key on the keyboard.
+///
+namespace SEE.Controls.KeyActions
+{
+}
diff --git a/Assets/SEE/Controls/KeyActions/KeyActions.cs.meta b/Assets/SEE/Controls/KeyActions/KeyActions.cs.meta
new file mode 100644
index 0000000000..0278b6d823
--- /dev/null
+++ b/Assets/SEE/Controls/KeyActions/KeyActions.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: dde136b9257ada444b95352b7674940b
\ No newline at end of file
diff --git a/Assets/SEE/Controls/MouseButton.cs b/Assets/SEE/Controls/KeyActions/MouseButton.cs
similarity index 86%
rename from Assets/SEE/Controls/MouseButton.cs
rename to Assets/SEE/Controls/KeyActions/MouseButton.cs
index 36ca1cc242..7b40c9b91d 100644
--- a/Assets/SEE/Controls/MouseButton.cs
+++ b/Assets/SEE/Controls/KeyActions/MouseButton.cs
@@ -1,4 +1,4 @@
-namespace SEE.Controls
+namespace SEE.Controls.KeyActions
{
///
/// Enum representing the different mouse buttons.
diff --git a/Assets/SEE/Controls/MouseButton.cs.meta b/Assets/SEE/Controls/KeyActions/MouseButton.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/MouseButton.cs.meta
rename to Assets/SEE/Controls/KeyActions/MouseButton.cs.meta
diff --git a/Assets/SEE/Controls/SEEInput.cs b/Assets/SEE/Controls/KeyActions/SEEInput.cs
similarity index 99%
rename from Assets/SEE/Controls/SEEInput.cs
rename to Assets/SEE/Controls/KeyActions/SEEInput.cs
index d37bb24aa3..9af4e2c974 100644
--- a/Assets/SEE/Controls/SEEInput.cs
+++ b/Assets/SEE/Controls/KeyActions/SEEInput.cs
@@ -1,12 +1,13 @@
-using SEE.Controls.Actions;
-using SEE.Controls.KeyActions;
+using SEE.Controls.ReversibleActions;
+using SEE.Controls.Players;
using SEE.Tools.OpenTelemetry;
+using SEE.UserSettings;
using SEE.Utils;
using SEE.XR;
using UnityEditor;
using UnityEngine;
-namespace SEE.Controls
+namespace SEE.Controls.KeyActions
{
///
/// Provides a logical abstraction of raw Unity inputs by the user.
@@ -181,7 +182,7 @@ public static bool DigitKeyPressed(int digit)
/// True if the user requests this action and .
public static bool Undo()
{
- if (User.UserSettings.IsVR && XRSEEActions.UndoToggle)
+ if (UserSetting.IsVR && XRSEEActions.UndoToggle)
{
bool undo = XRSEEActions.UndoToggle;
XRSEEActions.UndoToggle = false;
@@ -221,7 +222,7 @@ public static bool Undo()
/// True if the user requests this action and .
public static bool Redo()
{
- if (User.UserSettings.IsVR && XRSEEActions.RedoToggle)
+ if (UserSetting.IsVR && XRSEEActions.RedoToggle)
{
bool redo = XRSEEActions.RedoToggle;
XRSEEActions.RedoToggle = false;
@@ -661,7 +662,7 @@ public static bool MoveDown()
public static bool RotateCamera()
{
return Input.GetMouseButton(rightMouseButton)
- || (Input.GetKey(KeyCode.LeftControl) && Input.GetMouseButton(leftMouseButton));
+ || Input.GetKey(KeyCode.LeftControl) && Input.GetMouseButton(leftMouseButton);
}
///
diff --git a/Assets/SEE/Controls/SEEInput.cs.meta b/Assets/SEE/Controls/KeyActions/SEEInput.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/SEEInput.cs.meta
rename to Assets/SEE/Controls/KeyActions/SEEInput.cs.meta
diff --git a/Assets/SEE/Controls/MetricCharts.meta b/Assets/SEE/Controls/MetricCharts.meta
new file mode 100644
index 0000000000..da7cb369a5
--- /dev/null
+++ b/Assets/SEE/Controls/MetricCharts.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0ba191bc3691155479027baf9d94b0fd
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Controls/Actions/ChartAction.cs b/Assets/SEE/Controls/MetricCharts/ChartAction.cs
similarity index 97%
rename from Assets/SEE/Controls/Actions/ChartAction.cs
rename to Assets/SEE/Controls/MetricCharts/ChartAction.cs
index 19ec486f69..57b831b3b7 100644
--- a/Assets/SEE/Controls/Actions/ChartAction.cs
+++ b/Assets/SEE/Controls/MetricCharts/ChartAction.cs
@@ -21,7 +21,7 @@
using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.MetricCharts
{
///
/// Abstract super class of the actions applied to metric charts.
diff --git a/Assets/SEE/Controls/Actions/ChartAction.cs.meta b/Assets/SEE/Controls/MetricCharts/ChartAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ChartAction.cs.meta
rename to Assets/SEE/Controls/MetricCharts/ChartAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/DesktopChartAction.cs b/Assets/SEE/Controls/MetricCharts/DesktopChartAction.cs
similarity index 90%
rename from Assets/SEE/Controls/Actions/DesktopChartAction.cs
rename to Assets/SEE/Controls/MetricCharts/DesktopChartAction.cs
index d20616ff55..58bf6a49fe 100644
--- a/Assets/SEE/Controls/Actions/DesktopChartAction.cs
+++ b/Assets/SEE/Controls/MetricCharts/DesktopChartAction.cs
@@ -19,13 +19,15 @@
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+using SEE.Controls.KeyActions;
using SEE.Game.Charts;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.MetricCharts
{
///
/// Handles the toggling of metric charts.
///
+ /// This component is attached to a player via DesktopPlayer.prefab./>
public class DesktopChartAction : ChartAction
{
///
diff --git a/Assets/SEE/Controls/Actions/DesktopChartAction.cs.meta b/Assets/SEE/Controls/MetricCharts/DesktopChartAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/DesktopChartAction.cs.meta
rename to Assets/SEE/Controls/MetricCharts/DesktopChartAction.cs.meta
diff --git a/Assets/SEE/Controls/Modifiers.meta b/Assets/SEE/Controls/Modifiers.meta
new file mode 100644
index 0000000000..f4d8ff1ade
--- /dev/null
+++ b/Assets/SEE/Controls/Modifiers.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6867ead5eb8439645902d9600218522c
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Controls/Actions/InteractableObjectAction.cs b/Assets/SEE/Controls/Modifiers/InteractableObjectModifier.cs
similarity index 62%
rename from Assets/SEE/Controls/Actions/InteractableObjectAction.cs
rename to Assets/SEE/Controls/Modifiers/InteractableObjectModifier.cs
index 647425b78a..73a3520b47 100644
--- a/Assets/SEE/Controls/Actions/InteractableObjectAction.cs
+++ b/Assets/SEE/Controls/Modifiers/InteractableObjectModifier.cs
@@ -1,13 +1,16 @@
-using SEE.GO;
+using SEE.Extensions;
using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Modifiers
{
///
- /// Common abstract superclass of all actions relating to a game object that
+ /// Common abstract superclass of all modifiers relating to a game object that
/// has an component attached to them.
+ /// A modifier is one that modifies the appearance (e.g.,
+ /// by an outline) or shows additional information (e.g., erosion icons)
+ /// for a picked interactable object.
///
- public abstract class InteractableObjectAction : MonoBehaviour
+ public abstract class InteractableObjectModifier : MonoBehaviour
{
///
/// The interactable component attached to the same object as a sibling of this action.
@@ -25,4 +28,4 @@ protected virtual void Awake()
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Assets/SEE/Controls/Modifiers/InteractableObjectModifier.cs.meta b/Assets/SEE/Controls/Modifiers/InteractableObjectModifier.cs.meta
new file mode 100644
index 0000000000..f7f79f6dd6
--- /dev/null
+++ b/Assets/SEE/Controls/Modifiers/InteractableObjectModifier.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 77e0dd9df07d1d94785e49ea91795be0
\ No newline at end of file
diff --git a/Assets/SEE/Controls/Modifiers/Modifiers.cs b/Assets/SEE/Controls/Modifiers/Modifiers.cs
new file mode 100644
index 0000000000..5481c3c49a
--- /dev/null
+++ b/Assets/SEE/Controls/Modifiers/Modifiers.cs
@@ -0,0 +1,11 @@
+///
+/// Namespace for all modifiers s.
+/// These modifiers are attached to a game object that has an
+/// component.
+/// A modifier is one that modifies the appearance (e.g.,
+/// by an outline) or shows additional information (e.g., erosion icons)
+/// for a picked interactable object.
+///
+namespace SEE.Controls.Modifiers
+{
+}
diff --git a/Assets/SEE/Controls/Modifiers/Modifiers.cs.meta b/Assets/SEE/Controls/Modifiers/Modifiers.cs.meta
new file mode 100644
index 0000000000..0fe1ad9357
--- /dev/null
+++ b/Assets/SEE/Controls/Modifiers/Modifiers.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 08456316f41bdcd48917f276b9269695
\ No newline at end of file
diff --git a/Assets/SEE/Controls/ShowAuthorEdges.cs b/Assets/SEE/Controls/Modifiers/ShowAuthorEdges.cs
similarity index 96%
rename from Assets/SEE/Controls/ShowAuthorEdges.cs
rename to Assets/SEE/Controls/Modifiers/ShowAuthorEdges.cs
index dd3561804c..5f80fbc9de 100644
--- a/Assets/SEE/Controls/ShowAuthorEdges.cs
+++ b/Assets/SEE/Controls/Modifiers/ShowAuthorEdges.cs
@@ -1,7 +1,7 @@
using System;
-using SEE.GameObjects.BranchCity;
+using SEE.Components.GameNodes.BranchCity;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Modifiers
{
///
/// This action shows/animates edges connecting authors spheres and nodes when
@@ -9,7 +9,7 @@ namespace SEE.Controls.Actions
/// This script can be added to both s and game objects
/// representing graph nodes (aka game nodes).
///
- internal class ShowAuthorEdges : InteractableObjectAction, IDisposable
+ internal class ShowAuthorEdges : InteractableObjectModifier, IDisposable
{
///
/// Disposes the CancellationTokenSource.
diff --git a/Assets/SEE/Controls/ShowAuthorEdges.cs.meta b/Assets/SEE/Controls/Modifiers/ShowAuthorEdges.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/ShowAuthorEdges.cs.meta
rename to Assets/SEE/Controls/Modifiers/ShowAuthorEdges.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ShowEdges.cs b/Assets/SEE/Controls/Modifiers/ShowEdges.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/ShowEdges.cs
rename to Assets/SEE/Controls/Modifiers/ShowEdges.cs
index 752d40f68c..e2b5d03712 100644
--- a/Assets/SEE/Controls/Actions/ShowEdges.cs
+++ b/Assets/SEE/Controls/Modifiers/ShowEdges.cs
@@ -7,18 +7,18 @@
using SEE.DataModel.DG;
using SEE.Game.City;
using SEE.Game.Operator;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Utils;
using UnityEngine;
using Node = SEE.DataModel.DG.Node;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Modifiers
{
///
/// Shows connected edges when the user hovers over or selects a node.
///
/// This component is assumed to be attached to a game node.
- public class ShowEdges : InteractableObjectAction
+ public class ShowEdges : InteractableObjectModifier
{
///
/// True if the object is currently being hovered over.
diff --git a/Assets/SEE/Controls/Actions/ShowEdges.cs.meta b/Assets/SEE/Controls/Modifiers/ShowEdges.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ShowEdges.cs.meta
rename to Assets/SEE/Controls/Modifiers/ShowEdges.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HighlightErosion.cs b/Assets/SEE/Controls/Modifiers/ShowErosions.cs
similarity index 92%
rename from Assets/SEE/Controls/Actions/HighlightErosion.cs
rename to Assets/SEE/Controls/Modifiers/ShowErosions.cs
index fe2a307e1e..5b749bbb91 100644
--- a/Assets/SEE/Controls/Actions/HighlightErosion.cs
+++ b/Assets/SEE/Controls/Modifiers/ShowErosions.cs
@@ -1,22 +1,26 @@
using System;
using DG.Tweening;
using SEE.DataModel.DG;
+using SEE.Factories;
using SEE.Game.City;
-using SEE.GO;
+using SEE.Extensions;
+using SEE.GraphElementRefs;
using TMPro;
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.UI;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Modifiers
{
///
- /// Highlights the corresponding erosion icons of the node this component is attached to.
- /// If no erosion icons are present, this component won't do anything.
+ /// Shows the corresponding erosion icons of the node this
+ /// component is attached to. If no erosion icons are
+ /// present, this component won't do anything.
///
- public class HighlightErosion : InteractableObjectAction
+ public class ShowErosions : InteractableObjectModifier
{
- // TODO: This file heavily clones code from ShowLabel.cs. It may be worthwhile to put this common behavior
+ // TODO: This file heavily clones code from ShowLabel.cs.
+ // It may be worthwhile to put this common behavior
// into a shared superclass.
///
@@ -41,7 +45,7 @@ protected void OnEnable()
{
if (Interactable == null)
{
- Debug.LogError($"HighlightErosion.OnEnable for {name} has no interactable.\n");
+ Debug.LogError($"{nameof(ShowErosions)}.{nameof(OnEnable)} for {name} has no interactable.\n");
enabled = false;
}
else
@@ -67,7 +71,7 @@ protected void OnDisable()
}
else
{
- Debug.LogError($"HighlightErosion.OnDisable for {name} has no interactable.\n");
+ Debug.LogError($"{nameof(ShowErosions)}.{nameof(OnDisable)} for {name} has no interactable.\n");
enabled = false;
}
}
@@ -224,7 +228,7 @@ private void ForEachErosion(Action();
SpriteRenderer spriteRenderer = childTransform.GetComponentInChildren();
@@ -237,4 +241,4 @@ private void ForEachErosion(Action
/// Draws or modifies, respectively, an outline around a game object being grabbed and
/// makes it opaque.
///
- internal class ShowGrabbing : HighlightedInteractableObjectAction
+ internal class ShowGrabbing : ShowOutline
{
///
/// Initializes the local and remote outline color.
diff --git a/Assets/SEE/Controls/Actions/ShowGrabbing.cs.meta b/Assets/SEE/Controls/Modifiers/ShowGrabbing.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ShowGrabbing.cs.meta
rename to Assets/SEE/Controls/Modifiers/ShowGrabbing.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ShowHoverInfo.cs b/Assets/SEE/Controls/Modifiers/ShowHoverInfo.cs
similarity index 96%
rename from Assets/SEE/Controls/Actions/ShowHoverInfo.cs
rename to Assets/SEE/Controls/Modifiers/ShowHoverInfo.cs
index 379dd0be03..50af39a621 100644
--- a/Assets/SEE/Controls/Actions/ShowHoverInfo.cs
+++ b/Assets/SEE/Controls/Modifiers/ShowHoverInfo.cs
@@ -1,16 +1,17 @@
using SEE.Game.City;
using SEE.Game.Operator;
-using SEE.GO;
+using SEE.Extensions;
using SEE.UI;
using UnityEngine;
+using SEE.Controls.ReversibleActions;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Modifiers
{
///
/// Shows a tooltip with a short block of information about the object when it is hovered over.
/// The content of the tooltip is configurable through the city's .
///
- public class ShowHoverInfo : InteractableObjectAction
+ public class ShowHoverInfo : InteractableObjectModifier
{
///
/// Operator component for this object.
diff --git a/Assets/SEE/Controls/Actions/ShowHoverInfo.cs.meta b/Assets/SEE/Controls/Modifiers/ShowHoverInfo.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ShowHoverInfo.cs.meta
rename to Assets/SEE/Controls/Modifiers/ShowHoverInfo.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ShowHovering.cs b/Assets/SEE/Controls/Modifiers/ShowHovering.cs
similarity index 97%
rename from Assets/SEE/Controls/Actions/ShowHovering.cs
rename to Assets/SEE/Controls/Modifiers/ShowHovering.cs
index fb0452d5d6..48c503286e 100644
--- a/Assets/SEE/Controls/Actions/ShowHovering.cs
+++ b/Assets/SEE/Controls/Modifiers/ShowHovering.cs
@@ -1,12 +1,12 @@
using SEE.Utils;
using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Modifiers
{
///
/// Draws or modifies, respectively, an outline around a game object being hovered over and makes it opaque.
///
- internal class ShowHovering : HighlightedInteractableObjectAction
+ internal class ShowHovering : ShowOutline
{
///
/// Initializes the local and remote outline color.
diff --git a/Assets/SEE/Controls/Actions/ShowHovering.cs.meta b/Assets/SEE/Controls/Modifiers/ShowHovering.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ShowHovering.cs.meta
rename to Assets/SEE/Controls/Modifiers/ShowHovering.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ShowLabel.cs b/Assets/SEE/Controls/Modifiers/ShowLabel.cs
similarity index 95%
rename from Assets/SEE/Controls/Actions/ShowLabel.cs
rename to Assets/SEE/Controls/Modifiers/ShowLabel.cs
index e7f5d42855..cc8e036370 100644
--- a/Assets/SEE/Controls/Actions/ShowLabel.cs
+++ b/Assets/SEE/Controls/Modifiers/ShowLabel.cs
@@ -1,20 +1,21 @@
-using System;
-using SEE.DataModel.DG;
+using SEE.Controls.Players;
+using SEE.Extensions;
using SEE.Game;
using SEE.Game.Avatars;
using SEE.Game.City;
using SEE.Game.Operator;
-using SEE.GO;
-using UnityEngine;
+using SEE.UserSettings;
using SEE.XR;
+using System;
+using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Modifiers
{
///
/// Shows the source name of the hovered or selected object as a text label above the
/// object. In between that label and the game object, a connecting line will be shown.
///
- public class ShowLabel : InteractableObjectAction
+ public class ShowLabel : InteractableObjectModifier
{
// There can be two reasons why the label needs to be shown: because it is selected
// or because it is hovered over. Those two conditions are not mutually exclusive.
@@ -38,7 +39,7 @@ public class ShowLabel : InteractableObjectAction
///
/// The laser pointer component of the local player.
///
- private readonly Lazy pointer = new(() => SceneQueries.GetLocalPlayer().MustGetComponent());
+ private readonly Lazy pointer = new(() => WindowSpaceManager.GetLocalPlayer().MustGetComponent());
///
/// Registers On() and Off() for the respective hovering and selection events.
@@ -160,7 +161,7 @@ public void On()
if (nodeOperator.Node != null)
{
LabelAttributes settings = nodeOperator.City.LabelSettings;
- if (User.UserSettings.IsDesktop)
+ if (UserSetting.IsDesktop)
{
if (settings.Show && pointer.Value.On && nodeOperator.LabelIsNotEmpty())
{
@@ -207,7 +208,7 @@ private void Update()
{
if ((isHovered || isSelected) && nodeOperator != null && nodeOperator.Node != null)
{
- if (User.UserSettings.IsVR)
+ if (UserSetting.IsVR)
{
XRSEEActions.RayInteractor.TryGetCurrent3DRaycastHit(out RaycastHit raycasthit);
nodeOperator.UpdateLabelLayout(raycasthit.point);
diff --git a/Assets/SEE/Controls/Actions/ShowLabel.cs.meta b/Assets/SEE/Controls/Modifiers/ShowLabel.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ShowLabel.cs.meta
rename to Assets/SEE/Controls/Modifiers/ShowLabel.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HighlightedInteractableObjectAction.cs b/Assets/SEE/Controls/Modifiers/ShowOutline.cs
similarity index 92%
rename from Assets/SEE/Controls/Actions/HighlightedInteractableObjectAction.cs
rename to Assets/SEE/Controls/Modifiers/ShowOutline.cs
index 6ad9acf914..2ebce99461 100644
--- a/Assets/SEE/Controls/Actions/HighlightedInteractableObjectAction.cs
+++ b/Assets/SEE/Controls/Modifiers/ShowOutline.cs
@@ -1,9 +1,13 @@
-using SEE.Controls.Interactables;
+using SEE.Components.GraphElements;
using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Modifiers
{
- public abstract class HighlightedInteractableObjectAction : InteractableObjectAction
+ ///
+ /// Adds an outline to a game object when it is selected, hovered, or grabbed.
+ /// When the outline is actually activated depends upon the subclasses.
+ ///
+ public abstract class ShowOutline : InteractableObjectModifier
{
///
/// The local color of the outline. Is expected to be assigned by the static
diff --git a/Assets/SEE/Controls/Modifiers/ShowOutline.cs.meta b/Assets/SEE/Controls/Modifiers/ShowOutline.cs.meta
new file mode 100644
index 0000000000..938f150345
--- /dev/null
+++ b/Assets/SEE/Controls/Modifiers/ShowOutline.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 0959bf2b2abb1f442af4ba16144c582b
\ No newline at end of file
diff --git a/Assets/SEE/Controls/Actions/ShowSelection.cs b/Assets/SEE/Controls/Modifiers/ShowSelection.cs
similarity index 97%
rename from Assets/SEE/Controls/Actions/ShowSelection.cs
rename to Assets/SEE/Controls/Modifiers/ShowSelection.cs
index 59e164c905..f134f9ee99 100644
--- a/Assets/SEE/Controls/Actions/ShowSelection.cs
+++ b/Assets/SEE/Controls/Modifiers/ShowSelection.cs
@@ -1,12 +1,12 @@
using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Modifiers
{
///
/// Draws or modifies, respectively, an outline around a selected game object
/// and makes it opaque.
///
- public class ShowSelection : HighlightedInteractableObjectAction
+ public class ShowSelection : ShowOutline
{
///
/// Initializes the local and remote outline color.
diff --git a/Assets/SEE/Controls/Actions/ShowSelection.cs.meta b/Assets/SEE/Controls/Modifiers/ShowSelection.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ShowSelection.cs.meta
rename to Assets/SEE/Controls/Modifiers/ShowSelection.cs.meta
diff --git a/Assets/SEE/Game/City/TooltipContentBuilder.cs b/Assets/SEE/Controls/Modifiers/TooltipContentBuilder.cs
similarity index 99%
rename from Assets/SEE/Game/City/TooltipContentBuilder.cs
rename to Assets/SEE/Controls/Modifiers/TooltipContentBuilder.cs
index 82777bc04b..e660ecb88e 100644
--- a/Assets/SEE/Game/City/TooltipContentBuilder.cs
+++ b/Assets/SEE/Controls/Modifiers/TooltipContentBuilder.cs
@@ -1,7 +1,8 @@
using SEE.DataModel.DG;
+using SEE.Game.City;
using System.Text;
-namespace SEE.Game.City
+namespace SEE.Controls.ReversibleActions
{
///
/// Utility class for building tooltip content based on .
diff --git a/Assets/SEE/Game/City/TooltipContentBuilder.cs.meta b/Assets/SEE/Controls/Modifiers/TooltipContentBuilder.cs.meta
similarity index 100%
rename from Assets/SEE/Game/City/TooltipContentBuilder.cs.meta
rename to Assets/SEE/Controls/Modifiers/TooltipContentBuilder.cs.meta
diff --git a/Assets/SEE/Controls/Players.meta b/Assets/SEE/Controls/Players.meta
new file mode 100644
index 0000000000..34fac99ece
--- /dev/null
+++ b/Assets/SEE/Controls/Players.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 815a54293227e4a40a39018fa6e9ede9
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Controls/DesktopPlayerMovement.cs b/Assets/SEE/Controls/Players/DesktopPlayerMovement.cs
similarity index 98%
rename from Assets/SEE/Controls/DesktopPlayerMovement.cs
rename to Assets/SEE/Controls/Players/DesktopPlayerMovement.cs
index 0c3cbbe248..debe6e7ca2 100644
--- a/Assets/SEE/Controls/DesktopPlayerMovement.cs
+++ b/Assets/SEE/Controls/Players/DesktopPlayerMovement.cs
@@ -1,13 +1,16 @@
-using SEE.GO;
+using SEE.Controls.KeyActions;
+using SEE.Extensions;
using SEE.Tools.OpenTelemetry;
using UnityEngine;
-using Plane = SEE.GO.Plane;
+using Plane = SEE.Cities.Plane;
-namespace SEE.Controls
+namespace SEE.Controls.Players
{
///
/// Moves a player in a desktop environment (based on keyboard and mouse input).
///
+ /// This component is expected to be attached to the game object representing
+ /// the local player.
public class DesktopPlayerMovement : PlayerMovement
{
///
diff --git a/Assets/SEE/Controls/DesktopPlayerMovement.cs.meta b/Assets/SEE/Controls/Players/DesktopPlayerMovement.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/DesktopPlayerMovement.cs.meta
rename to Assets/SEE/Controls/Players/DesktopPlayerMovement.cs.meta
diff --git a/Assets/SEE/Controls/PlayerMovement.cs b/Assets/SEE/Controls/Players/PlayerMovement.cs
similarity index 54%
rename from Assets/SEE/Controls/PlayerMovement.cs
rename to Assets/SEE/Controls/Players/PlayerMovement.cs
index 1e15118615..b62c353ddc 100644
--- a/Assets/SEE/Controls/PlayerMovement.cs
+++ b/Assets/SEE/Controls/Players/PlayerMovement.cs
@@ -1,10 +1,12 @@
using UnityEngine;
-namespace SEE.Controls
+namespace SEE.Controls.Players
{
///
/// Common abstract superclass of all player movements.
///
+ /// This component is expected to be attached to the game object representing
+ /// the local player.
public abstract class PlayerMovement : MonoBehaviour
{
}
diff --git a/Assets/SEE/Controls/PlayerMovement.cs.meta b/Assets/SEE/Controls/Players/PlayerMovement.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/PlayerMovement.cs.meta
rename to Assets/SEE/Controls/Players/PlayerMovement.cs.meta
diff --git a/Assets/SEE/Controls/Players/Players.cs b/Assets/SEE/Controls/Players/Players.cs
new file mode 100644
index 0000000000..d246f6137f
--- /dev/null
+++ b/Assets/SEE/Controls/Players/Players.cs
@@ -0,0 +1,7 @@
+///
+/// Namespace for components to be attached to a game object representing
+/// a player.
+///
+namespace SEE.Controls.Players
+{
+}
diff --git a/Assets/SEE/Controls/Players/Players.cs.meta b/Assets/SEE/Controls/Players/Players.cs.meta
new file mode 100644
index 0000000000..edf4fd05d5
--- /dev/null
+++ b/Assets/SEE/Controls/Players/Players.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 6bb4628d72bde19419cd2a93150ab54d
\ No newline at end of file
diff --git a/Assets/SEE/Controls/Actions/SelectAction.cs b/Assets/SEE/Controls/Players/SelectAction.cs
similarity index 91%
rename from Assets/SEE/Controls/Actions/SelectAction.cs
rename to Assets/SEE/Controls/Players/SelectAction.cs
index 971b7fc2d8..1fddd7433f 100644
--- a/Assets/SEE/Controls/Actions/SelectAction.cs
+++ b/Assets/SEE/Controls/Players/SelectAction.cs
@@ -3,10 +3,11 @@
using SEE.Utils;
using UnityEngine;
using SEE.Audio;
-using SEE.GO;
using SEE.XR;
+using SEE.UserSettings;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Players
{
///
/// Provides the ability to select graph elements (nodes or edges).
@@ -14,6 +15,7 @@ namespace SEE.Controls.Actions
/// object. Generally, it will be added to prefabs for such player
/// objects.
///
+ /// This component is attached to a player via DesktopPlayer.prefab./>
public class SelectAction : MonoBehaviour
{
///
@@ -46,7 +48,7 @@ private void Update()
obj = interactableObject;
}
if (Input.GetKey(KeyCode.LeftControl)
- || (User.UserSettings.IsVR && XRSEEActions.SelectedFlag))
+ || UserSetting.IsVR && XRSEEActions.SelectedFlag)
{
if (obj != null)
{
diff --git a/Assets/SEE/Controls/Actions/SelectAction.cs.meta b/Assets/SEE/Controls/Players/SelectAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/SelectAction.cs.meta
rename to Assets/SEE/Controls/Players/SelectAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ShowTree.cs b/Assets/SEE/Controls/Players/ShowTree.cs
similarity index 94%
rename from Assets/SEE/Controls/Actions/ShowTree.cs
rename to Assets/SEE/Controls/Players/ShowTree.cs
index 2a8cf5be6e..7f0b0f9c31 100644
--- a/Assets/SEE/Controls/Actions/ShowTree.cs
+++ b/Assets/SEE/Controls/Players/ShowTree.cs
@@ -1,13 +1,13 @@
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
+using SEE.Controls.KeyActions;
using SEE.Game;
using SEE.Game.City;
-using SEE.GO;
using SEE.UI.Window;
using SEE.UI.Window.TreeWindow;
using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Players
{
///
/// Shows or hides the tree view over a code city.
@@ -61,8 +61,8 @@ private void ShowTreeView()
async UniTaskVoid SetupManager()
{
// We need to wait until the WindowSpaceManager has been initialized.
- await UniTask.WaitUntil(() => WindowSpaceManager.ManagerInstance[WindowSpaceManager.LocalPlayer] != null);
- space = WindowSpaceManager.ManagerInstance[WindowSpaceManager.LocalPlayer];
+ await UniTask.WaitUntil(() => WindowSpaceManager.WindowSpaceOfLocalPlayer != null);
+ space = WindowSpaceManager.WindowSpaceOfLocalPlayer;
foreach (string city in treeWindows.Keys)
{
if (!space.Windows.Contains(treeWindows[city]))
diff --git a/Assets/SEE/Controls/Actions/ShowTree.cs.meta b/Assets/SEE/Controls/Players/ShowTree.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ShowTree.cs.meta
rename to Assets/SEE/Controls/Players/ShowTree.cs.meta
diff --git a/Assets/SEE/Controls/Actions/VRPointerAction.cs b/Assets/SEE/Controls/Players/VRPointerAction.cs
similarity index 80%
rename from Assets/SEE/Controls/Actions/VRPointerAction.cs
rename to Assets/SEE/Controls/Players/VRPointerAction.cs
index 4be85cffc1..6bc1c24199 100644
--- a/Assets/SEE/Controls/Actions/VRPointerAction.cs
+++ b/Assets/SEE/Controls/Players/VRPointerAction.cs
@@ -1,14 +1,16 @@
using UnityEngine;
using UnityEngine.XR;
+using SEE.Controls.Modifiers;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.Players
{
///
/// Implements actions that can be triggered by the laser pointer in XR.
/// Currently, the label of the hit game object is shown if the game object
/// has a .
///
- /// This component is attached to the XR rig prefab.
+ /// This component is attached to the XR rig prefab, which is
+ /// the game object representing the local player in a VR environment.
public class VRPointerAction : MonoBehaviour
{
///
@@ -29,10 +31,10 @@ public class VRPointerAction : MonoBehaviour
///
void Update()
{
- UnityEngine.XR.InputDevice handRDevice = InputDevices.GetDeviceAtXRNode(XRNode.RightHand);
- handRDevice.TryGetFeatureValue(UnityEngine.XR.CommonUsages.devicePosition, out Vector3 posR);
+ InputDevice handRDevice = InputDevices.GetDeviceAtXRNode(XRNode.RightHand);
+ handRDevice.TryGetFeatureValue(CommonUsages.devicePosition, out Vector3 posR);
Vector3 vPosition = transform.TransformPoint(posR); //to world coords
- handRDevice.TryGetFeatureValue(UnityEngine.XR.CommonUsages.deviceRotation, out Quaternion rotR);
+ handRDevice.TryGetFeatureValue(CommonUsages.deviceRotation, out Quaternion rotR);
Vector3 vGazeDirection = rotR * Vector3.forward;
vGazeDirection = transform.TransformDirection(vGazeDirection);
if (Physics.Raycast(vPosition, vGazeDirection, out RaycastHit hit, rayLength))
diff --git a/Assets/SEE/Controls/Actions/VRPointerAction.cs.meta b/Assets/SEE/Controls/Players/VRPointerAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/VRPointerAction.cs.meta
rename to Assets/SEE/Controls/Players/VRPointerAction.cs.meta
diff --git a/Assets/SEE/Controls/WindowSpaceManager.cs b/Assets/SEE/Controls/Players/WindowSpaceManager.cs
similarity index 79%
rename from Assets/SEE/Controls/WindowSpaceManager.cs
rename to Assets/SEE/Controls/Players/WindowSpaceManager.cs
index cadf7c80d4..1d67ee8736 100644
--- a/Assets/SEE/Controls/WindowSpaceManager.cs
+++ b/Assets/SEE/Controls/Players/WindowSpaceManager.cs
@@ -3,36 +3,40 @@
using SEE.UI.Window;
using SEE.UI.Menu;
using SEE.UI.StateIndicator;
-using SEE.GO;
+using SEE.Extensions;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Serialization;
+using SEE.Controls.KeyActions;
+using System;
-namespace SEE.Controls
+namespace SEE.Controls.Players
{
///
/// Manages the association from players to s.
/// Will also display a menu which can be opened using TAB. The player whose code window shall be displayed
/// can be selected from this menu.
/// Note that only one instance of this class may be active in the scene. This instance can be retrieved
- /// using .
+ /// using .
///
+ /// This component is expected to be attached to the game object representing
+ /// the local player.
public class WindowSpaceManager : MonoBehaviour
{
///
/// String representing the local player.
///
- public const string LocalPlayer = "Local player";
+ private const string localPlayer = "Local player";
///
/// String representing no player, i.e. no windows being displayed.
///
- public const string NoPlayer = "None";
+ private const string noPlayer = "None";
///
/// The name of the player whose window is currently displayed.
///
- public string CurrentPlayer { get; private set; } = LocalPlayer;
+ private string CurrentPlayer { get; set; } = localPlayer;
///
/// A dictionary mapping player names to their code spaces.
@@ -40,7 +44,7 @@ public class WindowSpaceManager : MonoBehaviour
private readonly Dictionary windowSpaces = new();
///
- /// This event will be invoked whenever the active window for the is changed.
+ /// This event will be invoked whenever the active window for the is changed.
/// This includes changing the active window to nothing (i.e. closing all of them.)
///
[FormerlySerializedAs("OnActiveCodeWindowChanged")]
@@ -59,19 +63,42 @@ public class WindowSpaceManager : MonoBehaviour
///
/// Represents the space manager currently active in the scene.
///
- public static WindowSpaceManager ManagerInstance;
+ public static WindowSpaceManager Instance;
///
/// Accesses the space for the given .
/// If the given does not exist, null will be returned.
///
/// The name of the player whose space should be returned.
- public WindowSpace this[string playerName]
+ private WindowSpace this[string playerName]
{
get => windowSpaces.ContainsKey(playerName) ? windowSpaces[playerName] : null;
set => windowSpaces[playerName] = value;
}
+ ///
+ /// Returns the of the local player.
+ /// May be null during initialization.
+ ///
+ public static WindowSpace WindowSpaceOfLocalPlayer => Instance[localPlayer];
+
+ ///
+ /// True if the current player is the local player.
+ ///
+ public static bool CurrentPlayerIsLocalPlayer => Instance.CurrentPlayer == localPlayer;
+
+ ///
+ /// Returns the local player game object.
+ ///
+ /// Local player game object.
+ /// This method should not belong here. Retrieving the local player
+ /// via an arbitrary component attached to the local player is akward.
+ [Obsolete("Do not use. We will replace it by a better way to retrieve the local player.")]
+ public static GameObject GetLocalPlayer()
+ {
+ return Instance.gameObject;
+ }
+
/// Updates the space of the player specified by using the values
/// from .
///
@@ -128,12 +155,13 @@ public void UpdateSpaceFromValueObject(string playerName, WindowSpace.WindowSpac
private void Start()
{
- if (FindObjectsOfType().Length > 1)
+ WindowSpaceManager[] windowSpaceManagers = FindObjectsByType(FindObjectsSortMode.None);
+ if (windowSpaceManagers.Length > 1)
{
Debug.LogError($"More than one {nameof(WindowSpaceManager)} is present in the scene! "
+ "This will lead to undefined behaviour when synchronizing "
+ "windows across the network! No new indicator will be created.\n");
- foreach (WindowSpaceManager manager in FindObjectsOfType())
+ foreach (WindowSpaceManager manager in windowSpaceManagers)
{
Debug.LogError($"{typeof(WindowSpaceManager)} at game object {manager.gameObject.FullName()}.\n");
}
@@ -145,14 +173,14 @@ private void Start()
spaceIndicator.AnchorMin = Vector2.zero;
spaceIndicator.AnchorMax = Vector2.zero;
spaceIndicator.Pivot = Vector2.zero;
- ManagerInstance = this;
+ Instance = this;
}
// Create local code space and associate it with current player
- WindowSpace space = windowSpaces[LocalPlayer] = gameObject.AddOrGetComponent();
+ WindowSpace space = windowSpaces[localPlayer] = gameObject.AddOrGetComponent();
space.OnActiveWindowChanged.AddListener(OnActiveWindowChanged.Invoke);
- ManagerInstance.spaceIndicator.ChangeState(LocalPlayer, Color.black);
+ Instance.spaceIndicator.ChangeState(localPlayer, Color.black);
SetUpWindowSelectionMenu();
}
@@ -172,17 +200,17 @@ private void Update()
private void SetUpWindowSelectionMenu()
{
windowMenu = gameObject.AddComponent();
- MenuEntry localEntry = new(SelectAction: () => ActivateSpace(LocalPlayer),
+ MenuEntry localEntry = new(SelectAction: () => ActivateSpace(localPlayer),
UnselectAction: DeactivateCurrentSpace,
- Title: LocalPlayer,
+ Title: localPlayer,
Description: "Windows for the local player (you).",
EntryColor: Color.black);
- MenuEntry noneEntry = new(() => CurrentPlayer = NoPlayer, NoPlayer,
+ MenuEntry noneEntry = new(() => CurrentPlayer = noPlayer, noPlayer,
Description: "This option hides all windows.", EntryColor: Color.grey);
windowMenu.AddEntry(noneEntry);
windowMenu.AddEntry(localEntry);
windowMenu.SelectEntry(localEntry);
- foreach (KeyValuePair space in windowSpaces.Where(space => space.Key != LocalPlayer))
+ foreach (KeyValuePair space in windowSpaces.Where(space => space.Key != localPlayer))
{
windowMenu.AddEntry(new MenuEntry(() => ActivateSpace(space.Key),
space.Key, DeactivateCurrentSpace,
@@ -198,7 +226,7 @@ private void SetUpWindowSelectionMenu()
private void DeactivateCurrentSpace()
{
windowSpaces[CurrentPlayer].enabled = false;
- ManagerInstance.spaceIndicator.enabled = false;
+ Instance.spaceIndicator.enabled = false;
}
///
@@ -210,8 +238,8 @@ private void ActivateSpace(string playerName)
{
windowSpaces[playerName].enabled = true;
CurrentPlayer = playerName;
- ManagerInstance.spaceIndicator.enabled = true;
- ManagerInstance.spaceIndicator.ChangeState(playerName, Color.black);
+ Instance.spaceIndicator.enabled = true;
+ Instance.spaceIndicator.ChangeState(playerName, Color.black);
}
}
}
diff --git a/Assets/SEE/Controls/WindowSpaceManager.cs.meta b/Assets/SEE/Controls/Players/WindowSpaceManager.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/WindowSpaceManager.cs.meta
rename to Assets/SEE/Controls/Players/WindowSpaceManager.cs.meta
diff --git a/Assets/SEE/Controls/ReversibleActions.meta b/Assets/SEE/Controls/ReversibleActions.meta
new file mode 100644
index 0000000000..e7fa102d9f
--- /dev/null
+++ b/Assets/SEE/Controls/ReversibleActions.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 65e59bf1b0790e64bbc55a5c61dcf2f1
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Controls/Actions/AbstractActionStateType.cs b/Assets/SEE/Controls/ReversibleActions/AbstractActionStateType.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/AbstractActionStateType.cs
rename to Assets/SEE/Controls/ReversibleActions/AbstractActionStateType.cs
index fd3c2cd50d..ebf3a7d54d 100644
--- a/Assets/SEE/Controls/Actions/AbstractActionStateType.cs
+++ b/Assets/SEE/Controls/ReversibleActions/AbstractActionStateType.cs
@@ -1,6 +1,6 @@
using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Super class of and .
diff --git a/Assets/SEE/Controls/Actions/AbstractActionStateType.cs.meta b/Assets/SEE/Controls/ReversibleActions/AbstractActionStateType.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/AbstractActionStateType.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/AbstractActionStateType.cs.meta
diff --git a/Assets/SEE/Controls/Actions/AbstractPlayerAction.cs b/Assets/SEE/Controls/ReversibleActions/AbstractPlayerAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/AbstractPlayerAction.cs
rename to Assets/SEE/Controls/ReversibleActions/AbstractPlayerAction.cs
index fbcca98493..bf27c7bd15 100644
--- a/Assets/SEE/Controls/Actions/AbstractPlayerAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/AbstractPlayerAction.cs
@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
-using SEE.Utils.History;
using UnityEngine;
using UnityEngine.Assertions;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// An abstract superclass of all PlayerActions such as NewNodeAction, ScaleNodeAction, EditNodeAction and AddEdgeAction.
diff --git a/Assets/SEE/Controls/Actions/AbstractPlayerAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/AbstractPlayerAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/AbstractPlayerAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/AbstractPlayerAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/AcceptDivergenceAction.cs b/Assets/SEE/Controls/ReversibleActions/AcceptDivergenceAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/AcceptDivergenceAction.cs
rename to Assets/SEE/Controls/ReversibleActions/AcceptDivergenceAction.cs
index 51da702a66..9c514c91a5 100644
--- a/Assets/SEE/Controls/Actions/AcceptDivergenceAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/AcceptDivergenceAction.cs
@@ -1,21 +1,21 @@
using SEE.Audio;
using SEE.DataModel.DG;
-using SEE.Game;
-using SEE.Game.SceneManipulation;
-using SEE.GO;
+using SEE.SceneManipulation;
+using SEE.Extensions;
using SEE.Net.Actions;
using SEE.Net.Actions.GraphElement;
using SEE.Tools.ReflexionAnalysis;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using SEE.XR;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
+using SEE.GraphElementRefs;
+using SEE.UserSettings;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Action to solve a divergence (see ) between
@@ -115,7 +115,7 @@ public override void Stop()
/// True if completed.
public override bool Update()
{
- if (User.UserSettings.IsVR)
+ if (UserSetting.IsVR)
{
if (XRSEEActions.Selected
&& XRSEEActions.RayInteractor.TryGetCurrent3DRaycastHit(out RaycastHit hit))
diff --git a/Assets/SEE/Controls/Actions/AcceptDivergenceAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/AcceptDivergenceAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/AcceptDivergenceAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/AcceptDivergenceAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ActionStateType.cs b/Assets/SEE/Controls/ReversibleActions/ActionStateType.cs
similarity index 97%
rename from Assets/SEE/Controls/Actions/ActionStateType.cs
rename to Assets/SEE/Controls/ReversibleActions/ActionStateType.cs
index a03f66515a..58d5a4039c 100644
--- a/Assets/SEE/Controls/Actions/ActionStateType.cs
+++ b/Assets/SEE/Controls/ReversibleActions/ActionStateType.cs
@@ -1,9 +1,7 @@
-using SEE.Utils.History;
using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
-
///
/// The type of a state-based action.
///
diff --git a/Assets/SEE/Controls/Actions/ActionStateType.cs.meta b/Assets/SEE/Controls/ReversibleActions/ActionStateType.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ActionStateType.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/ActionStateType.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ActionStateTypeGroup.cs b/Assets/SEE/Controls/ReversibleActions/ActionStateTypeGroup.cs
similarity index 97%
rename from Assets/SEE/Controls/Actions/ActionStateTypeGroup.cs
rename to Assets/SEE/Controls/ReversibleActions/ActionStateTypeGroup.cs
index 8ce6273b5e..862bc73d84 100644
--- a/Assets/SEE/Controls/Actions/ActionStateTypeGroup.cs
+++ b/Assets/SEE/Controls/ReversibleActions/ActionStateTypeGroup.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using UnityEngine;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// A group of other s. It is not itself executable but
diff --git a/Assets/SEE/Controls/Actions/ActionStateTypeGroup.cs.meta b/Assets/SEE/Controls/ReversibleActions/ActionStateTypeGroup.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ActionStateTypeGroup.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/ActionStateTypeGroup.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ActionStateTypes.cs b/Assets/SEE/Controls/ReversibleActions/ActionStateTypes.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/ActionStateTypes.cs
rename to Assets/SEE/Controls/ReversibleActions/ActionStateTypes.cs
index 2d38fec8de..0bae54379a 100644
--- a/Assets/SEE/Controls/Actions/ActionStateTypes.cs
+++ b/Assets/SEE/Controls/ReversibleActions/ActionStateTypes.cs
@@ -1,15 +1,16 @@
using UnityEngine;
using SEE.Utils;
-using SEE.Controls.Actions.HolisticMetrics;
-using SEE.Controls.Actions.Drawable;
-using SEE.Controls.Actions.Table;
+using SEE.Extensions;
+using SEE.Controls.ReversibleActions.HolisticMetrics;
+using SEE.Controls.ReversibleActions.Drawable;
+using SEE.Controls.ReversibleActions.Tables;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Provides all available s.
///
- /// These are used for .
+ /// These are used for .
public static class ActionStateTypes
{
///
diff --git a/Assets/SEE/Controls/Actions/ActionStateTypes.cs.meta b/Assets/SEE/Controls/ReversibleActions/ActionStateTypes.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ActionStateTypes.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/ActionStateTypes.cs.meta
diff --git a/Assets/SEE/Controls/Actions/AddEdgeAction.cs b/Assets/SEE/Controls/ReversibleActions/AddEdgeAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/AddEdgeAction.cs
rename to Assets/SEE/Controls/ReversibleActions/AddEdgeAction.cs
index 9b4024e1c0..369f52e295 100644
--- a/Assets/SEE/Controls/Actions/AddEdgeAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/AddEdgeAction.cs
@@ -1,19 +1,19 @@
using System.Collections.Generic;
-using SEE.Game;
using SEE.UI.Notification;
-using SEE.GO;
-using SEE.Net.Actions;
+using SEE.Extensions;
using SEE.Utils;
-using SEE.Utils.History;
using System;
using UnityEngine;
using SEE.Audio;
using SEE.DataModel.DG;
-using SEE.Game.SceneManipulation;
+using SEE.SceneManipulation;
using SEE.XR;
+using SEE.UserSettings;
+using SEE.GraphElementRefs;
using SEE.Net.Actions.GraphElement;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Action to create an edge between two selected nodes.
@@ -143,7 +143,7 @@ public override bool Update()
// Assigning the game objects to be connected.
// Checking whether the two game objects are not null and whether they are
// actually nodes.
- if (User.UserSettings.IsVR)
+ if (UserSetting.IsVR)
{
if (XRSEEActions.Selected
&& InteractableObject.HoveredObjectWithWorldFlag.gameObject != null
diff --git a/Assets/SEE/Controls/Actions/AddEdgeAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/AddEdgeAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/AddEdgeAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/AddEdgeAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/AddNodeAction.cs b/Assets/SEE/Controls/ReversibleActions/AddNodeAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/AddNodeAction.cs
rename to Assets/SEE/Controls/ReversibleActions/AddNodeAction.cs
index 269e5c9dad..4e9b2cedfe 100644
--- a/Assets/SEE/Controls/Actions/AddNodeAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/AddNodeAction.cs
@@ -4,19 +4,19 @@
using UnityEngine;
using SEE.Audio;
using SEE.DataModel.DG;
-using SEE.Game;
using SEE.Game.City;
-using SEE.Game.SceneManipulation;
-using SEE.GO;
-using SEE.Net.Actions;
+using SEE.SceneManipulation;
+using SEE.Extensions;
using SEE.UI.Notification;
using SEE.UI.PropertyDialog;
using SEE.Utils;
-using SEE.Utils.History;
using SEE.XR;
+using SEE.GraphElementRefs;
+using SEE.UserSettings;
using SEE.Net.Actions.GraphElement;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Action to create a new node for a selected city.
@@ -79,14 +79,14 @@ public override bool Update()
switch (progress)
{
case ProgressState.NoNodeSelected:
- if (User.UserSettings.IsDesktop && Input.GetMouseButtonDown(0)
+ if (UserSetting.IsDesktop && Input.GetMouseButtonDown(0)
&& Raycasting.RaycastGraphElement(out RaycastHit raycastHit, out GraphElementRef ger, false) == HitGraphElement.Node
&& ger.gameObject.TryGetComponent(out InteractableObject io)
&& io.IsInteractable(raycastHit.point))
{
CheckAddNode(raycastHit.collider.gameObject, raycastHit.transform.InverseTransformPoint(raycastHit.point));
}
- else if (User.UserSettings.IsVR
+ else if (UserSetting.IsVR
&& XRSEEActions.Selected
&& InteractableObject.HoveredObjectWithWorldFlag.gameObject != null
&& InteractableObject.HoveredObjectWithWorldFlag.gameObject.HasNodeRef()
diff --git a/Assets/SEE/Controls/Actions/AddNodeAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/AddNodeAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/AddNodeAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/AddNodeAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/DeleteAction.cs b/Assets/SEE/Controls/ReversibleActions/DeleteAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/DeleteAction.cs
rename to Assets/SEE/Controls/ReversibleActions/DeleteAction.cs
index aec7d9d604..a49d4569c7 100644
--- a/Assets/SEE/Controls/Actions/DeleteAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/DeleteAction.cs
@@ -4,21 +4,24 @@
using SEE.DataModel.DG;
using SEE.Game;
using SEE.Game.City;
-using SEE.Game.SceneManipulation;
-using SEE.GO;
+using SEE.SceneManipulation;
+using SEE.Extensions;
using SEE.Net.Actions;
using SEE.Net.Actions.GraphElement;
using SEE.UI.Menu;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using SEE.XR;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
+using SEE.GraphElementRefs;
+using SEE.UserSettings;
+using SEE.Controls.KeyActions;
+using SEE.Controls.Players;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Action to delete the currently selected game object (edge or node)
@@ -219,7 +222,7 @@ public override bool Update()
///
private void HandleInputSelection()
{
- if (User.UserSettings.IsDesktop && Input.GetMouseButtonDown(0)
+ if (UserSetting.IsDesktop && Input.GetMouseButtonDown(0)
&& Raycasting.RaycastGraphElement(out RaycastHit raycastHit, out GraphElementRef _) != HitGraphElement.None)
{
// the hit object is the one to be deleted
@@ -228,7 +231,7 @@ private void HandleInputSelection()
validationViaContextMenu = false;
progress = ProgressState.Validation;
}
- else if (User.UserSettings.IsVR && XRSEEActions.Selected)
+ else if (UserSetting.IsVR && XRSEEActions.Selected)
{
// the hit object is the one to be deleted
hitGraphElements.Add(InteractableObject.HoveredObjectWithWorldFlag.gameObject);
diff --git a/Assets/SEE/Controls/Actions/DeleteAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/DeleteAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/DeleteAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/DeleteAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable.meta b/Assets/SEE/Controls/ReversibleActions/Drawable.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/AddImageAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/AddImageAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/AddImageAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/AddImageAction.cs
index 8f4d064a71..ef95ab5ed6 100644
--- a/Assets/SEE/Controls/Actions/Drawable/AddImageAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/AddImageAction.cs
@@ -8,15 +8,14 @@
using System.Collections.Generic;
using System.IO;
using UnityEngine;
-using SEE.Utils.History;
using SEE.UI.PropertyDialog.Drawable;
using SEE.UI.Drawable;
using SEE.UI.Menu.Drawable;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Game.Drawable.ValueHolders;
using SEE.UI;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This class provides an action to add an image to a drawable.
diff --git a/Assets/SEE/Controls/Actions/Drawable/AddImageAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/AddImageAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/AddImageAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/AddImageAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/ClearAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/ClearAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/ClearAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/ClearAction.cs
index 1bed16b47f..f7a2d0c27e 100644
--- a/Assets/SEE/Controls/Actions/Drawable/ClearAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/ClearAction.cs
@@ -5,13 +5,13 @@
using SEE.Utils;
using System.Collections.Generic;
using UnityEngine;
-using SEE.Utils.History;
using SEE.Game.Drawable.ValueHolders;
using SEE.Game.Drawable.ActionHelpers;
using SEE.UI.Menu.Drawable;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This class provides an action to clear a whole drawable.
diff --git a/Assets/SEE/Controls/Actions/Drawable/ClearAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/ClearAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/ClearAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/ClearAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/ColorPickerAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/ColorPickerAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/ColorPickerAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/ColorPickerAction.cs
index 233ba3c2fc..ff5b619f10 100644
--- a/Assets/SEE/Controls/Actions/Drawable/ColorPickerAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/ColorPickerAction.cs
@@ -2,17 +2,17 @@
using SEE.Game.Drawable;
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
-using SEE.GO;
+using SEE.Extensions;
using SEE.UI;
using SEE.UI.Drawable;
using SEE.UI.Menu.Drawable;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This class provides a color picker action for objects.
diff --git a/Assets/SEE/Controls/Actions/Drawable/ColorPickerAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/ColorPickerAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/ColorPickerAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/ColorPickerAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/CutCopyPasteAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/CutCopyPasteAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/CutCopyPasteAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/CutCopyPasteAction.cs
index 5ecbf0a98a..a265029d8c 100644
--- a/Assets/SEE/Controls/Actions/Drawable/CutCopyPasteAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/CutCopyPasteAction.cs
@@ -4,17 +4,17 @@
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
using SEE.Game.Drawable.ValueHolders;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Net.Actions.Drawable;
using SEE.UI;
using SEE.UI.Menu.Drawable;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using UnityEngine;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This action provides the cut, copy, and paste functionality
diff --git a/Assets/SEE/Controls/Actions/Drawable/CutCopyPasteAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/CutCopyPasteAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/CutCopyPasteAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/CutCopyPasteAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/DrawFreehandAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/DrawFreehandAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/DrawFreehandAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/DrawFreehandAction.cs
index 94909f4492..cac0eff5fc 100644
--- a/Assets/SEE/Controls/Actions/Drawable/DrawFreehandAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/DrawFreehandAction.cs
@@ -1,16 +1,16 @@
+using SEE.Controls.KeyActions;
using SEE.Game.Drawable;
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
using SEE.Net.Actions.Drawable;
using SEE.UI.Menu.Drawable;
using SEE.Utils;
-using SEE.Utils.History;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This action allows drawing on a drawable.
diff --git a/Assets/SEE/Controls/Actions/Drawable/DrawFreehandAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/DrawFreehandAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/DrawFreehandAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/DrawFreehandAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/DrawShapesAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/DrawShapesAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/DrawShapesAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/DrawShapesAction.cs
index 2962251b00..6649270f92 100644
--- a/Assets/SEE/Controls/Actions/Drawable/DrawShapesAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/DrawShapesAction.cs
@@ -1,21 +1,21 @@
using SEE.Game.Drawable;
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
+using SEE.Extensions;
using SEE.Game.Drawable.ValueHolders;
-using SEE.GO;
using SEE.Net.Actions.Drawable;
using SEE.UI.Menu.Drawable;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
+using SEE.Controls.KeyActions;
using static SEE.Game.Drawable.ActionHelpers.LineCapPointsCalculator;
using static SEE.Game.Drawable.GameDrawer;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// Allows the user to draw a shape.
diff --git a/Assets/SEE/Controls/Actions/Drawable/DrawShapesAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/DrawShapesAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/DrawShapesAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/DrawShapesAction.cs.meta
diff --git a/Assets/SEE/Controls/ReversibleActions/Drawable/Drawable.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/Drawable.cs
new file mode 100644
index 0000000000..8bfe70e898
--- /dev/null
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/Drawable.cs
@@ -0,0 +1,6 @@
+///
+/// Actions for drawing.
+///
+namespace SEE.Controls.ReversibleActions.Drawable
+{
+}
diff --git a/Assets/SEE/Controls/ReversibleActions/Drawable/Drawable.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/Drawable.cs.meta
new file mode 100644
index 0000000000..2f2a77e966
--- /dev/null
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/Drawable.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 931b568f360f1c946a099c460b613a56
\ No newline at end of file
diff --git a/Assets/SEE/Controls/Actions/Drawable/DrawableAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/DrawableAction.cs
similarity index 89%
rename from Assets/SEE/Controls/Actions/Drawable/DrawableAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/DrawableAction.cs
index cdb0ef8a6e..eff4f0b929 100644
--- a/Assets/SEE/Controls/Actions/Drawable/DrawableAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/DrawableAction.cs
@@ -1,6 +1,6 @@
using UnityEngine;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// Super class of all actions dealing with drawables. Provides the
diff --git a/Assets/SEE/Controls/Actions/Drawable/DrawableAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/DrawableAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/DrawableAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/DrawableAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/EditAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/EditAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/EditAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/EditAction.cs
index de4b716c75..d926ffb45d 100644
--- a/Assets/SEE/Controls/Actions/Drawable/EditAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/EditAction.cs
@@ -8,11 +8,11 @@
using System.Collections.Generic;
using UnityEngine;
using TextConf = SEE.Game.Drawable.Configurations.TextConf;
-using SEE.Utils.History;
using SEE.Game.Drawable.ActionHelpers;
using SEE.UI;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This class provides the option to edit a object.
diff --git a/Assets/SEE/Controls/Actions/Drawable/EditAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/EditAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/EditAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/EditAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/EraseAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/EraseAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/EraseAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/EraseAction.cs
index bf362d23cc..9556f7dc49 100644
--- a/Assets/SEE/Controls/Actions/Drawable/EraseAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/EraseAction.cs
@@ -1,3 +1,4 @@
+using SEE.Controls.KeyActions;
using SEE.Game;
using SEE.Game.Drawable;
using SEE.Game.Drawable.ActionHelpers;
@@ -5,12 +6,11 @@
using SEE.Game.Drawable.ValueHolders;
using SEE.Net.Actions.Drawable;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This class provides the action to erase (delete) a object.
diff --git a/Assets/SEE/Controls/Actions/Drawable/EraseAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/EraseAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/EraseAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/EraseAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/LayerChangeAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/LayerChangeAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/Drawable/LayerChangeAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LayerChangeAction.cs
index 77091ab13a..892612d6b7 100644
--- a/Assets/SEE/Controls/Actions/Drawable/LayerChangeAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/LayerChangeAction.cs
@@ -7,12 +7,12 @@
using SEE.Utils;
using System.Collections.Generic;
using UnityEngine;
-using SEE.Utils.History;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Game.Drawable.ActionHelpers;
using SEE.UI;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This class is responsible for changing the layer order of a
diff --git a/Assets/SEE/Controls/Actions/Drawable/LayerChangeAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/LayerChangeAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/LayerChangeAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LayerChangeAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/LineAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/LineAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/Drawable/LineAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LineAction.cs
index 38526f40d3..5981d075ae 100644
--- a/Assets/SEE/Controls/Actions/Drawable/LineAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/LineAction.cs
@@ -9,7 +9,7 @@
using System.Linq;
using UnityEngine;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This abstract class is the base for all actions that work with lines.
diff --git a/Assets/SEE/Controls/Actions/Drawable/LineAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/LineAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/LineAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LineAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/LineConnectionEraseAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/LineConnectionEraseAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/Drawable/LineConnectionEraseAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LineConnectionEraseAction.cs
index 8745ea01b3..8c2c757256 100644
--- a/Assets/SEE/Controls/Actions/Drawable/LineConnectionEraseAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/LineConnectionEraseAction.cs
@@ -1,14 +1,14 @@
+using SEE.Controls.KeyActions;
using SEE.Game;
using SEE.Game.Drawable;
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
using SEE.Net.Actions.Drawable;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using UnityEngine;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This action allows the user to delete a line connector between two points.
diff --git a/Assets/SEE/Controls/Actions/Drawable/LineConnectionEraseAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/LineConnectionEraseAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/LineConnectionEraseAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LineConnectionEraseAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/LinePointEraseAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/LinePointEraseAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/Drawable/LinePointEraseAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LinePointEraseAction.cs
index 0a93cbb5c5..30c58b00a7 100644
--- a/Assets/SEE/Controls/Actions/Drawable/LinePointEraseAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/LinePointEraseAction.cs
@@ -1,14 +1,14 @@
+using SEE.Controls.KeyActions;
using SEE.Game;
using SEE.Game.Drawable;
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
using SEE.Net.Actions.Drawable;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using UnityEngine;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This class provides an action to erase only some points of a .
diff --git a/Assets/SEE/Controls/Actions/Drawable/LinePointEraseAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/LinePointEraseAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/LinePointEraseAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LinePointEraseAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/LineSplitAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/LineSplitAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/LineSplitAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LineSplitAction.cs
index 80bc95d72c..1697ba7af0 100644
--- a/Assets/SEE/Controls/Actions/Drawable/LineSplitAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/LineSplitAction.cs
@@ -3,16 +3,16 @@
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
using SEE.Game.Drawable.ValueHolders;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Net.Actions.Drawable;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This action allows the user to split a .
diff --git a/Assets/SEE/Controls/Actions/Drawable/LineSplitAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/LineSplitAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/LineSplitAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LineSplitAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/LoadAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/LoadAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/LoadAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LoadAction.cs
index 6139337a34..4b17ceca5f 100644
--- a/Assets/SEE/Controls/Actions/Drawable/LoadAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/LoadAction.cs
@@ -4,21 +4,21 @@
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
using SEE.Game.Drawable.ValueHolders;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Net.Actions.Drawable;
using SEE.UI;
using SEE.UI.Drawable;
using SEE.UI.Menu.Drawable;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using SEE.Utils.Paths;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Events;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// Adds the to the scene from one or more drawable configs saved
diff --git a/Assets/SEE/Controls/Actions/Drawable/LoadAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/LoadAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/LoadAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/LoadAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/MindMapAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/MindMapAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/MindMapAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/MindMapAction.cs
index 3c5108761a..364b6d3f5a 100644
--- a/Assets/SEE/Controls/Actions/Drawable/MindMapAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/MindMapAction.cs
@@ -3,18 +3,18 @@
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
using SEE.Game.Drawable.ValueHolders;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Net.Actions.Drawable;
using SEE.UI.Menu.Drawable;
using SEE.UI.Notification;
using SEE.UI.PropertyDialog.Drawable;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using UnityEngine;
using static SEE.UI.Menu.Drawable.MindMapMenu;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This class provides the operations for a mind map.
diff --git a/Assets/SEE/Controls/Actions/Drawable/MindMapAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/MindMapAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/MindMapAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/MindMapAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/MovePointAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/MovePointAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/MovePointAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/MovePointAction.cs
index d3b8d33b5d..13ece09d4c 100644
--- a/Assets/SEE/Controls/Actions/Drawable/MovePointAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/MovePointAction.cs
@@ -3,14 +3,14 @@
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
using SEE.UI.Notification;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Net.Actions.Drawable;
using SEE.Utils;
using System.Collections.Generic;
using UnityEngine;
-using SEE.Utils.History;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This action allows the user to move a point of a .
diff --git a/Assets/SEE/Controls/Actions/Drawable/MovePointAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/MovePointAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/MovePointAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/MovePointAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/MoveRotateAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/MoveRotateAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/MoveRotateAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/MoveRotateAction.cs
index 54ebfc4d36..a346be514e 100644
--- a/Assets/SEE/Controls/Actions/Drawable/MoveRotateAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/MoveRotateAction.cs
@@ -1,4 +1,5 @@
using Michsky.UI.ModernUIPack;
+using SEE.Controls.KeyActions;
using SEE.Game;
using SEE.Game.Drawable;
using SEE.Game.Drawable.ActionHelpers;
@@ -9,12 +10,11 @@
using SEE.UI.Menu.Drawable;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using UnityEngine;
using MoveNetAction = SEE.Net.Actions.Drawable.MoveNetAction;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// Moves or rotate a drawable type object.
diff --git a/Assets/SEE/Controls/Actions/Drawable/MoveRotateAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/MoveRotateAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/MoveRotateAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/MoveRotateAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/SaveAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/SaveAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/SaveAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/SaveAction.cs
index 0a7ede8af9..7558486a88 100644
--- a/Assets/SEE/Controls/Actions/Drawable/SaveAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/SaveAction.cs
@@ -3,21 +3,20 @@
using SEE.Game.Drawable;
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
+using SEE.UI.Notification;
+using SEE.Extensions;
using SEE.Game.Drawable.ValueHolders;
-using SEE.GO;
using SEE.UI;
using SEE.UI.Drawable;
using SEE.UI.Menu.Drawable;
-using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using SEE.Utils.Paths;
-using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// Saves one or more drawable configurations to a file.
diff --git a/Assets/SEE/Controls/Actions/Drawable/SaveAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/SaveAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/SaveAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/SaveAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/ScaleAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/ScaleAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/ScaleAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/ScaleAction.cs
index 8622f5fff4..be1b622e86 100644
--- a/Assets/SEE/Controls/Actions/Drawable/ScaleAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/ScaleAction.cs
@@ -1,4 +1,5 @@
-using SEE.Game.Drawable;
+using SEE.Controls.KeyActions;
+using SEE.Game.Drawable;
using SEE.Game.Drawable.ActionHelpers;
using SEE.Game.Drawable.Configurations;
using SEE.Net.Actions.Drawable;
@@ -7,11 +8,10 @@
using SEE.UI.Menu.Drawable;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using UnityEngine;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// Scales a drawable type object.
diff --git a/Assets/SEE/Controls/Actions/Drawable/ScaleAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/ScaleAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/ScaleAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/ScaleAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/ShowDrawableManager.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/ShowDrawableManager.cs
similarity index 90%
rename from Assets/SEE/Controls/Actions/Drawable/ShowDrawableManager.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/ShowDrawableManager.cs
index 584be6ae07..3c66daa23b 100644
--- a/Assets/SEE/Controls/Actions/Drawable/ShowDrawableManager.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/ShowDrawableManager.cs
@@ -1,12 +1,13 @@
using Cysharp.Threading.Tasks;
-using SEE.GO;
+using SEE.Controls.KeyActions;
+using SEE.Controls.Players;
+using SEE.Extensions;
using SEE.UI;
-using SEE.UI.Drawable;
using SEE.UI.Window;
using SEE.UI.Window.DrawableManagerWindow;
using UnityEngine;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// Allows the user to show or hide the drawable manager window.
@@ -41,8 +42,8 @@ internal void ShowDrawableManagerWindow()
async UniTaskVoid SetupManager()
{
- await UniTask.WaitUntil(() => WindowSpaceManager.ManagerInstance[WindowSpaceManager.LocalPlayer] != null);
- space = WindowSpaceManager.ManagerInstance[WindowSpaceManager.LocalPlayer];
+ await UniTask.WaitUntil(() => WindowSpaceManager.WindowSpaceOfLocalPlayer != null);
+ space = WindowSpaceManager.WindowSpaceOfLocalPlayer;
space.AddWindow(window);
space.ActiveWindow = window;
}
diff --git a/Assets/SEE/Controls/Actions/Drawable/ShowDrawableManager.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/ShowDrawableManager.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/ShowDrawableManager.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/ShowDrawableManager.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/StickyNoteAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/StickyNoteAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/StickyNoteAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/StickyNoteAction.cs
index 35290b65bb..c1a1e1a548 100644
--- a/Assets/SEE/Controls/Actions/Drawable/StickyNoteAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/StickyNoteAction.cs
@@ -2,16 +2,16 @@
using SEE.Game;
using SEE.Game.Drawable;
using SEE.Game.Drawable.Configurations;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Net.Actions.Drawable;
using SEE.UI.Menu.Drawable;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using UnityEngine;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// This class provides all operations for sticky notes.
diff --git a/Assets/SEE/Controls/Actions/Drawable/StickyNoteAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/StickyNoteAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/StickyNoteAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/StickyNoteAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Drawable/WriteTextAction.cs b/Assets/SEE/Controls/ReversibleActions/Drawable/WriteTextAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Drawable/WriteTextAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Drawable/WriteTextAction.cs
index 803c4b62b8..686580e298 100644
--- a/Assets/SEE/Controls/Actions/Drawable/WriteTextAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Drawable/WriteTextAction.cs
@@ -8,12 +8,11 @@
using SEE.Utils;
using System.Collections.Generic;
using UnityEngine;
-using SEE.Utils.History;
using SEE.Game.Drawable.ValueHolders;
using SEE.Game.Drawable.ActionHelpers;
using SEE.UI;
-namespace SEE.Controls.Actions.Drawable
+namespace SEE.Controls.ReversibleActions.Drawable
{
///
/// Adds a text to a drawable.
diff --git a/Assets/SEE/Controls/Actions/Drawable/WriteTextAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Drawable/WriteTextAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Drawable/WriteTextAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Drawable/WriteTextAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/EditNodeAction.cs b/Assets/SEE/Controls/ReversibleActions/EditNodeAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/EditNodeAction.cs
rename to Assets/SEE/Controls/ReversibleActions/EditNodeAction.cs
index 316a261c41..222089f2b5 100644
--- a/Assets/SEE/Controls/Actions/EditNodeAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/EditNodeAction.cs
@@ -1,15 +1,16 @@
using SEE.DataModel.DG;
-using SEE.Game.SceneManipulation;
-using SEE.GO;
+using SEE.SceneManipulation;
+using SEE.Extensions;
using SEE.Net.Actions.GraphElement;
using SEE.UI.PropertyDialog;
using SEE.Utils;
-using SEE.Utils.History;
using System;
using System.Collections.Generic;
using UnityEngine;
+using SEE.GraphElementRefs;
+using SEE.Controls.KeyActions;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Action to edit an existing node's attributes.
diff --git a/Assets/SEE/Controls/Actions/EditNodeAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/EditNodeAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/EditNodeAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/EditNodeAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HideAction.cs b/Assets/SEE/Controls/ReversibleActions/HideAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/HideAction.cs
rename to Assets/SEE/Controls/ReversibleActions/HideAction.cs
index 10b633610e..6d2f8b2bb2 100644
--- a/Assets/SEE/Controls/Actions/HideAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/HideAction.cs
@@ -1,15 +1,16 @@
using SEE.DataModel.DG;
using SEE.Game;
-using SEE.GO;
+using SEE.Extensions;
using System.Collections.Generic;
using System.Linq;
using SEE.UI.PropertyDialog;
using UnityEngine;
using UnityEngine.Assertions;
-using SEE.Utils.History;
using SEE.XR;
+using SEE.GraphElementRefs;
+using SEE.UserSettings;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Action to hide/show the currently selected game object (edge or node).
@@ -79,7 +80,7 @@ public override IReversibleAction NewInstance()
///
public override void Start()
{
- if (User.UserSettings.IsDesktop)
+ if (UserSetting.IsDesktop)
{
base.Stop();
OpenDialog();
@@ -131,11 +132,11 @@ public override void Stop()
/// True if completed.
public override bool Update()
{
- if (User.UserSettings.IsDesktop)
+ if (UserSetting.IsDesktop)
{
MakeUnselectedTransparent();
}
- if (User.UserSettings.IsVR)
+ else if (UserSetting.IsVR)
{
mode = RadialSelection.HideMode;
}
diff --git a/Assets/SEE/Controls/Actions/HideAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/HideAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HideAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/HideAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HideModeSelector.cs b/Assets/SEE/Controls/ReversibleActions/HideModeSelector.cs
similarity index 92%
rename from Assets/SEE/Controls/Actions/HideModeSelector.cs
rename to Assets/SEE/Controls/ReversibleActions/HideModeSelector.cs
index 2e337db77f..da85e78abc 100644
--- a/Assets/SEE/Controls/Actions/HideModeSelector.cs
+++ b/Assets/SEE/Controls/ReversibleActions/HideModeSelector.cs
@@ -1,4 +1,4 @@
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Represents the various modes for hiding nodes and edges
diff --git a/Assets/SEE/Controls/Actions/HideModeSelector.cs.meta b/Assets/SEE/Controls/ReversibleActions/HideModeSelector.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HideModeSelector.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/HideModeSelector.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics.meta b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HolisticMetrics.meta
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics.meta
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/AddBoardAction.cs b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/AddBoardAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/AddBoardAction.cs
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/AddBoardAction.cs
index 37e046ddfb..ec4c66c91d 100644
--- a/Assets/SEE/Controls/Actions/HolisticMetrics/AddBoardAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/AddBoardAction.cs
@@ -6,11 +6,9 @@
using SEE.Net.Actions.HolisticMetrics;
using SEE.Utils;
using UnityEngine;
-using SEE.Utils.History;
-using SEE.UI.Drawable;
using SEE.UI;
-namespace SEE.Controls.Actions.HolisticMetrics
+namespace SEE.Controls.ReversibleActions.HolisticMetrics
{
///
/// This action manages the creation of a specific metrics board.
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/AddBoardAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/AddBoardAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/AddBoardAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/AddBoardAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/AddWidgetAction.cs b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/AddWidgetAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/AddWidgetAction.cs
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/AddWidgetAction.cs
index d7011bdfd5..dbf90cc720 100644
--- a/Assets/SEE/Controls/Actions/HolisticMetrics/AddWidgetAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/AddWidgetAction.cs
@@ -5,9 +5,8 @@
using SEE.UI.PropertyDialog.HolisticMetrics;
using SEE.Net.Actions.HolisticMetrics;
using UnityEngine;
-using SEE.Utils.History;
-namespace SEE.Controls.Actions.HolisticMetrics
+namespace SEE.Controls.ReversibleActions.HolisticMetrics
{
///
/// This class manages the creation of a holistic metrics widget. It is needed so we can also revert the deletion.
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/AddWidgetAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/AddWidgetAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/AddWidgetAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/AddWidgetAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/DeleteBoardAction.cs b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/DeleteBoardAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/DeleteBoardAction.cs
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/DeleteBoardAction.cs
index a17630b7ba..b15dc17c3b 100644
--- a/Assets/SEE/Controls/Actions/HolisticMetrics/DeleteBoardAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/DeleteBoardAction.cs
@@ -2,10 +2,9 @@
using SEE.Game.HolisticMetrics;
using SEE.Net.Actions.HolisticMetrics;
using SEE.Utils;
-using SEE.Utils.History;
using UnityEngine;
-namespace SEE.Controls.Actions.HolisticMetrics
+namespace SEE.Controls.ReversibleActions.HolisticMetrics
{
///
/// This class manages the delete action deleting one metrics board. When deleting a board, you should use this
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/DeleteBoardAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/DeleteBoardAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/DeleteBoardAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/DeleteBoardAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/DeleteWidgetAction.cs b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/DeleteWidgetAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/DeleteWidgetAction.cs
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/DeleteWidgetAction.cs
index e92ccce715..f5cba9fd9d 100644
--- a/Assets/SEE/Controls/Actions/HolisticMetrics/DeleteWidgetAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/DeleteWidgetAction.cs
@@ -1,10 +1,9 @@
using System.Collections.Generic;
using SEE.Game.HolisticMetrics;
using SEE.Net.Actions.HolisticMetrics;
-using SEE.Utils.History;
using UnityEngine;
-namespace SEE.Controls.Actions.HolisticMetrics
+namespace SEE.Controls.ReversibleActions.HolisticMetrics
{
///
/// This class is responsible for executing or reverting widget deletions. (holistic metric widgets)
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/DeleteWidgetAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/DeleteWidgetAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/DeleteWidgetAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/DeleteWidgetAction.cs.meta
diff --git a/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/HolisticMetrics.cs b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/HolisticMetrics.cs
new file mode 100644
index 0000000000..fbca1af384
--- /dev/null
+++ b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/HolisticMetrics.cs
@@ -0,0 +1,6 @@
+///
+/// Actions for the metric board.
+///
+namespace SEE.Controls.ReversibleActions.HolisticMetrics
+{
+}
diff --git a/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/HolisticMetrics.cs.meta b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/HolisticMetrics.cs.meta
new file mode 100644
index 0000000000..87943707cb
--- /dev/null
+++ b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/HolisticMetrics.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: edbeba3f87d2cd445b3ebb3a904b359e
\ No newline at end of file
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/LoadBoardAction.cs b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/LoadBoardAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/LoadBoardAction.cs
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/LoadBoardAction.cs
index 14716d32f0..9eafa4c15a 100644
--- a/Assets/SEE/Controls/Actions/HolisticMetrics/LoadBoardAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/LoadBoardAction.cs
@@ -7,10 +7,9 @@
using SEE.Net.Actions.HolisticMetrics;
using SEE.Utils;
using UnityEngine;
-using SEE.Utils.History;
using SEE.UI;
-namespace SEE.Controls.Actions.HolisticMetrics
+namespace SEE.Controls.ReversibleActions.HolisticMetrics
{
///
/// Adds a board to the scene from a board config saved in a file on the disk.
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/LoadBoardAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/LoadBoardAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/LoadBoardAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/LoadBoardAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/MoveBoardAction.cs b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/MoveBoardAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/MoveBoardAction.cs
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/MoveBoardAction.cs
index 9697f21133..6211bc5a57 100644
--- a/Assets/SEE/Controls/Actions/HolisticMetrics/MoveBoardAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/MoveBoardAction.cs
@@ -1,10 +1,9 @@
using System.Collections.Generic;
using SEE.Game.HolisticMetrics;
using SEE.Net.Actions.HolisticMetrics;
-using SEE.Utils.History;
using UnityEngine;
-namespace SEE.Controls.Actions.HolisticMetrics
+namespace SEE.Controls.ReversibleActions.HolisticMetrics
{
///
/// Each instance of this class manages one concrete move action of a metrics board from an old position and
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/MoveBoardAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/MoveBoardAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/MoveBoardAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/MoveBoardAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/MoveWidgetAction.cs b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/MoveWidgetAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/MoveWidgetAction.cs
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/MoveWidgetAction.cs
index 72c2edf045..cb9f54a079 100644
--- a/Assets/SEE/Controls/Actions/HolisticMetrics/MoveWidgetAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/MoveWidgetAction.cs
@@ -2,10 +2,9 @@
using System.Collections.Generic;
using SEE.Game.HolisticMetrics;
using SEE.Net.Actions.HolisticMetrics;
-using SEE.Utils.History;
using UnityEngine;
-namespace SEE.Controls.Actions.HolisticMetrics
+namespace SEE.Controls.ReversibleActions.HolisticMetrics
{
///
/// This class manages a move action of a metrics widget from its old position to a new position where the player
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/MoveWidgetAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/MoveWidgetAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/MoveWidgetAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/MoveWidgetAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/SaveBoardAction.cs b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/SaveBoardAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/SaveBoardAction.cs
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/SaveBoardAction.cs
index dd6bd62e8e..d2ea6820cd 100644
--- a/Assets/SEE/Controls/Actions/HolisticMetrics/SaveBoardAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/SaveBoardAction.cs
@@ -5,9 +5,8 @@
using SEE.UI.Notification;
using SEE.UI.PropertyDialog.HolisticMetrics;
using SEE.Utils;
-using SEE.Utils.History;
-namespace SEE.Controls.Actions.HolisticMetrics
+namespace SEE.Controls.ReversibleActions.HolisticMetrics
{
///
/// Saves a metrics board's configuration to a file.
diff --git a/Assets/SEE/Controls/Actions/HolisticMetrics/SaveBoardAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/HolisticMetrics/SaveBoardAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/HolisticMetrics/SaveBoardAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/HolisticMetrics/SaveBoardAction.cs.meta
diff --git a/Assets/SEE/Utils/History/IReversibleAction.cs b/Assets/SEE/Controls/ReversibleActions/IReversibleAction.cs
similarity index 98%
rename from Assets/SEE/Utils/History/IReversibleAction.cs
rename to Assets/SEE/Controls/ReversibleActions/IReversibleAction.cs
index 9caa31c7f1..676e7f23c6 100644
--- a/Assets/SEE/Utils/History/IReversibleAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/IReversibleAction.cs
@@ -1,7 +1,6 @@
-using SEE.Controls.Actions;
-using System.Collections.Generic;
+using System.Collections.Generic;
-namespace SEE.Utils.History
+namespace SEE.Controls.ReversibleActions
{
///
/// Creates a new instance of .
diff --git a/Assets/SEE/Utils/History/IReversibleAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/IReversibleAction.cs.meta
similarity index 100%
rename from Assets/SEE/Utils/History/IReversibleAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/IReversibleAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/MoveAction.cs b/Assets/SEE/Controls/ReversibleActions/MoveAction.cs
similarity index 86%
rename from Assets/SEE/Controls/Actions/MoveAction.cs
rename to Assets/SEE/Controls/ReversibleActions/MoveAction.cs
index 21953138c0..0afcf2a6c3 100644
--- a/Assets/SEE/Controls/Actions/MoveAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/MoveAction.cs
@@ -2,22 +2,24 @@
using System.Collections.Generic;
using UnityEngine;
using SEE.Audio;
-using SEE.Controls.Interactables;
using SEE.DataModel.DG;
using SEE.Game;
using SEE.Game.City;
-using SEE.Game.SceneManipulation;
-using SEE.GO;
-using SEE.Net.Actions;
+using SEE.SceneManipulation;
+using SEE.Extensions;
using SEE.Tools.OpenTelemetry;
using SEE.Tools.ReflexionAnalysis;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using SEE.XR;
+using SEE.GraphElementRefs;
+using SEE.UserSettings;
using SEE.Net.Actions.GraphElement;
+using SEE.Controls.Modifiers;
+using SEE.Controls.KeyActions;
+using SEE.Components.GraphElements;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// An action to grab, move, and drop nodes.
@@ -32,7 +34,7 @@ internal class MoveAction : AbstractPlayerAction
///
/// The object to move which was selected via context menu.
///
- private GameObject contextMenuObjectToMove;
+ private GameObject contextMenuGameNodeToMove;
///
/// The offset of the cursor to the pivot of .
@@ -128,16 +130,16 @@ public override bool Update()
return false;
}
}
- else if ((!movementRequested || User.UserSettings.IsVR) && ExecuteViaContextMenu)
+ else if ((!movementRequested || UserSetting.IsVR) && ExecuteViaContextMenu)
{
// User starts dragging object selected via context menu.
// Override the initial cursorOffset based on new mouse position to reduce jump
- if (contextMenuObjectToMove.TryGetNodeRef(out NodeRef nodeRef)
+ if (contextMenuGameNodeToMove.TryGetNodeRef(out NodeRef nodeRef)
&& Raycasting.RaycastLowestNode(out RaycastHit? targetObjectHit, out Node _, nodeRef))
{
// Calculate position on object and close to the cursor
- Vector3 objectSize = contextMenuObjectToMove.WorldSpaceSize();
- Vector3 objectPosition = contextMenuObjectToMove.transform.position;
+ Vector3 objectSize = contextMenuGameNodeToMove.WorldSpaceSize();
+ Vector3 objectPosition = contextMenuGameNodeToMove.transform.position;
Vector3 anchorPosition = targetObjectHit.Value.point;
anchorPosition.x = Mathf.Clamp(anchorPosition.x,
objectPosition.x - 0.5f * objectSize.x,
@@ -148,15 +150,15 @@ public override bool Update()
cursorOffset = anchorPosition - objectPosition;
}
XRSEEActions.Selected = false;
- grabbedObject.Grab(contextMenuObjectToMove);
+ grabbedObject.Grab(contextMenuGameNodeToMove);
activeAction = true;
CurrentState = IReversibleAction.Progress.InProgress;
}
}
// Drag grabbed object
else if (
- ((User.UserSettings.IsDesktop && (movementRequested ^ ExecuteViaContextMenu)) // exclusive OR
- || (User.UserSettings.IsVR && !XRSEEActions.Selected))
+ ((UserSetting.IsDesktop && (movementRequested ^ ExecuteViaContextMenu)) // exclusive OR
+ || (UserSetting.IsVR && !XRSEEActions.Selected))
&& activeAction)
{
Raycasting.RaycastLowestNode(out RaycastHit? targetObjectHit, out Node _, grabbedObject.Node, false);
@@ -175,10 +177,10 @@ public override bool Update()
// End dragging
else
{
- if (grabbedObject.GrabbedGameObject != null)
+ if (grabbedObject.GrabbedGameNode != null)
{
AudioManagerImpl.EnqueueSoundEffect(IAudioManager.SoundEffect.DropSound,
- grabbedObject.GrabbedGameObject, true);
+ grabbedObject.GrabbedGameNode, true);
}
activeAction = false;
ExecuteViaContextMenu = false;
@@ -186,10 +188,10 @@ public override bool Update()
bool wasMoved = grabbedObject.UnGrab();
// Action is finished.
CurrentState = wasMoved ? IReversibleAction.Progress.Completed : IReversibleAction.Progress.NoEffect;
- if (wasMoved && grabbedObject.GrabbedGameObject != null)
+ if (wasMoved && grabbedObject.GrabbedGameNode != null)
{
- TracingHelperService.Instance?.TrackMoveAction(grabbedObject.GrabbedGameObject,
- grabbedObject.GrabbedGameObject.transform.position, grabbedObject.NewParent);
+ TracingHelperService.Instance?.TrackMoveAction(grabbedObject.GrabbedGameNode,
+ grabbedObject.GrabbedGameNode.transform.position, grabbedObject.NewParent);
}
return wasMoved;
@@ -228,7 +230,7 @@ public void ContextMenuExecution(GameObject objToMove, Vector3 raycastHitPositio
{
ExecuteViaContextMenu = true;
cursorOffset = raycastHitPosition - objToMove.transform.position;
- contextMenuObjectToMove = objToMove;
+ contextMenuGameNodeToMove = objToMove;
}
///
@@ -238,9 +240,9 @@ public void ContextMenuExecution(GameObject objToMove, Vector3 raycastHitPositio
private struct GrabbedObject
{
///
- /// The game object that is currently grabbed.
+ /// The game node that is currently grabbed.
///
- public GameObject GrabbedGameObject
+ public GameObject GrabbedGameNode
{
get;
private set;
@@ -263,13 +265,13 @@ public GameObject GrabbedGameObject
///
/// The name of the grabbed object if any was grabbed; otherwise the empty string.
///
- internal readonly string Name => GrabbedGameObject != null ? GrabbedGameObject.name : string.Empty;
+ internal readonly string Name => GrabbedGameNode != null ? GrabbedGameNode.name : string.Empty;
///
/// The node reference associated with the grabbed object. May be null if no
/// node is associated with the grabbed object.
///
- public readonly NodeRef Node => GrabbedGameObject.TryGetNodeRef(out NodeRef result) ? result : null;
+ public readonly NodeRef Node => GrabbedGameNode.TryGetNodeRef(out NodeRef result) ? result : null;
///
/// Memorizes the new parent of after it was moved.
@@ -321,9 +323,9 @@ public void Grab(GameObject gameObject)
{
if (gameObject != null)
{
- GrabbedGameObject = gameObject;
+ GrabbedGameNode = gameObject;
grabbedObjID = gameObject.name;
- if (User.UserSettings.IsVR)
+ if (UserSetting.IsVR)
{
originalParent = XRSEEActions.OldParent;
}
@@ -388,11 +390,11 @@ public bool UnGrab()
}
}
- if (GrabbedGameObject.TryGetComponent(out InteractableObject interactableObject))
+ if (GrabbedGameNode.TryGetComponent(out InteractableObject interactableObject))
{
interactableObject.SetGrab(grab: false, isInitiator: true);
}
- ShowLabel.Off(GrabbedGameObject);
+ ShowLabel.Off(GrabbedGameNode);
IsGrabbed = false;
// Note: We do not set grabbedObject to null because we may need its
// value later for Undo/Redo.
@@ -414,10 +416,10 @@ public bool UnGrab()
public readonly bool CanBePlaced()
{
Bounds2D parentBounds = new(NewParent);
- Bounds2D grabbedBounds = new(GrabbedGameObject);
+ Bounds2D grabbedBounds = new(GrabbedGameNode);
bool portalCheckPassed = true;
- if (Portal.GetPortal(GrabbedGameObject, out Vector2 leftFront, out Vector2 rightBack))
+ if (Portal.GetPortal(GrabbedGameNode, out Vector2 leftFront, out Vector2 rightBack))
{
Bounds2D portalBounds = Bounds2D.FromPortal(leftFront, rightBack);
portalCheckPassed = portalBounds.Contains(grabbedBounds);
@@ -425,7 +427,50 @@ public readonly bool CanBePlaced()
return parentBounds.Contains(grabbedBounds)
&& portalCheckPassed
- && !GrabbedGameObject.OverlapsWithSiblings();
+ && !OverlapsWithSiblings(GrabbedGameNode);
+ }
+
+ ///
+ /// Checks if overlaps with any other active direct child node of its parent.
+ ///
+ /// Overlap is checked based on the components. Objects with no
+ /// component and inactive nodes are ignored.
+ ///
+ ///
+ ///
+ /// The must be a node, i.e., coantain a NodeRef component.
+ ///
+ /// The game object whose operator to retrieve.
+ /// False if does not have a component,
+ /// or does not overlap with its siblings.
+ ///
+ /// Thrown when the object the method is called on is not a node, i.e., has no
+ /// component.
+ ///
+ private static bool OverlapsWithSiblings(GameObject gameObject)
+ {
+ if (!gameObject.HasNodeRef())
+ {
+ throw new InvalidOperationException("GameObject must be a node!");
+ }
+ if (!gameObject.TryGetComponent(out Collider collider))
+ {
+ return false;
+ }
+ foreach (Transform sibling in gameObject.transform.parent)
+ {
+ if (sibling.gameObject == gameObject || !sibling.gameObject.IsNodeAndActiveSelf()
+ || !sibling.gameObject.TryGetComponent(out Collider siblingCollider))
+ {
+ continue;
+ }
+
+ if (collider.bounds.Intersects(siblingCollider.bounds))
+ {
+ return true;
+ }
+ }
+ return false;
}
///
@@ -434,11 +479,11 @@ public readonly bool CanBePlaced()
///
private readonly void MoveToOrigin()
{
- if (GrabbedGameObject == null)
+ if (GrabbedGameNode == null)
{
return;
}
- MoveTo(GrabbedGameObject, originalWorldPosition);
+ MoveTo(GrabbedGameNode, originalWorldPosition);
}
///
@@ -448,11 +493,11 @@ private readonly void MoveToOrigin()
///
private readonly void MoveToNewPosition()
{
- if (GrabbedGameObject == null)
+ if (GrabbedGameNode == null)
{
return;
}
- MoveTo(GrabbedGameObject, currentPositionOfGrabbedObject, 1);
+ MoveTo(GrabbedGameNode, currentPositionOfGrabbedObject, 1);
}
///
@@ -466,20 +511,20 @@ private readonly void MoveToNewPosition()
/// The will be updated to reflect the actual target
/// world-space position after the move operation.
///
- /// The will NOT be reparented to the .
+ /// The will NOT be reparented to the .
///
///
/// The game object to place the grabbed node on.
/// The world-space position where the grabbed node should be moved.
internal void MoveToTarget(GameObject targetGameObject, Vector3 targetPosition)
{
- if (GrabbedGameObject == null)
+ if (GrabbedGameNode == null)
{
return;
}
- currentPositionOfGrabbedObject = GameNodeMover.GetCoordinatesOn(GrabbedGameObject.WorldSpaceSize(),
+ currentPositionOfGrabbedObject = GameNodeMover.GetCoordinatesOn(GrabbedGameNode.WorldSpaceSize(),
targetPosition, targetGameObject);
- MoveTo(GrabbedGameObject, currentPositionOfGrabbedObject, 0);
+ MoveTo(GrabbedGameNode, currentPositionOfGrabbedObject, 0);
}
#region HitColor
@@ -551,9 +596,9 @@ internal void Undo()
{
originalParent = GraphElementIDMap.Find(originalParentID).transform;
}
- if (GrabbedGameObject == null)
+ if (GrabbedGameNode == null)
{
- GrabbedGameObject = GraphElementIDMap.Find(grabbedObjID);
+ GrabbedGameNode = GraphElementIDMap.Find(grabbedObjID);
}
UnReparent();
}
@@ -621,7 +666,7 @@ internal void Reparent(GameObject target, bool isProvisional, bool isUnOrRedo =
if (isProvisional)
{
HighlightTarget();
- if (GrabbedGameObject.TryGetComponent(out Outline outline))
+ if (GrabbedGameNode.TryGetComponent(out Outline outline))
{
outline.OutlineColor = CanBePlaced() ? Color.green : Color.red;
}
@@ -636,11 +681,11 @@ internal void Reparent(GameObject target, bool isProvisional, bool isUnOrRedo =
// and the mapping target is not the root of the graph.
if (withinReflexionCity && !target.IsRoot())
{
- ReflexionMapperSetParent(GrabbedGameObject, target);
+ ReflexionMapperSetParent(GrabbedGameNode, target);
}
else
{
- GameNodeMoverSetParent(GrabbedGameObject, target);
+ GameNodeMoverSetParent(GrabbedGameNode, target);
}
}
diff --git a/Assets/SEE/Controls/Actions/MoveAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/MoveAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/MoveAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/MoveAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ResizeNodeAction.cs b/Assets/SEE/Controls/ReversibleActions/ResizeNodeAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/ResizeNodeAction.cs
rename to Assets/SEE/Controls/ReversibleActions/ResizeNodeAction.cs
index 3a6fc24c80..4e0abfbdc4 100644
--- a/Assets/SEE/Controls/Actions/ResizeNodeAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/ResizeNodeAction.cs
@@ -4,15 +4,15 @@
using UnityEngine;
using SEE.Game;
using SEE.Game.City;
-using SEE.Game.SceneManipulation;
-using SEE.GO;
+using SEE.SceneManipulation;
+using SEE.Extensions;
using SEE.Utils;
-using SEE.Utils.History;
using Plane = UnityEngine.Plane;
-using SEE.GO.Factories;
+using SEE.Factories;
+using SEE.GraphElementRefs;
using SEE.Net.Actions.GraphElement;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Action to resize a node.
diff --git a/Assets/SEE/Controls/Actions/ResizeNodeAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/ResizeNodeAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ResizeNodeAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/ResizeNodeAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ShowCodeAction.cs b/Assets/SEE/Controls/ReversibleActions/ShowCodeAction.cs
similarity index 95%
rename from Assets/SEE/Controls/Actions/ShowCodeAction.cs
rename to Assets/SEE/Controls/ReversibleActions/ShowCodeAction.cs
index f6eb42b3ca..ab128cdb81 100644
--- a/Assets/SEE/Controls/Actions/ShowCodeAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/ShowCodeAction.cs
@@ -3,7 +3,7 @@
using System.Linq;
using SEE.UI.Window.CodeWindow;
using SEE.UI.Notification;
-using SEE.GO;
+using SEE.Extensions;
using SEE.Net.Actions;
using SEE.Utils;
using UnityEngine;
@@ -11,25 +11,22 @@
using System;
using Cysharp.Threading.Tasks;
using SEE.UI.Window;
-using SEE.Utils.History;
using SEE.Game.City;
using SEE.VCS;
using SEE.XR;
-using GraphElementRef = SEE.GO.GraphElementRef;
using Range = SEE.DataModel.DG.Range;
+using SEE.GraphProviders.VCS;
+using SEE.GraphElementRefs;
+using SEE.Controls.KeyActions;
+using SEE.Controls.Players;
-namespace SEE.Controls.Actions
+namespace SEE.Controls.ReversibleActions
{
///
/// Action to display the source code of the currently selected node using s.
///
internal class ShowCodeAction : AbstractPlayerAction
{
- ///
- /// Manager object which takes care of the player selection menu and window space dictionary for us.
- ///
- private WindowSpaceManager spaceManager;
-
///
/// Action responsible for synchronizing the window spaces across the network.
///
@@ -51,16 +48,11 @@ public override HashSet GetChangedObjects()
public override IReversibleAction NewInstance() => CreateReversibleAction();
- public override void Awake()
- {
- spaceManager = WindowSpaceManager.ManagerInstance;
- }
-
public override void Start()
{
syncAction = new SyncWindowSpaceAction();
- spaceManager.OnActiveWindowChanged.AddListener(UpdateSpace);
- spaceManager[WindowSpaceManager.LocalPlayer].OnWindowAdded.AddListener(w =>
+ WindowSpaceManager.Instance.OnActiveWindowChanged.AddListener(UpdateSpace);
+ WindowSpaceManager.WindowSpaceOfLocalPlayer.OnWindowAdded.AddListener(w =>
{
if (w is CodeWindow codeWindow)
{
@@ -71,7 +63,7 @@ public override void Start()
void UpdateSpace()
{
- syncAction.UpdateSpace(spaceManager[WindowSpaceManager.LocalPlayer]);
+ syncAction.UpdateSpace(WindowSpaceManager.WindowSpaceOfLocalPlayer);
}
}
@@ -318,7 +310,7 @@ async UniTask EnterWindowContent()
public override bool Update()
{
// Only allow local player to open new code windows
- if (spaceManager.CurrentPlayer == WindowSpaceManager.LocalPlayer
+ if (WindowSpaceManager.CurrentPlayerIsLocalPlayer
&& (SEEInput.Select() || XRSEEActions.Selected)
&& Raycasting.RaycastGraphElement(out RaycastHit _, out GraphElementRef graphElementRef) != HitGraphElement.None)
{
@@ -341,7 +333,7 @@ void ShowCodeWindow()
? ShowUnifiedDiff(edgeRef)
: ShowCode(graphElementRef);
// Add code window to our space of code window, if it isn't in there yet
- WindowSpace manager = spaceManager[WindowSpaceManager.LocalPlayer];
+ WindowSpace manager = WindowSpaceManager.WindowSpaceOfLocalPlayer;
if (!manager.Windows.Contains(codeWindow))
{
manager.AddWindow(codeWindow);
diff --git a/Assets/SEE/Controls/Actions/ShowCodeAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/ShowCodeAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ShowCodeAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/ShowCodeAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/ShowSnapshotWindow.cs b/Assets/SEE/Controls/ReversibleActions/ShowSnapshotWindow.cs
similarity index 87%
rename from Assets/SEE/Controls/Actions/ShowSnapshotWindow.cs
rename to Assets/SEE/Controls/ReversibleActions/ShowSnapshotWindow.cs
index 0b8eefdfc6..6a84669d43 100644
--- a/Assets/SEE/Controls/Actions/ShowSnapshotWindow.cs
+++ b/Assets/SEE/Controls/ReversibleActions/ShowSnapshotWindow.cs
@@ -1,4 +1,6 @@
using System.Linq;
+using SEE.Controls.KeyActions;
+using SEE.Controls.Players;
using SEE.UI.Window;
using SEE.UI.Window.SnapshotsWindow;
using UnityEngine;
@@ -17,7 +19,7 @@ private void Update()
{
if (SEEInput.OpenSnapshotsView())
{
- WindowSpace manager = WindowSpaceManager.ManagerInstance[WindowSpaceManager.LocalPlayer];
+ WindowSpace manager = WindowSpaceManager.WindowSpaceOfLocalPlayer;
if (manager.Windows.OfType().FirstOrDefault() is { } snapshotWindow)
{
diff --git a/Assets/SEE/Controls/Actions/ShowSnapshotWindow.cs.meta b/Assets/SEE/Controls/ReversibleActions/ShowSnapshotWindow.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/ShowSnapshotWindow.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/ShowSnapshotWindow.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Table.meta b/Assets/SEE/Controls/ReversibleActions/Table.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Table.meta
rename to Assets/SEE/Controls/ReversibleActions/Table.meta
diff --git a/Assets/SEE/Controls/Actions/Table/ModifyTableAction.cs b/Assets/SEE/Controls/ReversibleActions/Table/ModifyTableAction.cs
similarity index 99%
rename from Assets/SEE/Controls/Actions/Table/ModifyTableAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Table/ModifyTableAction.cs
index 1f210cbada..71953340d2 100644
--- a/Assets/SEE/Controls/Actions/Table/ModifyTableAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Table/ModifyTableAction.cs
@@ -2,21 +2,22 @@
using MoreLinq;
using SEE.Game;
using SEE.Game.City;
-using SEE.Game.Table;
-using SEE.GameObjects;
-using SEE.GO;
+using SEE.Game.Tables;
+using SEE.Extensions;
using SEE.Net.Actions.Table;
using SEE.UI.Menu;
using SEE.UI.Menu.Table;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using ModifyOperation = SEE.UI.Menu.Table.ModifyTableMenu.ModifyOperation;
+using SEE.Cities;
+using SEE.Controls.KeyActions;
+using SEE.Controls.CodeCityActions;
-namespace SEE.Controls.Actions.Table
+namespace SEE.Controls.ReversibleActions.Tables
{
///
/// This action provides functionality to move, rotate, scale and delete
diff --git a/Assets/SEE/Controls/Actions/Table/ModifyTableAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Table/ModifyTableAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Table/ModifyTableAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Table/ModifyTableAction.cs.meta
diff --git a/Assets/SEE/Controls/Actions/Table/SpawnTableAction.cs b/Assets/SEE/Controls/ReversibleActions/Table/SpawnTableAction.cs
similarity index 98%
rename from Assets/SEE/Controls/Actions/Table/SpawnTableAction.cs
rename to Assets/SEE/Controls/ReversibleActions/Table/SpawnTableAction.cs
index 31be45a6d8..e26917cf8d 100644
--- a/Assets/SEE/Controls/Actions/Table/SpawnTableAction.cs
+++ b/Assets/SEE/Controls/ReversibleActions/Table/SpawnTableAction.cs
@@ -1,13 +1,13 @@
using Cysharp.Threading.Tasks;
-using SEE.Game.Table;
+using SEE.Controls.KeyActions;
+using SEE.Game.Tables;
using SEE.Net.Actions.Table;
using SEE.UI.Notification;
using SEE.Utils;
-using SEE.Utils.History;
using System.Collections.Generic;
using UnityEngine;
-namespace SEE.Controls.Actions.Table
+namespace SEE.Controls.ReversibleActions.Tables
{
///
/// This class provides the option to spawn a new table.
diff --git a/Assets/SEE/Controls/Actions/Table/SpawnTableAction.cs.meta b/Assets/SEE/Controls/ReversibleActions/Table/SpawnTableAction.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/Actions/Table/SpawnTableAction.cs.meta
rename to Assets/SEE/Controls/ReversibleActions/Table/SpawnTableAction.cs.meta
diff --git a/Assets/SEE/Controls/ReversibleActions/Table/Table.cs b/Assets/SEE/Controls/ReversibleActions/Table/Table.cs
new file mode 100644
index 0000000000..5ea75f5c4d
--- /dev/null
+++ b/Assets/SEE/Controls/ReversibleActions/Table/Table.cs
@@ -0,0 +1,6 @@
+///
+/// Actions for tables upon which code cities are placed.
+///
+namespace SEE.Controls.ReversibleActions.Tables
+{
+}
diff --git a/Assets/SEE/Controls/ReversibleActions/Table/Table.cs.meta b/Assets/SEE/Controls/ReversibleActions/Table/Table.cs.meta
new file mode 100644
index 0000000000..94d9a96f5d
--- /dev/null
+++ b/Assets/SEE/Controls/ReversibleActions/Table/Table.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: de10f533b6afce04f807244187945f52
\ No newline at end of file
diff --git a/Assets/SEE/Controls/RoomObjects.meta b/Assets/SEE/Controls/RoomObjects.meta
new file mode 100644
index 0000000000..96f80d470c
--- /dev/null
+++ b/Assets/SEE/Controls/RoomObjects.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5e397ef7ef6d75d47951058c5fbd1f91
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Controls/RoomObjects/RoomObjects.cs b/Assets/SEE/Controls/RoomObjects/RoomObjects.cs
new file mode 100644
index 0000000000..2406ede1fe
--- /dev/null
+++ b/Assets/SEE/Controls/RoomObjects/RoomObjects.cs
@@ -0,0 +1,8 @@
+///
+/// Namespace for controls of room objects, such as a mirror or a browser.
+///
+/// Game objects representing graph elements are not room objects.
+///
+namespace SEE.Controls.RoomObjects
+{
+}
diff --git a/Assets/SEE/Controls/RoomObjects/RoomObjects.cs.meta b/Assets/SEE/Controls/RoomObjects/RoomObjects.cs.meta
new file mode 100644
index 0000000000..5a2021e8d9
--- /dev/null
+++ b/Assets/SEE/Controls/RoomObjects/RoomObjects.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 940f02d1a6ead7d47a4c95ca077ad8d5
\ No newline at end of file
diff --git a/Assets/SEE/Controls/ToggleBrowser.cs b/Assets/SEE/Controls/RoomObjects/ToggleBrowser.cs
similarity index 95%
rename from Assets/SEE/Controls/ToggleBrowser.cs
rename to Assets/SEE/Controls/RoomObjects/ToggleBrowser.cs
index 80d3fcfd22..5350e60c23 100644
--- a/Assets/SEE/Controls/ToggleBrowser.cs
+++ b/Assets/SEE/Controls/RoomObjects/ToggleBrowser.cs
@@ -1,6 +1,7 @@
+using SEE.Controls.KeyActions;
using UnityEngine;
-namespace SEE.Controls
+namespace SEE.Controls.RoomObjects
{
///
/// Toggles the browser on and off if the user requests so.
diff --git a/Assets/SEE/Controls/ToggleBrowser.cs.meta b/Assets/SEE/Controls/RoomObjects/ToggleBrowser.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/ToggleBrowser.cs.meta
rename to Assets/SEE/Controls/RoomObjects/ToggleBrowser.cs.meta
diff --git a/Assets/SEE/Controls/ToggleChildren.cs b/Assets/SEE/Controls/RoomObjects/ToggleChildren.cs
similarity index 97%
rename from Assets/SEE/Controls/ToggleChildren.cs
rename to Assets/SEE/Controls/RoomObjects/ToggleChildren.cs
index 9e754a91c8..7e1a65537a 100644
--- a/Assets/SEE/Controls/ToggleChildren.cs
+++ b/Assets/SEE/Controls/RoomObjects/ToggleChildren.cs
@@ -1,6 +1,6 @@
using UnityEngine;
-namespace SEE.Controls
+namespace SEE.Controls.RoomObjects
{
///
/// Toggles the children of the game object this component is attached to.
diff --git a/Assets/SEE/Controls/ToggleChildren.cs.meta b/Assets/SEE/Controls/RoomObjects/ToggleChildren.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/ToggleChildren.cs.meta
rename to Assets/SEE/Controls/RoomObjects/ToggleChildren.cs.meta
diff --git a/Assets/SEE/Controls/ToggleMirror.cs b/Assets/SEE/Controls/RoomObjects/ToggleMirror.cs
similarity index 97%
rename from Assets/SEE/Controls/ToggleMirror.cs
rename to Assets/SEE/Controls/RoomObjects/ToggleMirror.cs
index 600828ca17..ed566ae93d 100644
--- a/Assets/SEE/Controls/ToggleMirror.cs
+++ b/Assets/SEE/Controls/RoomObjects/ToggleMirror.cs
@@ -1,7 +1,8 @@
-using SEE.GO;
+using SEE.Controls.KeyActions;
+using SEE.Extensions;
using UnityEngine;
-namespace SEE.Controls
+namespace SEE.Controls.RoomObjects
{
///
/// Toggles the mirror.
diff --git a/Assets/SEE/Controls/ToggleMirror.cs.meta b/Assets/SEE/Controls/RoomObjects/ToggleMirror.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/ToggleMirror.cs.meta
rename to Assets/SEE/Controls/RoomObjects/ToggleMirror.cs.meta
diff --git a/Assets/SEE/Controls/SpeechInputs.meta b/Assets/SEE/Controls/SpeechInputs.meta
new file mode 100644
index 0000000000..901193705c
--- /dev/null
+++ b/Assets/SEE/Controls/SpeechInputs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f5a083f7ffd5fc048b22146e69128099
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Controls/DictationInput.cs b/Assets/SEE/Controls/SpeechInputs/DictationInput.cs
similarity index 99%
rename from Assets/SEE/Controls/DictationInput.cs
rename to Assets/SEE/Controls/SpeechInputs/DictationInput.cs
index ec6e8b69f7..4f6b604f27 100644
--- a/Assets/SEE/Controls/DictationInput.cs
+++ b/Assets/SEE/Controls/SpeechInputs/DictationInput.cs
@@ -2,7 +2,7 @@
using UnityEngine.Windows.Speech;
using static UnityEngine.Windows.Speech.DictationRecognizer;
-namespace SEE.Controls
+namespace SEE.Controls.SpeechInput
{
///
/// Speech input for arbitrary spoken text. Unlike and
diff --git a/Assets/SEE/Controls/DictationInput.cs.meta b/Assets/SEE/Controls/SpeechInputs/DictationInput.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/DictationInput.cs.meta
rename to Assets/SEE/Controls/SpeechInputs/DictationInput.cs.meta
diff --git a/Assets/SEE/Controls/GrammarInput.cs b/Assets/SEE/Controls/SpeechInputs/GrammarInput.cs
similarity index 99%
rename from Assets/SEE/Controls/GrammarInput.cs
rename to Assets/SEE/Controls/SpeechInputs/GrammarInput.cs
index c9f5e3a97a..2d5adf0877 100644
--- a/Assets/SEE/Controls/GrammarInput.cs
+++ b/Assets/SEE/Controls/SpeechInputs/GrammarInput.cs
@@ -1,7 +1,7 @@
using UnityEngine.Windows.Speech;
using static UnityEngine.Windows.Speech.PhraseRecognizer;
-namespace SEE.Controls
+namespace SEE.Controls.SpeechInput
{
///
/// Speech input based on a Speech Recognition Grammar Specification (SRGS).
diff --git a/Assets/SEE/Controls/GrammarInput.cs.meta b/Assets/SEE/Controls/SpeechInputs/GrammarInput.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/GrammarInput.cs.meta
rename to Assets/SEE/Controls/SpeechInputs/GrammarInput.cs.meta
diff --git a/Assets/SEE/Controls/KeywordInput.cs b/Assets/SEE/Controls/SpeechInputs/KeywordInput.cs
similarity index 98%
rename from Assets/SEE/Controls/KeywordInput.cs
rename to Assets/SEE/Controls/SpeechInputs/KeywordInput.cs
index 0fc7e03d14..3b0b561dd3 100644
--- a/Assets/SEE/Controls/KeywordInput.cs
+++ b/Assets/SEE/Controls/SpeechInputs/KeywordInput.cs
@@ -1,7 +1,7 @@
using UnityEngine.Windows.Speech;
using static UnityEngine.Windows.Speech.PhraseRecognizer;
-namespace SEE.Controls
+namespace SEE.Controls.SpeechInput
{
///
/// Speech input based on a predefined set of keywords.
diff --git a/Assets/SEE/Controls/KeywordInput.cs.meta b/Assets/SEE/Controls/SpeechInputs/KeywordInput.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/KeywordInput.cs.meta
rename to Assets/SEE/Controls/SpeechInputs/KeywordInput.cs.meta
diff --git a/Assets/SEE/Controls/SpeechInput.cs b/Assets/SEE/Controls/SpeechInputs/SpeechInput.cs
similarity index 94%
rename from Assets/SEE/Controls/SpeechInput.cs
rename to Assets/SEE/Controls/SpeechInputs/SpeechInput.cs
index 0b80673a68..7a02234981 100644
--- a/Assets/SEE/Controls/SpeechInput.cs
+++ b/Assets/SEE/Controls/SpeechInputs/SpeechInput.cs
@@ -1,4 +1,4 @@
-namespace SEE.Controls
+namespace SEE.Controls.SpeechInput
{
///
/// Super class for speech input.
@@ -24,4 +24,4 @@ public abstract class SpeechInput
///
public abstract void Dispose();
}
-}
\ No newline at end of file
+}
diff --git a/Assets/SEE/Controls/SpeechInput.cs.meta b/Assets/SEE/Controls/SpeechInputs/SpeechInput.cs.meta
similarity index 100%
rename from Assets/SEE/Controls/SpeechInput.cs.meta
rename to Assets/SEE/Controls/SpeechInputs/SpeechInput.cs.meta
diff --git a/Assets/SEE/Controls/XRInput.cs b/Assets/SEE/Controls/XRInput.cs
deleted file mode 100644
index 0e11cd8b92..0000000000
--- a/Assets/SEE/Controls/XRInput.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-namespace SEE.Controls
-{
- public static class XRInput
- {
- ///
- /// Name of the action set defined by VR Steam Input.
- ///
- public const string DefaultActionSetName = "default";
-
- ///
- /// Name of the throttle action defined by VR Steam Input.
- ///
- public const string ThrottleActionName = "Throttle";
-
- ///
- /// Name of the reset charts action defined by VR Steam Input
- ///
- public const string ResetChartsName = "ResetCharts";
-
- ///
- /// Name of the create chart action defined by VR Steam Input.
- ///
- public const string CreateChartActionName = "CreateChart";
-
- ///
- /// Name of the create chart action defined by VR Steam Input.
- ///
- public const string ClickActionName = "InteractUI";
-
- ///
- /// Name of the move chart action defined by VR Steam Input.
- ///
- public const string MoveActionName = "Move";
- }
-}
\ No newline at end of file
diff --git a/Assets/SEE/Controls/XRInput.cs.meta b/Assets/SEE/Controls/XRInput.cs.meta
deleted file mode 100644
index 572a2e1da0..0000000000
--- a/Assets/SEE/Controls/XRInput.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: a490ccfd0fc3e344aac87cf5e67eed17
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/SEE/DataModel/DG/Attributable.cs b/Assets/SEE/DataModel/DG/Attributable.cs
index 135756bea3..6708aac831 100644
--- a/Assets/SEE/DataModel/DG/Attributable.cs
+++ b/Assets/SEE/DataModel/DG/Attributable.cs
@@ -1,4 +1,5 @@
using SEE.Utils;
+using SEE.Events;
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/Assets/SEE/DataModel/DG/GraphElementExtensions.cs b/Assets/SEE/DataModel/DG/GraphElementExtensions.cs
index 77809aeaae..e742a5dbb6 100644
--- a/Assets/SEE/DataModel/DG/GraphElementExtensions.cs
+++ b/Assets/SEE/DataModel/DG/GraphElementExtensions.cs
@@ -1,10 +1,10 @@
using System.Collections.Generic;
using System.Linq;
using SEE.DataModel.DG;
-using SEE.Game;
using SEE.Game.Operator;
-using SEE.GO;
+using SEE.Extensions;
using UnityEngine;
+using SEE.GraphElementRefs;
namespace SEE.Utils
{
diff --git a/Assets/SEE/DataModel/GraphElementIDComparer.cs b/Assets/SEE/DataModel/DG/GraphElementIDComparer.cs
similarity index 95%
rename from Assets/SEE/DataModel/GraphElementIDComparer.cs
rename to Assets/SEE/DataModel/DG/GraphElementIDComparer.cs
index 2c463281ca..317e174036 100644
--- a/Assets/SEE/DataModel/GraphElementIDComparer.cs
+++ b/Assets/SEE/DataModel/DG/GraphElementIDComparer.cs
@@ -1,7 +1,6 @@
-using SEE.DataModel.DG;
-using System.Collections.Generic;
+using System.Collections.Generic;
-namespace SEE.DataModel
+namespace SEE.DataModel.DG
{
///
/// A comparer for that considers only the
diff --git a/Assets/SEE/DataModel/GraphElementIDComparer.cs.meta b/Assets/SEE/DataModel/DG/GraphElementIDComparer.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/GraphElementIDComparer.cs.meta
rename to Assets/SEE/DataModel/DG/GraphElementIDComparer.cs.meta
diff --git a/Assets/SEE/DataModel/DG/GraphIndex/GraphIndex.cs b/Assets/SEE/DataModel/DG/GraphIndex/GraphIndex.cs
new file mode 100644
index 0000000000..c4b9ef6080
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/GraphIndex/GraphIndex.cs
@@ -0,0 +1,6 @@
+///
+/// An index to graph nodes. Allows to look up nodes by their source location.
+///
+namespace SEE.DataModel.DG.GraphIndex
+{
+}
diff --git a/Assets/SEE/DataModel/DG/GraphIndex/GraphIndex.cs.meta b/Assets/SEE/DataModel/DG/GraphIndex/GraphIndex.cs.meta
new file mode 100644
index 0000000000..af56d9c090
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/GraphIndex/GraphIndex.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 3b45df06409e5e8429e04c10470b4416
\ No newline at end of file
diff --git a/Assets/SEE/DataModel/DG/GraphSearch/GraphFilter.cs b/Assets/SEE/DataModel/DG/GraphSearch/GraphFilter.cs
index 0e9f1948ce..a71e88ed5c 100644
--- a/Assets/SEE/DataModel/DG/GraphSearch/GraphFilter.cs
+++ b/Assets/SEE/DataModel/DG/GraphSearch/GraphFilter.cs
@@ -4,7 +4,7 @@
namespace SEE.DataModel.DG.GraphSearch
{
///
- /// A configurable filter for graph elements, mainly intended for use with .
+ /// A configurable filter for graph elements, mainly intended for use with .
///
public record GraphFilter : IGraphModifier
{
diff --git a/Assets/SEE/DataModel/DG/GraphSearch/GraphSearch.cs b/Assets/SEE/DataModel/DG/GraphSearch/GraphSearch.cs
index f71a2c65cf..92b16f5dfe 100644
--- a/Assets/SEE/DataModel/DG/GraphSearch/GraphSearch.cs
+++ b/Assets/SEE/DataModel/DG/GraphSearch/GraphSearch.cs
@@ -1,172 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using FuzzySharp;
-
+///
+/// Offers search capability for s.
+///
namespace SEE.DataModel.DG.GraphSearch
{
- ///
- /// Allows searching for nodes by their source name.
- /// The graph associated to this search may be dynamic – that is, when the graph changes
- /// (for example, when a node is added), the search index will be updated accordingly.
- /// Searches are fuzzy, i.e., they will return results even if the query does not match the
- /// element's name exactly.
- ///
- /// To perform a search on the associated graph, call .
- ///
- public class GraphSearch : IObserver
- {
- ///
- /// A mapping from names to a list of nodes with that name.
- /// Is constructed in the constructor in order not to have to descend into the graph every
- /// time a search is executed.
- ///
- private readonly IDictionary> elements;
-
- ///
- /// The graph to be searched.
- ///
- public readonly Graph Graph;
-
- ///
- /// The filter that is applied to the graph elements when they are searched.
- ///
- public GraphFilter Filter { get; } = new();
-
- ///
- /// The sorter that is applied to the graph elements when they are searched.
- ///
- public GraphSorter Sorter { get; } = new();
-
- ///
- /// Returns all graph modifiers that shall be applied to the search results.
- ///
- private IEnumerable Modifiers => new IGraphModifier[] { Filter, Sorter };
-
- ///
- /// Creates a new instance of for the given .
- ///
- /// The graph to be searched.
- public GraphSearch(Graph graph)
- {
- Graph = graph;
- elements = graph.Nodes().GroupBy(ElementToString).ToDictionary(g => g.Key, g => g.ToList());
- graph.Subscribe(this);
- }
-
- ///
- /// Performs a fuzzy search for the given in the graph,
- /// by comparing it to the source name of the nodes.
- /// Case will be ignored, and the query may be a substring of the source name (this is a fuzzy search).
- ///
- /// The query to be searched for.
- /// A list of nodes which match the query.
- public IEnumerable Search(string query, int limit = 10, int cutoff = 40)
- {
- IEnumerable<(int Score, Node Element)> results = Process.ExtractTop(FilterString(query), elements.Keys, limit: limit, cutoff: cutoff)
- .SelectMany(x => Modifiers.ApplyAll(elements[x.Value]).Select(element => (x.Score, element)));
- if (!Sorter.IsActive())
- {
- // If we don't sort by any custom attribute, we sort by the fuzzy score.
- results = results.OrderByDescending(x => x.Score);
- }
- return results.Select(x => x.Element);
- }
-
- ///
- /// Removes zero-width-spaces from the given , as well as whitespace at the
- /// beginning and end, and converts the string to lowercase.
- ///
- /// The string which shall be filtered.
- /// The filtered string.
- public static string FilterString(string input)
- {
- const string zeroWidthSpace = "\u200B";
- return input.Trim().Replace(zeroWidthSpace, string.Empty).ToLowerInvariant();
- }
-
- ///
- /// Adds the given to the dictionary.
- ///
- /// The element to be added.
- private void AddElement(Node element)
- {
- string elementString = ElementToString(element);
- if (elements.TryGetValue(elementString, out List list))
- {
- list.Add(element);
- }
- else
- {
- elements.Add(elementString, new List { element });
- }
- }
-
- ///
- /// Removes the given from the dictionary.
- ///
- /// The element to be removed.
- private void RemoveElement(Node element)
- {
- string elementString = ElementToString(element);
- if (elements.TryGetValue(elementString, out List list))
- {
- list.Remove(element);
- if (list.Count == 0)
- {
- elements.Remove(elementString);
- }
- }
- }
-
- ///
- /// Converts the given to a searchable string.
- ///
- /// The element to be converted.
- /// The string representation of the element.
- private static string ElementToString(Node element)
- {
- return element.SourceName.ToLowerInvariant();
- }
-
- ///
- /// Called when no more events will be fired from the graph.
- ///
- public void OnCompleted()
- {
- // Nothing to be done.
- }
-
- ///
- /// Called when an error occurs in the graph.
- ///
- /// The error which occurred.
- public void OnError(Exception error)
- {
- throw error;
- }
-
- ///
- /// Called when a new event is fired from the graph.
- ///
- /// The event which was fired.
- public void OnNext(ChangeEvent changeEvent)
- {
- // We want to update our mapping of names to nodes whenever a node is added or removed.
- switch (changeEvent)
- {
- case NodeEvent { Change: ChangeType.Addition } nodeEvent:
- AddElement(nodeEvent.Node);
- break;
- case NodeEvent { Change: ChangeType.Removal } nodeEvent:
- RemoveElement(nodeEvent.Node);
- break;
- case IAttributeEvent { AttributeName: Node.SourceNameAttribute, Attributable: Node node }:
- // If the source name of a node changes, we need to update the mapping.
- RemoveElement(node);
- AddElement(node);
- break;
- }
- }
- }
}
diff --git a/Assets/SEE/DataModel/DG/GraphSearch/GraphSearch.cs.meta b/Assets/SEE/DataModel/DG/GraphSearch/GraphSearch.cs.meta
index eb6e0e3de4..e8d7e4d38c 100644
--- a/Assets/SEE/DataModel/DG/GraphSearch/GraphSearch.cs.meta
+++ b/Assets/SEE/DataModel/DG/GraphSearch/GraphSearch.cs.meta
@@ -1,3 +1,2 @@
fileFormatVersion: 2
-guid: e2bc5cd2ba5f498dbb66dc802641b47d
-timeCreated: 1700171671
\ No newline at end of file
+guid: 27ab88a2bde9eda4c82a7f0d8ddc98e5
\ No newline at end of file
diff --git a/Assets/SEE/DataModel/DG/GraphSearch/GraphSorter.cs b/Assets/SEE/DataModel/DG/GraphSearch/GraphSorter.cs
index a53a55976e..372bcaf7f6 100644
--- a/Assets/SEE/DataModel/DG/GraphSearch/GraphSorter.cs
+++ b/Assets/SEE/DataModel/DG/GraphSearch/GraphSorter.cs
@@ -5,7 +5,7 @@
namespace SEE.DataModel.DG.GraphSearch
{
///
- /// A configurable sorter for graph elements, mainly intended for use with .
+ /// A configurable sorter for graph elements, mainly intended for use with .
///
public class GraphSorter : IGraphModifier
{
diff --git a/Assets/SEE/DataModel/DG/GraphSearch/IGraphModifier.cs b/Assets/SEE/DataModel/DG/GraphSearch/IGraphModifier.cs
index f4b053be3e..efffcc1eb5 100644
--- a/Assets/SEE/DataModel/DG/GraphSearch/IGraphModifier.cs
+++ b/Assets/SEE/DataModel/DG/GraphSearch/IGraphModifier.cs
@@ -4,7 +4,7 @@ namespace SEE.DataModel.DG.GraphSearch
{
///
/// Modifies a collection of graph elements by filtering, sorting, or otherwise transforming it.
- /// Intended for use with .
+ /// Intended for use with .
///
public interface IGraphModifier
{
diff --git a/Assets/SEE/DataModel/DG/GraphSearch/NodeSearch.cs b/Assets/SEE/DataModel/DG/GraphSearch/NodeSearch.cs
new file mode 100644
index 0000000000..4c9732508f
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/GraphSearch/NodeSearch.cs
@@ -0,0 +1,172 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using FuzzySharp;
+
+namespace SEE.DataModel.DG.GraphSearch
+{
+ ///
+ /// Allows searching for nodes by their source name.
+ /// The graph associated to this search may be dynamic – that is, when the graph changes
+ /// (for example, when a node is added), the search index will be updated accordingly.
+ /// Searches are fuzzy, i.e., they will return results even if the query does not match the
+ /// element's name exactly.
+ ///
+ /// To perform a search on the associated graph, call .
+ ///
+ public class NodeSearch : IObserver
+ {
+ ///
+ /// A mapping from names to a list of nodes with that name.
+ /// Is constructed in the constructor in order not to have to descend into the graph every
+ /// time a search is executed.
+ ///
+ private readonly IDictionary> elements;
+
+ ///
+ /// The graph to be searched.
+ ///
+ public readonly Graph Graph;
+
+ ///
+ /// The filter that is applied to the graph elements when they are searched.
+ ///
+ public GraphFilter Filter { get; } = new();
+
+ ///
+ /// The sorter that is applied to the graph elements when they are searched.
+ ///
+ public GraphSorter Sorter { get; } = new();
+
+ ///
+ /// Returns all graph modifiers that shall be applied to the search results.
+ ///
+ private IEnumerable Modifiers => new IGraphModifier[] { Filter, Sorter };
+
+ ///
+ /// Creates a new instance of for the given .
+ ///
+ /// The graph to be searched.
+ public NodeSearch(Graph graph)
+ {
+ Graph = graph;
+ elements = graph.Nodes().GroupBy(ElementToString).ToDictionary(g => g.Key, g => g.ToList());
+ graph.Subscribe(this);
+ }
+
+ ///
+ /// Performs a fuzzy search for the given in the graph,
+ /// by comparing it to the source name of the nodes.
+ /// Case will be ignored, and the query may be a substring of the source name (this is a fuzzy search).
+ ///
+ /// The query to be searched for.
+ /// A list of nodes which match the query.
+ public IEnumerable Search(string query, int limit = 10, int cutoff = 40)
+ {
+ IEnumerable<(int Score, Node Element)> results = Process.ExtractTop(FilterString(query), elements.Keys, limit: limit, cutoff: cutoff)
+ .SelectMany(x => Modifiers.ApplyAll(elements[x.Value]).Select(element => (x.Score, element)));
+ if (!Sorter.IsActive())
+ {
+ // If we don't sort by any custom attribute, we sort by the fuzzy score.
+ results = results.OrderByDescending(x => x.Score);
+ }
+ return results.Select(x => x.Element);
+ }
+
+ ///
+ /// Removes zero-width-spaces from the given , as well as whitespace at the
+ /// beginning and end, and converts the string to lowercase.
+ ///
+ /// The string which shall be filtered.
+ /// The filtered string.
+ public static string FilterString(string input)
+ {
+ const string zeroWidthSpace = "\u200B";
+ return input.Trim().Replace(zeroWidthSpace, string.Empty).ToLowerInvariant();
+ }
+
+ ///
+ /// Adds the given to the dictionary.
+ ///
+ /// The element to be added.
+ private void AddElement(Node element)
+ {
+ string elementString = ElementToString(element);
+ if (elements.TryGetValue(elementString, out List list))
+ {
+ list.Add(element);
+ }
+ else
+ {
+ elements.Add(elementString, new List { element });
+ }
+ }
+
+ ///
+ /// Removes the given from the dictionary.
+ ///
+ /// The element to be removed.
+ private void RemoveElement(Node element)
+ {
+ string elementString = ElementToString(element);
+ if (elements.TryGetValue(elementString, out List list))
+ {
+ list.Remove(element);
+ if (list.Count == 0)
+ {
+ elements.Remove(elementString);
+ }
+ }
+ }
+
+ ///
+ /// Converts the given to a searchable string.
+ ///
+ /// The element to be converted.
+ /// The string representation of the element.
+ private static string ElementToString(Node element)
+ {
+ return element.SourceName.ToLowerInvariant();
+ }
+
+ ///
+ /// Called when no more events will be fired from the graph.
+ ///
+ public void OnCompleted()
+ {
+ // Nothing to be done.
+ }
+
+ ///
+ /// Called when an error occurs in the graph.
+ ///
+ /// The error which occurred.
+ public void OnError(Exception error)
+ {
+ throw error;
+ }
+
+ ///
+ /// Called when a new event is fired from the graph.
+ ///
+ /// The event which was fired.
+ public void OnNext(ChangeEvent changeEvent)
+ {
+ // We want to update our mapping of names to nodes whenever a node is added or removed.
+ switch (changeEvent)
+ {
+ case NodeEvent { Change: ChangeType.Addition } nodeEvent:
+ AddElement(nodeEvent.Node);
+ break;
+ case NodeEvent { Change: ChangeType.Removal } nodeEvent:
+ RemoveElement(nodeEvent.Node);
+ break;
+ case IAttributeEvent { AttributeName: Node.SourceNameAttribute, Attributable: Node node }:
+ // If the source name of a node changes, we need to update the mapping.
+ RemoveElement(node);
+ AddElement(node);
+ break;
+ }
+ }
+ }
+}
diff --git a/Assets/SEE/DataModel/DG/GraphSearch/NodeSearch.cs.meta b/Assets/SEE/DataModel/DG/GraphSearch/NodeSearch.cs.meta
new file mode 100644
index 0000000000..eb6e0e3de4
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/GraphSearch/NodeSearch.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: e2bc5cd2ba5f498dbb66dc802641b47d
+timeCreated: 1700171671
\ No newline at end of file
diff --git a/Assets/SEE/DataModel/DG/IO/CSV.meta b/Assets/SEE/DataModel/DG/IO/CSV.meta
new file mode 100644
index 0000000000..5cf5e21ac3
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/IO/CSV.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f2beb6baae89d7c4caa92f617ba48097
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/DataModel/DG/IO/CSV/CSV.cs b/Assets/SEE/DataModel/DG/IO/CSV/CSV.cs
new file mode 100644
index 0000000000..2b532d162b
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/IO/CSV/CSV.cs
@@ -0,0 +1,6 @@
+///
+/// Import and export of graph element metrics in CSV.
+///
+namespace SEE.DataModel.DG.IO.CSV
+{
+}
diff --git a/Assets/SEE/DataModel/DG/IO/CSV/CSV.cs.meta b/Assets/SEE/DataModel/DG/IO/CSV/CSV.cs.meta
new file mode 100644
index 0000000000..f8614055fa
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/IO/CSV/CSV.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 47f0ab4ace5fa664bbaaf46bc529354e
\ No newline at end of file
diff --git a/Assets/SEE/DataModel/DG/IO/MetricExporter.cs b/Assets/SEE/DataModel/DG/IO/CSV/MetricExporter.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/MetricExporter.cs
rename to Assets/SEE/DataModel/DG/IO/CSV/MetricExporter.cs
index be34c9f08d..23a2a48381 100644
--- a/Assets/SEE/DataModel/DG/IO/MetricExporter.cs
+++ b/Assets/SEE/DataModel/DG/IO/CSV/MetricExporter.cs
@@ -3,7 +3,7 @@
using System.Text;
using UnityEngine;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.CSV
{
///
/// Exports node metrics of a graph to CSV files.
diff --git a/Assets/SEE/DataModel/DG/IO/MetricExporter.cs.meta b/Assets/SEE/DataModel/DG/IO/CSV/MetricExporter.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/MetricExporter.cs.meta
rename to Assets/SEE/DataModel/DG/IO/CSV/MetricExporter.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/MetricImporter.cs b/Assets/SEE/DataModel/DG/IO/CSV/MetricImporter.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/MetricImporter.cs
rename to Assets/SEE/DataModel/DG/IO/CSV/MetricImporter.cs
index 5f7d8a5ed4..f1235a2a08 100644
--- a/Assets/SEE/DataModel/DG/IO/MetricImporter.cs
+++ b/Assets/SEE/DataModel/DG/IO/CSV/MetricImporter.cs
@@ -15,7 +15,7 @@
using CsvHelper.Configuration;
using SEE.Utils;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.CSV
{
///
/// Imports node metrics from CSV files into the graph.
diff --git a/Assets/SEE/DataModel/DG/IO/MetricImporter.cs.meta b/Assets/SEE/DataModel/DG/IO/CSV/MetricImporter.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/MetricImporter.cs.meta
rename to Assets/SEE/DataModel/DG/IO/CSV/MetricImporter.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/MetricsIO.cs b/Assets/SEE/DataModel/DG/IO/CSV/MetricsIO.cs
similarity index 89%
rename from Assets/SEE/DataModel/DG/IO/MetricsIO.cs
rename to Assets/SEE/DataModel/DG/IO/CSV/MetricsIO.cs
index 5c6344e71a..de815df4b6 100644
--- a/Assets/SEE/DataModel/DG/IO/MetricsIO.cs
+++ b/Assets/SEE/DataModel/DG/IO/CSV/MetricsIO.cs
@@ -1,4 +1,4 @@
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.CSV
{
///
/// Input and output of node metrics in CSV.
diff --git a/Assets/SEE/DataModel/DG/IO/MetricsIO.cs.meta b/Assets/SEE/DataModel/DG/IO/CSV/MetricsIO.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/MetricsIO.cs.meta
rename to Assets/SEE/DataModel/DG/IO/CSV/MetricsIO.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/GXL.meta b/Assets/SEE/DataModel/DG/IO/GXL.meta
new file mode 100644
index 0000000000..69c72a04fb
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/IO/GXL.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1e261ea4321ed5b49a1bfe170b46476d
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/DataModel/DG/IO/GXL/GXL.cs b/Assets/SEE/DataModel/DG/IO/GXL/GXL.cs
new file mode 100644
index 0000000000..cb1eb1f807
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/IO/GXL/GXL.cs
@@ -0,0 +1,6 @@
+///
+/// Import and export of graphs in GXL.
+///
+namespace SEE.DataModel.DG.IO.GXL
+{
+}
diff --git a/Assets/SEE/DataModel/DG/IO/GXL/GXL.cs.meta b/Assets/SEE/DataModel/DG/IO/GXL/GXL.cs.meta
new file mode 100644
index 0000000000..e5f2ade927
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/IO/GXL/GXL.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 3a6854ef8c24e6741b10bc92799f1326
\ No newline at end of file
diff --git a/Assets/SEE/DataModel/DG/IO/GXLParser.cs b/Assets/SEE/DataModel/DG/IO/GXL/GXLParser.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/GXLParser.cs
rename to Assets/SEE/DataModel/DG/IO/GXL/GXLParser.cs
index 9bd09a04bb..cf858ac233 100644
--- a/Assets/SEE/DataModel/DG/IO/GXLParser.cs
+++ b/Assets/SEE/DataModel/DG/IO/GXL/GXLParser.cs
@@ -7,7 +7,7 @@
using Cysharp.Threading.Tasks;
using SEE.Utils;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.GXL
{
///
/// Class responsible for parsing GXL files.
diff --git a/Assets/SEE/DataModel/DG/IO/GXLParser.cs.meta b/Assets/SEE/DataModel/DG/IO/GXL/GXLParser.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/GXLParser.cs.meta
rename to Assets/SEE/DataModel/DG/IO/GXL/GXLParser.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/GraphIO.cs b/Assets/SEE/DataModel/DG/IO/GXL/GraphIO.cs
similarity index 95%
rename from Assets/SEE/DataModel/DG/IO/GraphIO.cs
rename to Assets/SEE/DataModel/DG/IO/GXL/GraphIO.cs
index 52c5dcb06a..bf0a4a0fc8 100644
--- a/Assets/SEE/DataModel/DG/IO/GraphIO.cs
+++ b/Assets/SEE/DataModel/DG/IO/GXL/GraphIO.cs
@@ -1,4 +1,4 @@
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.GXL
{
///
/// Input and output of graph data in GXL format.
diff --git a/Assets/SEE/DataModel/DG/IO/GraphIO.cs.meta b/Assets/SEE/DataModel/DG/IO/GXL/GraphIO.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/GraphIO.cs.meta
rename to Assets/SEE/DataModel/DG/IO/GXL/GraphIO.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/GraphReader.cs b/Assets/SEE/DataModel/DG/IO/GXL/GraphReader.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/GraphReader.cs
rename to Assets/SEE/DataModel/DG/IO/GXL/GraphReader.cs
index 90c5db0e05..efe2ece66b 100644
--- a/Assets/SEE/DataModel/DG/IO/GraphReader.cs
+++ b/Assets/SEE/DataModel/DG/IO/GXL/GraphReader.cs
@@ -6,7 +6,7 @@
using SEE.Utils.Paths;
using UnityEngine;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.GXL
{
///
/// Reads a graph from a GXL file and returns it as a graph.
diff --git a/Assets/SEE/DataModel/DG/IO/GraphReader.cs.meta b/Assets/SEE/DataModel/DG/IO/GXL/GraphReader.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/GraphReader.cs.meta
rename to Assets/SEE/DataModel/DG/IO/GXL/GraphReader.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/GraphWriter.cs b/Assets/SEE/DataModel/DG/IO/GXL/GraphWriter.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/GraphWriter.cs
rename to Assets/SEE/DataModel/DG/IO/GXL/GraphWriter.cs
index b65cc24cc1..055b74a956 100644
--- a/Assets/SEE/DataModel/DG/IO/GraphWriter.cs
+++ b/Assets/SEE/DataModel/DG/IO/GXL/GraphWriter.cs
@@ -8,7 +8,7 @@
using Stream = System.IO.Stream;
using XmlElement = System.Xml.XmlElement;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.GXL
{
///
/// Saves graphs in GXL format on disk.
diff --git a/Assets/SEE/DataModel/DG/IO/GraphWriter.cs.meta b/Assets/SEE/DataModel/DG/IO/GXL/GraphWriter.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/GraphWriter.cs.meta
rename to Assets/SEE/DataModel/DG/IO/GXL/GraphWriter.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/GraphsReader.cs b/Assets/SEE/DataModel/DG/IO/GXL/GraphsReader.cs
similarity index 96%
rename from Assets/SEE/DataModel/DG/IO/GraphsReader.cs
rename to Assets/SEE/DataModel/DG/IO/GXL/GraphsReader.cs
index 066b29e6db..1236c3e9be 100644
--- a/Assets/SEE/DataModel/DG/IO/GraphsReader.cs
+++ b/Assets/SEE/DataModel/DG/IO/GXL/GraphsReader.cs
@@ -7,7 +7,7 @@
using SEE.Utils.Paths;
using UnityEngine;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.GXL
{
///
/// Loads and stores multiple GXL files from a directory.
@@ -75,7 +75,7 @@ public async UniTask LoadAsync(string directory, HashSet hierarchicalEdg
if (File.Exists(csvFilename))
{
Debug.Log($"Loading CSV file {csvFilename}.\n");
- int numberOfErrors = await MetricImporter.LoadCsvAsync(graph, csvFilename);
+ int numberOfErrors = await CSV.MetricImporter.LoadCsvAsync(graph, csvFilename);
if (numberOfErrors > 0)
{
Debug.LogError($"CSV file {csvFilename} has {numberOfErrors} many errors.\n");
diff --git a/Assets/SEE/DataModel/DG/IO/GraphsReader.cs.meta b/Assets/SEE/DataModel/DG/IO/GXL/GraphsReader.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/GraphsReader.cs.meta
rename to Assets/SEE/DataModel/DG/IO/GXL/GraphsReader.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/IO.cs b/Assets/SEE/DataModel/DG/IO/IO.cs
index eb29105ca2..17c8fbe7ff 100644
--- a/Assets/SEE/DataModel/DG/IO/IO.cs
+++ b/Assets/SEE/DataModel/DG/IO/IO.cs
@@ -1,6 +1,6 @@
///
-/// SEE.DataModel.DG.IO provides input/output for persistent storage
-/// and retrieval of data structures in SEE.DataModel.DG.
+/// provides input/output for persistent storage
+/// and retrieval of graph data structures in .
///
namespace SEE.DataModel.DG.IO
{
diff --git a/Assets/SEE/DataModel/DG/IO/JaCoCoImporter.cs b/Assets/SEE/DataModel/DG/IO/JaCoCoImporter.cs
deleted file mode 100644
index 9bb413da50..0000000000
--- a/Assets/SEE/DataModel/DG/IO/JaCoCoImporter.cs
+++ /dev/null
@@ -1,537 +0,0 @@
-using Cysharp.Threading.Tasks;
-using SEE.Utils.Paths;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Xml;
-using SEE.DataModel.DG.GraphIndex;
-using UnityEngine;
-
-namespace SEE.DataModel.DG.IO
-{
- ///
- /// This class implements everything that is necessary to read a JaCoCo test report in
- /// XML and adds the metrics to the graph nodes.
- ///
- internal static class JaCoCoImporter
- {
- ///
- /// A report XML node is currently processed.
- ///
- private const string reportContext = "report";
- ///
- /// A package XML node is currently processed.
- ///
- private const string packageContext = "package";
- ///
- /// A class XML node is currently processed.
- ///
- private const string classContext = "class";
- ///
- /// A method XML node is currently processed.
- ///
- private const string methodContext = "method";
-
- ///
- /// Loads a JaCoCo test report from the given assumed to
- /// conform to the JaCoCo coverage report syntax.
- /// The retrieved coverage metrics will be added to nodes of .
- ///
- /// Graph for which node metrics are to be imported.
- /// Path to a data file containing JaCoCo data from which to import node metrics.
- /// If is null.
- /// If is null or empty.
- public static async UniTask LoadAsync(Graph graph, DataPath path)
- {
- if (string.IsNullOrEmpty(path.Path))
- {
- throw new ArgumentException("Data path must neither be null nor empty.");
- }
- Stream stream = await path.LoadAsync();
- await LoadAsync(graph, stream, path.Path);
- }
-
- ///
- /// Loads a JaCoCo test report from the given .
- /// The retrieved coverage metrics will be added to nodes of .
- ///
- /// Graph where to add the metrics.
- /// Where to read the JaCoCo input data from.
- /// The name of the original JaCoCo file; used only for reporting.
- /// If is null.
- private static async UniTask LoadAsync(Graph graph, Stream stream, string jaCoCoFilename)
- {
- if (graph == null)
- {
- throw new ArgumentNullException(nameof(graph));
- }
- if (graph.GetRoots().Count == 0)
- {
- // graph is empty. Nothing to do.
- return;
- }
-
- SourceRangeIndex index = new(graph, IndexPath);
-
- XmlReaderSettings settings = new()
- {
- CloseInput = true,
- IgnoreWhitespace = true,
- IgnoreComments = true,
- Async = true,
- DtdProcessing = DtdProcessing.Parse
- };
- using XmlReader xmlReader = XmlReader.Create(stream, settings);
-
- // The fully qualified name of the package currently processed.
- // The name is retrieved from JaCoCo's XML report, where
- // a forward slash / is used as a separator, e.g., mypackage/mysubpackage.
- // A package name may be empty (in cases where the default package was
- // intended by a developer).
- string packageName = string.Empty;
-
- // The fully qualified name of the currently processed class in JaCoCo's XML report,
- // where a foward slash / is used as a separator, e.g., CodeFacts/CountConsonants.
- //
- // The qualifiedClassName contains the name of the path prefixed by the
- // packages it is contained in. In Java, the name of a source file is
- // the name of the main class in this file, appended by the file extension ".java".
- // A Java file, however, may have other classes - inner classes as well as classes
- // at the top level of the file. JaCoCo will report both kinds of non-main classes
- // with the same filename (obviously) as the filename of the main class. Only the
- // qualified name of non-main classes will differ. For instance, if we have a main
- // class C in package P, the filename will be C.java and the qualified name will
- // be P/C. If there is another class D in C.java that is not the main class,
- // the file of that class will be C.java, too, and its qualified name will be
- // P/D. If there is another class I nested in class C, the file of I will again
- // be C.java, but its qualified name will be P/D$I. The delimiter $ is used
- // to separate inner classes from the classes they are nested in.
- string qualifiedClassName = null;
-
- // Name of the currently processed method. This value is used only for error messages.
- string methodName = string.Empty;
-
- // The name of the source-code file for a class in JaCoCo's report,
- // e.g. CountConsonants.java. This filename is apparently always a
- // non-qualified name, that is, the directories this file is contained in
- // are not part of this name.
- string sourceFilename = null;
-
- // Source line as retrieved from JaCoCo's XML report, -1 if not set.
- //
- // Note that classes do not have a source line in JaCoCo's XML report,
- // only methods have.
- int sourceLine = -1;
-
- // Type of the XML node in JaCoCo's report currently processed, that is, the
- // one to add the metrics, to. This can be any of reportContext, packageContext,
- // classContext, or methodContext.
- string nodeType;
-
- // Note: A report clause is the outermost XML node and may have immediate
- // counter clauses itself. E.g.:
- //
- //
- //
- //
- //
- //
-
- // Stack to store the XML node type, that is, the values of nodeType.
- // The inner-most XML node type is at the top. This gives us the context
- // we are currently working in. The XML nodes may be nested deeply.
- Stack nodeTypeStack = new();
-
- // True if the currently processed XML node type is "sourcefile". If true, the
- // read metrics will be ignored.
- bool inSourcefile = false;
-
- while (await xmlReader.ReadAsync())
- {
- switch (xmlReader.NodeType)
- {
- case XmlNodeType.Element:
- if (xmlReader.Name is reportContext or packageContext or classContext or methodContext)
- {
- if (xmlReader.Name == classContext)
- {
- // Attribute sourcefilename consists of the simple filename including the
- // file extension ".java" but excluding the directories this file is
- // contained in.
- sourceFilename = xmlReader.GetAttribute("sourcefilename");
- // Attribute 'name' consists of the fully qualified class name where
- // a slash / is used as a separator.
- qualifiedClassName = xmlReader.GetAttribute("name");
- }
- else if (xmlReader.Name == methodContext)
- {
- // Attribute line refers to the line in which the opening curly bracket
- // of the method's body occurs within its source file.
- sourceLine = int.Parse(xmlReader.GetAttribute("line"));
- methodName = xmlReader.GetAttribute("name");
- }
- else if (xmlReader.Name == packageContext)
- {
- packageName = xmlReader.GetAttribute("name");
- if (string.IsNullOrWhiteSpace(packageName))
- {
- Debug.LogWarning($"{XMLSourcePosition(jaCoCoFilename, xmlReader)}: "
- + "Data for the default Java package (without name) were given. These will be ignored.\n");
- }
- }
- if (!xmlReader.IsEmptyElement)
- {
- // This is not a self-closing (empty) element, e.g., .
- // Note: A corresponding EndElement node is not generated for empty elements.
- // That is why we push a context onto the context stack only if the element is
- // not self-closing.
- nodeTypeStack.Push(xmlReader.Name);
- }
- else
- {
- Debug.LogWarning($"{XMLSourcePosition(jaCoCoFilename, xmlReader)}: "
- + "Report does not provide coverage data for this entity.\n");
- }
-
- }
- // skip sourcefile and its counter XML nodes
- else if (xmlReader.Name == "sourcefile")
- {
- // From now on we are in the section where the executed lines are listed
- // in the XML report.
- inSourcefile = true;
- }
- else if (!inSourcefile && xmlReader.Name == "counter")
- {
- // An XML node 'counter' may occur both nested in a sourcefile clause and
- // in a class clause. When we arrive here, the counter is one in
- // a class clause. These counters are processed and added to a graph node.
- nodeType = nodeTypeStack.Peek();
-
- try
- {
- if (nodeType == packageContext)
- {
- if (string.IsNullOrWhiteSpace(packageName))
- {
- // There is no chance to add metrics if we have an empty link name.
- // It is not an error, though, because a developer could have nested
- // a class within the default package, which does not have a name.
- // If we encounter this case, we have already reported it above.
- }
- else
- {
- // Packages have no source range and, hence, are not represented in the
- // source-range index. We need to use a different approach to retrieve their
- // node from the graph.
- // We do that via the unique ID of a package node, which is assumed to be
- // the fully qualified name of the packages where individual packages are
- // separated by a period.
- AddMetricsToClassOrPackage(graph, xmlReader, packageName, jaCoCoFilename);
- }
- }
- else if (nodeType == classContext)
- {
- // JaCoCo uses a similar way to represent the qualified name of a class
- // as how our graph does for unique IDs for classes - except that JaCoCo
- // uses / as a delimiter between simple names and our graph uses a period
- // as a delimiter. Also inner classes are named equally: both JaCoCo and
- // our unique IDs for graph nodes uses $ to separate the name of the inner
- // class from its nesting class. That allows us to retrieve classes directly
- // from the graph without the need for source positions.
- // Note also that non-main classes in Java (top-level classes declared non-public
- // in a file which already declares a public top-level class) will not cause any
- // problem. For instance, if a non-main class C were declared in a file X.java
- // which declares a main class X contained in package P, there cannot be another
- // file declaring a main class C as a sibling to X within P in the package hierarchy.
- // Both would have the name P.C in our graph. Yet, that would be illegal Java
- // code and, hence, cannot happen.
- AddMetricsToClassOrPackage(graph, xmlReader, qualifiedClassName, jaCoCoFilename);
- }
- else if (nodeType == reportContext)
- {
- // We add all metrics reported at the report level to the root of the graph.
- // A non-empty graph has always a root node.
- // Note that we might override the values of another node -- happened to be the
- // root -- that we processed previously and for which we added metrics.
- AddMetrics(xmlReader, graph.GetRoots()[0]);
- }
- else if (index.TryGetValue(MainTypeName(AsJavaQualifiedName(qualifiedClassName), sourceFilename),
- sourceLine, out Node nodeToAddMetrics))
- {
- AddMetrics(xmlReader, nodeToAddMetrics);
- }
- else
- {
- // We are in a method context.
- Debug.LogError($"{XMLSourcePosition(jaCoCoFilename, xmlReader)}: "
- + $"No node found for {nodeType} {AsJavaQualifiedName(qualifiedClassName)}.{methodName}:{sourceLine} "
- + $"using key {MainTypeName(AsJavaQualifiedName(qualifiedClassName), sourceFilename)}.\n");
- }
- }
- catch (Exception e)
- {
- Debug.LogError($"{XMLSourcePosition(jaCoCoFilename, xmlReader)}: {e.Message}.\n");
- throw;
- }
- }
- break;
-
- // re-sets attributes to default when tag is closed
- case XmlNodeType.EndElement:
- if (xmlReader.Name is reportContext or packageContext or classContext or methodContext)
- {
- // Only for the XML nodes listed in the condition above, we pushed a context.
- nodeTypeStack.Pop();
-
- if (xmlReader.Name == classContext)
- {
- qualifiedClassName = null;
- sourceFilename = null;
- methodName = string.Empty;
- }
- else if (xmlReader.Name == methodContext)
- {
- sourceLine = -1;
- }
- else if (xmlReader.Name == packageContext)
- {
- packageName = string.Empty;
- }
- }
- else if (xmlReader.Name == "sourcefile")
- {
- inSourcefile = false;
- }
- break;
- }
- }
- return;
-
- // Retrieves the counter metrics from xmlReader and adds them to nodeToAddMetrics
- static void AddMetrics(XmlReader xmlReader, Node nodeToAddMetrics)
- {
- int missed = int.Parse(xmlReader.GetAttribute("missed")!, CultureInfo.InvariantCulture.NumberFormat);
- int covered = int.Parse(xmlReader.GetAttribute("covered")!, CultureInfo.InvariantCulture.NumberFormat);
-
- string metricNamePrefix = JaCoCo.Prefix + xmlReader.GetAttribute("type");
-
- nodeToAddMetrics.SetInt(metricNamePrefix + "_missed", missed);
- nodeToAddMetrics.SetInt(metricNamePrefix + "_covered", covered);
-
- float percentage = covered + missed > 0 ? (float)covered / (covered + missed) * 100 : 0;
- nodeToAddMetrics.SetFloat(metricNamePrefix + "_percentage", percentage);
- }
-
- // Retrieves the counter metrics from xmlReader and adds them to a package or class
- // node retrieved from the given graph having the given uniqueID.
- // Note: the actually used node ID is uniqueID where every / is replaced by a period.
- static void AddMetricsToClassOrPackage(Graph graph, XmlReader xmlReader, string uniqueID, string jaCoCoFilename)
- {
- // JaCoCo uses "/" as a separator for packages and classes while our graph is
- // assumed to use a period "." to separate package/class names in unique IDs.
- if (uniqueID == null)
- {
- Debug.LogError($"{XMLSourcePosition(jaCoCoFilename, xmlReader)}: uniqueID is null.\n");
- }
- Node packageOrClassNode = graph.GetNode(uniqueID.Replace("/", "."));
- if (packageOrClassNode != null)
- {
- AddMetrics(xmlReader, packageOrClassNode);
- }
- else
- {
- Debug.LogError($"{XMLSourcePosition(jaCoCoFilename, xmlReader)}: No node found for package/class {uniqueID}.\n");
- }
- }
- }
-
- ///
- /// Returns the source position of the XML code currently processed by .
- /// The position is reported as :line:column. In case no source position
- /// can be retrieved : will returned.
- ///
- /// name of the XML file currently processed
- /// the XML reader processing the XML file
- /// the source position of the XML file
- private static string XMLSourcePosition(string filepath, XmlReader xmlReader)
- {
- string position = "";
-
- if (xmlReader is IXmlLineInfo xmlLineInfo && xmlLineInfo.HasLineInfo())
- {
- position = $"{xmlLineInfo.LineNumber}:{xmlLineInfo.LinePosition}";
- }
-
- return $"{filepath}:{position}";
- }
-
- ///
- /// The character used to separate elements in a path. This separator is used
- /// both in the JaCoCo XML report for qualified class names and the prefix.
- ///
- private const char jacocoSeparator = '/';
-
- ///
- /// A qualified name in Java is a set of words separated by a period as a delimiter.
- /// JaCoCo, however, uses a forward slash as a delimiter. This method returns
- /// where each forward slash has
- /// been replaced by a period.
- ///
- /// Qualified name in JaCoCo syntax to be converted.
- /// where each forward slash was replaced
- /// by a period.
- /// Thrown in case
- /// is null or empty.
- private static string AsJavaQualifiedName(string qualifiedJaCoCoTypeName)
- {
- if (string.IsNullOrEmpty(qualifiedJaCoCoTypeName))
- {
- throw new ArgumentException("The qualified name of a class must not be empty.");
- }
- return qualifiedJaCoCoTypeName.Replace(jacocoSeparator, '.');
- }
-
- ///
- /// The name of all node types representing types in Java.
- ///
- private static readonly HashSet typeNodeTypes
- = new() { "Class", "Interface", "Class_Template", "Interface_Template"};
-
- ///
- /// Yields the path name of .
- ///
- /// If is a type, that is, its
- /// is contained in , the fully qualified name of the
- /// main type corresponding to this type is returned.
- ///
- /// The fully qualified name of a main type is the name of the type including
- /// all the packages it is contained in, e.g., org.uni-bremen.mypackage.myclass
- /// for a class named myclass declared in package org.uni-bremen.mypackage. A
- /// period is used as a delimiter.
- ///
- /// What is a main type corresponding to a type? Java allows a file to declare multiple
- /// types in the same file even at the top level. Only one of those declared at top
- /// level may be public, however.
- /// If there is only one type declared at the top level, that type is the main type.
- /// If there are multiple types declared at the top level, the one declared as
- /// public is the main type.
- /// Other type declarations may be nested in types in Java. For inner (nested, not at
- /// the top level) types, the main type is the main type corresponding to the
- /// outer-most (top-level) type the inner type is contained in.
- ///
- /// For instance, if we have a file T.java with a main class T in package p
- /// and a non-main class Z which in turn contains a nested class W, then the
- /// result for T would be p.T, the result for Z would be p.T, too, the result for
- /// W would again be p.T.
- ///
- /// Note: The filename for a main type T must be T.java in Java. This fact allows
- /// us to distinguish the main type from other top-level types in a file.
- ///
- /// If is a method with p (obviously
- /// a type in which the method is declared), then applied
- /// to p is returned. For instance, if W had a method m in the example above,
- /// then again p.T would be returned.
- ///
- /// For all other node types, null is returned.
- ///
- /// Node whose fully qualified name is to be retrieved.
- /// Fully qualified name of the main type for the given .
- private static string IndexPath(Node node)
- {
- if (node.Type == "Method")
- {
- // A Java method can be declared only within a type, thus, its
- // parent node must be a type.
- return IndexPath(node.Parent);
- }
- else if (typeNodeTypes.Contains(node.Type))
- {
- return MainTypeName(node.ID, node.Filename);
- }
- else
- {
- // Node types different from a type and method will be ignored.
- return null;
- }
- }
-
- ///
- /// Returns a fully qualified Java name for the main type corresponding to the
- /// given .
- ///
- /// Fully qualified Java name of a type.
- /// The Java filename in which the type is declared.
- /// Fully qualified Java name for main type corresponding to the
- /// given .
- private static string MainTypeName(string qualifiedJavaTypeName, string filename)
- {
- // The ID (Linkage.Name) of a main type Y declared in package p
- // is p.Y.
- //
- // Likewise, the ID of a type Z declared at top level, but
- // different from the main type, is p.Z where p is the package
- // the corresponding main type is declared in. Whether a top-level
- // type is the main type can be determined by checking the
- // source filename. A main type T is contained in a file named
- // T.java; if that is not the case, the type is not a main type.
- //
- // The ID of an inner type W nested in a type Z declared in a
- // package p is p.Z$W. The delimiter $ is used to separate inner
- // types from their containing type.
-
- string outerMostType = OuterMostType(qualifiedJavaTypeName);
- // outerMostType could denote a main type or another top-level
- // type that is not a main type. The two can be distinguished
- // using the source filename.
- (string parentName, string simpleName) = SimpleName(outerMostType);
- string typeAccordingToFilename = Path.GetFileNameWithoutExtension(filename);
- if (simpleName == typeAccordingToFilename)
- {
- // It is a main type.
- return outerMostType;
- }
- else
- {
- // It is a top-level type that is not the main type. The filename
- // gives us the name of the main type this type corresponds to.
- return parentName.Length == 0 ?
- typeAccordingToFilename : parentName + "." + typeAccordingToFilename;
- }
-
- // If id does not contain the delimiter $, id is returned.
- // Otherwise the substring from the first character of id
- // until (and excluding) the first occurrence of the delimiter $
- // is returned.
- static string OuterMostType(string id)
- {
- // First occurrence of the delimiter for a nested type.
- int i = id.IndexOf('$');
- if (i == -1)
- {
- // This type is already an outer-most type.
- return id;
- }
- // Note: i == 0 is impossible; otherwise the type's name were only $.
- return id[..i];
- }
-
- // Returns the last name in the given qualified name.
- // The first element of the result is the fully qualified name
- // of the parent and the second element is the last simple name.
- static (string, string) SimpleName(string qualifiedName)
- {
- int i = qualifiedName.LastIndexOf(".", StringComparison.Ordinal);
- if (i == -1)
- {
- return (string.Empty, qualifiedName);
- }
- else
- {
- return (qualifiedName[..i], qualifiedName[..^i]);
- }
- }
- }
- }
-}
diff --git a/Assets/SEE/DataModel/DG/IO/JaCoCoImporter.cs.meta b/Assets/SEE/DataModel/DG/IO/JaCoCoImporter.cs.meta
deleted file mode 100644
index fdbbc32ab6..0000000000
--- a/Assets/SEE/DataModel/DG/IO/JaCoCoImporter.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 5fe793c0a72899e4fab4851bbd5d70ef
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/SEE/DataModel/DG/IO/ReportImports.meta b/Assets/SEE/DataModel/DG/IO/ReportImports.meta
new file mode 100644
index 0000000000..6227e71e1a
--- /dev/null
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b282170af5dc7cb4694f5ed1a27110b6
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/DataModel/DG/IO/CSharpIndexNodeStrategy.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/CSharpIndexNodeStrategy.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/CSharpIndexNodeStrategy.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/CSharpIndexNodeStrategy.cs
index 1c3b0ec3ae..47cd473bf7 100644
--- a/Assets/SEE/DataModel/DG/IO/CSharpIndexNodeStrategy.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/CSharpIndexNodeStrategy.cs
@@ -2,7 +2,7 @@
using System;
using System.IO;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Tool-agnostic index strategy for C# reports.
diff --git a/Assets/SEE/DataModel/DG/IO/CSharpIndexNodeStrategy.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/CSharpIndexNodeStrategy.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/CSharpIndexNodeStrategy.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/CSharpIndexNodeStrategy.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/CheckstyleParsingConfig.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/CheckstyleParsingConfig.cs
similarity index 97%
rename from Assets/SEE/DataModel/DG/IO/CheckstyleParsingConfig.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/CheckstyleParsingConfig.cs
index 67f386babc..e76f8beda4 100644
--- a/Assets/SEE/DataModel/DG/IO/CheckstyleParsingConfig.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/CheckstyleParsingConfig.cs
@@ -1,6 +1,7 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Contains parser configuration and node-indexing helpers for importing external analysis reports.
@@ -17,6 +18,7 @@ namespace SEE.DataModel.DG.IO
/// Metrics are configured per context (see ),
/// so the parser does not need XPath hacks that force irrelevant metrics to evaluate to NaN.
///
+ [Serializable]
internal sealed class CheckstyleParsingConfig : XmlParsingConfig
{
///
diff --git a/Assets/SEE/DataModel/DG/IO/CheckstyleParsingConfig.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/CheckstyleParsingConfig.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/CheckstyleParsingConfig.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/CheckstyleParsingConfig.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/Finding.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/Finding.cs
similarity index 97%
rename from Assets/SEE/DataModel/DG/IO/Finding.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/Finding.cs
index dbeddfcbbe..b169551295 100644
--- a/Assets/SEE/DataModel/DG/IO/Finding.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/Finding.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Represents a single parsed report element together with its metrics and optional location data.
diff --git a/Assets/SEE/DataModel/DG/IO/Finding.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/Finding.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/Finding.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/Finding.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/IIndexNodeStrategy.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/IIndexNodeStrategy.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/IIndexNodeStrategy.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/IIndexNodeStrategy.cs
index 6b0db279d2..7e24c35c93 100644
--- a/Assets/SEE/DataModel/DG/IO/IIndexNodeStrategy.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/IIndexNodeStrategy.cs
@@ -1,4 +1,4 @@
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Strategy interface for normalizing code element identifiers from external tools
diff --git a/Assets/SEE/DataModel/DG/IO/IIndexNodeStrategy.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/IIndexNodeStrategy.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/IIndexNodeStrategy.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/IIndexNodeStrategy.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/IReportParser.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/IReportParser.cs
similarity index 96%
rename from Assets/SEE/DataModel/DG/IO/IReportParser.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/IReportParser.cs
index 71bc310fa6..c13e6fef41 100644
--- a/Assets/SEE/DataModel/DG/IO/IReportParser.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/IReportParser.cs
@@ -2,7 +2,7 @@
using System.Threading;
using SEE.Utils.Paths;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Defines the contract for components that transform raw report files into
diff --git a/Assets/SEE/DataModel/DG/IO/IReportParser.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/IReportParser.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/IReportParser.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/IReportParser.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/JaCoCoParsingConfig.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/JaCoCoParsingConfig.cs
similarity index 97%
rename from Assets/SEE/DataModel/DG/IO/JaCoCoParsingConfig.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/JaCoCoParsingConfig.cs
index 78d7af2fb2..92ce40df46 100644
--- a/Assets/SEE/DataModel/DG/IO/JaCoCoParsingConfig.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/JaCoCoParsingConfig.cs
@@ -1,14 +1,16 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
///
/// Contains types for parsing external tool reports and applying their metrics to SEE dependency graphs.
///
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Parsing configuration for JaCoCo XML reports.
///
/// Preconditions: An instance must be used only with JaCoCo-compatible XML input.
+ [Serializable]
internal sealed class JaCoCoParsingConfig : XmlParsingConfig
{
///
diff --git a/Assets/SEE/DataModel/DG/IO/JaCoCoParsingConfig.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/JaCoCoParsingConfig.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/JaCoCoParsingConfig.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/JaCoCoParsingConfig.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/JavaIndexNodeStrategy.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/JavaIndexNodeStrategy.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/JavaIndexNodeStrategy.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/JavaIndexNodeStrategy.cs
index ffd7610e46..33d2c00c8d 100644
--- a/Assets/SEE/DataModel/DG/IO/JavaIndexNodeStrategy.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/JavaIndexNodeStrategy.cs
@@ -2,7 +2,7 @@
using System;
using System.IO;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Strategy for normalizing Java code element identifiers to logical Identifiers for node lookup in .
diff --git a/Assets/SEE/DataModel/DG/IO/JavaIndexNodeStrategy.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/JavaIndexNodeStrategy.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/JavaIndexNodeStrategy.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/JavaIndexNodeStrategy.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/JsonParsingConfig.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/JsonParsingConfig.cs
similarity index 58%
rename from Assets/SEE/DataModel/DG/IO/JsonParsingConfig.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/JsonParsingConfig.cs
index 1ca65b03d6..48db41eacc 100644
--- a/Assets/SEE/DataModel/DG/IO/JsonParsingConfig.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/JsonParsingConfig.cs
@@ -1,13 +1,21 @@
-namespace SEE.DataModel.DG.IO
+using System;
+using UnityEngine;
+
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Configuration for parsing JSON-based reports using JSONPath mappings.
///
+ [Serializable]
public abstract class JsonParsingConfig : ParsingConfig
{
///
/// Describes which JSON tokens to visit and how to interpret them.
///
+ /// This is not a user setting. It will not be saved to a configuration file.
+ /// It depends solely on the type of report data and will be set by the subclasses
+ /// appropriately.
+ [HideInInspector]
public JsonPathMapping JsonMapping = new();
internal override IReportParser CreateParser()
diff --git a/Assets/SEE/DataModel/DG/IO/JsonParsingConfig.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/JsonParsingConfig.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/JsonParsingConfig.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/JsonParsingConfig.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/JsonPathMapping.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/JsonPathMapping.cs
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/JsonPathMapping.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/JsonPathMapping.cs
diff --git a/Assets/SEE/DataModel/DG/IO/JsonPathMapping.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/JsonPathMapping.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/JsonPathMapping.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/JsonPathMapping.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/JsonReportParser.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/JsonReportParser.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/JsonReportParser.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/JsonReportParser.cs
index f2df54b2e4..73cdeb2be3 100644
--- a/Assets/SEE/DataModel/DG/IO/JsonReportParser.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/JsonReportParser.cs
@@ -8,7 +8,7 @@
using System.Threading;
using UnityEngine;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Generic JSON parser that uses a to translate report files
diff --git a/Assets/SEE/DataModel/DG/IO/JsonReportParser.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/JsonReportParser.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/JsonReportParser.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/JsonReportParser.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/MSBuildParsingConfig.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/MSBuildParsingConfig.cs
similarity index 96%
rename from Assets/SEE/DataModel/DG/IO/MSBuildParsingConfig.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/MSBuildParsingConfig.cs
index 6bebf2f35b..db9f07a12c 100644
--- a/Assets/SEE/DataModel/DG/IO/MSBuildParsingConfig.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/MSBuildParsingConfig.cs
@@ -1,7 +1,8 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Text.RegularExpressions;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Parsing configuration for MSBuild C# compiler output (warnings and errors).
@@ -17,6 +18,7 @@ namespace SEE.DataModel.DG.IO
/// ...\PlayerController.cs(42,15): warning CS0219: Variable is assigned but never used [...csproj]
///
///
+ [Serializable]
internal sealed class MSBuildParsingConfig : TextParsingConfig
{
///
diff --git a/Assets/SEE/DataModel/DG/IO/MSBuildParsingConfig.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/MSBuildParsingConfig.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/MSBuildParsingConfig.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/MSBuildParsingConfig.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/MetricApplier.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/MetricApplier.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/MetricApplier.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/MetricApplier.cs
index 4b0b560721..61a6e060ac 100644
--- a/Assets/SEE/DataModel/DG/IO/MetricApplier.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/MetricApplier.cs
@@ -4,7 +4,7 @@
using SEE.DataModel.DG.GraphIndex;
using UnityEngine;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Translates parsed findings into node metrics on a instance.
diff --git a/Assets/SEE/DataModel/DG/IO/MetricApplier.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/MetricApplier.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/MetricApplier.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/MetricApplier.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/MetricLocation.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/MetricLocation.cs
similarity index 94%
rename from Assets/SEE/DataModel/DG/IO/MetricLocation.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/MetricLocation.cs
index e3c776e9e1..91b082fb9d 100644
--- a/Assets/SEE/DataModel/DG/IO/MetricLocation.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/MetricLocation.cs
@@ -1,4 +1,4 @@
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Optional source-code location for a finding.
diff --git a/Assets/SEE/DataModel/DG/IO/MetricLocation.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/MetricLocation.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/MetricLocation.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/MetricLocation.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/MetricSchema.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/MetricSchema.cs
similarity index 93%
rename from Assets/SEE/DataModel/DG/IO/MetricSchema.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/MetricSchema.cs
index 007f8ee853..da64e69689 100644
--- a/Assets/SEE/DataModel/DG/IO/MetricSchema.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/MetricSchema.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Container for all findings extracted from a single metrics report.
diff --git a/Assets/SEE/DataModel/DG/IO/MetricSchema.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/MetricSchema.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/MetricSchema.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/MetricSchema.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/NUnitJsonParsingConfig.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/NUnitJsonParsingConfig.cs
similarity index 96%
rename from Assets/SEE/DataModel/DG/IO/NUnitJsonParsingConfig.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/NUnitJsonParsingConfig.cs
index 9c63087f9f..7c068d0a45 100644
--- a/Assets/SEE/DataModel/DG/IO/NUnitJsonParsingConfig.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/NUnitJsonParsingConfig.cs
@@ -1,11 +1,13 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Parsing configuration for OpenCover/ReportGenerator JSON summary reports.
/// Supports 'class' contexts.
///
+ [Serializable]
internal sealed class NUnitJsonParsingConfig : JsonParsingConfig
{
///
diff --git a/Assets/SEE/DataModel/DG/IO/NUnitJsonParsingConfig.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/NUnitJsonParsingConfig.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/NUnitJsonParsingConfig.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/NUnitJsonParsingConfig.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/ParsingConfig.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/ParsingConfig.cs
similarity index 83%
rename from Assets/SEE/DataModel/DG/IO/ParsingConfig.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/ParsingConfig.cs
index 07f0706b0b..e8e39f3cd7 100644
--- a/Assets/SEE/DataModel/DG/IO/ParsingConfig.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/ParsingConfig.cs
@@ -3,26 +3,35 @@
using SEE.Utils.Config;
using System;
using System.Collections.Generic;
+using UnityEngine;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Base configuration that describes how a specific tool's report should be interpreted.
///
+ [Serializable]
public abstract class ParsingConfig
{
///
/// Identifier that ties parsed metrics to their origin (for example, "JaCoCo").
/// This value must not be null when a parser uses this configuration.
///
+ /// This is not a user setting, yet it must be saved to a configuration file.
+ /// It will be used to identify what type of must
+ /// instantiated when reading a configuration file. It depends solely on the type
+ /// of report data and will be set by the subclasses appropriately.
+ [HideInInspector]
public string ToolId = string.Empty;
///
- /// Optional marker used to normalize file paths between the GLX graph and the external tool report.
+ /// Optional marker used to normalize file paths between the internal graph
+ /// and the external tool report.
///
- /// Some tools emit absolute paths or paths rooted differently than the GLX input. When this value is set,
- /// tries to cut off everything up to
- /// the last occurrence of this marker and returns the remaining path relative to that "source root".
+ /// Some tools emit absolute paths or paths rooted differently than the
+ /// internal graph. When this value is set,
+ /// tries to cut off everything up to the last occurrence of this marker and
+ /// returns the remaining path relative to that "source root".
///
/// Example:
///
@@ -31,8 +40,14 @@ public abstract class ParsingConfig
/// result = "com/acme/Foo.java"
///
///
- /// Leave this empty if report paths and GLX paths already match.
+ /// Leave this empty if report paths and paths in the graph already match.
///
+ /// This is a user setting. It must be saved to a configuration file.
+ [Tooltip("Marks the root of external paths of the import. "
+ + "If set, it will be used to normalize imported paths to match the paths in the the current graph. "
+ + "For instance, if an external path is 'C:/work/proj/src/main/java/com/acme/Foo.java' "
+ + "and this setting is 'src/main/java', the normalized path will be 'com/acme/Foo.java'. "
+ + "Leave empty if the paths match already.")]
public string SourceRootMarker = string.Empty;
///
diff --git a/Assets/SEE/DataModel/DG/IO/ParsingConfig.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/ParsingConfig.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/ParsingConfig.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/ParsingConfig.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/ParsingConfigFactory.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/ParsingConfigFactory.cs
similarity index 98%
rename from Assets/SEE/DataModel/DG/IO/ParsingConfigFactory.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/ParsingConfigFactory.cs
index de6fc15d76..d34f2bc084 100644
--- a/Assets/SEE/DataModel/DG/IO/ParsingConfigFactory.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/ParsingConfigFactory.cs
@@ -4,7 +4,7 @@
using System.Reflection;
using UnityEngine;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// A factory for creating instances of .
diff --git a/Assets/SEE/DataModel/DG/IO/ParsingConfigFactory.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/ParsingConfigFactory.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/ParsingConfigFactory.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/ParsingConfigFactory.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/TextParsingConfig.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/TextParsingConfig.cs
similarity index 61%
rename from Assets/SEE/DataModel/DG/IO/TextParsingConfig.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/TextParsingConfig.cs
index 7a2f6e192e..a28aff65c6 100644
--- a/Assets/SEE/DataModel/DG/IO/TextParsingConfig.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/TextParsingConfig.cs
@@ -1,7 +1,9 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Text.RegularExpressions;
+using UnityEngine;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Configuration for parsing line-oriented text reports using regular expressions.
@@ -31,6 +33,7 @@ namespace SEE.DataModel.DG.IO
/// }
///
///
+ [Serializable]
public abstract class TextParsingConfig : ParsingConfig
{
///
@@ -40,60 +43,89 @@ public abstract class TextParsingConfig : ParsingConfig
/// Each pattern should use named capture groups that can be referenced in other mappings.
/// Preconditions: Must not be null when a text parser uses this configuration.
///
- public Dictionary LinePatterns { get; set; } = new Dictionary();
+ /// This is not a user setting. It will not be saved to a configuration file.
+ /// It depends solely on the type of report data and will be set by the subclasses
+ /// appropriately.
+ [HideInInspector]
+ public Dictionary LinePatterns { get; set; } = new();
///
/// Maps context names to template strings that build the full path identifier.
/// Templates can reference named groups from using ${groupName} syntax.
+ ///
+ /// Preconditions: Dictionary keys must match contexts defined in .
///
- /// Preconditions: Dictionary keys must match contexts defined in .
- public Dictionary PathBuilders { get; set; } = new Dictionary();
+ /// This is not a user setting. It will not be saved to a configuration file.
+ /// It depends solely on the type of report data and will be set by the subclasses
+ /// appropriately.
+ [HideInInspector]
+ public Dictionary PathBuilders { get; set; } = new();
///
/// Maps context names to template strings that extract the file name.
/// Templates can reference named groups from using ${groupName} syntax.
+ ///
+ /// May be empty if file names are already captured in PathBuilders.
///
- /// May be empty if file names are already captured in PathBuilders.
- public Dictionary FileNameTemplates { get; set; } = new Dictionary();
+ /// This is not a user setting. It will not be saved to a configuration file.
+ /// It depends solely on the type of report data and will be set by the subclasses
+ /// appropriately.
+ [HideInInspector]
+ public Dictionary FileNameTemplates { get; set; } = new();
///
/// Maps standard location field names to capture group names from the line patterns.
- ///
- ///
/// Supported keys: StartLine, EndLine, StartColumn, EndColumn.
/// Values should be capture group names (without ${} syntax).
/// May be null if the report format does not provide explicit locations.
- ///
+ ///
+ /// This is not a user setting. It will not be saved to a configuration file.
+ /// It depends solely on the type of report data and will be set by the subclasses
+ /// appropriately.
+ [HideInInspector]
public Dictionary? LocationMapping { get; set; }
///
/// Metric definitions keyed by context, each containing metric names mapped to template strings.
/// Templates can reference named groups from using ${groupName} syntax.
+ ///
+ /// Preconditions: Outer dictionary keys must match contexts defined in .
///
- /// Preconditions: Outer dictionary keys must match contexts defined in .
- public Dictionary> MetricsByContext { get; set; }
- = new Dictionary>();
+ /// This is not a user setting. It will not be saved to a configuration file.
+ /// It depends solely on the type of report data and will be set by the subclasses
+ /// appropriately.
+ [HideInInspector]
+ public Dictionary> MetricsByContext { get; set; } = new();
///
/// Optional regex options applied to all patterns in .
+ ///
+ /// Defaults to RegexOptions.None if not specified.
///
- /// Defaults to RegexOptions.None if not specified.
+ /// This is not a user setting. It will not be saved to a configuration file.
+ /// It depends solely on the type of report data and will be set by the subclasses
+ /// appropriately.
+ [HideInInspector]
public RegexOptions RegexOptions { get; set; } = RegexOptions.None;
///
/// Optional filter that determines which lines should be processed.
/// If null, all lines are processed. If set, only lines matching this pattern are considered.
+ /// Useful for skipping header lines or filtering out noise in verbose reports.
///
- /// Useful for skipping header lines or filtering out noise in verbose reports.
+ /// This is not a user setting. It will not be saved to a configuration file.
+ /// It depends solely on the type of report data and will be set by the subclasses
+ /// appropriately.
+ [HideInInspector]
public string? LineFilter { get; set; }
///
/// Creates a configured for text input.
///
+ /// An instance for text reports.
///
/// Preconditions: and must be initialized.
///
- /// An instance for text reports.
internal override IReportParser CreateParser()
{
return new TextReportParser(this);
diff --git a/Assets/SEE/DataModel/DG/IO/TextParsingConfig.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/TextParsingConfig.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/TextParsingConfig.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/TextParsingConfig.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/TextReportParser.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/TextReportParser.cs
similarity index 99%
rename from Assets/SEE/DataModel/DG/IO/TextReportParser.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/TextReportParser.cs
index bfdb781263..14f45e27ad 100644
--- a/Assets/SEE/DataModel/DG/IO/TextReportParser.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/TextReportParser.cs
@@ -8,7 +8,7 @@
using System.Threading;
using UnityEngine;
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Parser for line-oriented text reports that uses regular expressions to extract
diff --git a/Assets/SEE/DataModel/DG/IO/TextReportParser.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/TextReportParser.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/TextReportParser.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/TextReportParser.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/XPathMapping.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/XPathMapping.cs
similarity index 90%
rename from Assets/SEE/DataModel/DG/IO/XPathMapping.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/XPathMapping.cs
index ae351cb3fa..317c26d992 100644
--- a/Assets/SEE/DataModel/DG/IO/XPathMapping.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/XPathMapping.cs
@@ -1,14 +1,16 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
///
/// Contains data model types for parsing and interpreting external tool reports in a .
///
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Encapsulates the XPath expressions used to traverse and interpret a report.
/// All XPath expressions must be valid for the corresponding report format.
///
+ [Serializable]
public class XPathMapping
{
///
@@ -21,13 +23,13 @@ public class XPathMapping
/// Maps XML element names to XPath expressions that produce the full path identifier.
///
/// Preconditions: Dictionary keys and values must not be null.
- public Dictionary PathBuilders { get; set; } = new Dictionary();
+ public Dictionary PathBuilders { get; set; } = new();
///
/// Maps XML element names (context) to XPath expressions that select the file name of a node.
///
/// Preconditions: Dictionary keys and values must not be null.
- public Dictionary FileName { get; set; } = new Dictionary();
+ public Dictionary FileName { get; set; } = new();
///
/// Optional mapping from location field names to XPath expressions.
@@ -39,8 +41,7 @@ public class XPathMapping
/// Metric definitions keyed by their output name, each pointing to a context-specific XPath expression.
///
/// Preconditions: Dictionary keys and values must not be null.
- public Dictionary> MetricsByContext { get; set; } =
- new Dictionary>();
+ public Dictionary> MetricsByContext { get; set; } = new();
///
/// Optional namespace prefix or URI map for XPath evaluation.
diff --git a/Assets/SEE/DataModel/DG/IO/XPathMapping.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/XPathMapping.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/XPathMapping.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/XPathMapping.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/XmlParsingConfig.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/XmlParsingConfig.cs
similarity index 67%
rename from Assets/SEE/DataModel/DG/IO/XmlParsingConfig.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/XmlParsingConfig.cs
index 45b8a4c355..3edc1a4c6f 100644
--- a/Assets/SEE/DataModel/DG/IO/XmlParsingConfig.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/XmlParsingConfig.cs
@@ -1,15 +1,23 @@
-namespace SEE.DataModel.DG.IO
+using System;
+using UnityEngine;
+
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Configuration for parsing XML-based reports using XPath mappings.
///
+ [Serializable]
public abstract class XmlParsingConfig : ParsingConfig
{
///
/// Describes which XML nodes to visit and how to interpret them.
/// Must not be null when an XML parser uses this configuration.
///
- public XPathMapping XPathMapping = new ();
+ /// This is not a user setting. It will not be saved to a configuration file.
+ /// It depends solely on the type of report data and will be set by the subclasses
+ /// appropriately.
+ [HideInInspector]
+ public XPathMapping XPathMapping = new();
///
/// Creates an configured for XML input.
diff --git a/Assets/SEE/DataModel/DG/IO/XmlParsingConfig.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/XmlParsingConfig.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/XmlParsingConfig.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/XmlParsingConfig.cs.meta
diff --git a/Assets/SEE/DataModel/DG/IO/XmlReportParser.cs b/Assets/SEE/DataModel/DG/IO/ReportImports/XmlReportParser.cs
similarity index 98%
rename from Assets/SEE/DataModel/DG/IO/XmlReportParser.cs
rename to Assets/SEE/DataModel/DG/IO/ReportImports/XmlReportParser.cs
index b53d63a796..608c767fff 100644
--- a/Assets/SEE/DataModel/DG/IO/XmlReportParser.cs
+++ b/Assets/SEE/DataModel/DG/IO/ReportImports/XmlReportParser.cs
@@ -12,7 +12,7 @@
///
/// Contains types for parsing external tool reports and applying their metrics to SEE dependency graphs.
///
-namespace SEE.DataModel.DG.IO
+namespace SEE.DataModel.DG.IO.ReportImports
{
///
/// Generic XML parser that uses a to translate report files
@@ -124,7 +124,7 @@ private static MetricSchema ParseCore(XmlReader xmlReader, XmlParsingConfig pars
throw new ArgumentNullException(nameof(parsingConfig.XPathMapping));
}
- XPathDocument report = new XPathDocument(xmlReader);
+ XPathDocument report = new(xmlReader);
XPathNavigator navigator = report.CreateNavigator();
// Optional: configure namespaces if provided by the mapping.
@@ -139,7 +139,7 @@ private static MetricSchema ParseCore(XmlReader xmlReader, XmlParsingConfig pars
}
}
- MetricSchema metricSchema = new MetricSchema
+ MetricSchema metricSchema = new()
{
ToolId = parsingConfig.ToolId ?? string.Empty
};
diff --git a/Assets/SEE/DataModel/DG/IO/XmlReportParser.cs.meta b/Assets/SEE/DataModel/DG/IO/ReportImports/XmlReportParser.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/DG/IO/XmlReportParser.cs.meta
rename to Assets/SEE/DataModel/DG/IO/ReportImports/XmlReportParser.cs.meta
diff --git a/Assets/SEE/Dissonance/ChatInputController.cs b/Assets/SEE/Dissonance/ChatInputController.cs
index 1c73bea142..ad51c47980 100644
--- a/Assets/SEE/Dissonance/ChatInputController.cs
+++ b/Assets/SEE/Dissonance/ChatInputController.cs
@@ -1,5 +1,5 @@
-using SEE.Controls;
-using SEE.GO;
+using SEE.Controls.KeyActions;
+using SEE.Extensions;
using System.Linq;
using UnityEngine;
using UnityEngine.EventSystems;
diff --git a/Assets/SEE/Dissonance/Dissonance.cs b/Assets/SEE/Dissonance/Dissonance.cs
new file mode 100644
index 0000000000..ec3eb20ea3
--- /dev/null
+++ b/Assets/SEE/Dissonance/Dissonance.cs
@@ -0,0 +1,6 @@
+///
+/// Dissonance voice and text chat components.
+///
+namespace SEE.Dissonance
+{
+}
diff --git a/Assets/SEE/Dissonance/Dissonance.cs.meta b/Assets/SEE/Dissonance/Dissonance.cs.meta
new file mode 100644
index 0000000000..4a26ec86e5
--- /dev/null
+++ b/Assets/SEE/Dissonance/Dissonance.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: cb9eeaffb39edb045bd7c6ac354159b4
\ No newline at end of file
diff --git a/Assets/SEE/Dissonance/VoiceChatInputController.cs b/Assets/SEE/Dissonance/VoiceChatInputController.cs
index 9fc132755c..35380f35c9 100644
--- a/Assets/SEE/Dissonance/VoiceChatInputController.cs
+++ b/Assets/SEE/Dissonance/VoiceChatInputController.cs
@@ -1,5 +1,5 @@
using Dissonance;
-using SEE.Controls;
+using SEE.Controls.KeyActions;
using UnityEngine;
namespace SEE.Dissonance
diff --git a/Assets/SEE/Events.meta b/Assets/SEE/Events.meta
new file mode 100644
index 0000000000..cabb8b8279
--- /dev/null
+++ b/Assets/SEE/Events.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 908f5442409c3e349b1cdc61b157b65b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Events/Events.cs b/Assets/SEE/Events/Events.cs
new file mode 100644
index 0000000000..12be0c39ef
--- /dev/null
+++ b/Assets/SEE/Events/Events.cs
@@ -0,0 +1,6 @@
+///
+/// Events triggered when an observable changes.
+///
+namespace SEE.Events
+{
+}
diff --git a/Assets/SEE/Events/Events.cs.meta b/Assets/SEE/Events/Events.cs.meta
new file mode 100644
index 0000000000..baa10d1430
--- /dev/null
+++ b/Assets/SEE/Events/Events.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: e268efc92fa8a68488908d8c44cad69b
\ No newline at end of file
diff --git a/Assets/SEE/DataModel/Observable.cs b/Assets/SEE/Events/Observable.cs
similarity index 99%
rename from Assets/SEE/DataModel/Observable.cs
rename to Assets/SEE/Events/Observable.cs
index 6768d634bb..a14f366376 100644
--- a/Assets/SEE/DataModel/Observable.cs
+++ b/Assets/SEE/Events/Observable.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
-namespace SEE.DataModel
+namespace SEE.Events
{
///
/// Represents an observable class, that is, a class which emits events that subscribers can be notified of.
@@ -114,4 +114,4 @@ protected void NotifyError(Exception error)
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Assets/SEE/DataModel/Observable.cs.meta b/Assets/SEE/Events/Observable.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/Observable.cs.meta
rename to Assets/SEE/Events/Observable.cs.meta
diff --git a/Assets/SEE/DataModel/ProxyObserver.cs b/Assets/SEE/Events/ProxyObserver.cs
similarity index 99%
rename from Assets/SEE/DataModel/ProxyObserver.cs
rename to Assets/SEE/Events/ProxyObserver.cs
index 498fa3a71f..e636450390 100644
--- a/Assets/SEE/DataModel/ProxyObserver.cs
+++ b/Assets/SEE/Events/ProxyObserver.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
-namespace SEE.DataModel
+namespace SEE.Events
{
public abstract partial class Observable
{
diff --git a/Assets/SEE/DataModel/ProxyObserver.cs.meta b/Assets/SEE/Events/ProxyObserver.cs.meta
similarity index 100%
rename from Assets/SEE/DataModel/ProxyObserver.cs.meta
rename to Assets/SEE/Events/ProxyObserver.cs.meta
diff --git a/Assets/SEE/Extensions.meta b/Assets/SEE/Extensions.meta
new file mode 100644
index 0000000000..dd1eac99ea
--- /dev/null
+++ b/Assets/SEE/Extensions.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b0081808ad67f754a93f7103158b226d
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/SEE/Extensions/CodeCityExtensions.cs b/Assets/SEE/Extensions/CodeCityExtensions.cs
new file mode 100644
index 0000000000..c37842233d
--- /dev/null
+++ b/Assets/SEE/Extensions/CodeCityExtensions.cs
@@ -0,0 +1,154 @@
+using SEE.Game;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+namespace SEE.Extensions
+{
+ ///
+ /// Extension methods for code-city game objects. A code-city game object
+ /// is a under which game nodes and
+ /// game edges are placed to render a code city.
+ ///
+ internal static class CodeCityExtensions
+ {
+ ///
+ /// Returns true if a code city was drawn for this .
+ /// A code city is assumed to be drawn in there is at least one immediate child
+ /// of this that represents a graph node, i.e., has a
+ /// (checked by predicate .
+ ///
+ /// This predicate can be queried for game objects representing a code city,
+ /// that is, game objects that have an attached to
+ /// them.
+ ///
+ /// The code city to checked.
+ /// True if a code city was drawn.
+ /// Applicable to a game object representing a code city.
+ public static bool IsCodeCityDrawn(this GameObject codeCity)
+ {
+ return codeCity.transform.Cast().Any(child => child.gameObject.IsNode());
+ }
+
+ ///
+ /// Returns true if a code city was drawn for this and is active.
+ /// A code city is assumed to be drawn in there is at least one immediate child
+ /// of this game object that represents a graph node, i.e., has a
+ /// (checked by predicate .
+ ///
+ /// This predicate can be queried for game objects representing a code city,
+ /// that is, game objects that have an attached to
+ /// them.
+ ///
+ /// The code city to checked.
+ /// True if a code city was drawn and is active.
+ /// Applicable to a game object representing a code city.
+ public static bool IsCodeCityDrawnAndActive(this GameObject codeCity)
+ {
+ return codeCity.transform.Cast().Any(child => child.gameObject.IsNode()
+ && child.gameObject.activeInHierarchy);
+ }
+
+ ///
+ /// Returns true if there is any edge in the given .
+ ///
+ /// The code city to checked.
+ /// True if there is any edge in the given .
+ /// Applicable to a game object representing a code city.
+ public static bool CodeCityHasAnyEdges(this GameObject codeCity)
+ {
+ // Edges are immediate children of the code-city game object.
+ return codeCity.transform.Cast().Any(child => child.gameObject.IsEdge()
+ && child.gameObject.activeInHierarchy);
+ }
+
+ ///
+ /// Returns first child of tagged by
+ /// or null if none can be found.
+ ///
+ /// Object representing a code city (tagged by ).
+ /// Game object representing the root of the graph or null if there is none.
+ /// If is a node representing a code city,
+ /// the first child tagged as is considered the root of the graph.
+ ///
+ /// Thrown if is null.
+ ///
+ /// Applicable to a game object representing a code city.
+ public static GameObject GetCityRootNode(this GameObject codeCity)
+ {
+ if (codeCity == null)
+ {
+ throw new ArgumentNullException(nameof(codeCity));
+ }
+ foreach (Transform child in codeCity.transform)
+ {
+ if (child.CompareTag(Tags.Node))
+ {
+ return child.transform.gameObject;
+ }
+ }
+ return null;
+ }
+
+ ///
+ /// Returns all game objects tagged as that are descendants
+ /// of .
+ ///
+ /// Root game object to be traversed.
+ /// All game objects tagged as .
+ /// Applicable to a game object representing a code city.
+ internal static IEnumerable AllEdges(this GameObject codeCity)
+ {
+ return codeCity.AllDescendants(Tags.Edge);
+ }
+
+ ///
+ /// Returns all transitive children of tagged by
+ /// given (including itself).
+ ///
+ /// The game object whose children are requested.
+ /// The tag the descendants must have.
+ /// All transitive children with .
+ /// Although this method primarily intended for code cities, it is
+ /// also applicable to a game node.
+ public static List AllDescendants(this GameObject gameObject, string tag)
+ {
+ List result = new();
+ if (gameObject.CompareTag(tag))
+ {
+ result.Add(gameObject);
+ }
+
+ foreach (Transform child in gameObject.transform)
+ {
+ result.AddRange(child.gameObject.AllDescendants(tag));
+ }
+
+ return result;
+ }
+
+ ///
+ /// Applies to all (transitive) descendants of
+ /// (including ) if they have the given .
+ ///
+ /// The game object on which to apply the .
+ /// The tag the descendants must have.
+ /// The action to be applied.
+ /// Although this method primarily intended for code cities, it is
+ /// also applicable to a game node.
+ public static void ApplyToAllDescendants(this GameObject root, string tag, Action action)
+ {
+ if (root.CompareTag(tag))
+ {
+ action(root);
+ }
+
+ foreach (Transform child in root.transform)
+ {
+ child.gameObject.ApplyToAllDescendants(tag, action);
+ }
+ }
+
+ }
+}
diff --git a/Assets/SEE/Extensions/CodeCityExtensions.cs.meta b/Assets/SEE/Extensions/CodeCityExtensions.cs.meta
new file mode 100644
index 0000000000..8378441d76
--- /dev/null
+++ b/Assets/SEE/Extensions/CodeCityExtensions.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 28c71a4eea3267f40893c793c2a399ae
\ No newline at end of file
diff --git a/Assets/SEE/Utils/ColorExtensions.cs b/Assets/SEE/Extensions/ColorExtensions.cs
similarity index 90%
rename from Assets/SEE/Utils/ColorExtensions.cs
rename to Assets/SEE/Extensions/ColorExtensions.cs
index 826ab6dbe9..0ca6c13368 100644
--- a/Assets/SEE/Utils/ColorExtensions.cs
+++ b/Assets/SEE/Extensions/ColorExtensions.cs
@@ -3,7 +3,7 @@
using System.Linq;
using UnityEngine;
-namespace SEE.Utils
+namespace SEE.Extensions
{
///
/// Provides various extensions methods for the Color class.
@@ -88,16 +88,5 @@ public static IEnumerable ToGradientColorKeys(this ICollection
var n => colors.Select((c, i) => new GradientColorKey(c, (float)i / (n - 1)))
};
}
-
- ///
- /// Converts the given to a list of colors.
- /// This simply extracts the colors from the keys.
- ///
- /// The keys to convert.
- /// The converted keys as colors.
- public static IEnumerable ToColors(this IEnumerable keys)
- {
- return keys.Select(c => c.color);
- }
}
}
diff --git a/Assets/SEE/Utils/ColorExtensions.cs.meta b/Assets/SEE/Extensions/ColorExtensions.cs.meta
similarity index 100%
rename from Assets/SEE/Utils/ColorExtensions.cs.meta
rename to Assets/SEE/Extensions/ColorExtensions.cs.meta
diff --git a/Assets/SEE/Extensions/Components.cs b/Assets/SEE/Extensions/Components.cs
new file mode 100644
index 0000000000..29324c61e7
--- /dev/null
+++ b/Assets/SEE/Extensions/Components.cs
@@ -0,0 +1,68 @@
+using Sirenix.Utilities;
+using System;
+using UnityEngine;
+
+namespace SEE.Extensions
+{
+ ///
+ /// Provides extension methods to manage s
+ /// of .
+ ///
+ public static class Components
+ {
+ ///
+ /// Tries to get the component of the given type of this .
+ /// If the component was found, it will be stored in and true will be returned.
+ /// If it wasn't found, will be null, false will be returned,
+ /// and an error message will be logged indicating that the component type wasn't present on the GameObject.
+ ///
+ /// The game object the component should be gotten from. Must not be null.
+ /// The variable in which to save the component.
+ /// The type of the component.
+ /// True if the component was present on the , false otherwise.
+ public static bool TryGetComponentOrLog(this GameObject gameObject, out T component)
+ {
+ if (!gameObject.TryGetComponent(out component))
+ {
+ Debug.LogError($"Couldn't find component '{typeof(T).GetNiceName()}' "
+ + $"on game object '{gameObject.FullName()}'.\n");
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Tries to get the component of the given type of this .
+ /// If a component of the type was found, it will be returned, otherwise a new component of the type
+ /// will be added and returned.
+ ///
+ /// The gameobject whose component of type
+ /// we wish to return.
+ /// The component to get / add
+ /// The existing or newly created component.
+ public static T AddOrGetComponent(this GameObject gameObject) where T : Component
+ {
+ return gameObject.TryGetComponent(out T component) ? component : gameObject.AddComponent();
+ }
+
+ ///
+ /// Tries to get the component of the given type of this .
+ /// If the component was found, it will be returned.
+ /// If it wasn't found, will be thrown.
+ ///
+ /// The game object the component should be gotten from. Must not be null.
+ /// The type of the component.
+ /// Thrown if has no
+ /// component of type .
+ public static T MustGetComponent(this GameObject gameObject)
+ {
+ if (!gameObject.TryGetComponent(out T component))
+ {
+ throw new InvalidOperationException($"Couldn't find component '{typeof(T).GetNiceName()}' on game object '{gameObject.FullName()}'");
+ }
+ return component;
+ }
+
+ }
+}
diff --git a/Assets/SEE/Extensions/Components.cs.meta b/Assets/SEE/Extensions/Components.cs.meta
new file mode 100644
index 0000000000..4380833192
--- /dev/null
+++ b/Assets/SEE/Extensions/Components.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: b892cac513096ef43a983b45276b13cb
\ No newline at end of file
diff --git a/Assets/SEE/Extensions/Extensions.cs b/Assets/SEE/Extensions/Extensions.cs
new file mode 100644
index 0000000000..e0fb89cd13
--- /dev/null
+++ b/Assets/SEE/Extensions/Extensions.cs
@@ -0,0 +1,7 @@
+///
+/// Provides extension methods for game objects (not limited to
+/// game nodes and game edges; there are extensions for Color, too.
+///
+namespace SEE.Extensions
+{
+}
diff --git a/Assets/SEE/Extensions/Extensions.cs.meta b/Assets/SEE/Extensions/Extensions.cs.meta
new file mode 100644
index 0000000000..4b915a835f
--- /dev/null
+++ b/Assets/SEE/Extensions/Extensions.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 5cac39b4fa4dd334d83220ea5aa90b4a
\ No newline at end of file
diff --git a/Assets/SEE/Extensions/GameEdgeExtensions.cs b/Assets/SEE/Extensions/GameEdgeExtensions.cs
new file mode 100644
index 0000000000..6fca0a1709
--- /dev/null
+++ b/Assets/SEE/Extensions/GameEdgeExtensions.cs
@@ -0,0 +1,156 @@
+using SEE.DataModel.DG;
+using SEE.Game;
+using SEE.Game.Operator;
+using SEE.GraphElementRefs;
+using System;
+using UnityEngine;
+
+namespace SEE.Extensions
+{
+ ///
+ /// Extension methods for game edges. A game edge is a
+ /// representing a .
+ ///
+ internal static class GameEdgeExtensions
+ {
+ ///
+ /// Returns true if has an
+ /// component attached to it whose edge is not null.
+ ///
+ /// The game object whose EdgeRef is checked.
+ /// True if has an
+ /// component attached to it whose edge is not null.
+ public static bool HasEdgeRef(this GameObject gameEdge)
+ {
+ return gameEdge.TryGetComponent(out EdgeRef edgeRef) && edgeRef.Value != null;
+ }
+
+ ///
+ /// Returns true if is tagged by .
+ ///
+ /// The game object to check.
+ /// True if is tagged by .
+ public static bool IsEdge(this GameObject gameEdge)
+ {
+ return gameEdge.CompareTag(Tags.Edge);
+ }
+
+ ///
+ /// Returns true if has an
+ /// component attached to it that is not null.
+ ///
+ /// The game object whose EdgeRef is checked.
+ /// The edge referenced by the attached EdgeRef; defined only if this method
+ /// returns true.
+ /// True if has an
+ /// component attached to it that is not null.
+ public static bool TryGetEdge(this GameObject gameEdge, out Edge edge)
+ {
+ edge = null;
+ if (gameEdge.TryGetComponent(out EdgeRef edgeRef))
+ {
+ edge = edgeRef.Value;
+ }
+ return edge != null;
+ }
+
+ ///
+ /// Returns the graph edge represented by this .
+ ///
+ /// Precondition: must have an
+ /// attached to it referring to a valid edge; if not, an exception is raised.
+ ///
+ /// The game object whose is requested.
+ /// The corresponding graph edge (will never be null).
+ /// Thrown if has
+ /// no valid or .
+ /// This method is similar to , but throws an exception
+ /// if the edge is not found. It is analogous to .
+ public static Edge GetEdge(this GameObject gameEdge)
+ {
+ if (gameEdge.TryGetComponent(out EdgeRef edgeRef))
+ {
+ if (edgeRef != null)
+ {
+ if (edgeRef.Value != null)
+ {
+ return edgeRef.Value;
+ }
+ else
+ {
+ throw new NullReferenceException($"Edge referenced by game object {gameEdge.name} is null.");
+ }
+ }
+ else
+ {
+ throw new NullReferenceException($"Edge reference of game object {gameEdge.name} is null.");
+ }
+ }
+ else
+ {
+ throw new NullReferenceException($"Game object {gameEdge.name} has no {nameof(EdgeRef)}.");
+ }
+ }
+
+ ///
+ /// Returns the source node of the given .
+ /// The is assumed to represent an edge, that is,
+ /// is tagged by and has an .
+ /// If this is not the case, an exception is thrown. If the source node
+ /// of this edge does not exist, an exception is thrown, too.
+ ///
+ /// Game object representing an edge.
+ /// The game object representing the source of this edge.
+ public static GameObject Source(this GameObject gameEdge)
+ {
+ if (gameEdge.CompareTag(Tags.Edge) && gameEdge.TryGetComponent(out EdgeRef edgeRef))
+ {
+ return GraphElementIDMap.Find(edgeRef.SourceNodeID, mustFindElement: true);
+ }
+ else
+ {
+ throw new Exception($"Game object {gameEdge.name} is not an edge. It has no source node.");
+ }
+ }
+
+ ///
+ /// Returns the target node of the given .
+ /// The is assumed to represent an edge, that is,
+ /// is tagged by and has an .
+ /// If this is not the case, an exception is thrown. If the target node
+ /// of this edge does not exist, an exception is thrown, too.
+ ///
+ /// Game object representing an edge.
+ /// The game object representing the target of this edge.
+ public static GameObject Target(this GameObject gameEdge)
+ {
+ if (gameEdge.CompareTag(Tags.Edge) && gameEdge.TryGetComponent(out EdgeRef edgeRef))
+ {
+ return GraphElementIDMap.Find(edgeRef.SourceNodeID, mustFindElement: true);
+ }
+ else
+ {
+ throw new Exception($"Game object {gameEdge.name} is not an edge. It has no target node.");
+ }
+ }
+
+ ///
+ /// Returns the for this .
+ /// If no operator exists yet, it will be added.
+ /// If the game object is not an edge, an exception will be thrown.
+ ///
+ /// The game object whose operator to retrieve.
+ /// The responsible for this .
+ public static EdgeOperator EdgeOperator(this GameObject gameEdge)
+ {
+ if (gameEdge.CompareTag(Tags.Edge))
+ {
+ return gameEdge.AddOrGetComponent();
+ }
+ else
+ {
+ throw new InvalidOperationException($"Cannot get {nameof(EdgeOperator)} for game object {gameEdge.name} because it is not an edge.");
+ }
+ }
+ }
+}
diff --git a/Assets/SEE/Extensions/GameEdgeExtensions.cs.meta b/Assets/SEE/Extensions/GameEdgeExtensions.cs.meta
new file mode 100644
index 0000000000..8c6486bc28
--- /dev/null
+++ b/Assets/SEE/Extensions/GameEdgeExtensions.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 2738d7e1517978a4891fd580e8dc8718
\ No newline at end of file
diff --git a/Assets/SEE/Extensions/GameNodeExtensions.cs b/Assets/SEE/Extensions/GameNodeExtensions.cs
new file mode 100644
index 0000000000..1e438af5f4
--- /dev/null
+++ b/Assets/SEE/Extensions/GameNodeExtensions.cs
@@ -0,0 +1,395 @@
+using SEE.DataModel.DG;
+using SEE.Game;
+using SEE.Game.Operator;
+using SEE.GraphElementRefs;
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace SEE.Extensions
+{
+ ///
+ /// Extension methods for game nodes. A game node is a
+ /// representing a .
+ ///
+ internal static class GameNodeExtensions
+ {
+ ///
+ /// Returns the first immediate child of that
+ /// is a graph node, i.e., has a attached to it
+ /// (checked by predicate ) or null if there
+ /// is none.
+ ///
+ /// The game object whose child is to be retrieved.
+ /// First immediate child representing a node or null if there is none.
+ /// Applicable to game nodes only.
+ public static GameObject FirstChildNode(this GameObject gameObject)
+ {
+ foreach (Transform child in gameObject.transform)
+ {
+ if (child.gameObject.IsNode())
+ {
+ return child.gameObject;
+ }
+ }
+ return null;
+ }
+
+ ///
+ /// True if represents a leaf in the graph.
+ ///
+ /// Precondition: has a component
+ /// attached to it that is a valid graph node reference.
+ ///
+ /// Game object representing a Node to be queried whether it is a leaf.
+ /// True if represents a leaf in the graph.
+ /// Applicable to game nodes only.
+ public static bool IsLeaf(this GameObject gameNode)
+ {
+ return gameNode.TryGetNode(out Node node) && node.IsLeaf();
+ }
+
+ ///
+ /// True if represents the root of the graph.
+ ///
+ /// Precondition: has a component
+ /// attached to it that is a valid graph node reference.
+ ///
+ /// Game object representing a Node to be queried whether it is a root node.
+ /// True if represents a root in the graph.
+ /// Applicable to game nodes only.
+ public static bool IsRoot(this GameObject gameNode)
+ {
+ return gameNode.TryGetNode(out Node node) && node.IsRoot();
+ }
+
+ ///
+ /// True if represents the implementation or architecture root of
+ /// the graph.
+ ///
+ /// Precondition: has a component
+ /// attached to it that is a valid graph node reference.
+ ///
+ /// Game object representing a Node to be queried whether it is an implementation or architecture root.
+ /// True if represents an implementation or architecture root in the graph.
+ /// Applicable to game nodes only.
+ public static bool IsArchitectureOrImplementationRoot(this GameObject gameNode)
+ {
+ return gameNode.TryGetNode(out Node node) && node.IsArchitectureOrImplementationRoot();
+ }
+
+ ///
+ /// Returns the world-space y position of the roof of this .
+ ///
+ /// Game object whose roof has to be determined.
+ /// World-space y position of the roof of this .
+ /// This does not consider the position of descendants if there are any.
+ /// Consider if you want to
+ /// take descendants into account, too.
+ public static float GetRoof(this GameObject gameNode)
+ {
+ return gameNode.transform.position.y + gameNode.WorldSpaceSize().y / 2.0f;
+ }
+
+ ///
+ /// Returns the maximal world-space position (y co-ordinate) of the roof of
+ /// this or any of its active descendants.
+ /// Unlike , this method recurses into
+ /// the game-object hierarchy rooted by .
+ ///
+ /// Note: only descendants that are currently active in the scene are considered.
+ ///
+ /// Game object whose height has to be determined.
+ /// Function returning true for descendant transforms that shall be taken into
+ /// account. By default, this is a constant function which always returns true.
+ /// World-space position of the roof of this
+ /// or any of its active descendants.
+ public static float GetMaxY(this GameObject gameNode, Func filterTransform = null)
+ {
+ float result = float.NegativeInfinity;
+ filterTransform ??= _ => true;
+ Recurse(gameNode, ref result);
+ return result;
+
+ void Recurse(GameObject root, ref float max)
+ {
+ float roof = root.GetRoof();
+ if (max < roof)
+ {
+ max = roof;
+ }
+
+ foreach (Transform child in root.transform)
+ {
+ if (child.gameObject.activeInHierarchy && filterTransform(child))
+ {
+ Recurse(child.gameObject, ref max);
+ }
+ }
+ }
+ }
+
+ ///
+ /// Returns the maximal world-space center position of the hull of
+ /// this . The hull includes
+ /// and any of its active descendants.
+ /// Unlike , this method recurses into
+ /// the game-object hierarchy rooted by .
+ ///
+ /// Note: only descendants that are currently active in the scene are considered.
+ ///
+ /// Game object whose center top has to be determined.
+ /// Function returning true for descendant transforms that shall be taken into
+ /// account. By default, this is a constant function which always returns true.
+ /// World-space position of the center top of the hull of this .
+ ///
+ /// The result is in world space of . If your are interested
+ /// in local space, use instead.
+ public static Vector3 GetTop(this GameObject gameNode, Func filterTransform = null)
+ {
+ Vector3 result = gameNode.transform.position;
+ result.y = gameNode.GetMaxY(filterTransform);
+ return result;
+ }
+
+ ///
+ /// Returns the maximal local-space center position of the hull of
+ /// this . The hull includes
+ /// and any of its active descendants.
+ /// Note: only descendants that are currently active in the scene are considered.
+ ///
+ /// Game object whose center top has to be determined.
+ /// Function returning true for descendant transforms that shall be taken into
+ /// account. By default, this is a constant function which always returns true.
+ /// Local-space position of the center top of the hull of this .
+ ///
+ /// The result is in local space of . If your are interested
+ /// in world space, use instead.
+ public static float GetRelativeTop(this GameObject gameNode, Func filterTransform = null)
+ {
+ float top = gameNode.GetMaxY(filterTransform);
+ return top - gameNode.transform.position.y;
+ }
+
+ ///
+ /// Returns the world-space center position of the ground of this .
+ ///
+ /// Game object whose ground has to be determined.
+ /// World-space center position of the ground of this .
+ public static Vector3 GetGroundCenter(this GameObject gameNode)
+ {
+ Vector3 result = gameNode.transform.position;
+ result.y -= gameNode.WorldSpaceSize().y / 2.0f;
+ return result;
+ }
+
+ ///
+ /// Sets the scale of this to independent from
+ /// the local scale of its parent.
+ ///
+ /// Object whose scale should be set.
+ /// The new scale in world space.
+ /// If true and is a graph node,
+ /// a will be used to animate the scaling; otherwise the
+ /// scale of is set immediately without any animation.
+ /// Is intended primarily for game nodes but also applicable to other kinds of
+ /// s.
+ public static void SetAbsoluteScale(this GameObject gameObject, Vector3 worldScale, bool animate = true)
+ {
+ Transform parent = gameObject.transform.parent;
+ gameObject.transform.parent = null;
+ if (animate && gameObject.HasNodeRef())
+ {
+ NodeOperator @operator = gameObject.NodeOperator();
+ @operator.ScaleTo(worldScale, 0f);
+ }
+ else
+ {
+ gameObject.transform.localScale = worldScale;
+ }
+ gameObject.transform.parent = parent;
+ }
+
+ ///
+ /// Returns true if has a
+ /// component attached to it that is actually referring to a valid node
+ /// (i.e., its Value is not null).
+ ///
+ /// The game object whose NodeRef is checked.
+ /// True if has a
+ /// component attached to it whose node is non-null.
+ public static bool HasNodeRef(this GameObject gameNode)
+ {
+ return gameNode.TryGetComponent(out NodeRef nodeRef) && nodeRef.Value != null;
+ }
+
+ ///
+ /// Returns true if is tagged by .
+ ///
+ /// The game object to check.
+ /// True if is tagged by .
+ public static bool IsNode(this GameObject gameNode)
+ {
+ return gameNode.CompareTag(Tags.Node);
+ }
+
+ ///
+ /// Returns true if 's
+ /// is true and it is tagged by .
+ ///
+ /// The game object to check.
+ /// True if is an active node.
+ public static bool IsNodeAndActiveSelf(this GameObject gameNode)
+ {
+ return gameNode.activeSelf && gameNode.CompareTag(Tags.Node);
+ }
+
+ ///
+ /// Returns true if 's
+ /// is true and it is tagged by .
+ ///
+ /// The game object to check.
+ /// True if is an active node.
+ public static bool IsNodeAndActiveInHierarchy(this GameObject gameNode)
+ {
+ return gameNode.CompareTag(Tags.Node) && gameNode.activeInHierarchy;
+ }
+
+ ///
+ /// Retrieves the node reference component, if possible.
+ ///
+ /// The game object whose NodeRef is checked.
+ /// The attached NodeRef; defined only if this method
+ /// returns true.
+ /// True if has a
+ /// component attached to it.
+ public static bool TryGetNodeRef(this GameObject gameNode, out NodeRef nodeRef)
+ {
+ return gameNode.TryGetComponent(out nodeRef);
+ }
+
+ ///
+ /// Returns true if has a
+ /// component attached to it that is not null.
+ ///
+ /// The game object whose NodeRef is checked.
+ /// The node referenced by the attached NodeRef; defined only if this method
+ /// returns true.
+ /// True if has a
+ /// component attached to it that is not null.
+ public static bool TryGetNode(this GameObject gameNode, out Node node)
+ {
+ node = null;
+ if (gameNode.TryGetComponent(out NodeRef nodeRef))
+ {
+ node = nodeRef.Value;
+ }
+ return node != null;
+ }
+
+ ///
+ /// Returns the graph node represented by this .
+ ///
+ /// Precondition: must have a
+ /// attached to it referring to a valid node; if not, an exception is raised.
+ ///
+ /// The game object whose is requested.
+ /// The correponding graph node (will never be null).
+ /// Thrown if has
+ /// no valid or .
+ /// This method is similar to ,
+ /// but throws an exception if the node is not found. It is analogous to
+ /// .
+ public static Node GetNode(this GameObject gameNode)
+ {
+ if (gameNode.TryGetComponent(out NodeRef nodeRef))
+ {
+ if (nodeRef != null)
+ {
+ if (nodeRef.Value != null)
+ {
+ return nodeRef.Value;
+ }
+ else
+ {
+ throw new NullReferenceException($"Node referenced by game object {gameNode.name} is null.");
+ }
+ }
+ else
+ {
+ throw new NullReferenceException($"Node reference of game object {gameNode.name} is null.");
+ }
+ }
+ else
+ {
+ throw new NullReferenceException($"Game object {gameNode.name} has no NodeRef.");
+ }
+ }
+
+ ///
+ /// Returns the graph containing the node represented by this .
+ ///
+ /// Precondition: must have a
+ /// attached to it referring to a valid node; if not, an exception is raised.
+ ///
+ /// The game object whose graph is requested.
+ /// The correponding graph.
+ public static Graph ItsGraph(this GameObject gameNode)
+ {
+ return gameNode.GetNode().ItsGraph;
+ }
+
+ ///
+ /// Returns all active descendants of given tagged by
+ /// including itself.
+ ///
+ /// The root of the node hierarchy to be collected.
+ /// All descendants of including .
+ public static IList AllDescendants(this GameObject gameNode)
+ {
+ IList result = new List() { gameNode };
+ AllDescendants(gameNode, result);
+ return result;
+ }
+
+ ///
+ /// Adds all active descendants of to
+ /// (only if tagged by ).
+ ///
+ /// Note: is assumed to be contained in
+ /// already.
+ ///
+ /// The root of the game-object hierarchy to be collected.
+ /// Where to add the descendants.
+ private static void AllDescendants(GameObject gameNode, IList result)
+ {
+ foreach (Transform child in gameNode.transform)
+ {
+ if (child.gameObject.activeInHierarchy && child.gameObject.CompareTag(Tags.Node))
+ {
+ result.Add(child.gameObject);
+ AllDescendants(child.gameObject, result);
+ }
+ }
+ }
+
+ ///
+ /// Returns the for this .
+ /// If no operator exists yet, it will be added.
+ /// If the game object is not a node, an exception will be thrown.
+ ///
+ /// The game object whose operator to retrieve.
+ /// The responsible for this .
+ public static NodeOperator NodeOperator(this GameObject gameNode)
+ {
+ if (gameNode.CompareTag(Tags.Node))
+ {
+ return gameNode.AddOrGetComponent();
+ }
+ else
+ {
+ throw new InvalidOperationException($"Cannot get {nameof(NodeOperator)} for game object {gameNode.name} because it is not a node.");
+ }
+ }
+ }
+}
diff --git a/Assets/SEE/Extensions/GameNodeExtensions.cs.meta b/Assets/SEE/Extensions/GameNodeExtensions.cs.meta
new file mode 100644
index 0000000000..c43ab789ba
--- /dev/null
+++ b/Assets/SEE/Extensions/GameNodeExtensions.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: f38c01471d4058e4ca3d1e40c25dfd43
\ No newline at end of file
diff --git a/Assets/SEE/Extensions/GameObjectColorExtensions.cs b/Assets/SEE/Extensions/GameObjectColorExtensions.cs
new file mode 100644
index 0000000000..c40f47b5b0
--- /dev/null
+++ b/Assets/SEE/Extensions/GameObjectColorExtensions.cs
@@ -0,0 +1,74 @@
+using UnityEngine;
+
+namespace SEE.Extensions
+{
+ ///
+ /// Provides extension methods for
+ /// regarding color.
+ ///
+ internal static class GameObjectColorExtensions
+ {
+ ///
+ /// Sets the color for this to given .
+ ///
+ /// Precondition: has a renderer whose material has a color attribute.
+ ///
+ ///
+ /// Object whose color is to be set.
+ /// The new color to be set.
+ public static void SetColor(this GameObject gameObject, Color color)
+ {
+ if (gameObject.TryGetComponent(out Renderer renderer))
+ {
+ renderer.sharedMaterial.color = color;
+ }
+ }
+
+ ///
+ /// Retrieves the color from this .
+ ///
+ /// Precondition: has a renderer whose material has a color attribute.
+ ///
+ /// Object whose color is to be returned.
+ /// Color of this .
+ ///
+ /// If this has no renderer attached to it.
+ ///
+ public static Color GetColor(this GameObject gameObject)
+ {
+ return gameObject.MustGetComponent().sharedMaterial.color;
+ }
+
+ ///
+ /// Sets the alpha value (transparency) of the given
+ /// to .
+ ///
+ /// Game objects whose transparency is to be set.
+ /// A value in between 0 and 1 for transparency.
+ public static void SetTransparency(this GameObject gameObject, float alpha)
+ {
+ if (gameObject.TryGetComponent(out Renderer renderer))
+ {
+ Color oldColor = renderer.material.color;
+ renderer.material.color = oldColor.WithAlpha(alpha);
+ }
+ }
+
+ ///
+ /// Sets the start and end line color of .
+ ///
+ /// Precondition: must have a line renderer.
+ ///
+ /// Object holding a line renderer whose start and end color is to be set.
+ /// Start color of the line.
+ /// End color of the line.
+ public static void SetLineColor(this GameObject gameObject, Color startColor, Color endColor)
+ {
+ if (gameObject.TryGetComponent(out LineRenderer renderer))
+ {
+ renderer.startColor = startColor;
+ renderer.endColor = endColor;
+ }
+ }
+ }
+}
diff --git a/Assets/SEE/Extensions/GameObjectColorExtensions.cs.meta b/Assets/SEE/Extensions/GameObjectColorExtensions.cs.meta
new file mode 100644
index 0000000000..9ddc1f5ef6
--- /dev/null
+++ b/Assets/SEE/Extensions/GameObjectColorExtensions.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: de3e66da21c85c648bf91bd889b4b6d5
\ No newline at end of file
diff --git a/Assets/SEE/Extensions/GameObjectExtensions.cs b/Assets/SEE/Extensions/GameObjectExtensions.cs
new file mode 100644
index 0000000000..698abfee7e
--- /dev/null
+++ b/Assets/SEE/Extensions/GameObjectExtensions.cs
@@ -0,0 +1,83 @@
+using SEE.Game;
+using UnityEngine;
+using static SEE.Game.Portal.IncludeDescendants;
+
+namespace SEE.Extensions
+{
+ ///
+ /// Provides extensions for s.
+ ///
+ public static class GameObjectExtensions
+ {
+ ///
+ /// Enables/disables the renderers of and all its
+ /// descendants so that they become visible/invisible.
+ ///
+ /// Objects whose renderer (and those of its children) is to be enabled/disabled.
+ /// Iff true, the renderers will be enabled.
+ /// Applicable only to a and its descendants
+ /// with a
+ private static void SetVisible(this GameObject gameObject, bool isVisible)
+ {
+ gameObject.GetComponent().enabled = isVisible;
+ foreach (Transform child in gameObject.transform)
+ {
+ SetVisible(child.gameObject, isVisible);
+ }
+ }
+
+ ///
+ /// Returns the full name of the game object, that is, its name and the
+ /// names of its ancestors in the game-object hierarchy separated by /.
+ /// If is null, "" will be returned.
+ ///
+ /// Game object for which to retrieve the full name.
+ /// Can be null.
+ public static string FullName(this GameObject gameObject)
+ {
+ if (gameObject == null)
+ {
+ return "";
+ }
+ string result = gameObject.name;
+ while (gameObject.transform.parent != null)
+ {
+ gameObject = gameObject.transform.parent.gameObject;
+ result = gameObject.name + "/" + result;
+ }
+ return result;
+ }
+
+ ///
+ /// Updates the portal of this game object by setting the portal boundaries of itself
+ /// (and its descendants, depending on )
+ /// to the code city they're contained in.
+ /// If they're not contained in a code city and is true,
+ /// a warning log message will be emitted, otherwise nothing will happen.
+ ///
+ /// The game object whose portal shall be updated.
+ ///
+ /// Whether a warning log message shall be emitted if the
+ /// is not attached to any code city.
+ ///
+ ///
+ /// Whether the portal of the descendants of this shall be updated too.
+ ///
+ /// The can be a game node or game edge
+ /// or anything else that has a portal.
+ public static void UpdatePortal(this GameObject gameObject, bool warnOnFailure = false,
+ Portal.IncludeDescendants includeDescendants = OnlySelf)
+ {
+ GameObject rootCity = gameObject.GetCodeCity();
+ if (rootCity != null)
+ {
+ Portal.SetPortal(rootCity, gameObject, includeDescendants);
+ }
+ else if (warnOnFailure)
+ {
+ Debug.LogWarning("Couldn't update portal: No code city has been found"
+ + $" attached to game object {gameObject.FullName()}.\n");
+ }
+ }
+ }
+}
diff --git a/Assets/SEE/GameObjects/GameObjectExtensions.cs.meta b/Assets/SEE/Extensions/GameObjectExtensions.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/GameObjectExtensions.cs.meta
rename to Assets/SEE/Extensions/GameObjectExtensions.cs.meta
diff --git a/Assets/SEE/Extensions/GameObjectHierarchyExtensions.cs b/Assets/SEE/Extensions/GameObjectHierarchyExtensions.cs
new file mode 100644
index 0000000000..8224be4503
--- /dev/null
+++ b/Assets/SEE/Extensions/GameObjectHierarchyExtensions.cs
@@ -0,0 +1,194 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+namespace SEE.Extensions
+{
+ ///
+ /// Extensions methods dealing with the hierarchy of general s.
+ ///
+ internal static class GameObjectHierarchyExtensions
+ {
+ ///
+ /// Searches for the first descendant with the specified
+ /// within the hierarchy of the given .
+ ///
+ /// The game object whose descendants will be searched.
+ /// The name of the descendant to search for.
+ /// If set to true, the search wil include inactive s.
+ /// Otherwise, only active ones will be considered.
+ /// The first matching descendant with the specified ,
+ /// or null if none is found.
+ public static GameObject FindDescendant(this GameObject gameObject, string descendantName, bool includeInactive = true)
+ {
+ return gameObject
+ .GetComponentsInChildren(includeInactive)
+ .FirstOrDefault(t => t.gameObject.name == descendantName)?
+ .gameObject;
+ }
+
+ ///
+ /// Searches for the first descendant with the specified
+ /// within the hierarchy of the given .
+ ///
+ /// The game object whose descendants will be searched.
+ /// The tag to search for.
+ /// If set to true, the search will include inactive s.
+ /// Otherwise, only active ones will be considered.
+ /// The first matching descendant with the specified tag, or null if none is found.
+ public static GameObject FindDescendantWithTag(this GameObject gameObject, string tag, bool includeInactive = true)
+ {
+ return gameObject
+ .GetComponentsInChildren(includeInactive)
+ .FirstOrDefault(t => t.gameObject.CompareTag(tag))?
+ .gameObject;
+ }
+
+ ///
+ /// QDetermines whether the has any descendant
+ /// with the specified .
+ ///
+ /// The root to search from.
+ /// The tag to search for.
+ /// True if a descendant with the specified tag is found; otherwise, false.
+ public static bool HasDescendantWithTag(this GameObject gameObject, string tag)
+ {
+ return gameObject.FindDescendantWithTag(tag) != null;
+ }
+
+ ///
+ /// Finds all descendant s of the given
+ /// that have the specified tag.
+ ///
+ /// The root to start the search from.
+ /// The tag that matching descendants must have.
+ /// Whether to include inactive s in the search.
+ /// A list of all descendant s with the specified tag.
+ public static IList FindAllDescendantsWithTag(this GameObject gameObject, string tag, bool includeInactive = true)
+ {
+ return gameObject
+ .GetComponentsInChildren(includeInactive)
+ .Where(t => t.CompareTag(tag))
+ .Select(t => t.gameObject)
+ .ToList();
+ }
+ ///
+ /// Finds all descendant s with the specified ,
+ /// exluding those whose immediate parent has the specified .
+ ///
+ /// The root to search from.
+ /// The tag that matching descendants must have.
+ /// If the immediate parent has this tag, the child will be excluded from the result.
+ /// Whether inactive s should be included in the search.
+ /// A list of matching descendant s, excluding those whose parent has the specified tag.
+ public static List FindAllDescendantsWithTagExcludingSpecificParentTag(this GameObject gameObject,
+ string descendantTag, string immediateParentTag, bool includeInactive = true)
+ {
+ return gameObject
+ .GetComponentsInChildren(includeInactive)
+ .Where(t => t.CompareTag(descendantTag) &&
+ t.parent != null &&
+ !t.parent.CompareTag(immediateParentTag))
+ .Select(t => t.gameObject)
+ .ToList();
+ }
+
+ ///
+ /// Determines whether the specified has any ancestor
+ /// with the given .
+ ///
+ /// The starting whose parent hierarhcy will be searched.
+ /// The tag to search for.
+ /// True if a parent or ancestor with the specified tag is found; otherwise, false.
+ public static bool HasParentWithTag(this GameObject gameObject, string tag)
+ {
+ Transform transform = gameObject.transform;
+ while (transform.parent != null)
+ {
+ if (transform.parent.gameObject.CompareTag(tag))
+ {
+ return true;
+ }
+ transform = transform.parent;
+ }
+ return false;
+ }
+
+ ///
+ /// Searches upward through the transform hierarchy to find the first parent GameObject
+ /// with the specified name.
+ ///
+ /// The starting GameObject from which the search begins.
+ /// The exact name of the parent GameObject to look for.
+ ///
+ /// The first matching parent GameObject, or null if no parent with the given name is found.
+ ///
+ public static GameObject FindParentWithName(this GameObject gameObject, string name)
+ {
+ if (gameObject.transform.parent == null)
+ {
+ return null;
+ }
+ else
+ {
+ return gameObject.transform.parent.name == name ?
+ gameObject.transform.parent.gameObject
+ : FindParentWithName(gameObject.transform.parent.gameObject, name);
+ }
+ }
+
+ ///
+ /// Finds all descendant s whose names start with the given prefix.
+ ///
+ /// Root object to search in.
+ /// Name prefix to match.
+ /// Whether inactive objects are included.
+ /// List of matching descendants (empty if none found).
+ public static List FindAllDescendantWithStartingName
+ (this GameObject gameObject, string startName, bool includeInactive = true)
+ {
+ return gameObject
+ .GetComponentsInChildren(includeInactive)
+ .Select(t => t.gameObject)
+ .Where(go => go.name.StartsWith(startName, StringComparison.Ordinal))
+ .ToList();
+ }
+
+ ///
+ /// Checks recursively whether the specified GameObject has any parent
+ /// with the given layer.
+ ///
+ /// The starting GameObject from which the search begins.
+ /// The layer number to check against.
+ ///
+ /// True if any parent GameObject has the specified layer;
+ /// otherwise, false.
+ ///
+ public static bool HasParentWithLayer(this GameObject gameObject, uint layer)
+ {
+ if (gameObject.transform.parent == null)
+ {
+ return false;
+ }
+ else
+ {
+ return gameObject.transform.parent.gameObject.layer == layer
+ || HasParentWithLayer(gameObject.transform.parent.gameObject, layer);
+ }
+ }
+
+ ///
+ /// Traverses up the hierachy from the given
+ /// and returns the highest parent.
+ ///
+ /// The starting in the hierarchy.
+ /// The root at the top of the hierarchy.
+ /// If the given object has no parent, it is returned itself.
+ public static GameObject GetRootParent(this GameObject gameObject)
+ {
+ Transform parent = gameObject.transform.parent;
+ return parent != null ? GetRootParent(parent.gameObject) : gameObject;
+ }
+ }
+}
diff --git a/Assets/SEE/Extensions/GameObjectHierarchyExtensions.cs.meta b/Assets/SEE/Extensions/GameObjectHierarchyExtensions.cs.meta
new file mode 100644
index 0000000000..fc9f57b679
--- /dev/null
+++ b/Assets/SEE/Extensions/GameObjectHierarchyExtensions.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 8a714d65183958140b06fb60fe4e6b33
\ No newline at end of file
diff --git a/Assets/SEE/Extensions/GameObjectScaleExtensions.cs b/Assets/SEE/Extensions/GameObjectScaleExtensions.cs
new file mode 100644
index 0000000000..4511bcf970
--- /dev/null
+++ b/Assets/SEE/Extensions/GameObjectScaleExtensions.cs
@@ -0,0 +1,297 @@
+using SEE.Utils;
+using System;
+using UnityEngine;
+
+namespace SEE.Extensions
+{
+ ///
+ /// Provides extensions for s regarding size (scale).
+ ///
+ public static class GameObjectScaleExtensions
+ {
+ ///
+ /// Provides the size and the mesh offset of the given in world space.
+ /// This does not include the size of descendants if there are any.
+ ///
+ /// This value reflects the actual world-space bounds of the axis-aligned cuboid that contains the rendered
+ /// object.
+ /// Please note that the is only the scale factor and not the actual size of
+ /// a rendered object.
+ /// Similarly, is not necessarily the center point of the rendered object.
+ ///
+ ///
+ /// -
+ /// If a is attached, the will be used.
+ ///
-
+ /// If a is attached, the bounds will be calculated based on its positions with a
+ /// performance penalty (see ).
+ ///
-
+ /// If a is attached, the will be used.
+ ///
-
+ /// Else, and are provided and a warning
+ /// is logged.
+ /// It means that either the object is not rendered at all or this method needs to be extended.
+ ///
+ ///
+ ///
+ /// Local-space counterpart:
+ ///
+ ///
+ /// Object whose scale is requested.
+ /// Out parameter for the world-space position of the object.
+ /// Out parameter for the world-space size of the object.
+ /// True if the size was successfully retrieved, false if the fallback was used.
+ /// Applicable to different kinds of game objects (with ,
+ /// , general , or none of these).
+ public static bool WorldSpaceSize(this GameObject gameObject, out Vector3 size, out Vector3 position)
+ {
+ // Rely on collider bounds if available.
+ if (gameObject.TryGetComponent(out Collider collider))
+ {
+ size = collider.bounds.size;
+ position = collider.bounds.center;
+ return true;
+ }
+
+ // For objects with a LineRenderer, we can use its positions to determine its bounds.
+ // Otherwise Unity will return overly large bounds.
+ if (gameObject.TryGetComponent(out LineRenderer lineRenderer))
+ {
+ Bounds lineBounds = GeometryUtils.CalculateLineBounds(lineRenderer, true);
+ size = lineBounds.size;
+ position = lineBounds.center;
+ return true;
+ }
+
+ // For some objects, such as capsules or custom meshes, lossyScale gives wrong results.
+ // The more reliable option to determine the size is using the
+ // object's renderer if it has one.
+ if (gameObject.TryGetComponent(out Renderer renderer))
+ {
+ size = renderer.bounds.size;
+ position = renderer.bounds.center;
+ return true;
+ }
+
+ // No renderer, so we use lossyScale as a fallback.
+ // Note: This may happen for container objects that have no mesh.
+ size = gameObject.transform.lossyScale;
+ position = gameObject.transform.position;
+ return false;
+ }
+
+ ///
+ /// Returns the size of the given in world space.
+ /// This does not include the size of descendants if there are any.
+ ///
+ /// This is a shorthand method for that only returns the size.
+ /// See there for additional documentation.
+ ///
+ /// Use directly if you need both position and size.
+ ///
+ /// Local-space counterpart:
+ ///
+ ///
+ /// Object whose size is requested.
+ /// Size of given .
+ public static Vector3 WorldSpaceSize(this GameObject gameObject)
+ {
+ WorldSpaceSize(gameObject, out Vector3 size, out Vector3 _);
+ return size;
+ }
+
+ ///
+ /// Provides the size and the mesh offset of the given in local space,
+ /// i.e., in relation to its parent.
+ /// This does not include the size of descendants if there are any.
+ ///
+ /// This value should often be used instead of the because the scale only
+ /// reflects the size for objects with a standardized size like cube primitives. Similarly, the
+ /// can be significantly off the object's center.
+ ///
+ ///
+ /// -
+ /// If a is attached, the will be used and converted into
+ /// local space.
+ ///
-
+ /// If a is attached, the bounds will be calculated based on its positions with a
+ /// performance penalty (see ).
+ ///
-
+ /// If a is attached, the will be used.
+ ///
-
+ /// Else, and are provided and a
+ /// warning is logged.
+ /// It means that either the object is not rendered at all or this method needs to be extended.
+ ///
+ ///
+ ///
+ /// World-space counterpart:
+ ///
+ ///
+ /// Object whose scale is requested.
+ /// Out parameter for the local size of the object.
+ /// Out parameter for the local position of the object.
+ /// True if the has a size, false if the fallback was used.
+ /// Applicable to game objects having a or
+ /// and others (in the latter case, the localScale is used as a fallback.
+ public static bool LocalSize(this GameObject gameObject, out Vector3 size, out Vector3 position)
+ {
+ // Rely on collider bounds if available.
+ if (gameObject.TryGetComponent(out Collider collider))
+ {
+ size = getLocalColliderSize(collider);
+ position = collider.transform.InverseTransformPoint(collider.bounds.center) + gameObject.transform.localPosition;
+ return true;
+ }
+
+ // For objects with a LineRenderer, we can use its positions to determine its bounds.
+ // Otherwise Unity will return overly large bounds.
+ if (gameObject.TryGetComponent(out LineRenderer lineRenderer))
+ {
+ Bounds lineBounds = GeometryUtils.CalculateLineBounds(lineRenderer, false);
+ size = lineBounds.size;
+ position = lineBounds.center;
+ return true;
+ }
+
+ // For some objects, such as capsules or custom meshes, localScale gives wrong results.
+ // The more reliable option to determine the size is using the object's mesh if it has one.
+ Mesh sharedMesh;
+ if (gameObject.TryGetComponent(out MeshFilter meshFilter) && (sharedMesh = meshFilter.sharedMesh) != null)
+ {
+ size = Vector3.Scale(sharedMesh.bounds.size, gameObject.transform.localScale);
+ position = sharedMesh.bounds.center + gameObject.transform.localPosition;
+ return true;
+ }
+
+ // No mesh, so we use localScale as a fallback.
+ // Note: This should not happen. If the object has no mesh, it has no size at all.
+ Debug.LogWarning($"GameObject {gameObject.FullName()} has neither a {nameof(Mesh)} nor {nameof(LineRenderer)}, "
+ + "using localScale as fallback.\n");
+ size = gameObject.transform.localScale;
+ position = gameObject.transform.localPosition;
+ return false;
+
+ Vector3 getLocalColliderSize(Collider collider)
+ {
+ Vector3 localScale = collider.transform.localScale;
+
+ if (collider is BoxCollider box)
+ {
+ return Vector3.Scale(box.size, localScale);
+ }
+ else if (collider is SphereCollider sphere)
+ {
+ float diameter = sphere.radius * 2f;
+ // Sphere scales uniformly in all axes
+ return new Vector3(diameter, diameter, diameter) * Mathf.Max(localScale.x, Mathf.Max(localScale.y, localScale.z));
+ }
+ else if (collider is CapsuleCollider capsule)
+ {
+ float diameter = capsule.radius * 2f;
+ Vector3 size = Vector3.zero;
+ switch (capsule.direction)
+ {
+ case 0: // X axis
+ size = new Vector3(capsule.height, diameter, diameter);
+ break;
+ case 1: // Y axis
+ size = new Vector3(diameter, capsule.height, diameter);
+ break;
+ case 2: // Z axis
+ size = new Vector3(diameter, diameter, capsule.height);
+ break;
+ default:
+ // This should never happen
+ throw new NotImplementedException();
+ }
+ size.x *= localScale.x;
+ size.y *= localScale.y;
+ size.z *= localScale.z;
+ return size;
+ }
+ else if (collider is MeshCollider meshCollider)
+ {
+ Mesh mesh = meshCollider.sharedMesh;
+ if (mesh != null)
+ {
+ return Vector3.Scale(mesh.bounds.size, localScale);
+ }
+ else
+ {
+ return Vector3.zero;
+ }
+ }
+ else
+ {
+ // Fallback: bounds.size is in world space, convert to local by dividing by scale
+ Debug.LogWarning($"GameObject has unknown collider type, using localScale as fallback: {gameObject.name}");
+ Bounds worldBounds = collider.bounds;
+ Vector3 worldSize = worldBounds.size;
+ return new Vector3(
+ localScale.x != 0 ? worldSize.x / localScale.x : 0,
+ localScale.y != 0 ? worldSize.y / localScale.y : 0,
+ localScale.z != 0 ? worldSize.z / localScale.z : 0);
+ }
+ }
+ }
+
+ ///
+ /// Returns the size of the given in local space,
+ /// i.e., in relation to its parent.
+ ///
+ /// This is a shorthand method for that only returns the size.
+ /// See there for additional documentation.
+ ///
+ /// Use directly if you need both position and size.
+ ///
+ /// World-space counterpart:
+ ///
+ ///
+ /// Object whose size is requested.
+ /// Size of given .
+ /// Applicable to game objects having a or
+ /// and others (in the latter case, the localScale is used as a fallback.
+ public static Vector3 LocalSize(this GameObject gameObject)
+ {
+ LocalSize(gameObject, out Vector3 size, out Vector3 _);
+ return size;
+ }
+
+ ///
+ /// Returns the bounds of the given in its own
+ /// local coordinate system.
+ ///
+ /// Note: A primitive cube has a size of (1,1,1), and a coordinate center (pivot)
+ /// of (0,0,0).
+ /// However, that does not apply for all primitives or models in general.
+ ///
+ ///
+ /// The game object.
+ /// Local-space bounds of .
+ /// Applicable to game objects having a ,
+ /// a and others (in the latter case, the (Vector2.zero, Vector3.one)
+ /// is used as a fallback.
+ public static Bounds LocalBounds(this GameObject gameObject)
+ {
+ // For objects with a LineRenderer, we can use its positions to determine its bounds.
+ // Otherwise Unity will return overly large bounds.
+ if (gameObject.TryGetComponent(out LineRenderer lineRenderer))
+ {
+ return GeometryUtils.CalculateLineBounds(lineRenderer, false);
+ }
+ if (gameObject.TryGetComponent(out MeshFilter meshFilter))
+ {
+ return meshFilter.sharedMesh.bounds;
+ }
+ if (gameObject.TryGetComponent(out Renderer renderer))
+ {
+ return new(
+ gameObject.transform.InverseTransformPoint(renderer.bounds.center),
+ gameObject.transform.InverseTransformVector(renderer.bounds.size));
+ }
+ // This fallback works for uniform primitives like cubes, but not for non-uniforms like cylinders.
+ return new(Vector3.zero, Vector3.one);
+ }
+ }
+}
diff --git a/Assets/SEE/Extensions/GameObjectScaleExtensions.cs.meta b/Assets/SEE/Extensions/GameObjectScaleExtensions.cs.meta
new file mode 100644
index 0000000000..b9f52be86d
--- /dev/null
+++ b/Assets/SEE/Extensions/GameObjectScaleExtensions.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: bed86c68a0065c24c846f929d4d007a2
\ No newline at end of file
diff --git a/Assets/SEE/Extensions/GraphElementObjectExtensions.cs b/Assets/SEE/Extensions/GraphElementObjectExtensions.cs
new file mode 100644
index 0000000000..ebe69fa1ec
--- /dev/null
+++ b/Assets/SEE/Extensions/GraphElementObjectExtensions.cs
@@ -0,0 +1,218 @@
+using SEE.Components.GameEdges;
+using SEE.Game;
+using SEE.Game.City;
+using SEE.Game.Operator;
+using SEE.GraphElementRefs;
+using System;
+using UnityEngine;
+
+namespace SEE.Extensions
+{
+ ///
+ /// Extension methods for game nodes and game edges alike. A game node is a
+ /// representing a . A game edge is a
+ /// representing a
+ ///
+ internal static class GraphElementObjectExtensions
+ {
+ ///
+ /// An extension of GameObjects to retrieve their IDs. If
+ /// has a attached to it, the corresponding node's ID is returned.
+ /// If has an attached to it, the corresponding
+ /// edge's ID is returned. Otherwise the name of is
+ /// returned.
+ ///
+ /// ID for .
+ /// Applicable to game nodes and game edges.
+ public static string ID(this GameObject gameObject)
+ {
+ NodeRef nodeRef = gameObject.GetComponent();
+ if (nodeRef == null)
+ {
+ EdgeRef edgeRef = gameObject.GetComponent();
+ if (edgeRef == null)
+ {
+ return gameObject.name;
+ }
+ else
+ {
+ return edgeRef.Value.ID;
+ }
+ }
+ return nodeRef.Value.ID;
+ }
+
+ ///
+ /// Returns the city this is contained in.
+ /// If is null or if it is not contained in a city of type, null is returned.
+ ///
+ /// Object whose containing city is requested.
+ /// The containing city of or null.
+ /// Applicable to game nodes and game edges.
+ public static AbstractSEECity ContainingCity(this GameObject gameObject) => ContainingCity(gameObject);
+
+ ///
+ /// Returns the city of type this is contained.
+ /// If is null or if it is not contained in a city of type, null is returned.
+ ///
+ /// Object whose containing city of type
+ /// is requested.
+ /// The containing city of type of
+ /// or null.
+ /// Type of the code city that shall be returned
+ /// Applicable to game nodes and game edges.
+ public static T ContainingCity(this GameObject gameObject) where T : AbstractSEECity
+ {
+ if (gameObject == null)
+ {
+ return null;
+ }
+ else
+ {
+ GameObject codeCityObject = gameObject.GetCodeCity();
+ if (codeCityObject != null && codeCityObject.TryGetComponent(out T city))
+ {
+ return city;
+ }
+ else
+ {
+ /// We do not log the fact that does not have the
+ /// expected type of city, as some clients are using this method just as a predicate.
+ return null;
+ }
+ }
+ }
+
+ ///
+ /// Returns the closest ancestor of that
+ /// represents a code city, that is, is tagged by .
+ /// This ancestor is assumed to carry the settings (layout information etc.).
+ /// If none can be found, null will be returned.
+ /// If is tagged by ,
+ /// it will be returned.
+ ///
+ /// Game object at which to start the search.
+ /// Closest ancestor game object in the game-object hierarchy tagged by
+ /// or null.
+ ///
+ /// Thrown if is null.
+ ///
+ /// Applicable to game nodes and game edges.
+ public static GameObject GetCodeCity(this GameObject gameObject)
+ {
+ if (gameObject == null)
+ {
+ throw new ArgumentNullException(nameof(gameObject));
+ }
+ Transform result = gameObject.transform;
+ while (result != null)
+ {
+ if (result.CompareTag(Tags.CodeCity))
+ {
+ return result.gameObject;
+ }
+ result = result.parent;
+ }
+ return null;
+ }
+
+ ///
+ /// Sets the visibility and the collider of this to .
+ /// If is false, the object becomes invisible. If it is true
+ /// instead, it becomes visible.
+ ///
+ /// If is false, only the renderer of
+ /// is turned on/off, which will not affect whether the
+ /// is active or inactive. If has children, their
+ /// renderers will not be changed.
+ ///
+ /// If is true, the operation applies to all descendants, too.
+ ///
+ /// Precondition: must have a Renderer.
+ ///
+ /// Object whose visibility is to be changed.
+ /// Whether or not to make the object visible.
+ /// If true, the operation applies to all descendants, too.
+ /// Applicable to both game nodes and game edges.
+ public static void SetVisibility(this GameObject gameObject, bool show, bool includingChildren = true)
+ {
+ if (gameObject.TryGetComponent(out Renderer renderer))
+ {
+ renderer.enabled = show;
+ }
+
+ if (gameObject.TryGetComponent(out Collider collider))
+ {
+ collider.enabled = show;
+ }
+
+ if (includingChildren)
+ {
+ foreach (Transform child in gameObject.transform)
+ {
+ child.gameObject.SetVisibility(show, includingChildren);
+ }
+ }
+ }
+
+ ///
+ /// Returns the world-space center position of the roof of this .
+ ///
+ /// Game object whose roof has to be determined.
+ /// World-space center position of the roof of this .
+ /// This does not consider the position of descendants if there are any.
+ /// Consider if you want to
+ /// take descendants into account, too. This method is applicable to game nodes
+ /// and game edges having a .
+ public static Vector3 GetRoofCenter(this GameObject gameObject)
+ {
+ Vector3 result;
+ if (gameObject.TryGetComponent(out SEESpline spline))
+ {
+ // Splines aren't actually positioned at their game object's position,
+ // but their position can be determined by their middle control point.
+ result = spline.GetMiddleControlPoint();
+ result.y += spline.Radius;
+ }
+ else
+ {
+ result = gameObject.transform.position;
+ result.y += gameObject.WorldSpaceSize().y / 2.0f;
+ }
+ return result;
+ }
+
+ ///
+ /// Returns the for this .
+ /// If no operator exists yet, a fitting operator will be added.
+ /// If the game object is neither a node nor an edge, an exception will be thrown.
+ ///
+ /// The game object whose operator to retrieve.
+ /// The responsible for this .
+ /// Applicable to both game nodes and game edges.
+ public static GraphElementOperator Operator(this GameObject gameObject)
+ {
+ if (gameObject.TryGetComponent(out GraphElementOperator elementOperator))
+ {
+ return elementOperator;
+ }
+ else
+ {
+ // We may need to add the appropriate operator first.
+ if (gameObject.IsNode())
+ {
+ return gameObject.AddComponent();
+ }
+ else if (gameObject.IsEdge())
+ {
+ return gameObject.AddComponent();
+ }
+ else
+ {
+ throw new InvalidOperationException($"Cannot get {nameof(GraphElementOperator)} for game object "
+ + $"{gameObject.name} because it is neither a node nor an edge.");
+ }
+ }
+ }
+ }
+}
diff --git a/Assets/SEE/Extensions/GraphElementObjectExtensions.cs.meta b/Assets/SEE/Extensions/GraphElementObjectExtensions.cs.meta
new file mode 100644
index 0000000000..7b161a4da1
--- /dev/null
+++ b/Assets/SEE/Extensions/GraphElementObjectExtensions.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 4a53503583b1a3840850434d424275dc
\ No newline at end of file
diff --git a/Assets/SEE/GameObjects/Factories.meta b/Assets/SEE/Factories.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories.meta
rename to Assets/SEE/Factories.meta
diff --git a/Assets/SEE/GameObjects/Decorators/AntennaDecorator.cs b/Assets/SEE/Factories/AntennaFactory.cs
similarity index 94%
rename from Assets/SEE/GameObjects/Decorators/AntennaDecorator.cs
rename to Assets/SEE/Factories/AntennaFactory.cs
index 2a0bc65bf4..56c84a9e85 100644
--- a/Assets/SEE/GameObjects/Decorators/AntennaDecorator.cs
+++ b/Assets/SEE/Factories/AntennaFactory.cs
@@ -1,20 +1,20 @@
using SEE.DataModel.DG;
using SEE.Game;
using SEE.Game.City;
-using SEE.GO.Factories;
-using SEE.GO.Factories.NodeFactories;
+using SEE.Factories.NodeFactories;
using SEE.Utils;
using System;
using System.Collections.Generic;
using UnityEngine;
+using SEE.Extensions;
+using SEE.MetricScales;
-namespace SEE.GO.Decorators
+namespace SEE.Factories
{
///
- /// A decorator for game nodes generating an antenna representing various metrics
- /// above a game node (leaf or inner alike).
+ /// A factory for antennas representing various metrics above a game node (leaf or inner alike).
///
- internal class AntennaDecorator
+ internal class AntennaFactory
{
///
/// Constructor.
@@ -24,11 +24,11 @@ internal class AntennaDecorator
/// The width of every antenna segment.
/// The maximal height of an individual antenna segment.
/// A mapping of metric names onto colors.
- public AntennaDecorator(IScale scaler,
- AntennaAttributes antennaAttributes,
- float antennaWidth,
- float maximalAntennaSegmentHeight,
- ColorMap metricToColor)
+ public AntennaFactory(IScale scaler,
+ AntennaAttributes antennaAttributes,
+ float antennaWidth,
+ float maximalAntennaSegmentHeight,
+ ColorMap metricToColor)
{
this.scaler = scaler;
this.antennaAttributes = antennaAttributes;
diff --git a/Assets/SEE/Factories/AntennaFactory.cs.meta b/Assets/SEE/Factories/AntennaFactory.cs.meta
new file mode 100644
index 0000000000..7c469a3d2a
--- /dev/null
+++ b/Assets/SEE/Factories/AntennaFactory.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 4b233739135e23d4183ece901da956c7
\ No newline at end of file
diff --git a/Assets/SEE/GameObjects/Factories/DynamicMarkerFactory.cs b/Assets/SEE/Factories/DynamicMarkerFactory.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/DynamicMarkerFactory.cs
rename to Assets/SEE/Factories/DynamicMarkerFactory.cs
index 44b1b1094b..99869a9e0e 100644
--- a/Assets/SEE/GameObjects/Factories/DynamicMarkerFactory.cs
+++ b/Assets/SEE/Factories/DynamicMarkerFactory.cs
@@ -1,11 +1,12 @@
using SEE.Game;
+using SEE.Extensions;
using SEE.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
-namespace SEE.GO.Factories
+namespace SEE.Factories
{
///
/// A factory for dynamic markers.
diff --git a/Assets/SEE/GameObjects/Factories/DynamicMarkerFactory.cs.meta b/Assets/SEE/Factories/DynamicMarkerFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/DynamicMarkerFactory.cs.meta
rename to Assets/SEE/Factories/DynamicMarkerFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/EdgeFactory.cs b/Assets/SEE/Factories/EdgeFactory.cs
similarity index 98%
rename from Assets/SEE/GameObjects/Factories/EdgeFactory.cs
rename to Assets/SEE/Factories/EdgeFactory.cs
index 8a377527a7..0e25ef19a8 100644
--- a/Assets/SEE/GameObjects/Factories/EdgeFactory.cs
+++ b/Assets/SEE/Factories/EdgeFactory.cs
@@ -1,13 +1,15 @@
using System.Collections.Generic;
using System.Linq;
+using SEE.Components.GameEdges;
using SEE.Game;
using SEE.Game.CityRendering;
+using SEE.GraphElementRefs;
using SEE.Layout;
using SEE.Layout.EdgeLayouts;
using SEE.Utils;
using UnityEngine;
-namespace SEE.GO.Factories
+namespace SEE.Factories
{
///
/// A factory to create game objects for laid out edges.
diff --git a/Assets/SEE/GameObjects/Factories/EdgeFactory.cs.meta b/Assets/SEE/Factories/EdgeFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/EdgeFactory.cs.meta
rename to Assets/SEE/Factories/EdgeFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/EdgeMaterial.cs b/Assets/SEE/Factories/EdgeMaterial.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/EdgeMaterial.cs
rename to Assets/SEE/Factories/EdgeMaterial.cs
index 4517d96f8e..95822a53bb 100644
--- a/Assets/SEE/GameObjects/Factories/EdgeMaterial.cs
+++ b/Assets/SEE/Factories/EdgeMaterial.cs
@@ -1,6 +1,6 @@
using UnityEngine;
-namespace SEE.GO.Factories
+namespace SEE.Factories
{
///
/// Handles the properties of materials for our
diff --git a/Assets/SEE/GameObjects/Factories/EdgeMaterial.cs.meta b/Assets/SEE/Factories/EdgeMaterial.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/EdgeMaterial.cs.meta
rename to Assets/SEE/Factories/EdgeMaterial.cs.meta
diff --git a/Assets/SEE/GameObjects/ErosionIssues.cs b/Assets/SEE/Factories/ErosionFactory.cs
similarity index 98%
rename from Assets/SEE/GameObjects/ErosionIssues.cs
rename to Assets/SEE/Factories/ErosionFactory.cs
index 23987c2508..4b5b838716 100644
--- a/Assets/SEE/GameObjects/ErosionIssues.cs
+++ b/Assets/SEE/Factories/ErosionFactory.cs
@@ -2,16 +2,18 @@
using System.Globalization;
using System.Linq;
using SEE.DataModel.DG;
-using SEE.GO.Factories;
+using SEE.Extensions;
+using SEE.GraphElementRefs;
+using SEE.MetricScales;
using SEE.Tools;
using UnityEngine;
-namespace SEE.GO
+namespace SEE.Factories
{
///
/// Allows to add erosion issues as sprites atop of game objects.
///
- internal class ErosionIssues
+ internal class ErosionFactory
{
///
/// Constructor.
@@ -19,7 +21,7 @@ internal class ErosionIssues
/// The relevant metrics for the erosion issues.
/// Scaling to be applied on the metrics for the erosion issues.
/// The factor by which the erosion icons shall be scaled.
- public ErosionIssues(Dictionary issueMap,
+ public ErosionFactory(Dictionary issueMap,
IScale scaler, float erosionScalingFactor, bool aggregated = false)
{
this.issueMap = issueMap;
diff --git a/Assets/SEE/Factories/ErosionFactory.cs.meta b/Assets/SEE/Factories/ErosionFactory.cs.meta
new file mode 100644
index 0000000000..48d40eb4ed
--- /dev/null
+++ b/Assets/SEE/Factories/ErosionFactory.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 67cf4cb4956252c4fa9b27674befef3b
\ No newline at end of file
diff --git a/Assets/SEE/Factories/Factories.cs b/Assets/SEE/Factories/Factories.cs
new file mode 100644
index 0000000000..55b78a1523
--- /dev/null
+++ b/Assets/SEE/Factories/Factories.cs
@@ -0,0 +1,6 @@
+///
+/// Factories for game nodes and game edges and their decorations.
+///
+namespace SEE.Factories
+{
+}
diff --git a/Assets/SEE/Factories/Factories.cs.meta b/Assets/SEE/Factories/Factories.cs.meta
new file mode 100644
index 0000000000..228f2f5602
--- /dev/null
+++ b/Assets/SEE/Factories/Factories.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: b57f3ddb5522f774d89799a70bc89b06
\ No newline at end of file
diff --git a/Assets/SEE/GameObjects/Factories/IconFactory.cs b/Assets/SEE/Factories/IconFactory.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/IconFactory.cs
rename to Assets/SEE/Factories/IconFactory.cs
index 0192b6386a..1810be55c0 100644
--- a/Assets/SEE/GameObjects/Factories/IconFactory.cs
+++ b/Assets/SEE/Factories/IconFactory.cs
@@ -6,7 +6,7 @@
using UnityEngine.Assertions;
using UnityEngine.UI;
-namespace SEE.GO.Factories
+namespace SEE.Factories
{
///
/// A factory to generate sprites from sprite prefab files for all types of
diff --git a/Assets/SEE/GameObjects/Factories/IconFactory.cs.meta b/Assets/SEE/Factories/IconFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/IconFactory.cs.meta
rename to Assets/SEE/Factories/IconFactory.cs.meta
diff --git a/Assets/SEE/Game/InteractionDecorator.cs b/Assets/SEE/Factories/InteractionDecorator.cs
similarity index 57%
rename from Assets/SEE/Game/InteractionDecorator.cs
rename to Assets/SEE/Factories/InteractionDecorator.cs
index 92111a7309..f76df863f4 100644
--- a/Assets/SEE/Game/InteractionDecorator.cs
+++ b/Assets/SEE/Factories/InteractionDecorator.cs
@@ -3,14 +3,14 @@
using System.Threading;
using Cysharp.Threading.Tasks;
using SEE.Controls;
-using SEE.Controls.Actions;
using SEE.Controls.Interactables;
-using SEE.GO;
+using SEE.Controls.Modifiers;
+using SEE.Extensions;
using SEE.Utils;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit.Interactables;
-namespace SEE.Game
+namespace SEE.Factories
{
///
/// Adds components required for interacting with a game object.
@@ -18,7 +18,7 @@ namespace SEE.Game
internal static class InteractionDecorator
{
///
- /// Adds the following components to given :
+ /// Adds the following components to given :
/// ,
/// ,
/// ,
@@ -26,38 +26,38 @@ internal static class InteractionDecorator
/// ,
/// .
///
- /// If has a , then the following
+ /// If has a , then the following
/// components are added in addition to the ones above:
/// ,
///
///
///
- /// .
+ /// .
///
- /// Note: The is assumed to represent a graph node
+ /// Note: The is assumed to represent a graph node
/// or edge.
///
- /// Game object where the components are to be added to.
- public static void PrepareGraphElementForInteraction(GameObject gameObject)
+ /// Game node or edge where the components are to be added to.
+ public static void PrepareGraphElementForInteraction(GameObject gameNodeOrEdge)
{
- gameObject.AddOrGetComponent();
+ gameNodeOrEdge.AddOrGetComponent();
- gameObject.isStatic = false; // we want to move the object during the game
+ gameNodeOrEdge.isStatic = false; // we want to move the object during the game
// The following additions of components must come after the addition of InteractableObject
// because they require the presence of an InteractableObject.
- AddGeneralComponents(gameObject);
- if (gameObject.HasNodeRef())
+ AddGeneralComponents(gameNodeOrEdge);
+ if (gameNodeOrEdge.HasNodeRef())
{
- gameObject.AddOrGetComponent();
- gameObject.AddOrGetComponent();
- gameObject.AddOrGetComponent();
- gameObject.AddOrGetComponent();
- gameObject.AddOrGetComponent();
+ gameNodeOrEdge.AddOrGetComponent();
+ gameNodeOrEdge.AddOrGetComponent();
+ gameNodeOrEdge.AddOrGetComponent();
+ gameNodeOrEdge.AddOrGetComponent();
+ gameNodeOrEdge.AddOrGetComponent();
}
}
///
- /// Addes the following components to given :
+ /// Addes the following components to given :
/// ,
/// ,
/// ,
@@ -65,52 +65,55 @@ public static void PrepareGraphElementForInteraction(GameObject gameObject)
/// ,
/// ,
/// .
+ ///
+ /// is assumed to be a game object representing
+ /// an author in a .
///
- /// Where the components should be added to.
- public static void PrepareAuthorForInteraction(GameObject gameObject)
+ /// Where the components should be added to.
+ public static void PrepareAuthorForInteraction(GameObject authorSphere)
{
- gameObject.AddOrGetComponent();
- gameObject.AddOrGetComponent();
- AddGeneralComponents(gameObject);
+ authorSphere.AddOrGetComponent();
+ authorSphere.AddOrGetComponent();
+ AddGeneralComponents(authorSphere);
}
///
- /// Adds the following components to given :
+ /// Adds the following components to given :
/// ,
/// ,
/// ,
/// ,
/// .
///
- /// Where the components should be added to.
- private static void AddGeneralComponents(GameObject gameObject)
+ /// A game node or edge where the components should be added to.
+ private static void AddGeneralComponents(GameObject gameNodeOrEdge)
{
- gameObject.AddOrGetComponent().colliders.Add(gameObject.GetComponent());
- gameObject.AddOrGetComponent();
- gameObject.AddOrGetComponent();
- gameObject.AddOrGetComponent();
+ gameNodeOrEdge.AddOrGetComponent().colliders.Add(gameNodeOrEdge.GetComponent());
+ gameNodeOrEdge.AddOrGetComponent();
+ gameNodeOrEdge.AddOrGetComponent();
+ gameNodeOrEdge.AddOrGetComponent();
}
///
/// Adds the same components as
- /// to all .
+ /// to all .
///
- /// Note: All are assumed to represent a graph node
+ /// Note: All are assumed to represent a graph node
/// or edge.
///
- /// Game objects where the components are to be added to.
+ /// Game objects where the components are to be added to.
/// Action that updates the progress of the preparation.
/// Token with which to cancel the preparation.
- public static async UniTask PrepareForInteractionAsync(ICollection gameObjects,
+ public static async UniTask PrepareForInteractionAsync(ICollection gameNodesOrEdges,
Action updateProgress,
CancellationToken token = default)
{
- int totalGameObjects = gameObjects.Count;
+ int totalGameObjects = gameNodesOrEdges.Count;
// The batch size controls the compromise between FPS and processing speed.
// In the editor, requirements for FPS are significantly lower than in-game.
int batchSize = Application.isPlaying ? 200 : 1000;
float i = 0;
- await foreach (GameObject go in gameObjects.BatchPerFrame(batchSize, token: token))
+ await foreach (GameObject go in gameNodesOrEdges.BatchPerFrame(batchSize, token: token))
{
PrepareGraphElementForInteraction(go);
updateProgress(++i / totalGameObjects);
diff --git a/Assets/SEE/Game/InteractionDecorator.cs.meta b/Assets/SEE/Factories/InteractionDecorator.cs.meta
similarity index 100%
rename from Assets/SEE/Game/InteractionDecorator.cs.meta
rename to Assets/SEE/Factories/InteractionDecorator.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/LineFactory.cs b/Assets/SEE/Factories/LineFactory.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/LineFactory.cs
rename to Assets/SEE/Factories/LineFactory.cs
index e5eca1e7be..2425ad75f8 100644
--- a/Assets/SEE/GameObjects/Factories/LineFactory.cs
+++ b/Assets/SEE/Factories/LineFactory.cs
@@ -1,6 +1,7 @@
-using UnityEngine;
+using SEE.Extensions;
+using UnityEngine;
-namespace SEE.GO.Factories
+namespace SEE.Factories
{
///
/// Sets attributes of lines.
diff --git a/Assets/SEE/GameObjects/Factories/LineFactory.cs.meta b/Assets/SEE/Factories/LineFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/LineFactory.cs.meta
rename to Assets/SEE/Factories/LineFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/MarkerFactory.cs b/Assets/SEE/Factories/MarkerFactory.cs
similarity index 98%
rename from Assets/SEE/GameObjects/Factories/MarkerFactory.cs
rename to Assets/SEE/Factories/MarkerFactory.cs
index 1171c55c64..8fc7a71def 100644
--- a/Assets/SEE/GameObjects/Factories/MarkerFactory.cs
+++ b/Assets/SEE/Factories/MarkerFactory.cs
@@ -3,12 +3,13 @@
using DG.Tweening;
using SEE.Game;
using SEE.Game.City;
-using SEE.GO.Factories.NodeFactories;
+using SEE.Factories.NodeFactories;
using SEE.Utils;
using UnityEngine;
-using static SEE.GO.Factories.MaterialsFactory.ShaderType;
+using static SEE.Factories.MaterialsFactory.ShaderType;
+using SEE.Extensions;
-namespace SEE.GO.Factories
+namespace SEE.Factories
{
///
/// A factory for markers to highlight added, changed, and deleted nodes.
diff --git a/Assets/SEE/GameObjects/Factories/MarkerFactory.cs.meta b/Assets/SEE/Factories/MarkerFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/MarkerFactory.cs.meta
rename to Assets/SEE/Factories/MarkerFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/MaterialsFactory.cs b/Assets/SEE/Factories/MaterialsFactory.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/MaterialsFactory.cs
rename to Assets/SEE/Factories/MaterialsFactory.cs
index 4d3c1b368d..8a4c98edcd 100644
--- a/Assets/SEE/GameObjects/Factories/MaterialsFactory.cs
+++ b/Assets/SEE/Factories/MaterialsFactory.cs
@@ -5,7 +5,7 @@
using UnityEngine;
using UnityEngine.Assertions;
-namespace SEE.GO.Factories
+namespace SEE.Factories
{
///
/// Provides default material that can be shared among game objects to
diff --git a/Assets/SEE/GameObjects/Factories/MaterialsFactory.cs.meta b/Assets/SEE/Factories/MaterialsFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/MaterialsFactory.cs.meta
rename to Assets/SEE/Factories/MaterialsFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories.meta b/Assets/SEE/Factories/NodeFactories.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/NodeFactories.meta
rename to Assets/SEE/Factories/NodeFactories.meta
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/BarsFactory.cs b/Assets/SEE/Factories/NodeFactories/BarsFactory.cs
similarity index 98%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/BarsFactory.cs
rename to Assets/SEE/Factories/NodeFactories/BarsFactory.cs
index 8d9bf23397..2a17c370cf 100644
--- a/Assets/SEE/GameObjects/Factories/NodeFactories/BarsFactory.cs
+++ b/Assets/SEE/Factories/NodeFactories/BarsFactory.cs
@@ -2,7 +2,7 @@
using System.Linq;
using UnityEngine;
-namespace SEE.GO.Factories.NodeFactories
+namespace SEE.Factories.NodeFactories
{
///
/// A factory for bar charts as visual representations of graph nodes
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/BarsFactory.cs.meta b/Assets/SEE/Factories/NodeFactories/BarsFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/BarsFactory.cs.meta
rename to Assets/SEE/Factories/NodeFactories/BarsFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/CubeFactory.cs b/Assets/SEE/Factories/NodeFactories/CubeFactory.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/CubeFactory.cs
rename to Assets/SEE/Factories/NodeFactories/CubeFactory.cs
index 6c4fa1778a..c4898889d3 100644
--- a/Assets/SEE/GameObjects/Factories/NodeFactories/CubeFactory.cs
+++ b/Assets/SEE/Factories/NodeFactories/CubeFactory.cs
@@ -1,7 +1,7 @@
using SEE.Game;
using UnityEngine;
-namespace SEE.GO.Factories.NodeFactories
+namespace SEE.Factories.NodeFactories
{
///
/// A factory for cubes as visual representations of graph nodes in the scene.
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/CubeFactory.cs.meta b/Assets/SEE/Factories/NodeFactories/CubeFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/CubeFactory.cs.meta
rename to Assets/SEE/Factories/NodeFactories/CubeFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/CylinderFactory.cs b/Assets/SEE/Factories/NodeFactories/CylinderFactory.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/CylinderFactory.cs
rename to Assets/SEE/Factories/NodeFactories/CylinderFactory.cs
index e39d0b78f0..4de4177f9f 100644
--- a/Assets/SEE/GameObjects/Factories/NodeFactories/CylinderFactory.cs
+++ b/Assets/SEE/Factories/NodeFactories/CylinderFactory.cs
@@ -1,7 +1,7 @@
using SEE.Game;
using UnityEngine;
-namespace SEE.GO.Factories.NodeFactories
+namespace SEE.Factories.NodeFactories
{
///
/// A factory for cylinder game objects.
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/CylinderFactory.cs.meta b/Assets/SEE/Factories/NodeFactories/CylinderFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/CylinderFactory.cs.meta
rename to Assets/SEE/Factories/NodeFactories/CylinderFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/NodeFactories.cs b/Assets/SEE/Factories/NodeFactories/NodeFactories.cs
similarity index 65%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/NodeFactories.cs
rename to Assets/SEE/Factories/NodeFactories/NodeFactories.cs
index f97556d94a..5597939821 100644
--- a/Assets/SEE/GameObjects/Factories/NodeFactories/NodeFactories.cs
+++ b/Assets/SEE/Factories/NodeFactories/NodeFactories.cs
@@ -1,9 +1,9 @@
///
-/// SEE.GO.NodeFactories contains factories that create
+/// contains factories that create
/// game objects representing graph nodes to be shown in the scene.
/// These factories may be used at design time (in the Unity editor)
/// as well as run time (during the game).
///
-namespace SEE.GO.Factories.NodeFactories
+namespace SEE.Factories.NodeFactories
{
}
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/NodeFactories.cs.meta b/Assets/SEE/Factories/NodeFactories/NodeFactories.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/NodeFactories.cs.meta
rename to Assets/SEE/Factories/NodeFactories/NodeFactories.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/NodeFactory.cs b/Assets/SEE/Factories/NodeFactories/NodeFactory.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/NodeFactory.cs
rename to Assets/SEE/Factories/NodeFactories/NodeFactory.cs
index b9ddcfb1ad..838f421ffe 100644
--- a/Assets/SEE/GameObjects/Factories/NodeFactories/NodeFactory.cs
+++ b/Assets/SEE/Factories/NodeFactories/NodeFactory.cs
@@ -4,7 +4,7 @@
using System.Linq;
using UnityEngine;
-namespace SEE.GO.Factories.NodeFactories
+namespace SEE.Factories.NodeFactories
{
///
/// A factory for visual representations of graph nodes in the scene.
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/NodeFactory.cs.meta b/Assets/SEE/Factories/NodeFactories/NodeFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/NodeFactory.cs.meta
rename to Assets/SEE/Factories/NodeFactories/NodeFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/PolygonFactory.cs b/Assets/SEE/Factories/NodeFactories/PolygonFactory.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/PolygonFactory.cs
rename to Assets/SEE/Factories/NodeFactories/PolygonFactory.cs
index 7743cbca7d..24194bf19c 100644
--- a/Assets/SEE/GameObjects/Factories/NodeFactories/PolygonFactory.cs
+++ b/Assets/SEE/Factories/NodeFactories/PolygonFactory.cs
@@ -3,7 +3,7 @@
using System.Linq;
using UnityEngine;
-namespace SEE.GO.Factories.NodeFactories
+namespace SEE.Factories.NodeFactories
{
///
/// A factory for shapes with a irregular closed polygon as a floor space
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/PolygonFactory.cs.meta b/Assets/SEE/Factories/NodeFactories/PolygonFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/PolygonFactory.cs.meta
rename to Assets/SEE/Factories/NodeFactories/PolygonFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/SpiderFactory.cs b/Assets/SEE/Factories/NodeFactories/SpiderFactory.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/SpiderFactory.cs
rename to Assets/SEE/Factories/NodeFactories/SpiderFactory.cs
index a0e7c4c2be..09cc9ed86e 100644
--- a/Assets/SEE/GameObjects/Factories/NodeFactories/SpiderFactory.cs
+++ b/Assets/SEE/Factories/NodeFactories/SpiderFactory.cs
@@ -2,7 +2,7 @@
using System.Linq;
using UnityEngine;
-namespace SEE.GO.Factories.NodeFactories
+namespace SEE.Factories.NodeFactories
{
///
/// A factory for shapes with a spider-chart floor space as visual representations
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/SpiderFactory.cs.meta b/Assets/SEE/Factories/NodeFactories/SpiderFactory.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/SpiderFactory.cs.meta
rename to Assets/SEE/Factories/NodeFactories/SpiderFactory.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/Triangulator.cs b/Assets/SEE/Factories/NodeFactories/Triangulator.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/Triangulator.cs
rename to Assets/SEE/Factories/NodeFactories/Triangulator.cs
index 5aabad955f..248e2690c4 100644
--- a/Assets/SEE/GameObjects/Factories/NodeFactories/Triangulator.cs
+++ b/Assets/SEE/Factories/NodeFactories/Triangulator.cs
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections.Generic;
-namespace SEE.GO.Factories.NodeFactories
+namespace SEE.Factories.NodeFactories
{
///
/// A utility class to generate a set of triangles from a list of points
diff --git a/Assets/SEE/GameObjects/Factories/NodeFactories/Triangulator.cs.meta b/Assets/SEE/Factories/NodeFactories/Triangulator.cs.meta
similarity index 100%
rename from Assets/SEE/GameObjects/Factories/NodeFactories/Triangulator.cs.meta
rename to Assets/SEE/Factories/NodeFactories/Triangulator.cs.meta
diff --git a/Assets/SEE/GameObjects/Factories/PlaneFactory.cs b/Assets/SEE/Factories/PlaneFactory.cs
similarity index 99%
rename from Assets/SEE/GameObjects/Factories/PlaneFactory.cs
rename to Assets/SEE/Factories/PlaneFactory.cs
index b6195e641e..7e36d0af2b 100644
--- a/Assets/SEE/GameObjects/Factories/PlaneFactory.cs
+++ b/Assets/SEE/Factories/PlaneFactory.cs
@@ -3,7 +3,7 @@
using UnityEngine;
using UnityEngine.Rendering;
-namespace SEE.GO.Factories
+namespace SEE.Factories
{
///