Skip to content
Snippets Groups Projects
Commit 47adaf93 authored by Tobias Schöner's avatar Tobias Schöner
Browse files

Merge branch 'marcel' of https://github.com/UFrameIT/UFrameIT into marcel

parents e3e74855 964e953b
Branches
No related tags found
1 merge request!1feat: added visualisation for CircleFact; added Torus- and ConeGenerator
...@@ -38,7 +38,7 @@ RenderSettings: ...@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.4410865, g: 0.48984045, b: 0.5699203, a: 1} m_IndirectSpecularColor: {r: 0.4410664, g: 0.4898227, b: 0.5699191, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
...@@ -57707,6 +57707,12 @@ PrefabInstance: ...@@ -57707,6 +57707,12 @@ PrefabInstance:
value: value:
objectReference: {fileID: 8156936215466465834, guid: b6f35afcaff5d8a40bf8f792eb3299e6, objectReference: {fileID: 8156936215466465834, guid: b6f35afcaff5d8a40bf8f792eb3299e6,
type: 3} type: 3}
- target: {fileID: 3020720019460506146, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: prefab_CylinderVolume
value:
objectReference: {fileID: 4509982228914264782, guid: 09974a8b56c29434a9c32f1adc92d705,
type: 3}
- target: {fileID: 3020720019460506146, guid: b07552db700124a4680401e6fb94c186, - target: {fileID: 3020720019460506146, guid: b07552db700124a4680401e6fb94c186,
type: 3} type: 3}
propertyPath: prefab_AngleCircleLineFact propertyPath: prefab_AngleCircleLineFact
...@@ -32,7 +32,8 @@ public class ParsingDictionary { ...@@ -32,7 +32,8 @@ public class ParsingDictionary {
{MMTURIs.OrthoCircleLine, OrthogonalCircleLineFact.parseFact }, {MMTURIs.OrthoCircleLine, OrthogonalCircleLineFact.parseFact },
{MMTURIs.VolumeCone ,ConeVolumeFact.parseFact }, {MMTURIs.VolumeCone ,ConeVolumeFact.parseFact },
{MMTURIs.TruncatedVolumeCone ,TruncatedConeVolumeFact.parseFact }, {MMTURIs.TruncatedVolumeCone ,TruncatedConeVolumeFact.parseFact },
{MMTURIs.RightAngle, RightAngleFact.parseFact } {MMTURIs.RightAngle, RightAngleFact.parseFact },
{MMTURIs.CylinderVolume, CylinderVolumeFact.parseFact }
...@@ -3331,3 +3332,202 @@ protected override bool EquivalentWrapped(RightAngleFact f1, RightAngleFact f2) ...@@ -3331,3 +3332,202 @@ protected override bool EquivalentWrapped(RightAngleFact f1, RightAngleFact f2)
} }
/// <summary>
/// The volume of a cylinder defined by a base area <see cref="CircleFact">CircleFact</see>, a top area <see cref="CircleFact">CircleFact</see> and the volume as float
/// </summary>
public class CylinderVolumeFact : FactWrappedCRTP<CylinderVolumeFact>
{
/// <summary> a <see cref="CircleFact">CircleFact</see> describing the base area </summary>
public string Cid1;
/// <summary> a <see cref="CircleFact">CircleFact</see> describing the top area </summary>
public string Cid2;
/// <summary> the volume of the cylinder as a float </summary>
public float vol;
/// <summary> OMA proof that the two circles are parallel </summary>
public OMA proof;
/// <summary> \copydoc Fact.Fact </summary>
public CylinderVolumeFact() : base()
{
this.Cid1 = null;
this.Cid2 = null;
this.vol = 0.0f;
this.proof = null;
}
/// <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 CylinderVolumeFact(CylinderVolumeFact fact, Dictionary<string, string> old_to_new, FactOrganizer organizer) : base(fact, organizer)
{
init(old_to_new[fact.Cid1], old_to_new[fact.Cid2], fact.vol, fact.proof);
}
/// <summary>
/// Standard Constructor
/// </summary>
/// <param name="cid1">sets <see cref="Cid1"/></param>
/// <param name="cid2">sets <see cref="Cid2"/></param>
/// <param name="vol">sets <see cref="vol"/></param>
/// <param name="proof">sets <see cref="proof"/></param>
/// <param name="organizer">sets <see cref="Fact._Facts"/></param>
public CylinderVolumeFact(string cid1, string cid2, float vol, OMA proof, FactOrganizer organizer) : base(organizer)
{
init(cid1, cid2, vol, proof);
}
/// <summary>
/// sets variables and generates MMT Declaration
/// </summary>
/// <param name="cid1">sets <see cref="Cid1"/></param>
/// <param name="cid2">sets <see cref="Cid2"/></param>
/// <param name="vol">sets <see cref="vol"/></param>
/// <param name="proof">sets <see cref="proof"/></param>
private void init(string cid1, string cid2, float vol, OMA proof)
{
this.Cid1 = cid1;
this.Cid2 = cid2;
this.proof = proof;
CircleFact cf1 = _Facts[cid1] as CircleFact;
CircleFact cf2 = _Facts[cid2] as CircleFact;
this.vol = vol;
MMTDeclaration mmtDecl;
string c1URI = cf1.Id;
string c2URI = cf2.Id;
mmtDecl = generateMMTDeclaration(c1URI, c2URI, vol, proof);
AddFactResponse.sendAdd(mmtDecl, out this._URI);
}
/// <summary>
/// Bypasses initialization of new MMT %Fact by using existend URI, _which is not checked for existence_.
/// </summary>
/// <param name="Cid1">sets <see cref="Cid1"/></param>
/// <param name="Cid2">sets <see cref="Cid2"/></param>
/// <param name="volume">sets <see cref="vol"/></param>
/// <param name="proof">sets <see cref="proof"/></param>
/// <param name="backendURI">MMT URI</param>
/// <param name="organizer">sets <see cref="Fact._Facts"/></param>
public CylinderVolumeFact(string Cid1, string Cid2, float volume, OMA proof, string backendURI, FactOrganizer organizer) : base(organizer)
{
this.Cid1 = Cid1;
this.Cid2 = Cid2;
this.vol = volume;
this.proof = proof;
this._URI = backendURI;
_ = this.Label;
}
/// \copydoc Fact.parseFact(Scroll.ScrollFact)
public new static CylinderVolumeFact parseFact(Scroll.ScrollFact fact)
{
string uri = fact.@ref.uri;
string Circle1Uri = ((OMS)((OMA)((OMA)((Scroll.ScrollValueFact)fact).lhs).arguments[0]).arguments[0]).uri;
string Circle2Uri = ((OMS)((OMA)((OMA)((Scroll.ScrollValueFact)fact).lhs).arguments[0]).arguments[1]).uri;
float volume = ((OMF)((Scroll.ScrollValueFact)fact).value).f;
OMA proof = (OMA)(((OMA)((OMA)((Scroll.ScrollValueFact)fact).lhs).arguments[0]).arguments[2]);
if (StageStatic.stage.factState.ContainsKey(Circle1Uri) && StageStatic.stage.factState.ContainsKey(Circle2Uri))
return new CylinderVolumeFact(Circle1Uri, Circle2Uri, volume, proof, uri, StageStatic.stage.factState);
else //If dependent facts do not exist return null
return null;
}
/// \copydoc Fact.generateLabel
protected override string generateLabel()
{
return "V(" + _Facts[Cid1].Label + "," + _Facts[Cid2].Label + ")";
}
/// <summary>
/// Constructs struct for not-right-angled MMT %Fact <see cref="AddFactResponse"/>
/// </summary>
/// <param name="c1URI"> Uri for <see cref="Cid1"/></param>
/// <param name="c2URI"> Uri for <see cref="Cid2"/></param>
/// <param name="val"> <see cref="vol"/></param>
/// <returns>struct for <see cref="AddFactResponse"/></returns>
private MMTDeclaration generateMMTDeclaration(string c1URI, string c2URI, float val, OMA proof)
{
MMTTerm lhs =
new OMA(
new OMS(MMTURIs.CylinderVolume),
new List<MMTTerm> {
new OMS(c1URI),
new OMS(c2URI),
proof,
}
);
MMTTerm valueTp = new OMS(MMTURIs.RealLit);
MMTTerm value = new OMF(val);
return new MMTValueDeclaration(this.Label, lhs, valueTp, value);
}
/// \copydoc Fact.hasDependentFacts
public override Boolean hasDependentFacts()
{
return true;
}
/// \copydoc Fact.getDependentFactIds
public override string[] getDependentFactIds()
{
return new string[] { Cid1, Cid2 };
}
/// \copydoc Fact.instantiateDisplay(GameObject, Transform)
public override GameObject instantiateDisplay(GameObject prefab, Transform transform)
{
var obj = GameObject.Instantiate(prefab, Vector3.zero, Quaternion.identity, transform);
obj.transform.GetChild(0).gameObject.GetComponent<TextMeshProUGUI>().text = _Facts[this.Cid1].Label + _Facts[this.Cid2].Label;
obj.GetComponent<FactWrapper>().fact = this;
return obj;
}
/// \copydoc Fact.GetHashCode
/// uhhh is this a problem?
public override int GetHashCode()
{
return this.Cid1.GetHashCode() ^ this.Cid2.GetHashCode();
}
/// \copydoc Fact.Equivalent(Fact, Fact)
protected override bool EquivalentWrapped(CylinderVolumeFact f1, CylinderVolumeFact f2)
{
if (f1.Cid1 == f2.Cid1 && f1.Cid2 == f2.Cid2)
return true;
CircleFact c1f1 = (CircleFact)_Facts[f1.Cid1];
CircleFact c1f2 = (CircleFact)_Facts[f2.Cid1];
CircleFact c2f1 = (CircleFact)_Facts[f1.Cid2];
CircleFact c2f2 = (CircleFact)_Facts[f2.Cid2];
return (c1f1.Equivalent(c1f2) && c2f1.Equivalent(c2f2) && f1.vol == f2.vol);
}
}
...@@ -166,6 +166,7 @@ void Update() ...@@ -166,6 +166,7 @@ void Update()
else if (multipleHits[i].collider.gameObject.layer == LayerMask.NameToLayer("Ring")) else if (multipleHits[i].collider.gameObject.layer == LayerMask.NameToLayer("Ring"))
{ {
#region Ring #region Ring
Debug.Log("PRINT");
var id = multipleHits[i].transform.GetComponent<FactObject>().URI; var id = multipleHits[i].transform.GetComponent<FactObject>().URI;
CircleFact circleFact = StageStatic.stage.factState[id] as CircleFact; CircleFact circleFact = StageStatic.stage.factState[id] as CircleFact;
Vector3 middlePoint = ((PointFact)StageStatic.stage.factState[circleFact.Pid1]).Point; Vector3 middlePoint = ((PointFact)StageStatic.stage.factState[circleFact.Pid1]).Point;
......
...@@ -24,6 +24,7 @@ public class DisplayFacts : MonoBehaviour ...@@ -24,6 +24,7 @@ public class DisplayFacts : MonoBehaviour
public GameObject prefab_OrthogonalCircleLine; public GameObject prefab_OrthogonalCircleLine;
public GameObject prefab_TruncatedConeVolume; public GameObject prefab_TruncatedConeVolume;
public GameObject prefab_RightAngle; public GameObject prefab_RightAngle;
public GameObject prefab_CylinderVolume;
...@@ -57,6 +58,7 @@ void Start() ...@@ -57,6 +58,7 @@ void Start()
{typeof(OrthogonalCircleLineFact), prefab_OrthogonalCircleLine }, {typeof(OrthogonalCircleLineFact), prefab_OrthogonalCircleLine },
{typeof(TruncatedConeVolumeFact), prefab_TruncatedConeVolume }, {typeof(TruncatedConeVolumeFact), prefab_TruncatedConeVolume },
{typeof(RightAngleFact), prefab_RightAngle }, {typeof(RightAngleFact), prefab_RightAngle },
{typeof(CylinderVolumeFact), prefab_CylinderVolume},
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using static JSONManager; using static JSONManager;
public class Scroll public class Scroll
{ {
public string @ref; public string @ref;
......
...@@ -25,29 +25,31 @@ public class MMTURICollection ...@@ -25,29 +25,31 @@ public class MMTURICollection
public string RealLit = "http://mathhub.info/MitM/Foundation?RealLiterals?real_lit"; public string RealLit = "http://mathhub.info/MitM/Foundation?RealLiterals?real_lit";
public string ParallelLine = "http://mathhub.info/MitM/core/geometry?Geometry/Common?parallelLine"; public string ParallelLine = "http://mathhub.info/MitM/core/geometry?Geometry/Common?parallelLine";
// public string RectangleFact = "http://mathhub.info/FrameIT/frameworld?FrameITRectangles?rectangle_type"; // public string RectangleFact = "http://mathhub.info/FrameIT/frameworld?FrameITRectangles?rectangleType";
// public string RectangleFactmk = "http://mathhub.info/FrameIT/frameworld?FrameITRectangles?mk_rectangle"; // public string RectangleFactmk = "http://mathhub.info/FrameIT/frameworld?FrameITRectangles?mkRectangle";
public string CircleType3d = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?circle_type_3d"; public string CircleType3d = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?circleType3D";
public string MkCircle3d = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?circle_basic_definition_3d"; public string MkCircle3d = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?circle3D";
public string TriangleMiddlePoint = "http://mathhub.info/FrameIT/frameworld?FrameITTriangles?triangle_mid_point_wrapper"; public string TriangleMiddlePoint = "http://mathhub.info/FrameIT/frameworld?FrameITTriangles?triangleMidPointWrapper";
public string RadiusCircleMetric = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?circle_radius"; public string RadiusCircleMetric = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?circleRadius";
public string AreaCircle = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?area_circle"; public string AreaCircle = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?areaCircle";
public string VolumeCone = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?volume_cone"; public string VolumeCone = "http://mathhub.info/FrameIT/frameworld?FrameITCone?volumeCone";
public string ConeOfCircleApex = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?circle_cone_of"; public string ConeOfCircleApex = "http://mathhub.info/FrameIT/frameworld?FrameITCone?circleConeOf";
public string ParametrizedPlane = "http://mathhub.info/MitM/core/geometry?Geometry/Planes?ParametrizedPlane"; public string ParametrizedPlane = "http://mathhub.info/MitM/core/geometry?Geometry/Planes?ParametrizedPlane";
public string pointNormalPlane = "http://mathhub.info/MitM/core/geometry?Geometry/Planes?pointNormalPlane"; public string pointNormalPlane = "http://mathhub.info/MitM/core/geometry?Geometry/Planes?pointNormalPlane";
public string OnCircle = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?point_on_circle"; public string OnCircle = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?pointOnCircle";
public string AnglePlaneLine = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?angle_circle_line"; public string AnglePlaneLine = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?angleCircleLine";
public string OrthoCircleLine = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?orthogonal_circle_line"; public string OrthoCircleLine ="http://mathhub.info/FrameIT/frameworld?FrameITCircle?orthogonalCircleLine";
public string TruncatedVolumeCone = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?truncated_cone_volume"; public string TruncatedVolumeCone = "http://mathhub.info/FrameIT/frameworld?FrameITCone?truncatedConeVolume";
public string ParallelCircles = "http://mathhub.info/FrameIT/frameworld?FrameITTheories?parallelCircles"; public string CylinderVolume = "http://mathhub.info/FrameIT/frameworld?FrameITCylinder?cylinderVolume";
public string RightAngle = "http://mathhub.info/FrameIT/frameworld?FrameITBasics?right_angle";
public string ParallelCircles = "http://mathhub.info/FrameIT/frameworld?FrameITCone?parallelCircles";
public string RightAngle = "http://mathhub.info/FrameIT/frameworld?FrameITBasics?rightAngle";
......
...@@ -32,11 +32,6 @@ ...@@ -32,11 +32,6 @@
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "lightmapping.autoUnwrapLightmapUV", "key": "lightmapping.autoUnwrapLightmapUV",
"value": "{\"m_Value\":true}" "value": "{\"m_Value\":true}"
},
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "editor.autoRecalculateCollisions",
"value": "{\"m_Value\":false}"
} }
] ]
} }
......
...@@ -18,10 +18,10 @@ EditorUserSettings: ...@@ -18,10 +18,10 @@ EditorUserSettings:
value: 22424703114646680e0b0227036c721518021d39631b32313f3d2e30f0e53136acf238e0f323 value: 22424703114646680e0b0227036c721518021d39631b32313f3d2e30f0e53136acf238e0f323
flags: 0 flags: 0
RecentlyUsedScenePath-4: RecentlyUsedScenePath-4:
value: 22424703114646680e0b0227036c721518021d39630527392304183df7e57a2decee22f0 value: 22424703114646680e0b0227036c681f041b1c39631a2f26283b2a3cf0ec3076f7e93ffdfe
flags: 0 flags: 0
RecentlyUsedScenePath-5: RecentlyUsedScenePath-5:
value: 22424703114646680e0b0227036c681f041b1c39631a2f26283b2a3cf0ec3076f7e93ffdfe value: 22424703114646680e0b0227036c721518021d39630527392304183df7e57a2decee22f0
flags: 0 flags: 0
vcSharedLogLevel: vcSharedLogLevel:
value: 0d5e400f0650 value: 0d5e400f0650
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment