Skip to content
Snippets Groups Projects
Commit 83914da1 authored by Paul-Walcher's avatar Paul-Walcher
Browse files

Reapply "Renamed SquareFact to RectangleFact"

This reverts commit 03b32df1.
parent 03b32df1
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ GameObject:
- component: {fileID: 1812690906255965161}
- component: {fileID: 6950663371922587874}
m_Layer: 15
m_Name: Square
m_Name: Rectangle
m_TagString: Selectable
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......
......@@ -60623,6 +60623,12 @@ PrefabInstance:
value:
objectReference: {fileID: 6839596689016440457, guid: 3053a4bcf6f3c7c45ad438b69ffcde9b,
type: 3}
- target: {fileID: 2872381745209199267, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: Rectangle
value:
objectReference: {fileID: 6839596689016440457, guid: 3053a4bcf6f3c7c45ad438b69ffcde9b,
type: 3}
- target: {fileID: 2872381745209199267, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: TestPoint
......@@ -62776,10 +62782,16 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6898471569945669422, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: PrefabDataConfig.Array.data[30]
propertyPath: PrefabDataConfig.Array.data[29]
value:
objectReference: {fileID: 3080888058940174091, guid: 78a5636dd3b386a4e82a65390ad23c7d,
type: 3}
- target: {fileID: 6898471569945669422, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: PrefabDataConfig.Array.data[30]
value:
objectReference: {fileID: 3080888058940174091, guid: 389563c758e86d848b3341576b90b7e4,
type: 3}
- target: {fileID: 6899268459312977207, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: m_AnchorMax.y
......@@ -63212,10 +63224,16 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7743735189960969443, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: PrefabDataConfig.Array.data[30]
propertyPath: PrefabDataConfig.Array.data[29]
value:
objectReference: {fileID: 3080888058940174091, guid: 78a5636dd3b386a4e82a65390ad23c7d,
type: 3}
- target: {fileID: 7743735189960969443, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: PrefabDataConfig.Array.data[30]
value:
objectReference: {fileID: 3080888058940174091, guid: 389563c758e86d848b3341576b90b7e4,
type: 3}
- target: {fileID: 7748114935345543003, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: m_AnchorMax.y
......@@ -17,7 +17,7 @@ public GameObject
Ring,
Prism,
Cone,
Square,
Rectangle,
Circle;
private void OnEnable()
......@@ -59,19 +59,19 @@ public void SpawnFactRepresentation(Fact fact)
SpawnCone(ConeVolumeFact); break;
case TruncatedConeVolumeFact TruncatedConeVolumeFact:
SpawnTruncatedCone(TruncatedConeVolumeFact); break;
case SquareFact squareFact:
SpawnSquare(squareFact); break;
case RectangleFact rectangleFact:
SpawnRectangle(rectangleFact); break;
default: break;
};
}
public void SpawnSquare(SquareFact fact){
public void SpawnRectangle(RectangleFact fact){
GameObject square = GameObject.Instantiate(Square);
GameObject rectangle = GameObject.Instantiate(Rectangle);
square.transform.SetPositionAndRotation(fact.Position, fact.Rotation);
square.transform.localScale = Vector3.Scale(square.transform.localScale, fact.LocalScale);
square.GetComponentInChildren<TextMeshPro>().text = fact.GetLabel(StageStatic.stage.factState) + " = " + System.Math.Round(fact.Area, 2) + "m²";
rectangle.transform.SetPositionAndRotation(fact.Position, fact.Rotation);
rectangle.transform.localScale = Vector3.Scale(rectangle.transform.localScale, fact.LocalScale);
rectangle.GetComponentInChildren<TextMeshPro>().text = fact.GetLabel(StageStatic.stage.factState) + " = " + System.Math.Round(fact.Area, 2) + "m²";
}
......
......@@ -72,8 +72,8 @@ public static class ParsingDictionary
{ MMTConstants.FunctionFact,
FunctionFact.parseFact },
{
MMTConstants.SquareType,
SquareFact.parseFact
MMTConstants.RectangleType,
RectangleFact.parseFact
},
};
......@@ -115,7 +115,7 @@ public static class ParsingDictionary
[JsonSubtypes.KnownSubType(typeof(QuadFact), nameof(QuadFact))]
[JsonSubtypes.KnownSubType(typeof(TriangleFact), nameof(TriangleFact))]
[JsonSubtypes.KnownSubType(typeof(RealLitFact), nameof(RealLitFact))]
[JsonSubtypes.KnownSubType(typeof(SquareFact), nameof(SquareFact))]
[JsonSubtypes.KnownSubType(typeof(RectangleFact), nameof(RectangleFact))]
public abstract class Fact
{
[JsonIgnore]
......
......@@ -9,7 +9,7 @@
/// <summary>
/// Point in 3D Space
/// </summary>
public class SquareFact : FactWrappedCRTP<SquareFact>
public class RectangleFact : FactWrappedCRTP<RectangleFact>
{
......@@ -45,13 +45,13 @@ protected void calculate_vectors(){
}
public SquareFact() : base(){
public RectangleFact() : base(){
this.PidA = null;
this.PidB = null;
this.PidC = null;
}
[JsonConstructor]
public SquareFact( string PidA, string PidB, string PidC) : base()
public RectangleFact( string PidA, string PidB, string PidC) : base()
{
this.PidA = PidA;
......@@ -68,7 +68,7 @@ public SquareFact( string PidA, string PidB, string PidC) : base()
/// </summary>
/// <param name="Point">sets <see cref="Point"/></param>
/// <param name="ServerDefinition">MMT URI as OMS</param>
public SquareFact(string PidA, string PidB, string PidC, SOMDoc ServerDefinition) : base()
public RectangleFact(string PidA, string PidB, string PidC, SOMDoc ServerDefinition) : base()
{
......@@ -100,7 +100,7 @@ public SquareFact(string PidA, string PidB, string PidC, SOMDoc ServerDefinition
ret.Add(new SquareFact(PidA, PidB, PidC, fact.@ref));
ret.Add(new RectangleFact(PidA, PidB, PidC, fact.@ref));
//ParsingDictionary.parseTermsToId.TryAdd(defines.ToString(), fact.@ref.uri);
//ret.Add(new PointFact(SOMDoc.MakeVector3(defines), fact.@ref));
......@@ -123,7 +123,7 @@ protected override void RecalculateTransform()
calculate_vectors();
}
/// \copydoc Fact.Equivalent(Fact, Fact)
protected override bool EquivalentWrapped(SquareFact f1, SquareFact f2){
protected override bool EquivalentWrapped(RectangleFact f1, RectangleFact f2){
return (
......@@ -138,20 +138,20 @@ protected override bool EquivalentWrapped(SquareFact f1, SquareFact f2){
protected override Fact _ReInitializeMe(Dictionary<string, string> old_to_new){
return new SquareFact(this.PidA, this.PidB, this.PidC);
return new RectangleFact(this.PidA, this.PidB, this.PidC);
}
public override MMTFact MakeMMTDeclaration()
{
SOMDoc tp = new OMS(MMTConstants.SquareType);
SOMDoc tp = new OMS(MMTConstants.RectangleType);
return new MMTGeneralFact(_LastLabel, tp, Defines());
}
public override SOMDoc Defines()
=> new OMA(
new OMS(MMTConstants.SquareCons),
new OMS(MMTConstants.RectangleCons),
new[] {
new OMS(PidA),
new OMS(PidB),
......
......@@ -40,9 +40,9 @@ public static class MMTConstants
//public static readonly string RectangleFactmk = "http://mathhub.info/FrameIT/frameworld?FrameITRectangles?mkRectangle";
public static readonly string SquareCons = "http://mathhub.info/FrameIT/frameworld?SquareType?squareCons";
public static readonly string SquareType = "http://mathhub.info/FrameIT/frameworld?SquareType?squareType";
public static readonly string SquareScroll = "http://mathhub.info/FrameIT/frameworld?SquareScroll";
public static readonly string RectangleCons = "http://mathhub.info/FrameIT/frameworld?RectangleType?rectangleCons";
public static readonly string RectangleType = "http://mathhub.info/FrameIT/frameworld?RectangleType?rectangleType";
public static readonly string RectangleScroll = "http://mathhub.info/FrameIT/frameworld?RectangleScroll";
public static readonly string CircleType3d = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?circleType3D";
public static readonly string MkCircle3d = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?circle3D";
......@@ -151,8 +151,8 @@ public static class MMTConstants
{ TypeType,
typeof(Type) },
{
SquareType,
typeof(SquareFact)
RectangleType,
typeof(RectangleFact)
},
{ Point,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment