public ActionResult SumRegion(int x1, int y1, int z1, int x2, int y2, int z2)
        {
            //Get Cube
            IGCube cube = GeometryFactory.GetCube();

            PointTO point1 = new PointTO()
            {
                X = x1, Y = y1, Z = z1
            };
            PointTO point2 = new PointTO()
            {
                X = x2, Y = y2, Z = z2
            };

            return(Json(new { sum = cube.SumRegion(point1, point2) }, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public void Cube_CreateUpdateAndSumException()
        {
            IGCube cube = Geometry.GeometryFactory.GetCube();

            cube.Create(2);
            cube.Update(new RappiChallenge.TO.PointTO()
            {
                X = 1, Y = 5, Z = 1, Value = 15
            });

            Assert.AreEqual(
                cube.SumRegion(
                    new RappiChallenge.TO.PointTO()
            {
                X = 1, Y = 1, Z = 1
            },
                    new RappiChallenge.TO.PointTO()
            {
                X = 2, Y = 2, Z = 2
            })
                , Convert.ToDouble(10));
        }