Skip to content
Snippets Groups Projects
Commit 07a37a84 authored by MaZiFAU's avatar MaZiFAU
Browse files

Refactored Fact/-Organizer

Overall cleaner, Less Server Ressource use
Known bug: Label/LabelId does not propperly update
parent a349aa16
No related branches found
No related tags found
No related merge requests found
Showing
with 1233 additions and 1736 deletions
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
using UnityEngine.InputSystem.Utilities; using UnityEngine.InputSystem.Utilities;
using UnityEngine.Rendering.VirtualTexturing; using UnityEngine.Rendering.VirtualTexturing;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Xml.Linq;
//TODO: MMT: move some functionality there //TODO: MMT: move some functionality there
//TODO: consequent!= samestep != dependent //TODO: consequent!= samestep != dependent
...@@ -20,7 +21,7 @@ ...@@ -20,7 +21,7 @@
/// Organizes (insertion/ deletion / etc. operations) and sepperates <see cref="Fact">Fact</see> spaces. /// Organizes (insertion/ deletion / etc. operations) and sepperates <see cref="Fact">Fact</see> spaces.
/// Keeps track of insertion/ deletion actions for <see cref="undo"/> and <see cref="redo"/>. /// Keeps track of insertion/ deletion actions for <see cref="undo"/> and <see cref="redo"/>.
/// </summary> /// </summary>
public class FactOrganizer : IJSONsavable<FactOrganizer> public class FactOrganizer : IJSONsavable<FactOrganizer>, IDisposable
{ {
/// <summary> /// <summary>
/// Contains Immutable <see cref="Fact.Id"/>s; /// Contains Immutable <see cref="Fact.Id"/>s;
...@@ -46,18 +47,14 @@ public class FactOrganizer : IJSONsavable<FactOrganizer> ...@@ -46,18 +47,14 @@ public class FactOrganizer : IJSONsavable<FactOrganizer>
/// - <c>Key</c>: <see cref="Fact.Id"/> /// - <c>Key</c>: <see cref="Fact.Id"/>
/// - <c>Value</c>: <see cref="Fact"/> /// - <c>Value</c>: <see cref="Fact"/>
/// </summary> /// </summary>
[JsonIgnore]
protected IReadOnlyDictionary<string, Fact> MyFactSpace protected IReadOnlyDictionary<string, Fact> MyFactSpace
{ {
get => GlobalFactDictionary.MyFactSpace(this); get => GlobalFactDictionary.MyFactSpace(this);
} }
[JsonProperty] [JsonProperty]
protected IReadOnlyDictionary<string, Fact> JsonFactSpace private IReadOnlyDictionary<string, Fact> JsonFactSpace = null; //null!
{
get => MyFactSpace;
set => _JsonFactSpace = value;
}
private IReadOnlyDictionary<string, Fact> _JsonFactSpace;
/// <summary> /// <summary>
/// - <c>Key</c>: <see cref="Fact.Id"/> /// - <c>Key</c>: <see cref="Fact.Id"/>
...@@ -218,25 +215,26 @@ public stepnote(FactOrganizer that, string Id, bool samestep, bool creation, Gad ...@@ -218,25 +215,26 @@ public stepnote(FactOrganizer that, string Id, bool samestep, bool creation, Gad
if (new_gadget = !that.GadgetWorkflowDict.ContainsKey(gadget)) if (new_gadget = !that.GadgetWorkflowDict.ContainsKey(gadget))
{ {
that.GadgetWorkflowDict.Add(gadget, (that.marker, that.marker)); that.GadgetWorkflowDict.Add(gadget, (that.marker, that.marker));
that.WorkflowGadgetDict.Remove(that.marker);
that.WorkflowGadgetDict.Add(that.marker, gadget); that.WorkflowGadgetDict.Add(that.marker, gadget);
} }
var gadget_entree = that.GadgetWorkflowDict[gadget]; var (gadget_first_occurrence, gadget_last_occurrence) = that.GadgetWorkflowDict[gadget];
this.gadget_rank = gadget_entree.first_occurrence;
this.gadget_rank = gadget_first_occurrence;
// check for new USE of gadget // check for new USE of gadget
bool set_workflow = !samestep || new_gadget || prev.gadget_rank != this.gadget_rank bool set_workflow = !samestep || new_gadget || prev.gadget_rank != this.gadget_rank
|| gadget_entree.last_occurrence >= that.marker; || gadget_last_occurrence >= that.marker;
stepnote gadget_prev = set_workflow ? default /*unused then*/ stepnote gadget_prev = set_workflow
: that.Workflow[gadget_entree.last_occurrence]; ? default /*unused then*/
: that.Workflow[gadget_last_occurrence];
if (set_workflow || gadget_prev.GadgetFlow == null if (set_workflow || gadget_prev.GadgetFlow == null
|| !gadget_prev.GadgetFlow.SequenceEqual(gadget.Workflow.ToArray())) || !gadget_prev.GadgetFlow.SequenceEqual(gadget.Workflow.ToArray()))
{ {
this.GadgetFlow = gadget.Workflow.ToArray(); this.GadgetFlow = gadget.Workflow.ToArray();
that.GadgetWorkflowDict[gadget] = (gadget_entree.first_occurrence, that.marker); that.GadgetWorkflowDict[gadget] = (gadget_first_occurrence, that.marker);
} }
} }
} }
...@@ -296,9 +294,12 @@ public FactOrganizer() ...@@ -296,9 +294,12 @@ public FactOrganizer()
~FactOrganizer() ~FactOrganizer()
{ {
GlobalFactDictionary.FactSpaceDelete(this); Dispose();
} }
public void Dispose()
=> GlobalFactDictionary.FactSpaceDelete(this);
/// <summary> /// <summary>
/// Standard Constructor for empty, ready to use <see cref="FactOrganizer"/> /// Standard Constructor for empty, ready to use <see cref="FactOrganizer"/>
/// </summary> /// </summary>
...@@ -321,9 +322,11 @@ public static T ReInitializeFactOrganizer<T>(T source, bool invoke, out Dictiona ...@@ -321,9 +322,11 @@ public static T ReInitializeFactOrganizer<T>(T source, bool invoke, out Dictiona
where T : FactOrganizer, new() where T : FactOrganizer, new()
{ // TODO: other strategy needed when MMT save/load supported { // TODO: other strategy needed when MMT save/load supported
IReadOnlyDictionary<string, Fact> source_Dict = source._JsonFactSpace ?? source.MyFactSpace; bool not_from_JSON = source.JsonFactSpace == null;
Dictionary<string, string> _old_to_new = new(); Dictionary<string, string> _old_to_new = not_from_JSON
? source.MyFactSpace.Keys.ToDictionary(id => id)
: new();
// initiate // initiate
T target = new() T target = new()
...@@ -336,17 +339,9 @@ public static T ReInitializeFactOrganizer<T>(T source, bool invoke, out Dictiona ...@@ -336,17 +339,9 @@ public static T ReInitializeFactOrganizer<T>(T source, bool invoke, out Dictiona
// work ExposedSolutionFacts // work ExposedSolutionFacts
foreach (var element in source.ImmutableFacts) foreach (var element in source.ImmutableFacts)
{ {
try Fact ExposedFact = ReInitializeFact(element);
{
Fact ExposedFact = ReInitializeFact(source_Dict[element]);
target.Add(ExposedFact, out _, false, null, null, isImmutable: true); target.Add(ExposedFact, out _, false, null, null, isImmutable: true);
} }
catch (Exception ex)
{
Debug.LogWarningFormat("Could not Instantiate Immutable Fact: {0}", source_Dict[element]);
Debug.LogException(ex);
}
}
// work Workflow // work Workflow
for (int i = 0; i < source.Workflow.Count; i++) for (int i = 0; i < source.Workflow.Count; i++)
...@@ -366,7 +361,7 @@ public static T ReInitializeFactOrganizer<T>(T source, bool invoke, out Dictiona ...@@ -366,7 +361,7 @@ public static T ReInitializeFactOrganizer<T>(T source, bool invoke, out Dictiona
if (s_step.creation) if (s_step.creation)
// Add // Add
{ {
Fact add = ReInitializeFact(source_Dict[s_step.Id]); Fact add = ReInitializeFact(s_step.Id);
target.Add(add, out _, s_step.samestep, used_gadget, s_step.scroll_label); target.Add(add, out _, s_step.samestep, used_gadget, s_step.scroll_label);
} }
else if (_old_to_new.TryGetValue(s_step.Id, out string remove_Id)) else if (_old_to_new.TryGetValue(s_step.Id, out string remove_Id))
...@@ -385,18 +380,30 @@ public static T ReInitializeFactOrganizer<T>(T source, bool invoke, out Dictiona ...@@ -385,18 +380,30 @@ public static T ReInitializeFactOrganizer<T>(T source, bool invoke, out Dictiona
target.undo(); target.undo();
target.soft_resetted = source.soft_resetted; target.soft_resetted = source.soft_resetted;
//if(not_from_JSON)
// source.Dispose();
old_to_new = _old_to_new; old_to_new = _old_to_new;
return target; return target;
Fact ReInitializeFact(Fact old_Fact) Fact ReInitializeFact(string old_id)
{ {
if (_old_to_new.TryGetValue(old_Fact.Id, out string newId)) if (not_from_JSON)
return source.MyFactSpace[old_id]; // is in GlobalFactDictionary.Facts
if (_old_to_new.TryGetValue(old_id, out string newId))
return target[newId]; return target[newId];
Fact new_Fact = old_Fact.GetType() Fact old_Fact = source.JsonFactSpace[old_id];
.GetConstructor(new Type[] { old_Fact.GetType(), typeof(Dictionary<string, string>), typeof(FactOrganizer) })
.Invoke(new object[] { old_Fact, _old_to_new, target }) if (!old_Fact.getDependentFactIds().All(id => _old_to_new.ContainsKey(id)))
as Fact; {
Debug.LogWarningFormat("Could not Instantiate Immutable Fact: {0}", old_Fact);
return null;
}
Fact new_Fact = old_Fact.ReInitializeMe(_old_to_new, target);
_old_to_new.Add(old_Fact.Id, new_Fact.Id); _old_to_new.Add(old_Fact.Id, new_Fact.Id);
...@@ -571,7 +578,7 @@ public string Add(Fact value, out bool exists, bool samestep, Gadget gadget, str ...@@ -571,7 +578,7 @@ public string Add(Fact value, out bool exists, bool samestep, Gadget gadget, str
string key; string key;
#pragma warning restore IDE0018 // Inlinevariablendeklaration #pragma warning restore IDE0018 // Inlinevariablendeklaration
if (exists = FindEquivalent(value, out key, out bool exact)) if (exists = FindEquivalent(value, out key, out bool _))
{ {
if (exists = MetaInf[key].active) //Fact in Scene? if (exists = MetaInf[key].active) //Fact in Scene?
// desired outcome already achieved // desired outcome already achieved
...@@ -843,6 +850,12 @@ public void fastforward() ...@@ -843,6 +850,12 @@ public void fastforward()
FactOrganizer IJSONsavable<FactOrganizer>._IJPostProcess(FactOrganizer raw_payload) FactOrganizer IJSONsavable<FactOrganizer>._IJPostProcess(FactOrganizer raw_payload)
=> raw_payload == null ? raw_payload : ReInitializeFactOrganizer<FactOrganizer>(raw_payload, false, out _); => raw_payload == null ? raw_payload : ReInitializeFactOrganizer<FactOrganizer>(raw_payload, false, out _);
FactOrganizer IJSONsavable<FactOrganizer>._IJPreProcess(FactOrganizer payload)
{
payload.JsonFactSpace = payload.MyFactSpace;
return payload;
}
/// <summary> /// <summary>
/// Call this after assigning a stored instance in an empty world, that was not drawn. /// Call this after assigning a stored instance in an empty world, that was not drawn.
/// <see cref="redo">Redoes</see>/ draws everything from <see cref="marker"/> = 0 to <paramref name="draw_all"/><c> ? worksteps : backlog</c> /// <see cref="redo">Redoes</see>/ draws everything from <see cref="marker"/> = 0 to <paramref name="draw_all"/><c> ? worksteps : backlog</c>
...@@ -977,20 +990,21 @@ public IEnumerable<string> GetUsedScrolls() ...@@ -977,20 +990,21 @@ public IEnumerable<string> GetUsedScrolls()
public int GetNumberOfFacts() => MyFactSpace.Count; public int GetNumberOfFacts() => MyFactSpace.Count;
protected static class GlobalFactDictionary protected static class GlobalFactDictionary
{ {
/// <summary> /// <summary>
/// - <c>Key</c>: <see cref="Fact.Id"/> /// - <c>Key</c>: <see cref="Fact.Id"/>
/// - <c>Value</c>: <see cref="Fact"/> /// - <c>Value</c>: <see cref="Fact"/>
/// </summary> /// </summary>
private static Dictionary<string, Fact> FactDict = new(); private static readonly Dictionary<string, Fact> FactDict = new();
public static IReadOnlyDictionary<string, Fact> Facts { get => FactDict; } public static IReadOnlyDictionary<string, Fact> Facts { get => FactDict; }
private static Dictionary<string, uint> FactReferences = new(); private static readonly Dictionary<string, uint> FactReferences = new();
private static Dictionary<FactOrganizer, Dictionary<string, Fact>> FactSpaces = new(); private static readonly Dictionary<FactOrganizer, Dictionary<string, Fact>> FactSpaces = new();
public static IReadOnlyDictionary<string, Fact> MyFactSpace(FactOrganizer me) public static IReadOnlyDictionary<string, Fact> MyFactSpace(FactOrganizer me)
=> FactSpaces[me]; => FactSpaces[me];
......
...@@ -49,7 +49,7 @@ protected AbstractAngleFact(string pid1, string pid2, string pid3, FactOrganizer ...@@ -49,7 +49,7 @@ protected AbstractAngleFact(string pid1, string pid2, string pid3, FactOrganizer
this.Pid2 = pid2; this.Pid2 = pid2;
this.Pid3 = pid3; this.Pid3 = pid3;
RecalulateTransform(); RecalculateTransform();
} }
/// <summary>\copydoc AbstractAngleFact.AbstractAngleFact(string, string, string, FactOrganizer)</summary> /// <summary>\copydoc AbstractAngleFact.AbstractAngleFact(string, string, string, FactOrganizer)</summary>
...@@ -68,7 +68,7 @@ public override Boolean hasDependentFacts() ...@@ -68,7 +68,7 @@ public override Boolean hasDependentFacts()
public override string[] getDependentFactIds() public override string[] getDependentFactIds()
=> new string[] { Pid1, Pid2, Pid3 }; => new string[] { Pid1, Pid2, Pid3 };
protected override void RecalulateTransform() protected override void RecalculateTransform()
{ {
Position = Point2.Position; Position = Point2.Position;
{ //Rotation { //Rotation
...@@ -120,15 +120,6 @@ public class AngleFact : AbstractAngleFactWrappedCRTP<AngleFact> ...@@ -120,15 +120,6 @@ public class AngleFact : AbstractAngleFactWrappedCRTP<AngleFact>
/// <summary> \copydoc Fact.Fact </summary> /// <summary> \copydoc Fact.Fact </summary>
public AngleFact() : base() { } public AngleFact() : base() { }
/// <summary>
/// Copies <paramref name="fact"/> by initiating new MMT %Fact.
/// </summary>
/// <param name="fact">Fact to be copied</param>
/// <param name="old_to_new"><c>Dictionary</c> mapping <paramref name="fact"/>.<see cref="getDependentFactIds"/> in <paramref name="fact"/>.<see cref="Fact._Facts"/> to corresponding <see cref="Fact.Id"/> in <paramref name="organizer"/> </param>
/// <param name="organizer">sets <see cref="_Facts"/></param>
public AngleFact(AngleFact fact, Dictionary<string, string> old_to_new, FactOrganizer organizer)
: this(old_to_new[fact.Pid1], old_to_new[fact.Pid2], old_to_new[fact.Pid3], organizer) { }
/// <summary> /// <summary>
/// Standard Constructor: /// Standard Constructor:
/// Initiates <see cref="Pid1"/>, <see cref="Pid2"/>, <see cref="Pid3"/>, <see cref="is_right_angle"/>, <see cref="Fact._URI"/> and creates MMT %Fact Server-Side /// Initiates <see cref="Pid1"/>, <see cref="Pid2"/>, <see cref="Pid3"/>, <see cref="is_right_angle"/>, <see cref="Fact._URI"/> and creates MMT %Fact Server-Side
...@@ -229,6 +220,9 @@ public override GameObject instantiateDisplay(GameObject prefab, Transform trans ...@@ -229,6 +220,9 @@ public override GameObject instantiateDisplay(GameObject prefab, Transform trans
/// \copydoc Fact.Equivalent(Fact, Fact) /// \copydoc Fact.Equivalent(Fact, Fact)
protected override bool EquivalentWrapped(AngleFact f1, AngleFact f2) protected override bool EquivalentWrapped(AngleFact f1, AngleFact f2)
=> DependentFactsEquivalent(f1, f2); => DependentFactsEquivalent(f1, f2);
protected override Fact _ReInitializeMe(Dictionary<string, string> old_to_new, FactOrganizer organizer)
=> new AngleFact(old_to_new[this.Pid1], old_to_new[this.Pid2], old_to_new[this.Pid3], organizer);
} }
/// <summary> /// <summary>
...@@ -242,15 +236,6 @@ public class RightAngleFact : AbstractAngleFactWrappedCRTP<RightAngleFact> ...@@ -242,15 +236,6 @@ public class RightAngleFact : AbstractAngleFactWrappedCRTP<RightAngleFact>
/// <summary> \copydoc Fact.Fact </summary> /// <summary> \copydoc Fact.Fact </summary>
public RightAngleFact() : base() { } public RightAngleFact() : base() { }
/// <summary>
/// Copies <paramref name="fact"/> by initiating new MMT %Fact.
/// </summary>
/// <param name="fact">Fact to be copied</param>
/// <param name="old_to_new"><c>Dictionary</c> mapping <paramref name="fact"/>.<see cref="getDependentFactIds"/> in <paramref name="fact"/>.<see cref="Fact._Facts"/> to corresponding <see cref="Fact.Id"/> in <paramref name="organizer"/> </param>
/// <param name="organizer">sets <see cref="_Facts"/></param>
public RightAngleFact(RightAngleFact fact, Dictionary<string, string> old_to_new, FactOrganizer organizer)
: this(old_to_new[fact.Pid1], old_to_new[fact.Pid2], old_to_new[fact.Pid3], organizer) { }
/// <summary> /// <summary>
/// Standard Constructor: /// Standard Constructor:
/// Initiates <see cref="Pid1"/>, <see cref="Pid2"/>, <see cref="Pid3"/>, <see cref="is_right_angle"/>, <see cref="Fact._URI"/> and creates MMT %Fact Server-Side /// Initiates <see cref="Pid1"/>, <see cref="Pid2"/>, <see cref="Pid3"/>, <see cref="is_right_angle"/>, <see cref="Fact._URI"/> and creates MMT %Fact Server-Side
...@@ -347,4 +332,7 @@ public override GameObject instantiateDisplay(GameObject prefab, Transform trans ...@@ -347,4 +332,7 @@ public override GameObject instantiateDisplay(GameObject prefab, Transform trans
/// \copydoc Fact.Equivalent(Fact, Fact) /// \copydoc Fact.Equivalent(Fact, Fact)
protected override bool EquivalentWrapped(RightAngleFact f1, RightAngleFact f2) protected override bool EquivalentWrapped(RightAngleFact f1, RightAngleFact f2)
=> DependentFactsEquivalent(f1, f2); => DependentFactsEquivalent(f1, f2);
protected override Fact _ReInitializeMe(Dictionary<string, string> old_to_new, FactOrganizer organizer)
=> new RightAngleFact(old_to_new[this.Pid1], old_to_new[this.Pid2], old_to_new[this.Pid3], organizer);
} }
\ No newline at end of file
...@@ -39,17 +39,6 @@ protected AbstractLineFact() : base() ...@@ -39,17 +39,6 @@ protected AbstractLineFact() : base()
Dir = Vector3.zero; Dir = Vector3.zero;
} }
/// <summary>
/// Copies <paramref name="fact"/> by initiating new MMT %Fact.
/// </summary>
/// <param name="fact">Fact to be copied</param>
/// <param name="old_to_new"><c>Dictionary</c> mapping <paramref name="fact"/>.<see cref="getDependentFactIds"/> in <paramref name="fact"/>.<see cref="Fact._Facts"/> to corresponding <see cref="Fact.Id"/> in <paramref name="organizer"/> </param>
/// <param name="organizer">sets <see cref="_Facts"/></param>
protected AbstractLineFact(AbstractLineFact fact, Dictionary<string, string> old_to_new, FactOrganizer organizer) : base(fact, organizer)
{
set_public_members(old_to_new[fact.Pid1], old_to_new[fact.Pid2]);
}
/// <summary> /// <summary>
/// Standard Constructor /// Standard Constructor
/// </summary> /// </summary>
...@@ -87,10 +76,10 @@ private void set_public_members(string pid1, string pid2) ...@@ -87,10 +76,10 @@ private void set_public_members(string pid1, string pid2)
this.Dir = diff.normalized; this.Dir = diff.normalized;
this.Distance = diff.magnitude; this.Distance = diff.magnitude;
RecalulateTransform(); RecalculateTransform();
} }
protected override void RecalulateTransform() protected override void RecalculateTransform()
{ {
Position = Vector3.Lerp(Point1.Point, Point2.Point, 0.5f); Position = Vector3.Lerp(Point1.Point, Point2.Point, 0.5f);
Rotation = Quaternion.LookRotation(Dir, Vector3.up); Rotation = Quaternion.LookRotation(Dir, Vector3.up);
...@@ -115,9 +104,6 @@ public abstract class AbstractLineFactWrappedCRTP<T> : AbstractLineFact where T ...@@ -115,9 +104,6 @@ public abstract class AbstractLineFactWrappedCRTP<T> : AbstractLineFact where T
/// <summary>\copydoc Fact.Fact</summary> /// <summary>\copydoc Fact.Fact</summary>
protected AbstractLineFactWrappedCRTP() : base() { } protected AbstractLineFactWrappedCRTP() : base() { }
/// <summary>\copydoc AbstractLineFact.AbstractLineFact(AbstractLineFact, Dictionary{string, string}, FactOrganizer)</summary>
protected AbstractLineFactWrappedCRTP(AbstractLineFactWrappedCRTP<T> fact, Dictionary<string, string> old_to_new, FactOrganizer organizer) : base(fact, old_to_new, organizer) { }
/// <summary>\copydoc AbstractLineFact.AbstractLineFact(string, string, FactOrganizer)</summary> /// <summary>\copydoc AbstractLineFact.AbstractLineFact(string, string, FactOrganizer)</summary>
protected AbstractLineFactWrappedCRTP(string pid1, string pid2, FactOrganizer organizer) : base(pid1, pid2, organizer) { } protected AbstractLineFactWrappedCRTP(string pid1, string pid2, FactOrganizer organizer) : base(pid1, pid2, organizer) { }
...@@ -144,10 +130,6 @@ public class LineFact : AbstractLineFactWrappedCRTP<LineFact> ...@@ -144,10 +130,6 @@ public class LineFact : AbstractLineFactWrappedCRTP<LineFact>
/// <summary> \copydoc Fact.Fact </summary> /// <summary> \copydoc Fact.Fact </summary>
public LineFact() : base() { } public LineFact() : base() { }
/// <summary> \copydoc AbstractLineFact.AbstractLineFact(AbstractLineFact, Dictionary<string, string>, FactOrganizer) </summary>
public LineFact(LineFact fact, Dictionary<string, string> old_to_new, FactOrganizer organizer) : base(fact, old_to_new, organizer)
=> init(old_to_new[fact.Pid1], old_to_new[fact.Pid2]);
/// <summary> \copydoc AbstractLineFact.AbstractLineFact(string, string, string, FactOrganizer) </summary> /// <summary> \copydoc AbstractLineFact.AbstractLineFact(string, string, string, FactOrganizer) </summary>
public LineFact(string pid1, string pid2, string backendURI, FactOrganizer organizer) : base(pid1, pid2, backendURI, organizer) public LineFact(string pid1, string pid2, string backendURI, FactOrganizer organizer) : base(pid1, pid2, backendURI, organizer)
=> _ = this.Label; => _ = this.Label;
...@@ -211,6 +193,9 @@ public override GameObject instantiateDisplay(GameObject prefab, Transform trans ...@@ -211,6 +193,9 @@ public override GameObject instantiateDisplay(GameObject prefab, Transform trans
/// \copydoc Fact.Equivalent(Fact, Fact) /// \copydoc Fact.Equivalent(Fact, Fact)
protected override bool EquivalentWrapped(LineFact f1, LineFact f2) protected override bool EquivalentWrapped(LineFact f1, LineFact f2)
=> DependentFactsEquivalent(f1, f2); => DependentFactsEquivalent(f1, f2);
protected override Fact _ReInitializeMe(Dictionary<string, string> old_to_new, FactOrganizer organizer)
=> new LineFact(old_to_new[this.Pid1], old_to_new[this.Pid2], organizer);
} }
/// <summary> /// <summary>
...@@ -225,10 +210,6 @@ public class RayFact : AbstractLineFactWrappedCRTP<RayFact> ...@@ -225,10 +210,6 @@ public class RayFact : AbstractLineFactWrappedCRTP<RayFact>
/// <summary> \copydoc Fact.Fact </summary> /// <summary> \copydoc Fact.Fact </summary>
public RayFact() : base() { } public RayFact() : base() { }
/// <summary> \copydoc AbstractLineFact.AbstractLineFact(AbstractLineFact, Dictionary<string, string>, FactOrganizer) </summary>
public RayFact(RayFact fact, Dictionary<string, string> old_to_new, FactOrganizer organizer) : base(fact, old_to_new, organizer)
=> init(old_to_new[fact.Pid1], old_to_new[fact.Pid2]);
/// <summary> \copydoc AbstractLineFact.AbstractLineFact(string, string, string, FactOrganizer) </summary> /// <summary> \copydoc AbstractLineFact.AbstractLineFact(string, string, string, FactOrganizer) </summary>
public RayFact(string pid1, string pid2, string backendURI, FactOrganizer organizer) : base(pid1, pid2, backendURI, organizer) public RayFact(string pid1, string pid2, string backendURI, FactOrganizer organizer) : base(pid1, pid2, backendURI, organizer)
=> _ = this.Label; => _ = this.Label;
...@@ -257,9 +238,9 @@ private void init(string pid1, string pid2) ...@@ -257,9 +238,9 @@ private void init(string pid1, string pid2)
ParsingDictionary.parseTermsToId[df.ToString()] = this._URI; ParsingDictionary.parseTermsToId[df.ToString()] = this._URI;
} }
protected override void RecalulateTransform() protected override void RecalculateTransform()
{ {
base.RecalulateTransform(); base.RecalculateTransform();
LocalScale = new Vector3(1, 1, 2048); LocalScale = new Vector3(1, 1, 2048);
} }
...@@ -308,4 +289,7 @@ protected override bool EquivalentWrapped(RayFact f1, RayFact f2) ...@@ -308,4 +289,7 @@ protected override bool EquivalentWrapped(RayFact f1, RayFact f2)
return Math3d.IsPointApproximatelyOnLine(f1.Point1.Point, f1.Dir, f2.Point1.Point) return Math3d.IsPointApproximatelyOnLine(f1.Point1.Point, f1.Dir, f2.Point1.Point)
&& Math3d.IsPointApproximatelyOnLine(f1.Point1.Point, f1.Dir, f2.Point2.Point); && Math3d.IsPointApproximatelyOnLine(f1.Point1.Point, f1.Dir, f2.Point2.Point);
} }
protected override Fact _ReInitializeMe(Dictionary<string, string> old_to_new, FactOrganizer organizer)
=> new RayFact(old_to_new[this.Pid1], old_to_new[this.Pid2], organizer);
} }
This diff is collapsed.
...@@ -32,15 +32,6 @@ public class FunctionFact<T0, TResult> : FactWrappedCRTP<FunctionFact<T0, TResul ...@@ -32,15 +32,6 @@ public class FunctionFact<T0, TResult> : FactWrappedCRTP<FunctionFact<T0, TResul
/// <summary> \copydoc Fact.Fact </summary> /// <summary> \copydoc Fact.Fact </summary>
public FunctionFact() : base() { } public FunctionFact() : base() { }
/// <summary>
/// Copies <paramref name="fact"/> by initiating new MMT %Fact.
/// </summary>
/// <param name="fact">Fact to be copied</param>
/// <param name="old_to_new"><c>Dictionary</c> mapping <paramref name="fact"/>.<see cref="getDependentFactIds"/> in <paramref name="fact"/>.<see cref="Fact._Facts"/> to corresponding <see cref="Fact.Id"/> in <paramref name="organizer"/> </param>
/// <param name="organizer">sets <see cref="_Facts"/></param>
public FunctionFact(FunctionFact<T0, TResult> fact, Dictionary<string, string> old_to_new, FactOrganizer organizer) : base(fact, organizer)
=> init(fact.Function_SOMDoc.MapURIs(old_to_new), fact.Domain);
/// <summary> /// <summary>
/// Standard Constructor /// Standard Constructor
/// </summary> /// </summary>
...@@ -69,7 +60,7 @@ public FunctionFact(SOMDoc Function_SOMDoc, (T0, T0) domain, string uri, FactOrg ...@@ -69,7 +60,7 @@ public FunctionFact(SOMDoc Function_SOMDoc, (T0, T0) domain, string uri, FactOrg
this._URI = uri; this._URI = uri;
_ = this.Label; _ = this.Label;
RecalulateTransform(); RecalculateTransform();
} }
/// <summary> /// <summary>
...@@ -99,11 +90,11 @@ private void init(SOMDoc Function_SOMDoc, (T0, T0) domain) ...@@ -99,11 +90,11 @@ private void init(SOMDoc Function_SOMDoc, (T0, T0) domain)
//ParsingDictionary.parseTermsToId[df.ToString()] = _URI; //ParsingDictionary.parseTermsToId[df.ToString()] = _URI;
RecalulateTransform(); RecalculateTransform();
return; return;
} }
protected override void RecalulateTransform() { } protected override void RecalculateTransform() { }
/// \copydoc Fact.parseFact(Scroll.ScrollFact) /// \copydoc Fact.parseFact(Scroll.ScrollFact)
public new static FunctionFact<T0, TResult> parseFact(Scroll.ScrollFact fact) public new static FunctionFact<T0, TResult> parseFact(Scroll.ScrollFact fact)
...@@ -145,8 +136,11 @@ public override GameObject instantiateDisplay(GameObject prefab, Transform trans ...@@ -145,8 +136,11 @@ public override GameObject instantiateDisplay(GameObject prefab, Transform trans
/// \copydoc Fact.EquivalentWrapped /// \copydoc Fact.EquivalentWrapped
protected override bool EquivalentWrapped(FunctionFact<T0, TResult> f1, FunctionFact<T0, TResult> f2) protected override bool EquivalentWrapped(FunctionFact<T0, TResult> f1, FunctionFact<T0, TResult> f2)
//=> f1.Function_SOMDoc.Equivalent(f2.Function_SOMDoc); //=> f1.Function_SOMDoc.Equivalent(f2.Function_SOMDoc);
=> false;
// && f1.domain.Equals(f2.domain); // no! => exact instead of similar => CRTP // && f1.domain.Equals(f2.domain); // no! => exact instead of similar => CRTP
=> false;
protected override Fact _ReInitializeMe(Dictionary<string, string> old_to_new, FactOrganizer organizer)
=> new FunctionFact<T0, TResult>(this.Function_SOMDoc.MapURIs(old_to_new), this.Domain, organizer);
} }
/// <summary> /// <summary>
...@@ -158,9 +152,6 @@ public abstract class FunctionFactCRTP<CRTP, T0, TResult> : FunctionFact<T0, TRe ...@@ -158,9 +152,6 @@ public abstract class FunctionFactCRTP<CRTP, T0, TResult> : FunctionFact<T0, TRe
/// <summary> \copydoc FunctionFact.FunctionFact </summary> /// <summary> \copydoc FunctionFact.FunctionFact </summary>
protected FunctionFactCRTP() : base() { } protected FunctionFactCRTP() : base() { }
/// <summary> \copydoc FunctionFact.FunctionFact(FunctionFact{T0, TResult} fact, Dictionary{string, string} old_to_new, FactOrganizer organizer) </summary>
protected FunctionFactCRTP(FunctionFactCRTP<CRTP, T0, TResult> fact, Dictionary<string, string> old_to_new, FactOrganizer organizer) : base(fact, old_to_new, organizer) { }
/// <summary> \copydoc FunctionFact.FunctionFact(SOMDoc, Tuple{T0, T0}, FactOrganizer) </summary> /// <summary> \copydoc FunctionFact.FunctionFact(SOMDoc, Tuple{T0, T0}, FactOrganizer) </summary>
protected FunctionFactCRTP(SOMDoc Function_MMT, (T0, T0) domain, FactOrganizer organizer) : base(Function_MMT, domain, organizer) { } protected FunctionFactCRTP(SOMDoc Function_MMT, (T0, T0) domain, FactOrganizer organizer) : base(Function_MMT, domain, organizer) { }
...@@ -172,7 +163,7 @@ protected override bool EquivalentWrapped(FunctionFact<T0, TResult> f1, Function ...@@ -172,7 +163,7 @@ protected override bool EquivalentWrapped(FunctionFact<T0, TResult> f1, Function
=> EquivalentWrapped((CRTP)f1, (CRTP)f2) => EquivalentWrapped((CRTP)f1, (CRTP)f2)
&& base.EquivalentWrapped(f1, f2); && base.EquivalentWrapped(f1, f2);
/// <summary>CRTP step of <see cref="EquivalentWrapped(FunctionFact{T0, TResult}, AbstractLineFact{T0, TResult})"/></summary> /// <summary>CRTP step of <see cref="EquivalentWrapped(FunctionFact{T0, TResult}, FunctionFact{T0, TResult})"/></summary>
protected abstract bool EquivalentWrapped(CRTP f1, CRTP f2); protected abstract bool EquivalentWrapped(CRTP f1, CRTP f2);
} }
...@@ -184,9 +175,6 @@ public class FunctionFactFloat<TResult> : FunctionFactCRTP<FunctionFactFloat<TRe ...@@ -184,9 +175,6 @@ public class FunctionFactFloat<TResult> : FunctionFactCRTP<FunctionFactFloat<TRe
/// <summary> \copydoc FunctionFact.FunctionFact </summary> /// <summary> \copydoc FunctionFact.FunctionFact </summary>
public FunctionFactFloat() : base() { } public FunctionFactFloat() : base() { }
/// <summary> \copydoc FunctionFact.FunctionFact(FunctionFact{T0, TResult} fact, Dictionary{string, string} old_to_new, FactOrganizer organizer) </summary>
public FunctionFactFloat(FunctionFactFloat<TResult> fact, Dictionary<string, string> old_to_new, FactOrganizer organizer) : base(fact, old_to_new, organizer) { }
/// <summary> \copydoc FunctionFact.FunctionFact(SOMDoc, Tuple{T0, T0}, FactOrganizer) </summary> /// <summary> \copydoc FunctionFact.FunctionFact(SOMDoc, Tuple{T0, T0}, FactOrganizer) </summary>
public FunctionFactFloat(SOMDoc Function_MMT, (float, float) domain, FactOrganizer organizer) : base(Function_MMT, domain, organizer) { } public FunctionFactFloat(SOMDoc Function_MMT, (float, float) domain, FactOrganizer organizer) : base(Function_MMT, domain, organizer) { }
...@@ -198,6 +186,9 @@ protected override bool EquivalentWrapped(FunctionFactFloat<TResult> f1, Functio ...@@ -198,6 +186,9 @@ protected override bool EquivalentWrapped(FunctionFactFloat<TResult> f1, Functio
=> f1.Function_SOMDoc.Equivalent(f2.Function_SOMDoc) => f1.Function_SOMDoc.Equivalent(f2.Function_SOMDoc)
&& f1.Domain.t_0.IsApproximatelyEqual(f2.Domain.t_0) && f1.Domain.t_0.IsApproximatelyEqual(f2.Domain.t_0)
&& f1.Domain.t_n.IsApproximatelyEqual(f2.Domain.t_n); && f1.Domain.t_n.IsApproximatelyEqual(f2.Domain.t_n);
protected override Fact _ReInitializeMe(Dictionary<string, string> old_to_new, FactOrganizer organizer)
=> new FunctionFactFloat<TResult>(this.Function_SOMDoc.MapURIs(old_to_new), this.Domain, organizer);
} }
public class AttachedPositionFunction : FactWrappedCRTP<AttachedPositionFunction> public class AttachedPositionFunction : FactWrappedCRTP<AttachedPositionFunction>
...@@ -216,10 +207,6 @@ public FunctionFact<float, Vector3>[] FunctionFacts { ...@@ -216,10 +207,6 @@ public FunctionFact<float, Vector3>[] FunctionFacts {
/// <summary>\copydoc Fact.Fact()</summary> /// <summary>\copydoc Fact.Fact()</summary>
public AttachedPositionFunction() : base() { } public AttachedPositionFunction() : base() { }
/// <summary>\copydoc Fact.Fact(Fact, FactOrganizer)</summary>
public AttachedPositionFunction(AttachedPositionFunction fact, Dictionary<string, string> old_to_new, FactOrganizer organizer) : base(fact, organizer)
=> init(old_to_new[fact.fid], fact.funcids.Select(id => old_to_new[id]).ToArray());
/// <summary>\copydoc Fact.Fact(FactOrganizer)</summary> /// <summary>\copydoc Fact.Fact(FactOrganizer)</summary>
public AttachedPositionFunction(string fid, string[] funcids, FactOrganizer organizer) : base(organizer) public AttachedPositionFunction(string fid, string[] funcids, FactOrganizer organizer) : base(organizer)
=> init(fid, funcids); => init(fid, funcids);
...@@ -234,7 +221,7 @@ private void init(string fid, string[] funcids) ...@@ -234,7 +221,7 @@ private void init(string fid, string[] funcids)
//TODO: call MMT, set URI //TODO: call MMT, set URI
_URI = Fact.Id + "{" + string.Join(", ", FunctionFacts.Select(f => f.Id)) + "}"; _URI = Fact.Id + "{" + string.Join(", ", FunctionFacts.Select(f => f.Id)) + "}";
RecalulateTransform(); RecalculateTransform();
} }
protected AttachedPositionFunction(string fid, string[] funcids, string uri, FactOrganizer organizer) : base(organizer) protected AttachedPositionFunction(string fid, string[] funcids, string uri, FactOrganizer organizer) : base(organizer)
...@@ -246,7 +233,7 @@ protected AttachedPositionFunction(string fid, string[] funcids, string uri, Fac ...@@ -246,7 +233,7 @@ protected AttachedPositionFunction(string fid, string[] funcids, string uri, Fac
_URI = uri; _URI = uri;
RecalulateTransform(); RecalculateTransform();
} }
public new static AttachedPositionFunction parseFact(Scroll.ScrollFact fact) public new static AttachedPositionFunction parseFact(Scroll.ScrollFact fact)
...@@ -290,10 +277,13 @@ public override GameObject instantiateDisplay(GameObject prefab, Transform trans ...@@ -290,10 +277,13 @@ public override GameObject instantiateDisplay(GameObject prefab, Transform trans
protected override bool EquivalentWrapped(AttachedPositionFunction f1, AttachedPositionFunction f2) protected override bool EquivalentWrapped(AttachedPositionFunction f1, AttachedPositionFunction f2)
=> DependentFactsEquivalent(f1, f2); => DependentFactsEquivalent(f1, f2);
protected override void RecalulateTransform() protected override void RecalculateTransform()
{ {
Position = Fact.Position; Position = Fact.Position;
Rotation = Fact.Rotation; Rotation = Fact.Rotation;
LocalScale = Fact.LocalScale; LocalScale = Fact.LocalScale;
} }
protected override Fact _ReInitializeMe(Dictionary<string, string> old_to_new, FactOrganizer organizer)
=> new AttachedPositionFunction(old_to_new[this.fid], this.funcids.Select(id => old_to_new[id]).ToArray(), organizer);
} }
...@@ -163,4 +163,7 @@ SolutionOrganizer IJSONsavable<SolutionOrganizer>._IJPostProcess(SolutionOrganiz ...@@ -163,4 +163,7 @@ SolutionOrganizer IJSONsavable<SolutionOrganizer>._IJPostProcess(SolutionOrganiz
return payload; return payload;
} }
SolutionOrganizer IJSONsavable<SolutionOrganizer>._IJPreProcess(SolutionOrganizer payload)
=> (SolutionOrganizer)IJSONsavable<FactOrganizer>.preprocess(payload);
} }
...@@ -50,7 +50,7 @@ public void NewExecutingInstance() ...@@ -50,7 +50,7 @@ public void NewExecutingInstance()
return; return;
AttachedPositionFunctionBehaviour cloneComp = AttachedPositionFunctionBehaviour cloneComp =
GameObject.Instantiate(gameObject, gameObject.transform) GameObject.Instantiate(gameObject)//, gameObject.transform)
.GetComponent<AttachedPositionFunctionBehaviour>(); .GetComponent<AttachedPositionFunctionBehaviour>();
cloneComp.Start(); cloneComp.Start();
cloneComp.original = false; cloneComp.original = false;
......
...@@ -19,7 +19,7 @@ public void setAngle(float angle) ...@@ -19,7 +19,7 @@ public void setAngle(float angle)
private void CreateSegment(float angle, float radius) private void CreateSegment(float angle, float radius)
{ {
float absoluteAngle = Mathf.Abs(angle); float absoluteAngle = angle == 0f ? (float) Math3d.vectorPrecission : Mathf.Abs(angle);
List<Vector3> verticeList = new List<Vector3>(); List<Vector3> verticeList = new List<Vector3>();
List<int> triangleList = new List<int>(); List<int> triangleList = new List<int>();
......
...@@ -367,8 +367,7 @@ public static bool WriteToJsonFile(string filePath, object objectToWrite) ...@@ -367,8 +367,7 @@ public static bool WriteToJsonFile(string filePath, object objectToWrite)
} }
finally finally
{ {
if (writer != null) writer?.Close();
writer.Close();
} }
} }
...@@ -398,8 +397,7 @@ public static bool WriteToJsonFile(string filePath, object objectToWrite) ...@@ -398,8 +397,7 @@ public static bool WriteToJsonFile(string filePath, object objectToWrite)
} }
finally finally
{ {
if (reader != null) reader?.Close();
reader.Close();
} }
} }
......
This diff is collapsed.
{ {"category":"Demo Category","number":1,"description":"Tree Stage","scene":"RiverWorld","use_install_folder":true,"solution":{"ValidationSet":[{"MasterIDs":["http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact9"],"SolutionIndex":[],"RelationIndex":[],"ComparerString":"LineFactHightDirectionComparer"}],"WorkflowGadgetDict":{"-1":null},"FactDict":{"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact7":{"s_type":"PointFact","Point":{"x":0.0,"y":0.0,"z":0.0,"magnitude":0.0,"sqrMagnitude":0.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact7","Label":"A","hasCustomLabel":false,"LabelId":1},"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact8":{"s_type":"PointFact","Point":{"x":0.0,"y":6.0,"z":0.0,"normalized":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"magnitude":6.0,"sqrMagnitude":36.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact8","Label":"B","hasCustomLabel":false,"LabelId":2},"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact9":{"s_type":"LineFact","Distance":6.0,"Pid1":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact7","Pid2":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact8","Dir":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact9","Label":"[AB]","hasCustomLabel":false,"LabelId":0}},"MetaInf":{"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact7":{"workflow_id":0,"active":true},"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact8":{"workflow_id":1,"active":true},"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact9":{"workflow_id":2,"active":true}},"Workflow":[{"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact7","samestep":false,"steplink":3,"creation":true,"gadget_rank":-1,"scroll_label":null,"GadgetFlow":[],"GadgetTime":0.0},{"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact8","samestep":true,"steplink":0,"creation":true,"gadget_rank":-1,"scroll_label":null,"GadgetFlow":[],"GadgetTime":0.0},{"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact9","samestep":true,"steplink":0,"creation":true,"gadget_rank":-1,"scroll_label":null,"GadgetFlow":[],"GadgetTime":0.0}],"marker":3,"worksteps":1,"backlog":0,"soft_resetted":false,"invoke":true,"MaxLabelId":2,"UnusedLabelIds":[],"name":null,"path":null},"solution_approches":[],"AllowedScrolls":null,"AllowedGadgets":null,"name":"TechDemo A","path":null}
"category": "Demo Category", \ No newline at end of file
"number": 1,
"description": "Tree Stage",
"scene": "RiverWorld",
"use_install_folder": true,
"solution": {
"ValidationSet": [
{
"MasterIDs": [
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1620"
],
"SolutionIndex": [],
"RelationIndex": [],
"ComparerString": "LineFactHightDirectionComparer"
}
],
"ExposedSolutionFacts": [],
"WorkflowGadgetDict": {
"-1": null
},
"MetaInf": {
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1618": {
"workflow_id": 0,
"active": true,
"isImmutable": false
},
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1619": {
"workflow_id": 1,
"active": true,
"isImmutable": false
},
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1620": {
"workflow_id": 2,
"active": true,
"isImmutable": false
}
},
"Workflow": [
{
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1618",
"samestep": false,
"steplink": 3,
"creation": true,
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.541088400001172
},
{
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1619",
"samestep": true,
"steplink": 0,
"creation": true,
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.541088400001172
},
{
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1620",
"samestep": true,
"steplink": 0,
"creation": true,
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.541088400001172
}
],
"marker": 3,
"worksteps": 1,
"backlog": 0,
"soft_resetted": false,
"invoke": true,
"MaxLabelId": 2,
"UnusedLabelIds": [],
"JsonFactSpace": {
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1618": {
"Point": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"magnitude": 0.0,
"sqrMagnitude": 0.0
},
"Normal": {
"x": 0.0,
"y": 1.0,
"z": 0.0,
"magnitude": 1.0,
"sqrMagnitude": 1.0
},
"s_type": "PointFact",
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1618",
"Label": "A",
"hasCustomLabel": false,
"LabelId": 1
},
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1619": {
"Point": {
"x": 0.0,
"y": 6.0,
"z": 0.0,
"normalized": {
"x": 0.0,
"y": 1.0,
"z": 0.0,
"magnitude": 1.0,
"sqrMagnitude": 1.0
},
"magnitude": 6.0,
"sqrMagnitude": 36.0
},
"Normal": {
"x": 0.0,
"y": 1.0,
"z": 0.0,
"magnitude": 1.0,
"sqrMagnitude": 1.0
},
"s_type": "PointFact",
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1619",
"Label": "B",
"hasCustomLabel": false,
"LabelId": 2
},
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1620": {
"s_type": "LineFact",
"Pid1": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1618",
"Pid2": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1619",
"Dir": {
"x": 0.0,
"y": -1.0,
"z": 0.0,
"magnitude": 1.0,
"sqrMagnitude": 1.0
},
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1620",
"Label": "[AB]",
"hasCustomLabel": false,
"LabelId": 0
}
},
"name": null,
"path": null
},
"solution_approches": [],
"AllowedScrolls": null,
"AllowedGadgets": null,
"name": "TechDemo A",
"path": null
}
\ No newline at end of file
{ {"category":"Demo Category","number":2,"description":"River Stage","scene":"RiverWorld","use_install_folder":true,"solution":{"ValidationSet":[{"MasterIDs":["http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact12"],"SolutionIndex":[],"RelationIndex":[],"ComparerString":"LineFactHightDirectionComparer"},{"MasterIDs":["http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact12"],"SolutionIndex":[],"RelationIndex":[],"ComparerString":"LineSpanningOverRiverWorldComparer"},{"MasterIDs":[],"SolutionIndex":[1],"RelationIndex":[0],"ComparerString":"LineFactHightComparer"}],"WorkflowGadgetDict":{"-1":null},"FactDict":{"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact10":{"s_type":"PointFact","Point":{"x":0.0,"y":0.0,"z":0.0,"magnitude":0.0,"sqrMagnitude":0.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact10","Label":"A","hasCustomLabel":false,"LabelId":1},"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact11":{"s_type":"PointFact","Point":{"x":0.0,"y":6.0,"z":0.0,"normalized":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"magnitude":6.0,"sqrMagnitude":36.0},"Normal":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact11","Label":"B","hasCustomLabel":false,"LabelId":2},"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact12":{"s_type":"LineFact","Distance":6.0,"Pid1":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact10","Pid2":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact11","Dir":{"x":0.0,"y":1.0,"z":0.0,"magnitude":1.0,"sqrMagnitude":1.0},"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact12","Label":"[AB]","hasCustomLabel":false,"LabelId":0}},"MetaInf":{"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact10":{"workflow_id":0,"active":true},"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact11":{"workflow_id":1,"active":true},"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact12":{"workflow_id":2,"active":true}},"Workflow":[{"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact10","samestep":false,"steplink":3,"creation":true,"gadget_rank":-1,"scroll_label":null,"GadgetFlow":[],"GadgetTime":0.0},{"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact11","samestep":true,"steplink":0,"creation":true,"gadget_rank":-1,"scroll_label":null,"GadgetFlow":[],"GadgetTime":0.0},{"Id":"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact12","samestep":true,"steplink":0,"creation":true,"gadget_rank":-1,"scroll_label":null,"GadgetFlow":[],"GadgetTime":0.0}],"marker":3,"worksteps":1,"backlog":0,"soft_resetted":false,"invoke":true,"MaxLabelId":2,"UnusedLabelIds":[],"name":null,"path":null},"solution_approches":[],"AllowedScrolls":["OppositeLen","AngleSum","Pythagoras","CircleScroll","CircleAreaScroll","ConeVolumeScroll","TruncatedConeVolumeScroll","CylinderVolumeScroll","MidPoint","CircleLineAngleScroll","CircleLineAngleToAngle","SupplementaryAngles"],"AllowedGadgets":[{"s_type":"Pointer","Rank":1,"UiName":"Pointer","MaxRange":"Infinity","MaxHeight":"Infinity","ButtonIndx":1,"MaterialIndx":0,"IgnoreLayerMask":{"value":7682},"SecondaryLayerMask":{"value":0},"Workflow":[]},{"s_type":"Tape","Rank":2,"UiName":"Tape","MaxRange":2.5,"MaxHeight":2.5,"ButtonIndx":2,"MaterialIndx":0,"IgnoreLayerMask":{"value":129538},"SecondaryLayerMask":{"value":0},"Workflow":[]},{"s_type":"AngleTool","Rank":3,"UiName":"Angle Tool","MaxRange":"Infinity","MaxHeight":"Infinity","ButtonIndx":3,"MaterialIndx":1,"IgnoreLayerMask":{"value":129538},"SecondaryLayerMask":{"value":0},"Workflow":[]},{"s_type":"LineTool","Rank":4,"UiName":"Line Tool","MaxRange":"Infinity","MaxHeight":"Infinity","ButtonIndx":4,"MaterialIndx":0,"IgnoreLayerMask":{"value":129538},"SecondaryLayerMask":{"value":0},"Workflow":[]},{"s_type":"LotTool","Rank":5,"UiName":"Lot Tool","MaxRange":"Infinity","MaxHeight":"Infinity","ButtonIndx":5,"MaterialIndx":0,"IgnoreLayerMask":{"value":102914},"SecondaryLayerMask":{"value":0},"Workflow":[]},{"s_type":"Pendulum","Rank":6,"UiName":"Pendulum","MaxRange":"Infinity","MaxHeight":"Infinity","ButtonIndx":6,"MaterialIndx":0,"IgnoreLayerMask":{"value":129538},"SecondaryLayerMask":{"value":1},"Workflow":[]},{"s_type":"Remover","Rank":8,"UiName":"Delete Fact","MaxRange":"Infinity","MaxHeight":"Infinity","ButtonIndx":8,"MaterialIndx":0,"IgnoreLayerMask":{"value":66067},"SecondaryLayerMask":{"value":0},"Workflow":[]},{"s_type":"EqualCircles","Rank":9,"UiName":"Not Defined","MaxRange":"Infinity","MaxHeight":"Infinity","ButtonIndx":9,"MaterialIndx":0,"IgnoreLayerMask":{"value":0},"SecondaryLayerMask":{"value":0},"Workflow":[]}],"name":"TechDemo B","path":null}
"category": "Demo Category", \ No newline at end of file
"number": 2,
"description": "River Stage",
"scene": "RiverWorld",
"use_install_folder": true,
"solution": {
"ValidationSet": [
{
"MasterIDs": [
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1623"
],
"SolutionIndex": [],
"RelationIndex": [],
"ComparerString": "LineFactHightDirectionComparer"
},
{
"MasterIDs": [
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1623"
],
"SolutionIndex": [],
"RelationIndex": [],
"ComparerString": "LineSpanningOverRiverWorldComparer"
},
{
"MasterIDs": [],
"SolutionIndex": [
1
],
"RelationIndex": [
0
],
"ComparerString": "LineFactHightComparer"
}
],
"ExposedSolutionFacts": [],
"WorkflowGadgetDict": {
"-1": null
},
"MetaInf": {
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1621": {
"workflow_id": 0,
"active": true,
"isImmutable": false
},
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1622": {
"workflow_id": 1,
"active": true,
"isImmutable": false
},
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1623": {
"workflow_id": 2,
"active": true,
"isImmutable": false
}
},
"Workflow": [
{
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1621",
"samestep": false,
"steplink": 3,
"creation": true,
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.541088400001172
},
{
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1622",
"samestep": true,
"steplink": 0,
"creation": true,
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.541088400001172
},
{
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1623",
"samestep": true,
"steplink": 0,
"creation": true,
"gadget_rank": -1,
"scroll_label": null,
"GadgetFlow": [],
"GadgetTime": 0.541088400001172
}
],
"marker": 3,
"worksteps": 1,
"backlog": 0,
"soft_resetted": false,
"invoke": true,
"MaxLabelId": 2,
"UnusedLabelIds": [],
"JsonFactSpace": {
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1621": {
"Point": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"magnitude": 0.0,
"sqrMagnitude": 0.0
},
"Normal": {
"x": 0.0,
"y": 1.0,
"z": 0.0,
"magnitude": 1.0,
"sqrMagnitude": 1.0
},
"s_type": "PointFact",
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1621",
"Label": "A",
"hasCustomLabel": false,
"LabelId": 1
},
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1622": {
"Point": {
"x": 0.0,
"y": 6.0,
"z": 0.0,
"normalized": {
"x": 0.0,
"y": 1.0,
"z": 0.0,
"magnitude": 1.0,
"sqrMagnitude": 1.0
},
"magnitude": 6.0,
"sqrMagnitude": 36.0
},
"Normal": {
"x": 0.0,
"y": 1.0,
"z": 0.0,
"magnitude": 1.0,
"sqrMagnitude": 1.0
},
"s_type": "PointFact",
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1622",
"Label": "B",
"hasCustomLabel": false,
"LabelId": 2
},
"http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1623": {
"s_type": "LineFact",
"Pid1": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1621",
"Pid2": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1622",
"Dir": {
"x": 0.0,
"y": -1.0,
"z": 0.0,
"magnitude": 1.0,
"sqrMagnitude": 1.0
},
"Id": "http://mathhub.info/FrameIT/frameworld?DefaultSituationSpace/SituationTheory1?fact1623",
"Label": "[AB]",
"hasCustomLabel": false,
"LabelId": 0
}
},
"name": null,
"path": null
},
"solution_approches": [],
"AllowedScrolls": [
"OppositeLen"
],
"AllowedGadgets": [
{
"s_type": "Pointer",
"Rank": 1,
"UiName": "Pointer",
"MaxRange": "Infinity",
"MaxHeight": "Infinity",
"ButtonIndx": 1,
"MaterialIndx": 0,
"IgnoreLayerMask": {
"value": 269858
},
"SecondaryLayerMask": {
"value": 0
},
"Workflow": []
},
{
"s_type": "Tape",
"Rank": 2,
"UiName": "Tape",
"MaxRange": 2.5,
"MaxHeight": 2.5,
"ButtonIndx": 2,
"MaterialIndx": 0,
"IgnoreLayerMask": {
"value": 391714
},
"SecondaryLayerMask": {
"value": 0
},
"Workflow": []
},
{
"s_type": "AngleTool",
"Rank": 3,
"UiName": "Angle Tool",
"MaxRange": "Infinity",
"MaxHeight": "Infinity",
"ButtonIndx": 3,
"MaterialIndx": 1,
"IgnoreLayerMask": {
"value": 391718
},
"SecondaryLayerMask": {
"value": 0
},
"Workflow": []
},
{
"s_type": "LineTool",
"Rank": 4,
"UiName": "Line Tool",
"MaxRange": "Infinity",
"MaxHeight": "Infinity",
"ButtonIndx": 4,
"MaterialIndx": 0,
"IgnoreLayerMask": {
"value": 391714
},
"SecondaryLayerMask": {
"value": 0
},
"Workflow": []
},
{
"s_type": "LotTool",
"Rank": 5,
"UiName": "Lot Tool",
"MaxRange": "Infinity",
"MaxHeight": "Infinity",
"ButtonIndx": 5,
"MaterialIndx": 0,
"IgnoreLayerMask": {
"value": 365090
},
"SecondaryLayerMask": {
"value": 0
},
"Workflow": []
},
{
"s_type": "Pendulum",
"Rank": 6,
"UiName": "Pendulum",
"MaxRange": "Infinity",
"MaxHeight": "Infinity",
"ButtonIndx": 6,
"MaterialIndx": 0,
"IgnoreLayerMask": {
"value": 391714
},
"SecondaryLayerMask": {
"value": 1
},
"Workflow": []
},
{
"s_type": "Remover",
"Rank": 8,
"UiName": "Delete Fact",
"MaxRange": "Infinity",
"MaxHeight": "Infinity",
"ButtonIndx": 8,
"MaterialIndx": 0,
"IgnoreLayerMask": {
"value": 328243
},
"SecondaryLayerMask": {
"value": 0
},
"Workflow": []
}
],
"name": "TechDemo B",
"path": null
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment