FrameIT
AngleFact Class Reference

Angle comprised of three PointFacts [A,B,C] More...

Inheritance diagram for AngleFact:
FactWrappedCRTP< AngleFact >

Public Member Functions

 AngleFact ()
 
 AngleFact (AngleFact fact, Dictionary< string, string > old_to_new, FactOrganizer organizer)
 Copies fact by initiating new MMT Fact. More...
 
 AngleFact (string pid1, string pid2, string pid3, FactOrganizer organizer)
 Standard Constructor More...
 
 AngleFact (string Pid1, string Pid2, string Pid3, string backendURI, FactOrganizer organizer)
 Bypasses initialization of new MMT Fact by using existend URI, which is not checked for existence. More...
 
override Boolean hasDependentFacts ()
 
Returns
true if Fact depends on other Facts; equivalent to getDependentFactIds returns non empty array
More...
 
override string[] getDependentFactIds ()
 
override GameObject instantiateDisplay (GameObject prefab, Transform transform)
 Initiates a prefab at transform e.g. by setting Label. More...
 
override int GetHashCode ()
 canonical More...
 
- Public Member Functions inherited from FactWrappedCRTP< AngleFact >
override bool Equivalent (Fact f2)
 Compares this against f2 . More...
 
override bool Equivalent (Fact f1, Fact f2)
 Compares f1 against f2 . More...
 

Static Public Member Functions

static new AngleFact parseFact (Scroll.ScrollFact fact)
 Parses Scroll.ScrollFact to actual Fact More...
 

Public Attributes

bool is_right_angle
 true, if AngleFact is approximately 90° or 270° More...
 
string Pid1
 One Id of three PointFacts defining Angle [Pid1, Pid2, Pid3]. More...
 
string Pid2
 One Id of three PointFacts defining Angle [Pid1, Pid2, Pid3]. More...
 
string Pid3
 One Id of three PointFacts defining Angle [Pid1, Pid2, Pid3]. More...
 

Protected Member Functions

override string generateLabel ()
 auto-generates Label using generation variable(s) e.g. LabelId; if custom Label is set, tries to restore original generated Label without resetting _CustomLabel. If original Label is already taken, a new one will be generated. More...
 
override bool EquivalentWrapped (AngleFact f1, AngleFact f2)
 Compares f1 against f2 . More...
 
- Protected Member Functions inherited from FactWrappedCRTP< AngleFact >
 FactWrappedCRTP ()
 
 FactWrappedCRTP (FactOrganizer organizer)
 
 FactWrappedCRTP (FactWrappedCRTP< T > fact, FactOrganizer organizer)
 
abstract bool EquivalentWrapped (T f1, T f2)
 CRTP step of Equivalent(Fact) and Equivalent(Fact, Fact) More...
 

Private Member Functions

void init (string pid1, string pid2, string pid3)
 Initiates Pid1, Pid2, Pid3, is_right_angle, Fact._URI and creates MMT Fact Server-Side More...
 
float GetAngle ()
 Computes smallest angle and sets is_right_angle More...
 
MMTDeclaration generate90DegreeAngleDeclaration (float val, string p1URI, string p2URI, string p3URI)
 Constructs struct for right-angled MMT Fact AddFactResponse More...
 
MMTDeclaration generateNot90DegreeAngleDeclaration (float val, string p1URI, string p2URI, string p3URI)
 Constructs struct for not-right-angled MMT Fact AddFactResponse More...
 

Detailed Description

Angle comprised of three PointFacts [A,B,C]

Constructor & Destructor Documentation

◆ AngleFact() [1/4]

AngleFact.AngleFact ( )

Only being used by JsonReader to initiate empty Facts.

See also
JSONManager

◆ AngleFact() [2/4]

AngleFact.AngleFact ( AngleFact  fact,
Dictionary< string, string >  old_to_new,
FactOrganizer  organizer 
)

Copies fact by initiating new MMT Fact.

Parameters
factFact to be copied
old_to_newDictionary mapping fact .getDependentFactIds in fact .Fact._Facts to corresponding Fact.Id in organizer
organizersets _Facts

◆ AngleFact() [3/4]

AngleFact.AngleFact ( string  pid1,
string  pid2,
string  pid3,
FactOrganizer  organizer 
)

