Skip to content
Snippets Groups Projects
Select Git revision
  • 379098f0e172c4aa9a373ac6e249b7e63a6aac52
  • master default
  • dependabot/nuget/source/Sample/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/MasterDevs.ChromeDevTools.Tests/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/ProtocolGenerator/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/ChromeDevTools/Newtonsoft.Json-13.0.1
  • dependabot/nuget/source/ChromeDevTools/System.Net.Http-4.3.4
  • revert-29-revert-24-protocol_62
  • revert-24-protocol_62
  • 1.1.0
  • 1.0.2
  • 1.0.1
  • 1.0.0.40915
13 results

EnableCommand.cs

Blame
  • VolumeFacts.cs 14.47 KiB
    using Newtonsoft.Json;
    using REST_JSON_API;
    using System.Collections;
    using System.Collections.Generic;
    
    /// <summary>
    /// The volume of a cone A  defined by a base area  <see cref="CircleFact">CircleFact</see>, an apex <see cref="PointFact">PointFact</see> and the volume as float
    /// </summary>
    public class ConeVolumeFact : FactWrappedCRTP<ConeVolumeFact>
    {
        ///  <summary> a <see cref="CircleFact">CircleFact</see> describing the base area </summary>
        public string Cid1;
        [JsonIgnore]
        public CircleFact Circle { get => (CircleFact)FactRecorder.AllFacts[Cid1]; }
    
        ///  <summary> a <see cref="PointFact">PointFact</see> describing the apex point  </summary>
        public string Pid1;
        [JsonIgnore]
        public PointFact Point { get => (PointFact)FactRecorder.AllFacts[Pid1]; }
    
        ///  <summary> the volume of the cone as a float </summary>
        public float volume;
    
        /// <summary> \copydoc Fact.Fact </summary>
        public ConeVolumeFact() : base()
        {
            this.Cid1 = null;
            this.Pid1 = null;
            this.volume = 0.0f;
        }
    
        /// <summary>
        /// Standard Constructor:
        /// Initiates members and creates MMT %Fact Server-Side
        /// </summary>
        /// <param name="cid1">sets <see cref="Cid1"/></param>
        /// <param name="pid1">sets <see cref="Pid1"/></param>
        /// <param name="vol">sets <see cref="volume"/></param>
        public ConeVolumeFact(string cid1, string pid1, float vol) : base()
        {
            this.Cid1 = cid1;
            this.Pid1 = pid1;
            this.volume = vol;
        }
    
        protected override void RecalculateTransform()
        {
            Position = Point.Position;
            Rotation = Circle.Rotation;
        }
    
        /// <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="Pid1">sets <see cref="Pid1"/></param>
        /// <param name="volume">sets <see cref="volume"/></param>
        /// <param name="backendURI">MMT URI</param>
        public ConeVolumeFact(string Cid1, string Pid1, float volume, SOMDoc _ServerDefinition) : base()
        {
            this.Cid1 = Cid1;
            this.Pid1 = Pid1;
            this.volume = volume;
    
            this.ServerDefinition = _ServerDefinition;
        }
    
        /// \copydoc Fact.parseFact(ScrollFact)
        public new static IEnumerator parseFact(List<Fact> ret, MMTFact fact)
        {