Пример #1
0
        public void CeilingWithPositiveFirstInputAndNegativeSecondInputReturnsPoundNum()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs(52.3, -9), this.ParsingContext);

            Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result.Result).Type);
        }
 public void should_turn_on_ceiling_when_press_second_on_button()
 {
     var ceiling = new Ceiling();
     var remoteControl = new RemoteControl(null, ceiling, null);
     remoteControl.On(2);
     Assert.Equal(CeilingSpeed.High, ceiling.GetSpeed());
 }
Пример #3
0
 private void SetProperties()
 {
     BoundingBoxXYZ = _element.get_BoundingBox(null);
     if (_element.Category.Id.IntegerValue == (int)BuiltInCategory.OST_Walls)
     {
         HostType = HostType.Wall;
         Wall wall = _element as Wall;
         Thickness = Math.Round(UnitUtils.ConvertFromInternalUnits(wall.Width, DisplayUnitType.DUT_MILLIMETERS), 1);
     }
     if (_element.Category.Id.IntegerValue == (int)BuiltInCategory.OST_Floors)
     {
         HostType = HostType.Floor;
         Floor floor = _element as Floor;
         Thickness = Math.Round(UnitUtils.ConvertFromInternalUnits(floor.get_Parameter(BuiltInParameter.FLOOR_ATTR_THICKNESS_PARAM).AsDouble(), DisplayUnitType.DUT_MILLIMETERS), 1);
     }
     if (_element.Category.Id.IntegerValue == (int)BuiltInCategory.OST_Ceilings)
     {
         HostType = HostType.Ceiling;
         Ceiling     ceiling = _element as Ceiling;
         ElementId   typeId  = ceiling.GetTypeId();
         CeilingType cType   = _document.GetElement(typeId) as CeilingType;
         Thickness = Math.Round(UnitUtils.ConvertFromInternalUnits(cType.get_Parameter(BuiltInParameter.CEILING_THICKNESS).AsDouble(), DisplayUnitType.DUT_MILLIMETERS), 1);
     }
     if (_element.Category.Id.IntegerValue == (int)BuiltInCategory.OST_Roofs)
     {
         HostType  = HostType.Roof;
         Thickness = Math.Round(UnitUtils.ConvertFromInternalUnits(_element.get_Parameter(BuiltInParameter.ROOF_ATTR_THICKNESS_PARAM).AsDouble(), DisplayUnitType.DUT_MILLIMETERS), 1);
     }
 }
Пример #4
0
 /// <summary>
 /// Exports a ceiling to IFC covering.
 /// </summary>
 /// <param name="exporterIFC">
 /// The ExporterIFC object.
 /// </param>
 /// <param name="ceiling">
 /// The ceiling element to be exported.
 /// </param>
 /// <param name="geomElement">
 /// The geometry element.
 /// </param>
 /// <param name="productWrapper">
 /// The ProductWrapper.
 /// </param>
 public static void ExportCeilingElement(ExporterIFC exporterIFC, Ceiling ceiling, GeometryElement geomElement, ProductWrapper productWrapper)
 {
     string ifcEnumType = CategoryUtil.GetIFCEnumTypeName(exporterIFC, ceiling);
     if (String.IsNullOrEmpty(ifcEnumType))
         ifcEnumType = "CEILING";
     ExportCovering(exporterIFC, ceiling, geomElement, ifcEnumType, productWrapper);
 }
Пример #5
0
        public void CeilingWithFirstInputNegativeSecondInputPositiveReturnsCorrectValue()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs(-15, 4), this.ParsingContext);

            Assert.AreEqual(-12d, result.Result);
        }
Пример #6
0
        public void CeilingWithNumbericStringFirstInputReturnsCorrectValue()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs("45.6", 4), this.ParsingContext);

            Assert.AreEqual(48d, result.Result);
        }
Пример #7
0
        public void CeilingWithGeneralStringFirstInputReturnsCorrectValue()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs("string", 3), this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
Пример #8
0
        public void CeilingWithNoInputsReturnsPoundValue()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs(), this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
Пример #9
0
        private void OnCollisionEnter(Collision collision)
        {
            Ceiling ceiling = collision.gameObject.GetComponent <Ceiling>();
            Floor   floor   = collision.gameObject.GetComponent <Floor>();
            Crate   crate   = collision.gameObject.GetComponent <Crate>();

            //Log.Debug("Magnet.OnCollisionEnter: {0} {1} {2} (processCrateCollision={3})", ceiling, floor, crate, processCrateCollision);

            if (ceiling != null)
            {
                HandleCollision(ceiling);
            }

            else if (floor != null && processCrateCollision)
            {
                HandleCollision(floor);
                processCrateCollision = false;
            }

            else if (crate != null && processCrateCollision)
            {
                HandleCollision(crate);
                processCrateCollision = false;
            }
        }
Пример #10
0
        public void CeilingWithNegativeInputsReturnsCorrectValue()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs(-2.5, -2), this.ParsingContext);

            Assert.AreEqual(-4d, result.Result);
        }
Пример #11
0
        /***************************************************/

        public static IEnumerable <IBHoMObject> FromRevit(this Ceiling ceiling, Discipline discipline, Transform transform = null, RevitSettings settings = null, Dictionary <string, List <IBHoMObject> > refObjects = null)
        {
            IEnumerable <IElement2D> result = null;

            switch (discipline)
            {
            case Discipline.Environmental:
                result = ceiling.EnvironmentPanelsFromRevit(settings, refObjects);
                break;

            case Discipline.Facade:
            case Discipline.Architecture:
            case Discipline.Physical:
                result = new List <IElement2D> {
                    ceiling.CeilingFromRevit(settings, refObjects)
                };
                break;
            }

            if (result != null && transform?.IsIdentity == false)
            {
                TransformMatrix bHoMTransform = transform.FromRevit();
                result = result.Select(x => x.ITransform(bHoMTransform));
            }

            return(result?.Cast <IBHoMObject>().ToList());
        }
Пример #12
0
        public static List <CeilingTile> CeilingTiles(Ceiling ceiling, List <Line> ceilingTileLines, double angleTolerance = BH.oM.Geometry.Tolerance.Angle, double distanceTolerance = BH.oM.Geometry.Tolerance.Distance, int decimalPlaces = 6)
        {
            if (ceiling == null)
            {
                BH.Engine.Reflection.Compute.RecordError("Cannot compute the ceiling tiles for a null ceiling.");
                return(new List <CeilingTile>());
            }

            List <Line> openingLines = ceiling.Surface.IInternalEdges().SelectMany(x => x.ISubParts()).Cast <Line>().ToList();

            ceilingTileLines.AddRange(openingLines);

            Polyline outerPerimeter = ceiling.Surface.IExternalEdges().Select(x => x.ICollapseToPolyline(angleTolerance)).ToList().Join()[0];

            List <Polyline> regions = BH.Engine.Geometry.Compute.Split(outerPerimeter, ceilingTileLines, distanceTolerance, decimalPlaces);

            List <CeilingTile> tiles = new List <CeilingTile>();

            foreach (Polyline p in regions)
            {
                tiles.Add(new CeilingTile {
                    Perimeter = p
                });
            }

            return(tiles);
        }
Пример #13
0
        public void CeilingWithDoubleFirstInputReturnsCorrectValue()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs(12.63, 3), this.ParsingContext);

            Assert.AreEqual(15d, result.Result);
        }
Пример #14
0
    static void Main()
    {
        Ground ground = new Ground();

        BlueFish   bluefish   = new BlueFish(35, 20);
        RedFish    redfish    = new RedFish(45, 38);
        YellowFish yellowfish = new YellowFish(30, 22);

        while (true)
        {
            bluefish.DrawFish();
            redfish.DrawFish();
            yellowfish.DrawFish();
            bluefish.MoveFish();
            redfish.MoveFish();
            yellowfish.MoveFish();
            Thread.Sleep(40);
        }

        while (true)
        {
            Console.Clear();

            Ceiling ceiling = new Ceiling();
            ceiling.Draw();

            Rock rock = new Rock();
            rock.Draw(50, 22);

            PauseTillNextFrame(1000);
        }
    }
Пример #15
0
        public void CeilingWithDateAsStringSecondInputReturnsCorrectValue()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs(12.3, "5/5/2017"), this.ParsingContext);

            Assert.AreEqual(42860d, result.Result);
        }
Пример #16
0
        public void CeilingWithNumericStringSecondInputReturnsCorrectValue()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs(5, "2"), this.ParsingContext);

            Assert.AreEqual(6d, result.Result);
        }
Пример #17
0
        public void CeilingWithDoubleSecondInputReturnsCorrectValue()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs(45, 6.7), this.ParsingContext);

            Assert.AreEqual(46.9d, (double)result.Result, 0.000001);
        }
Пример #18
0
        public void CeilingWithSecondInputAsIntegerReturnsCorrectValue()
        {
            var function = new Ceiling();
            var result   = function.Execute(FunctionsHelper.CreateArgs(6, 5), this.ParsingContext);

            Assert.AreEqual(10d, result.Result);
        }
Пример #19
0
        public void CeilingPaintCostPaint2()
        {
            IPlace ceiling                 = new Ceiling(10, 9);
            double currentCeilingArea      = ceiling.calculateArea();
            double currentCeilingPaintCost = ceiling.calculateCost(currentCeilingArea, TypeOfCeilingPaint.CeilingPaint2);

            Assert.AreEqual(currentCeilingPaintCost, 1080);
        }
Пример #20
0
        public void CeilingShouldRoundTowardsZeroIfSignificanceAndNumberIsNegative()
        {
            var expectedValue = -30d;
            var func          = new Ceiling();
            var args          = FunctionsHelper.CreateArgs(-22.35d, -10);
            var result        = func.Execute(args, _parsingContext);

            Assert.AreEqual(expectedValue, result.Result);
        }
Пример #21
0
        public void CeilingShouldThrowExceptionIfNumberIsPositiveAndSignificanceIsNegative()
        {
            var expectedValue = 30d;
            var func          = new Ceiling();
            var args          = FunctionsHelper.CreateArgs(22.35d, -1);
            var result        = func.Execute(args, _parsingContext);

            Assert.AreEqual(expectedValue, result.Result);
        }
Пример #22
0
        public void CeilingShouldRoundUpAccordingToParamsSignificanceLowerThan0()
        {
            var expectedValue = 22.36d;
            var func          = new Ceiling();
            var args          = FunctionsHelper.CreateArgs(22.35d, 0.01);
            var result        = func.Execute(args, _parsingContext);

            Assert.AreEqual(expectedValue, result.Result);
        }
Пример #23
0
        public void CeilingBugTest2()
        {
            var expectedValue = 12000d;
            var func          = new Ceiling();
            var args          = FunctionsHelper.CreateArgs(12000d, 1000d);
            var result        = func.Execute(args, _parsingContext);

            Assert.AreEqual(expectedValue, result.Result);
        }
Пример #24
0
        public void CeilingShouldRoundTowardsZeroIfSignificanceAndNumberIsMinus0point1()
        {
            var expectedValue = -22.4d;
            var func          = new Ceiling();
            var args          = FunctionsHelper.CreateArgs(-22.35d, -0.1);
            var result        = func.Execute(args, _parsingContext);

            Assert.AreEqual(expectedValue, System.Math.Round((double)result.Result, 2));
        }
Пример #25
0
        public void CeilingWithBooleanFirstInputsReturnsCorrectValue()
        {
            var function     = new Ceiling();
            var booleanTrue  = function.Execute(FunctionsHelper.CreateArgs(true, 3), this.ParsingContext);
            var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(false, 2), this.ParsingContext);

            Assert.AreEqual(3d, booleanTrue.Result);
            Assert.AreEqual(0d, booleanFalse.Result);
        }
Пример #26
0
        public void CeilingWithBooleanSecondInputReturnsCorrectValue()
        {
            var function     = new Ceiling();
            var booleanTrue  = function.Execute(FunctionsHelper.CreateArgs(56.672, true), this.ParsingContext);
            var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(45.6, false), this.ParsingContext);

            Assert.AreEqual(57d, booleanTrue.Result);
            Assert.AreEqual(0d, booleanFalse.Result);
        }
Пример #27
0
        public static List <IElement1D> OutlineElements1D(this Ceiling ceiling)
        {
            if (ceiling == null)
            {
                BH.Engine.Reflection.Compute.RecordError("Cannot query the outline 1D elements of a null ceiling.");
                return(new List <IElement1D>());
            }

            return(ceiling.Surface.ISubParts().Cast <IElement1D>().ToList());
        }
Пример #28
0
        /// <summary>
        /// Exports a ceiling to IFC covering.
        /// </summary>
        /// <param name="exporterIFC">
        /// The ExporterIFC object.
        /// </param>
        /// <param name="ceiling">
        /// The ceiling element to be exported.
        /// </param>
        /// <param name="geomElement">
        /// The geometry element.
        /// </param>
        /// <param name="productWrapper">
        /// The ProductWrapper.
        /// </param>
        public static void ExportCeilingElement(ExporterIFC exporterIFC, Ceiling ceiling, GeometryElement geomElement, ProductWrapper productWrapper)
        {
            string ifcEnumType = ExporterUtil.GetIFCTypeFromExportTable(exporterIFC, ceiling);

            if (String.IsNullOrEmpty(ifcEnumType))
            {
                ifcEnumType = "CEILING";
            }
            ExportCovering(exporterIFC, ceiling, geomElement, ifcEnumType, productWrapper);
        }
Пример #29
0
 private void ChangeColor(Material color, string layer)
 {
     Collider.layer = LayerMask.NameToLayer(layer);
     Up.GetComponent <Renderer>().material      = color;
     Down.GetComponent <Renderer>().material    = color;
     Left.GetComponent <Renderer>().material    = color;
     Right.GetComponent <Renderer>().material   = color;
     Bottom.GetComponent <Renderer>().material  = color;
     Ceiling.GetComponent <Renderer>().material = color;
 }
Пример #30
0
        internal static void UpdateTag(ElementId modifiedElmId, Autodesk.Revit.DB.Document doc)
        {
            StringBuilder strBld      = new StringBuilder();
            int           rows        = 0;
            int           shelfLength = 0;
            Element       modifiedElm = doc.GetElement(modifiedElmId);

            switch (modifiedElm.Category.Name)
            {
            case "Walls":
                Wall              wl        = modifiedElm as Wall;
                WallType          wlType    = wl.WallType;
                CompoundStructure cmpStr_wl = wlType.GetCompoundStructure();
                strBld = LayersAsString(cmpStr_wl, doc, out shelfLength);
                rows   = wlType.GetCompoundStructure().LayerCount;
                break;

            case "Floors":
                Floor             fl        = modifiedElm as Floor;
                FloorType         flType    = fl.FloorType;
                CompoundStructure cmpStr_fl = flType.GetCompoundStructure();
                strBld = LayersAsString(cmpStr_fl, doc, out shelfLength);
                rows   = flType.GetCompoundStructure().LayerCount;
                break;

            case "Ceilings":
                Ceiling           cl        = modifiedElm as Ceiling;
                CeilingType       clType    = doc.GetElement(cl.GetTypeId()) as CeilingType;
                CompoundStructure cmpStr_cl = clType.GetCompoundStructure();
                strBld = LayersAsString(cmpStr_cl, doc, out shelfLength);
                rows   = clType.GetCompoundStructure().LayerCount;
                break;

            case "Roofs":
                RoofBase          rf        = modifiedElm as RoofBase;
                RoofType          rfType    = rf.RoofType;
                CompoundStructure cmpStr_rf = rfType.GetCompoundStructure();
                strBld = LayersAsString(cmpStr_rf, doc, out shelfLength);
                rows   = rfType.GetCompoundStructure().LayerCount;
                break;
            }

            FamilyInstance tag = doc.GetElement(new ElementId(modifiedElm.LookupParameter("LinkedTag").AsInteger())) as FamilyInstance;

            try
            {
                tag.LookupParameter("multilineText").Set(strBld.ToString());
                tag.LookupParameter("# of Rows").Set(rows);
                tag.LookupParameter("Shelf Length").Set(ToFt(shelfLength));
            }
            catch (Exception ex)
            {
                TaskDialog.Show("Error", ex.Message);
            }
        }
Пример #31
0
        public static Ceiling SetOutlineElements1D(this Ceiling ceiling, List <IElement1D> outlineElements1D)
        {
            if (ceiling == null)
            {
                BH.Engine.Reflection.Compute.RecordError("Cannot set the outline elements of a null ceiling.");
                return(ceiling);
            }

            ceiling.Surface = BH.Engine.Geometry.Create.PlanarSurface(BH.Engine.Geometry.Compute.IJoin(outlineElements1D.Cast <ICurve>().ToList())[0]);
            return(ceiling);
        }
Пример #32
0
        private void HandleCollision(Ceiling ceiling)
        {
            //Log.Debug("handleCollision: ceiling");

            // stop (upwards) movement
            movement.UnscaledVelocity = Vector3.zero;

            // allow crate collision processing again when the crane reached its origin y position
            processCrateCollision = true;

            OnCraneDeploymentFinished?.Invoke(scene.Game, new CraneEventArgs());
        }
 public RemoteControl(Light light, Ceiling ceiling, Stereo stereo)
 {
     this.light = light;
     this.ceiling = ceiling;
     this.stereo = stereo;
 }
Пример #34
0
 public void BuildCeiling()
 {
     var ceiling = new Ceiling();
     AddHousePart(ceiling);
 }