Standard Constructor

Parameters
pid1sets Pid1
pid2sets Pid2
pid3sets Pid3
organizersets Fact._Facts

◆ AngleFact() [4/4]

AngleFact.AngleFact ( string  Pid1,
string  Pid2,
string  Pid3,
string  backendURI,
FactOrganizer  organizer 
)

Bypasses initialization of new MMT Fact by using existend URI, which is not checked for existence.

Parameters
Pid1sets Pid1
Pid2sets Pid2
Pid3sets Pid3
backendURIMMT URI
organizersets Fact._Facts

Member Function Documentation

◆ EquivalentWrapped()

override bool AngleFact.EquivalentWrapped ( AngleFact  f1,
AngleFact  f2 
)
protected

Compares f1 against f2 .

Parameters
f1Fact to compare to
f2Fact to compare to
Returns
true if f2 is semantical very similar to f1

◆ generate90DegreeAngleDeclaration()

MMTDeclaration AngleFact.generate90DegreeAngleDeclaration ( float  val,
string  p1URI,
string  p2URI,
string  p3URI 
)
private

Constructs struct for right-angled MMT Fact AddFactResponse

Parameters
valAngle == 90f, not checked
p1URIPid1
p2URIPid2
p3URIPid3
Returns
struct for AddFactResponse

◆ generateLabel()

override string AngleFact.generateLabel ( )
protected

auto-generates Label using generation variable(s) e.g. LabelId; if custom Label is set, tries to restore original generated Label without resetting _CustomLabel. If original Label is already taken, a new one will be generated.

Returns
auto-generated Label

◆ generateNot90DegreeAngleDeclaration()

MMTDeclaration AngleFact.generateNot90DegreeAngleDeclaration ( float  val,
string  p1URI,
string  p2URI,
string  p3URI 
)
private

Constructs struct for not-right-angled MMT Fact AddFactResponse

Parameters
valAngle != 90f, not checked
p1URIPid1
p2URIPid2
p3URIPid3
Returns
struct for AddFactResponse

◆ GetAngle()

float AngleFact.GetAngle ( )
private

Computes smallest angle and sets is_right_angle

Returns
Smallets angle between [Pid1, Pid2] and [Pid2, Pid3]

◆ getDependentFactIds()

override string[] AngleFact.getDependentFactIds ( )

Returns
array of Fact Ids on which this Fact depends.

AngleFact needs 3 PointFacts to be defined.

◆ GetHashCode()

override int AngleFact.GetHashCode ( )

canonical

Returns
unique-ish Hash

◆ hasDependentFacts()

override Boolean AngleFact.hasDependentFacts ( )

Returns
true if Fact depends on other Facts; equivalent to getDependentFactIds returns non empty array

◆ init()

void AngleFact.init ( string  pid1,
string  pid2,
string  pid3 
)
private

Initiates Pid1, Pid2, Pid3, is_right_angle, Fact._URI and creates MMT Fact Server-Side

Parameters
pid1sets Pid1
pid2sets Pid2
pid3sets Pid3

◆ instantiateDisplay()

override GameObject AngleFact.instantiateDisplay ( GameObject  prefab,
Transform  transform 
)

Initiates a prefab at transform e.g. by setting Label.

Does not set Representation.

Parameters
prefabGameObject Prefab that will represent this Fact
transformTransform where to initiate prefab
Returns

◆ parseFact()

static new AngleFact AngleFact.parseFact ( Scroll.ScrollFact  fact)
static

Parses Scroll.ScrollFact to actual Fact

Parameters
factinstance to be parsed
Returns
parsed Fact

Member Data Documentation

◆ is_right_angle

bool AngleFact.is_right_angle

true, if AngleFact is approximately 90° or 270°

◆ Pid1

string AngleFact.Pid1

One Id of three PointFacts defining Angle [Pid1, Pid2, Pid3].

◆ Pid2

string AngleFact.Pid2

One Id of three PointFacts defining Angle [Pid1, Pid2, Pid3].

◆ Pid3

string AngleFact.Pid3

One Id of three PointFacts defining Angle [Pid1, Pid2, Pid3].


The documentation for this class was generated from the following file: